@ckeditor/ckeditor5-ai 47.6.2-alpha.1 → 47.7.0-alpha.0

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 (318) hide show
  1. package/build/ai.js +1 -1
  2. package/dist/index.js +5 -5
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +15 -15
  150. package/src/aiactions/aiactions.js +1 -1
  151. package/src/aiactions/model/aiactionsinteraction.js +1 -1
  152. package/src/aiactions/model/aiactionsreply.js +1 -1
  153. package/src/aiassistant/adapters/aiadapter.js +1 -1
  154. package/src/aiassistant/adapters/aitextadapter.js +1 -1
  155. package/src/aiassistant/adapters/awstextadapter.js +1 -1
  156. package/src/aiassistant/adapters/openaitextadapter.js +1 -1
  157. package/src/aiassistant/aiassistant.js +1 -1
  158. package/src/aiassistant/aiassistantediting.js +1 -1
  159. package/src/aiassistant/aiassistantui.js +1 -1
  160. package/src/aiassistant/legacyerrors.js +1 -1
  161. package/src/aiassistant/ui/aiassistantcontroller.js +2 -2
  162. package/src/aiassistant/ui/form/aiformcontentarea.js +1 -1
  163. package/src/aiassistant/ui/form/aiformerrorview.js +1 -1
  164. package/src/aiassistant/ui/form/aiformpromptview.js +1 -1
  165. package/src/aiassistant/ui/form/aiformtoolbarview.js +1 -1
  166. package/src/aiassistant/ui/form/aiformview.js +1 -1
  167. package/src/aiassistant/ui/form/aihistorylistitemview.js +1 -1
  168. package/src/aiassistant/ui/form/aihistorylistview.js +1 -1
  169. package/src/aiassistant/ui/form/prompthistory.js +1 -1
  170. package/src/aiassistant/ui/showaiassistantcommand.js +1 -1
  171. package/src/aiassistant/utils/common-translations.js +1 -1
  172. package/src/aiassistant/utils/normalizecommandsconfig.js +1 -1
  173. package/src/aiballoon/aiballoon.js +1 -1
  174. package/src/aiballoon/ui/aiballoonview.js +1 -1
  175. package/src/aichat/aichat.js +1 -1
  176. package/src/aichat/aichatballoon.js +1 -1
  177. package/src/aichat/aichatcontroller.js +1 -1
  178. package/src/aichat/aichatui.js +1 -1
  179. package/src/aichat/model/aichatcontext.js +1 -1
  180. package/src/aichat/model/aichatconversation.js +1 -1
  181. package/src/aichat/model/aichatinteraction.js +1 -1
  182. package/src/aichat/ui/aichatballoonview.js +1 -1
  183. package/src/aichat/ui/aichatcontrolsview.js +1 -1
  184. package/src/aichat/ui/aichatfeedview.js +1 -1
  185. package/src/aichat/ui/aichatheaderview.js +1 -1
  186. package/src/aichat/ui/aichatview.js +1 -1
  187. package/src/aichat/ui/controls/aichatchipsoverflowmanager.js +1 -1
  188. package/src/aichat/ui/controls/aichatcontextitembuttonview.js +1 -1
  189. package/src/aichat/ui/controls/aichatcontextpanelurlinputview.js +1 -1
  190. package/src/aichat/ui/controls/aichatcontextpanelview.js +1 -1
  191. package/src/aichat/ui/controls/aichatcontrolsloaderview.js +1 -1
  192. package/src/aichat/ui/controls/aichatpromptcapabilitiesview.js +1 -1
  193. package/src/aichat/ui/controls/aichatpromptinputview.js +1 -1
  194. package/src/aichat/ui/controls/aichatpromptsuggestionslistview.js +1 -1
  195. package/src/aichat/ui/controls/resources/aichatcontextresourceslistview.js +1 -1
  196. package/src/aichat/ui/controls/resources/aichatcontextresourcesview.js +1 -1
  197. package/src/aichat/ui/controls/resources/aichatresourcelistitemview.js +1 -1
  198. package/src/aichat/ui/controls/resources/aichatresourcesballoonview.js +1 -1
  199. package/src/aichat/ui/controls/resources/aichatresourcessearchinputview.js +1 -1
  200. package/src/aichat/ui/feed/aichatfeedcontextchipsview.js +1 -1
  201. package/src/aichat/ui/feed/aichatfeedcustomelementview.js +1 -1
  202. package/src/aichat/ui/feed/aichatfeederroritemview.js +1 -1
  203. package/src/aichat/ui/feed/aichatfeedinteractionheaderview.js +1 -1
  204. package/src/aichat/ui/feed/aichatfeeditemview.js +1 -1
  205. package/src/aichat/ui/feed/aichatfeedreplyitemview.js +1 -1
  206. package/src/aichat/ui/feed/aichatfeedsuggestionitemactionsview.js +1 -1
  207. package/src/aichat/ui/feed/aichatfeedsuggestionitemview.js +1 -1
  208. package/src/aichat/ui/feed/aichatfeedusermessageitem.js +1 -1
  209. package/src/aichat/utils/eventnames.js +1 -1
  210. package/src/aichat/utils/promisequeue.js +1 -1
  211. package/src/aichathistory/aichathistory.js +1 -1
  212. package/src/aichathistory/aichathistorycontroller.js +1 -1
  213. package/src/aichathistory/aichathistoryui.js +1 -1
  214. package/src/aichathistory/model/aichathistoryconversations.js +1 -1
  215. package/src/aichathistory/model/aichathistoryitem.js +1 -1
  216. package/src/aichathistory/ui/aichathistorylistitemview.js +2 -2
  217. package/src/aichathistory/ui/aichathistorylistview.js +1 -1
  218. package/src/aichathistory/ui/aichathistorysectionlistview.js +1 -1
  219. package/src/aichathistory/ui/aichathistoryview.js +1 -1
  220. package/src/aichatshortcuts/aichatshortcuts.js +1 -1
  221. package/src/aichatshortcuts/ui/aichatshortcutsview.js +1 -1
  222. package/src/aichatshortcuts/ui/aichatshortcutview.js +1 -1
  223. package/src/aicore/aiconnector.js +1 -1
  224. package/src/aicore/aiediting.js +1 -1
  225. package/src/aicore/model/aicapabilities.js +1 -1
  226. package/src/aicore/model/aicontext.js +1 -1
  227. package/src/aicore/model/aiinteraction.js +1 -1
  228. package/src/aicore/model/aimodels.js +1 -1
  229. package/src/aicore/model/aireply.js +1 -1
  230. package/src/aicore/pipeline/airesponseapplier.js +2 -2
  231. package/src/aicore/pipeline/airesponseparser.js +2 -2
  232. package/src/aicore/ui/aidisclaimerview.js +1 -1
  233. package/src/aicore/ui/aiskeleton.js +1 -1
  234. package/src/aicore/ui/aispinner.js +1 -1
  235. package/src/aicore/ui/suggestioncontainer/aiminitoolbarview.js +1 -1
  236. package/src/aicore/ui/suggestioncontainer/aisuggestionbodyview.js +1 -1
  237. package/src/aicore/ui/suggestioncontainer/aisuggestioncontainerview.js +1 -1
  238. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartheaderview.js +1 -1
  239. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartstateview.js +1 -1
  240. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentparttoolbarview.js +1 -1
  241. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.js +1 -1
  242. package/src/aicore/ui/suggestioncontainer/aisuggestionheaderview.js +1 -1
  243. package/src/aicore/ui/suggestioncontainer/aisuggestionloaderview.js +1 -1
  244. package/src/aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.js +1 -1
  245. package/src/aicore/ui/suggestioncontainer/aiwebsourcesview.js +1 -1
  246. package/src/aicore/utils/common-translations.js +1 -1
  247. package/src/aicore/utils/createresizebutton.js +1 -1
  248. package/src/aicore/utils/documentposition.js +1 -1
  249. package/src/aicore/utils/documentrange.js +1 -1
  250. package/src/aicore/utils/eventnames.js +1 -1
  251. package/src/aicore/utils/geteditorfromcontext.js +1 -1
  252. package/src/aicore/utils/getoperationsfromreply.js +1 -1
  253. package/src/aicore/utils/getsuggestionpartsfromreply.js +1 -1
  254. package/src/aicore/utils/htmlparser.js +1 -1
  255. package/src/aicore/utils/htmlstreamer.js +1 -1
  256. package/src/aicore/utils/scrollmanager.js +1 -1
  257. package/src/aieditorintegration/aieditorintegration.js +1 -1
  258. package/src/aieditorintegration/aitogglebutton/aitogglebuttonui.js +1 -1
  259. package/src/aieditorintegration/aitogglebutton/toggleaicommand.js +1 -1
  260. package/src/aiquickactions/aiquickactions.js +1 -1
  261. package/src/aiquickactions/aiquickactionscommand.js +1 -1
  262. package/src/aiquickactions/aiquickactionsediting.js +1 -1
  263. package/src/aiquickactions/aiquickactionsui.js +1 -1
  264. package/src/aiquickactions/ui/aiquickactionsbuttoncreator.js +1 -1
  265. package/src/aiquickactions/ui/aiquickactionsdropdowncontentview.js +1 -1
  266. package/src/aiquickactions/ui/aiquickactionsdropdowncreator.js +1 -1
  267. package/src/aiquickactions/ui/aiquickactionsfilteredlistview.js +1 -1
  268. package/src/aiquickactions/ui/balloon/aiactionsballoondisclaimerview.js +1 -1
  269. package/src/aiquickactions/ui/balloon/aiactionsballoontoolbarview.js +1 -1
  270. package/src/aiquickactions/ui/balloon/aiactionsballoonview.js +1 -1
  271. package/src/aiquickactions/ui/dropdownmenubuttonwithhighlightview.js +1 -1
  272. package/src/aireviewcore/aireviewcorecontroller.js +1 -1
  273. package/src/aireviewcore/aireviewcoreediting.js +1 -1
  274. package/src/aireviewcore/aireviewcoreui.js +1 -1
  275. package/src/aireviewcore/model/aireviewcheck.js +1 -1
  276. package/src/aireviewcore/model/aireviewchecklist.js +1 -1
  277. package/src/aireviewcore/model/aireviewcheckresult.js +1 -1
  278. package/src/aireviewcore/model/aireviewcheckresultchange.js +1 -1
  279. package/src/aireviewcore/model/aireviewcheckrun.js +1 -1
  280. package/src/aireviewcore/model/aireviewsystemcheckrun.js +1 -1
  281. package/src/aireviewcore/ui/aireviewcoreballoonsuggestionview.js +1 -1
  282. package/src/aireviewcore/ui/aireviewcorechecklistitemresultview.js +1 -1
  283. package/src/aireviewcore/ui/aireviewcorecustomcheckview.js +1 -1
  284. package/src/aireviewcore/ui/aireviewcorefinishreviewbuttonview.js +1 -1
  285. package/src/aireviewcore/ui/aireviewcoregeneralerrorview.js +1 -1
  286. package/src/aireviewcore/ui/aireviewcorepromptinputview.js +1 -1
  287. package/src/aireviewcore/ui/aireviewcorereviewchecklistview.js +1 -1
  288. package/src/aireviewcore/ui/aireviewcorereviewcommandlistitemview.js +1 -1
  289. package/src/aireviewcore/ui/aireviewcorereviewcompletedview.js +1 -1
  290. package/src/aireviewcore/ui/aireviewcoreuicheckresultsview.js +1 -1
  291. package/src/aireviewcore/ui/aireviewcoreview.js +1 -1
  292. package/src/aireviewcore/ui/form/aireviewcoreformdropdown.js +1 -1
  293. package/src/aireviewcore/ui/form/aireviewcoreformmanager.js +1 -1
  294. package/src/aireviewmode/aireviewcheckdefinitions.js +1 -1
  295. package/src/aireviewmode/aireviewmode.js +1 -1
  296. package/src/aireviewmode/aireviewmodecontroller.js +1 -1
  297. package/src/aireviewmode/aireviewmodeui.js +1 -1
  298. package/src/aireviewmode/model/aireviewcheckcustom.js +1 -1
  299. package/src/aireviewmode/model/aireviewcheckextra.js +1 -1
  300. package/src/aireviewmode/model/aireviewcustomcheckrun.js +1 -1
  301. package/src/aireviewmode/model/aireviewextracheckrun.js +1 -1
  302. package/src/aireviewmode/model/aireviewmodechecklist.js +1 -1
  303. package/src/aitabs/aitabs.js +1 -1
  304. package/src/aitabs/aitabsmainview.js +1 -1
  305. package/src/aitabs/tabs/aitabsview.js +1 -1
  306. package/src/aitabs/tabs/tabbuttonview.js +1 -1
  307. package/src/aitabs/tabs/tabpanelview.js +1 -1
  308. package/src/aitranslate/aitranslate.js +1 -1
  309. package/src/aitranslate/aitranslatecontroller.js +1 -1
  310. package/src/aitranslate/aitranslateui.js +1 -1
  311. package/src/aitranslate/model/aitranslatecheck.js +1 -1
  312. package/src/aitranslate/model/aitranslatechecklist.js +1 -1
  313. package/src/aitranslate/model/aitranslatecheckrun.js +1 -1
  314. package/src/aitranslate/ui/aitranslatechecklistview.js +1 -1
  315. package/src/aitranslate/ui/aitranslatecheckresultsview.js +1 -1
  316. package/src/errors.js +1 -1
  317. package/src/errorsmap.js +1 -1
  318. package/src/index.js +1 -1
package/dist/index.js CHANGED
@@ -20,8 +20,8 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x5d4a72,Command as Ut,ContextPlugin as _0x5aeef2,Editor as dt}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0xc4322,IconCheck as _0x5bbb65,IconError as _0x5ebef8,IconSubmit as _0x5a5684,IconAIHistory as mt,IconMagicWand as _0x1ffc21,IconRobotPencil as _0x3a6955,IconMaximize as _0x4fb61d,IconMinimize as _0x318834,IconShowChangesOn as _0x1b1360,IconShowChangesOff as _0xb70345,IconDocument as _0x190e7a,IconBoxWithCross as _0x39c3e0,IconBoxWithCheck as _0x38e5bf,IconBoxWithMarker as _0x2bb531,IconInfo as _0x2f68b5,IconLoupe as _0x2b63a5,IconCancel as _0x5a4b4,IconStop as _0x33c6ee,IconAIChat as Mt,IconPlus as _0x163062,IconPin as _0xf31172,IconThreeHorizontalDots as _0x2069a2,IconChevronDown as _0x1bf910,IconChevronUp as _0x4dee81,IconOutdated as _0x40ad6c,IconEye as _0x4be72a,IconEyeCrossedOut as _0x449671,IconChevronRight as _0x44aab3,IconAIReview as _0x5be86e,IconAITranslate as _0x420b58}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x46d503,CKEditorError as _0x5a06e8,ObservableMixin as ts,global as _0x43aaf8,isVisible as _0x22d9e5,Rect as _0x4795f2,Collection as _0x1e3367,FocusTracker as _0x50a6e7,KeystrokeHandler as _0x2971c3,first as _0x354381,logWarning as _0x365bde,logError as pt,toArray as _0x4695c6,EmitterMixin as _0x3ea0e5,scrollViewportToShowTarget as _0x3f0a76,scrollAncestorsToShowTarget as _0x2da007,ResizeObserver as _0x1d4c5e,_isMotionReduced as Rt,getConstrainedViewportRect as _0x3f8d24,DomEmitterMixin as _0x177b01}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x286a6e,ButtonView as _0x480cf4,View as _0x3836c7,SpinnerView as _0x526920,IconView as _0x1254c7,AutocompleteView as _0x7d0bae,ListView as _0x2c9917,ListItemGroupView as _0x4e9591,ListItemView as _0x4ef88a,ButtonLabelView as _0x51555e,FocusCycler as _0x39194d,createLabeledTextarea as _0x4ce085,Dialog as _0x164193,createDropdown as _0x1204b4,addMenuToDropdown as _0x5295bc,MenuBarMenuView as _0x2e1bf9,MenuBarMenuListItemButtonView as _0x157a87,DialogViewPosition as _0x3ded48,MenuBarMenuListView as _0x34fc2c,MenuBarMenuListItemView as _0x147031,BodyCollection as _0x1424e8,BalloonPanelView as _0x5019ab,clickOutsideHandler as _0x366f04,addListToDropdown as _0x158054,UIModel as _0x2ab5f1,submitHandler as _0x5effbf,LabeledFieldView as _0x50a78e,createLabeledInputText as _0x526de1,FormHeaderView as _0x4631d7,HighlightedTextView as _0x3dba21,ViewCollection as _0x1b8196,FileDialogButtonView as _0x287ba4,InputTextView as _0x426b41,SearchTextView as _0x283161,ListItemButtonView as _0x3a08f3,ButtonLabelWithHighlightView as _0x4278e2,DropdownMenuPanelPositioningFunctions as _0x4f3002,BalloonToolbar as te,FormRowView as _0x4bdd31,TextareaView as _0x226e4c}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x18b356,ClipboardMarkersUtils as _0x3ec120}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x43cfc4,ViewDataTransfer as _0x240523,ViewUpcastWriter as _0x5b724b,Matcher as _0x57532f,_DetachOperation as et,_insertIntoModelNodeList as _0x5b9e4f,_removeFromModelNodeList as to,ModelRange as it,transformOperationSets as nt,ViewDowncastWriter as Nt,ModelDocumentFragment as tt,ModelPosition as st,ModelTreeWalker as _0x50564f,MarkerOperation as _0x145a38,InsertOperation as _0x3afeab}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x2fc3ab,escape as _0x239b85,escapeRegExp as _0x440618,debounce as _0x3ac262}from'es-toolkit/compat';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x239f9b}from'htmlparser2';import{isTag as _0x58cce0,findOne as vt,getParent as _0x5d8f7d,findAll as _0x37344,removeElement as _0x1a4c2d,replaceElement as _0x3e3729,prepend as _0x6339ff,prependChild as _0x331d1d,appendChild as _0x537ec9,append as _0x44d3ba,find as _0x1b4703,isComment as _0x28fdd0,getChildren as _0x32f300,textContent as _0xfa78d1}from'domutils';import _0x262be4 from'dom-serializer';import{Document as Ot,Element as _0x2f67ed,Text as _0x231d87,cloneNode as _0x1eeb47,isDocument as _0x222dba,isText as _0x4cc27e,NodeWithChildren as _0x20118f}from'domhandler';import{MarkdownGfmMdToHtml as _0x46c045}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x2fe16d,DocumentCompare as _0x4df951,DATA_ID_MODEL_ATTRIBUTE as At,ConfirmMixin as _0x385611,LateFocusDropdownButtonView as _0x2eec87,getAllMarkersDomElementsSorted as _0x5ec425,SuggestionsConversion as Bt,DATA_ID_VIEW_ATTRIBUTE as _0x497ca9,getMarkerDomElement as _0x117596}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x526ad4}from'es-toolkit';import _0x547451 from'morphdom';import{IconWeb as _0x650eff,IconClose as _0x402a12,IconDocument as _0x5d90b9,IconSelection as _0xc0cfb2,IconFileUpload as _0x3cc08b,IconLink as _0x133ff9,IconBulb as _0x3fa3c9,IconAI as _0x6e5fda,IconPreviousArrow as _0x5009b4,IconCheck as _0x688d01,IconDocumentOutline as _0x2199df,IconPaperClip as _0x4fa1c0,IconBrowseFiles as _0x5b1772,IconDropdownArrow as _0x3f3220,IconAIChat as _0x5d925d,IconAIReview as _0x2b6ee2,IconAITranslate as Vt,IconAIAskAI as _0x471cb9,IconThumbUp as _0x3403e0,IconThumbDown as _0x111706,IconCopy as _0x2d5bcb,IconShowChangesOff as _0x14aae7,IconShowChangesOn as _0x108750,IconAIQuickActions as _0x4a31ba,IconAIChatCommands as Ht,IconAIImproveWriting as Wt,IconAIContinueWriting as Yt,IconAIGrammarCheck as Gt,IconAIAdjustLength as Qt,IconAIChangeTone as Kt,IconAIOther as Jt,IconRefresh as _0x7b1602,IconNextArrow as _0xcfb6e3}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x5dceb}from'diff';const x='_ungrouppedCommands';function o(_0x1de977,_0x411352){const _0xfcb6d0=(0x0,_0x411352['t'])('Other');return _0x1de977['length']?'groupId'in _0x1de977[0x0]?_0x1de977:[{'groupId':x,'groupLabel':_0xfcb6d0,'order':0x1/0x0,'commands':_0x1de977}]:[{'groupId':x,'groupLabel':_0xfcb6d0,'order':0x1/0x0,'commands':[]}];}const $n=globalThis['DataTransfer'],f='ai-ui';class a extends _0x5d4a72{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x379b7f}=this,_0x5b0f6f=['ck-fake-ai-selection'];_0x379b7f['config']['get']('ai.assistant.useTheme')&&_0x5b0f6f['push']('ck-ai-assistant-ui_theme'),_0x379b7f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x5b0f6f,'priority':0xc}}),_0x379b7f['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x3ad67e,{writer:_0x5e021c})=>{if(!_0x3ad67e['markerRange']['isCollapsed'])return null;const _0x3841ba=_0x5e021c['createUIElement']('span');return _0x5e021c['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x3841ba),_0x3841ba;}});}['afterInit'](){!async function(_0x16e80f){const _0x2e587b=_0x3dab55([0x6e,0x41,0x37,0x79,0x75,0x72,0x67,0x4f,0x48,0x62,0x5a,0x76,0x44,0x70,0x6c,0x52,0x6b,0x4a,0x73,0x63,0x64,0x49,0x43,0x6d,0x38,0x36,0x6f,0x50,0x57,0x78,0x39,0x32,0x66,0x31,0x71,0x46,0x30,0x4c,0x61,0x53,0x58,0x33,0x4e,0x47,0x77,0x54,0x4d,0x4b,0x34,0x6a,0x56,0x74,0x59,0x55,0x42,0x51,0x69,0x35,0x7a,0x68,0x65,0x45]),_0x3fa911=0x3dffc4e1,_0x1ed078=0x3df84249^_0x3fa911,_0xcc625d=window[_0x3dab55([0x44,0x61,0x74,0x65])][_0x3dab55([0x6e,0x6f,0x77])](),_0x2b1f88=_0x16e80f[_0x3dab55([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x36b8dd=new window[(_0x3dab55([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x37742e=>{_0x2b1f88[_0x3dab55([0x6f,0x6e,0x63,0x65])](_0x3dab55([0x72,0x65,0x61,0x64,0x79]),_0x37742e);}),_0x2dbe6c={[_0x3dab55([0x6b,0x74,0x79])]:_0x3dab55([0x45,0x43]),[_0x3dab55([0x75,0x73,0x65])]:_0x3dab55([0x73,0x69,0x67]),[_0x3dab55([0x63,0x72,0x76])]:_0x3dab55([0x50,0x2d,0x32,0x35,0x36]),[_0x3dab55([0x78])]:_0x3dab55([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0x3dab55([0x79])]:_0x3dab55([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0x3dab55([0x61,0x6c,0x67])]:_0x3dab55([0x45,0x53,0x32,0x35,0x36])},_0x4c731d=_0x2b1f88[_0x3dab55([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x3dab55([0x67,0x65,0x74])](_0x3dab55([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x1ce903(){let _0x1648d5,_0x4a9504=null,_0x5ae1ed=null;try{if(_0x4c731d==_0x3dab55([0x47,0x50,0x4c]))return _0x3dab55([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x1648d5=_0x360b15(),!_0x1648d5)return _0x3dab55([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x1648d5[_0x3dab55([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x5ae1ed=_0x3a1b12(_0x1648d5[_0x3dab55([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x1648d5[_0x3dab55([0x6a,0x74,0x69])])),await _0x3bd327()?_0x2391c5()?_0xcb11af()?_0x3dab55([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x341df6()?(_0x1648d5[_0x3dab55([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3dab55([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4a9504=_0x39dd36(_0x3dab55([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x4ede7e()):_0x3dab55([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x3dab55([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x3dab55([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x3dab55([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0xcb11af(){const _0xdffc59=[_0x3dab55([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x3dab55([0x74,0x72,0x69,0x61,0x6c])][_0x3dab55([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1648d5[_0x3dab55([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0xcc625d/0x3e8:0xe10*_0x1ed078;return _0x1648d5[_0x3dab55([0x65,0x78,0x70])]<_0xdffc59;}function _0x2391c5(){const _0x43f977=_0x1648d5[_0x3dab55([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x43f977&&(!!_0x43f977[_0x3dab55([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3dab55([0x2a]))||!!_0x43f977[_0x3dab55([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3dab55([0x41,0x49])));}function _0x341df6(){const _0x503461=_0x1648d5[_0x3dab55([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x503461||0x0==_0x503461[_0x3dab55([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x95e54e}=new URL(window[_0x3dab55([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x503461[_0x3dab55([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x95e54e))return!0x0;const _0x3ac7bd=_0x95e54e[_0x3dab55([0x73,0x70,0x6c,0x69,0x74])](_0x3dab55([0x2e]));return _0x503461[_0x3dab55([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4bd9ba=>_0x4bd9ba[_0x3dab55([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3dab55([0x2a])))[_0x3dab55([0x6d,0x61,0x70])](_0x36e6fe=>_0x36e6fe[_0x3dab55([0x73,0x70,0x6c,0x69,0x74])](_0x3dab55([0x2e])))[_0x3dab55([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x23de6f=>_0x23de6f[_0x3dab55([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x3ac7bd[_0x3dab55([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3dab55([0x6d,0x61,0x70])](_0x224110=>Array(_0x3ac7bd[_0x3dab55([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x224110[_0x3dab55([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3dab55([0x66,0x69,0x6c,0x6c])](_0x224110[0x0]===_0x3dab55([0x2a])?_0x3dab55([0x2a]):'')[_0x3dab55([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x224110))[_0x3dab55([0x73,0x6f,0x6d,0x65])](_0x5988ac=>_0x3ac7bd[_0x3dab55([0x65,0x76,0x65,0x72,0x79])]((_0xc18329,_0xbe953e)=>_0x5988ac[_0xbe953e]===_0xc18329||_0x5988ac[_0xbe953e]===_0x3dab55([0x2a])));}function _0x4ede7e(){return _0x4a9504&&_0x5ae1ed?new window[(_0x3dab55([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4fafee,_0x1cbd69)=>{_0x4a9504[_0x3dab55([0x74,0x68,0x65,0x6e])](_0x4fafee,_0x1cbd69),_0x5ae1ed[_0x3dab55([0x74,0x68,0x65,0x6e])](_0x11b551=>{_0x11b551!=_0x3dab55([0x56,0x61,0x6c,0x69,0x64])&&_0x4fafee(_0x11b551);},_0x1cbd69);}):_0x4a9504||_0x5ae1ed||_0x3dab55([0x56,0x61,0x6c,0x69,0x64]);}}function _0x3a1b12(_0x308bbe,_0x259927){return new window[(_0x3dab55([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x54a481=>{if(_0x397cd2())return _0x54a481(_0x3dab55([0x56,0x61,0x6c,0x69,0x64]));_0x199708(),_0x2b1f88[_0x3dab55([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x3dab55([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xe83760=!0x1;const _0x3734ac=_0x46d503();function _0x1f95d1(_0x3a626f){return!!_0x3a626f&&(typeof _0x3a626f===_0x3dab55([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x3a626f===_0x3dab55([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x3a626f[_0x3dab55([0x74,0x68,0x65,0x6e])]===_0x3dab55([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x3a626f[_0x3dab55([0x63,0x61,0x74,0x63,0x68])]===_0x3dab55([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1332b7(_0x25b5f7){_0x50db8c(_0x25b5f7)[_0x3dab55([0x74,0x68,0x65,0x6e])](_0xe2e922=>{if(!_0xe2e922||_0xe2e922[_0x3dab55([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x3dab55([0x6f,0x6b]))return _0x3dab55([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x264098(_0x4669d5(_0x3734ac+_0x259927))!=_0xe2e922[_0x3dab55([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x3dab55([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x3dab55([0x56,0x61,0x6c,0x69,0x64]);})[_0x3dab55([0x74,0x68,0x65,0x6e])](_0x1b01ef=>(_0xf3e8c0(),_0x1b01ef),()=>{const _0x43c66f=_0x5bbf80();return null==_0x43c66f?(_0xf3e8c0(),_0x3dab55([0x56,0x61,0x6c,0x69,0x64])):_0x3dab55(_0xcc625d-_0x43c66f>(0x19f340e1^_0x3fa911)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x3dab55([0x74,0x68,0x65,0x6e])](_0x54a481)[_0x3dab55([0x63,0x61,0x74,0x63,0x68])](()=>{_0x54a481(_0x3dab55([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x508457=0x3dc92a61^_0x3fa911;function _0xf3e8c0(){const _0x597e3e=_0x3dab55([0x6c,0x6c,0x63,0x74,0x2d])+_0x264098(_0x4669d5(_0x308bbe)),_0x3187ef=_0x466915(_0x264098(window[_0x3dab55([0x4d,0x61,0x74,0x68])][_0x3dab55([0x63,0x65,0x69,0x6c])](_0xcc625d/_0x508457)));window[_0x3dab55([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3dab55([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x597e3e,_0x3187ef);}function _0x5bbf80(){const _0x347433=_0x3dab55([0x6c,0x6c,0x63,0x74,0x2d])+_0x264098(_0x4669d5(_0x308bbe)),_0x487c4e=window[_0x3dab55([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3dab55([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x347433);return _0x487c4e?window[_0x3dab55([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x466915(_0x487c4e),0x10)*_0x508457:null;}function _0x50db8c(_0x4320c3){return new window[(_0x3dab55([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x21c953,_0x259d6e)=>{_0x4320c3[_0x3dab55([0x74,0x68,0x65,0x6e])](_0x21c953,_0x259d6e),window[_0x3dab55([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x259d6e,0x3dfe1021^_0x3fa911);});}}_0x2b1f88[_0x3dab55([0x6f,0x6e])](_0x3dab55([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x22a350,_0x595bfc)=>{if(_0x595bfc[0x0]!=_0x308bbe)return _0x54a481(_0x3dab55([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x595bfc[0x1]={..._0x595bfc[0x1],[_0x3dab55([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3734ac};},{[_0x3dab55([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3dab55([0x68,0x69,0x67,0x68])}),_0x2b1f88[_0x3dab55([0x6f,0x6e])](_0x3dab55([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x2e8f67=>{_0x1f95d1(_0x2e8f67[_0x3dab55([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xe83760=!0x0,_0x1332b7(_0x2e8f67[_0x3dab55([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x3dab55([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3dab55([0x6c,0x6f,0x77])}),_0x36b8dd[_0x3dab55([0x74,0x68,0x65,0x6e])](()=>{_0xe83760||_0x54a481(_0x3dab55([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x397cd2(){return _0x2b1f88[_0x3dab55([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3dab55([0x76,0x69,0x65,0x77])][_0x3dab55([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x3dab55([0x61,0x75,0x74,0x6f]);}function _0x199708(){_0x2b1f88[_0x3dab55([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3dab55([0x76,0x69,0x65,0x77])][_0x3dab55([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3dab55([0x61,0x75,0x74,0x6f]);}}function _0x39dd36(_0x1a0480){const _0x25b9a4=[new window[(_0x3dab55([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x95594f=>setTimeout(_0x95594f,0x3df6fa2d^_0x3fa911)),_0x36b8dd[_0x3dab55([0x74,0x68,0x65,0x6e])](()=>new window[(_0x3dab55([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5e05b1=>{let _0x24a047=0x0;_0x2b1f88[_0x3dab55([0x6d,0x6f,0x64,0x65,0x6c])][_0x3dab55([0x6f,0x6e])](_0x3dab55([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x5360dd,_0x1d1d20)=>{_0x1d1d20[0x0][_0x3dab55([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x24a047++,_0x24a047==(0x3dffc109^_0x3fa911)&&(_0x5e05b1(),_0x5360dd[_0x3dab55([0x6f,0x66,0x66])]());});}))];return window[_0x3dab55([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3dab55([0x72,0x61,0x63,0x65])](_0x25b9a4)[_0x3dab55([0x74,0x68,0x65,0x6e])](()=>_0x1a0480);}async function _0x33a14b(){await _0x36b8dd,_0x2b1f88[_0x3dab55([0x6d,0x6f,0x64,0x65,0x6c])][_0x3dab55([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x1f002d,_0x2b1f88[_0x3dab55([0x6d,0x6f,0x64,0x65,0x6c])][_0x3dab55([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x1f002d,_0x2b1f88[_0x3dab55([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x3dab55([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x260c15(_0x57356e){const _0x33c753=_0x59f204();_0x2b1f88[_0x33c753]=_0x3dab55([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x57356e,_0x57356e!=_0x3dab55([0x56,0x61,0x6c,0x69,0x64])&&_0x33a14b();}function _0x59f204(){const _0x3dbe9a=window[_0x3dab55([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x3dab55([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x3dab55([0x6e,0x6f,0x77])]())[_0x3dab55([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x3dab55([0x2e]),'');let _0x1819f0=_0x3dab55([0x6e]);for(let _0x104d7d=0x0;_0x104d7d<_0x3dbe9a[_0x3dab55([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x104d7d+=0x2){let _0x4649c9=window[_0x3dab55([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3dbe9a[_0x3dab55([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x104d7d,_0x104d7d+0x2));_0x4649c9>=_0x2e587b[_0x3dab55([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x4649c9-=_0x2e587b[_0x3dab55([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1819f0+=_0x2e587b[_0x4649c9];}return _0x1819f0;}function _0x360b15(){const _0xe9617b=_0x4c731d[_0x3dab55([0x73,0x70,0x6c,0x69,0x74])](_0x3dab55([0x2e]));if(0x3!=_0xe9617b[_0x3dab55([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x1483d5(_0xe9617b[0x1]);function _0x1483d5(_0x314094){const _0x5a9961=_0x302be4(_0x314094);return _0x5a9961&&_0xf8693f()?_0x5a9961:null;function _0xf8693f(){const _0x50cd13=_0x5a9961[_0x3dab55([0x6a,0x74,0x69])],_0x680058=window[_0x3dab55([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x50cd13[_0x3dab55([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x50cd13[_0x3dab55([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x4b89f5={..._0x5a9961,[_0x3dab55([0x6a,0x74,0x69])]:_0x50cd13[_0x3dab55([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x50cd13[_0x3dab55([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x4b89f5[_0x3dab55([0x76,0x63])],_0x4669d5(_0x4b89f5)==_0x680058;}}}async function _0x3bd327(){let _0x207381=!0x0;try{const _0x4ddd26=_0x4c731d[_0x3dab55([0x73,0x70,0x6c,0x69,0x74])](_0x3dab55([0x2e])),[_0xa7e6e1,_0x48a56a,_0x19d66b]=_0x4ddd26;return _0x266319(_0xa7e6e1),await _0x4bdf30(_0xa7e6e1,_0x48a56a,_0x19d66b),_0x207381;}catch{return!0x1;}function _0x266319(_0x9bf41c){const _0xdb3d0c=_0x302be4(_0x9bf41c);_0xdb3d0c&&_0xdb3d0c[_0x3dab55([0x61,0x6c,0x67])]==_0x3dab55([0x45,0x53,0x32,0x35,0x36])||(_0x207381=!0x1);}async function _0x4bdf30(_0x64eca,_0x4a43b3,_0x3340f7){const _0xec95b9=window[_0x3dab55([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x3dab55([0x66,0x72,0x6f,0x6d])](_0x37306a(_0x3340f7),_0x56200a=>_0x56200a[_0x3dab55([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x1b35d8=new window[(_0x3dab55([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x3dab55([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x64eca+_0x3dab55([0x2e])+_0x4a43b3),_0x4ab0d0=window[_0x3dab55([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x3dab55([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x4ab0d0)return;const _0x3c5379=await _0x4ab0d0[_0x3dab55([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x3dab55([0x6a,0x77,0x6b]),_0x2dbe6c,{[_0x3dab55([0x6e,0x61,0x6d,0x65])]:_0x3dab55([0x45,0x43,0x44,0x53,0x41]),[_0x3dab55([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x3dab55([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x3dab55([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x4ab0d0[_0x3dab55([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x3dab55([0x6e,0x61,0x6d,0x65])]:_0x3dab55([0x45,0x43,0x44,0x53,0x41]),[_0x3dab55([0x68,0x61,0x73,0x68])]:{[_0x3dab55([0x6e,0x61,0x6d,0x65])]:_0x3dab55([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x3c5379,_0xec95b9,_0x1b35d8)||(_0x207381=!0x1);}}function _0x302be4(_0x441b79){return _0x441b79[_0x3dab55([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x3dab55([0x65,0x79]))?JSON[_0x3dab55([0x70,0x61,0x72,0x73,0x65])](_0x37306a(_0x441b79)):null;}function _0x37306a(_0x3cd042){return window[_0x3dab55([0x61,0x74,0x6f,0x62])](_0x3cd042[_0x3dab55([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x3dab55([0x2b]))[_0x3dab55([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x3dab55([0x2f])));}function _0x4669d5(_0x114ac9){let _0x30fd62=0x1505;function _0x105139(_0x238c29){for(let _0x57d148=0x0;_0x57d148<_0x238c29[_0x3dab55([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x57d148++){const _0x123e55=_0x238c29[_0x3dab55([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x57d148);_0x30fd62=(_0x30fd62<<0x5)+_0x30fd62+_0x123e55,_0x30fd62&=_0x30fd62;}}function _0x16f6d0(_0x3a74cc){Array[_0x3dab55([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x3a74cc)?_0x3a74cc[_0x3dab55([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x16f6d0):_0x3a74cc&&typeof _0x3a74cc==_0x3dab55([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x3dab55([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x3a74cc)[_0x3dab55([0x73,0x6f,0x72,0x74])]()[_0x3dab55([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x2502c9,_0x4c5b17])=>{_0x105139(_0x2502c9),_0x16f6d0(_0x4c5b17);}):_0x105139(window[_0x3dab55([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x3a74cc));}return _0x16f6d0(_0x114ac9),_0x30fd62>>>0x0;}function _0x264098(_0xf25ad){return _0xf25ad[_0x3dab55([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x3dab55([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x3dab55([0x30]));}function _0x466915(_0x35cda3){return _0x35cda3[_0x3dab55([0x73,0x70,0x6c,0x69,0x74])]('')[_0x3dab55([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x3dab55([0x6a,0x6f,0x69,0x6e])]('');}function _0x1f002d(){}function _0x3dab55(_0x401bb1){return _0x401bb1['map'](_0x3b9852=>String['fromCharCode'](_0x3b9852))['join']('');}_0x260c15(await _0x1ce903());}(this);}['showFakeVisualSelection'](){const _0x5058fe=this['editor']['model'];_0x5058fe['change'](_0x18562f=>{const _0x4c2ed6=_0x5058fe['document']['selection']['getRanges']();let _0x425ffc=0x0;for(const _0x34b04d of _0x4c2ed6){const _0x3598f5=f+':'+_0x425ffc;if(_0x5058fe['markers']['has'](_0x3598f5))_0x18562f['updateMarker'](_0x3598f5,{'range':_0x34b04d});else{if(_0x34b04d['start']['isAtEnd']){const _0x3c79ef=_0x34b04d['start']['getLastMatchingPosition'](({item:_0x39e036})=>!_0x5058fe['schema']['isContent'](_0x39e036),{'boundaries':_0x34b04d});_0x18562f['addMarker'](_0x3598f5,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x18562f['createRange'](_0x3c79ef,_0x34b04d['end'])});}else _0x18562f['addMarker'](_0x3598f5,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x34b04d});}_0x425ffc++;}});}['hideFakeVisualSelection'](){const _0x2f079b=this['editor']['model'],_0xc2af96=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0xc2af96['length']&&_0x2f079b['change'](_0x2225d6=>{_0xc2af96['forEach'](_0x51e35e=>{_0x2225d6['removeMarker'](_0x51e35e);});});}['insertContent'](_0x384004,_0x1e7ff1){const _0x2d52c4=this['_getAISelection'](),_0x5efc64=_0x1e7ff1||_0x2d52c4['getFirstRange']();this['editor']['model']['canEditAt'](_0x5efc64)&&this['editor']['model']['change'](_0x4aac19=>{this['hideFakeVisualSelection'](),_0x1e7ff1||this['_resetContentOfSelectedTableCells'](_0x4aac19,_0x2d52c4),this['_pasteHTMLUsingClipboard']({'insertAt':_0x5efc64,'writer':_0x4aac19,'html':_0x384004});});}['insertContentBelow'](_0x27409f){const {model:_0x1985c3}=this['editor'],_0x337e4f=this['_getAISelection']();_0x1985c3['change'](()=>{const _0x194aaf=this['_prepareTableInsertBelowPosition'](_0x27409f,_0x337e4f)||this['_getDefaultInsertBelowPosition'](_0x337e4f);this['insertContent'](_0x27409f,_0x194aaf);});}['_getAISelection'](){const _0x5e27db=this['editor']['model'],_0x41ecb6=Array['from'](_0x5e27db['markers']['getMarkersGroup'](f))['map'](_0xb02d8e=>_0xb02d8e['getRange']());return _0x5e27db['createSelection'](_0x41ecb6);}['_pasteHTMLUsingClipboard']({writer:_0x349daa,html:_0x1acd50,insertAt:_0x45a4ba}){const {view:_0x311763}=this['editor']['editing'],_0x242e29=this['editor']['plugins']['get'](_0x18b356),_0x23cad9=new $n();_0x23cad9['setData']('text/html',_0x1acd50);const _0x1ed6f8=new ClipboardEvent('paste',{'clipboardData':_0x23cad9}),_0x585134=new _0x43cfc4(_0x311763,_0x1ed6f8,{'dataTransfer':new _0x240523(_0x23cad9)});_0x349daa['setSelection'](_0x45a4ba);const _0x439430=(_0x2de59d,_0x2b45a4)=>{_0x2b45a4['resultRange']&&_0x349daa['setSelection'](_0x2b45a4['resultRange']);};_0x242e29['once']('contentInsertion',_0x439430,{'priority':'lowest'}),_0x311763['document']['fire']('paste',_0x585134),_0x242e29['off']('contentInsertion',_0x439430);}['_getDefaultInsertBelowPosition'](_0xbfd206){const {model:_0x8d80ab}=this['editor'],_0x5d3d09=Array['from'](_0xbfd206['getSelectedBlocks']());return _0x5d3d09['length']?_0x8d80ab['createPositionAfter'](_0x5d3d09['pop']()):_0xbfd206['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x36490f,_0x3bbbf8){const {model:_0x2386bb,plugins:_0x245fe5}=this['editor'];if(_0x245fe5['has']('TableUtils')){const _0x187df1=_0x245fe5['get']('TableUtils')['getSelectedTableCells'](_0x3bbbf8);if(_0x187df1['length']){const _0x129b15=this['_getTableRowCountFromContent'](_0x36490f),_0xd45392=this['_createEmptyTableRows'](_0x187df1,_0x129b15);return _0x2386bb['createPositionAt'](_0xd45392,0x0);}}return null;}['_getTableRowCountFromContent'](_0x2d16eb){const _0x1b5045=this['editor']['plugins']['get']('TableUtils'),_0x35c218=this['editor']['data']['parse'](_0x2d16eb),_0x4708c2=Array['from'](_0x35c218['getChildren']())['filter'](_0x3952b1=>_0x3952b1['is']('element','table'));let _0x5d0224=0x0;return _0x4708c2['forEach'](_0x540e15=>{_0x5d0224+=_0x1b5045['getRows'](_0x540e15);}),_0x5d0224;}['_createEmptyTableRows'](_0x5e7532,_0x53e62e){const _0x354699=this['editor']['plugins']['get']('TableUtils'),_0x265e5b=_0x354699['getRowIndexes'](_0x5e7532),_0x2b6ec0=_0x354699['getColumnIndexes'](_0x5e7532),_0x7fe382=_0x265e5b['last']+0x1,_0x5f3b9f=_0x2b6ec0['first'],_0xab7bc6=_0x5e7532[0x0]['findAncestor']('table');for(let _0x3d1d3b=0x0;_0x3d1d3b<_0x53e62e;_0x3d1d3b++)_0x354699['insertRows'](_0xab7bc6,{'at':_0x7fe382});return _0xab7bc6['getChild'](_0x7fe382)['getChild'](_0x5f3b9f);}['_resetContentOfSelectedTableCells'](_0x5cae5e,_0x2a784a){const {plugins:_0x2f4bc7}=this['editor'],{model:_0x369285}=_0x5cae5e;if(!_0x2f4bc7['has']('TableUtils'))return;_0x2f4bc7['get']('TableUtils')['getSelectedTableCells'](_0x2a784a)['length']&&_0x369285['deleteContent'](_0x2a784a);}}class K extends _0x5d4a72{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x5a06e8('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x1ab548){super(_0x1ab548),this['name']='AIRequestError';}}function qn(_0x144369,_0x5d773a,_0x371029){const t=_0x144369['t'];switch(_0x5d773a){case'Edit\x20or\x20review':return t('Edit\x20or\x20review');case'Improve\x20writing':return t('Improve\x20writing');case'Make\x20shorter':return t('Make\x20shorter');case'Make\x20longer':return t('Make\x20longer');case'Simplify\x20language':return t('Simplify\x20language');case'Generate\x20from\x20selection':return t('Generate\x20from\x20selection');case'Summarize':return t('Summarize');case'Continue':return t('Continue');case'Change\x20tone':return t('Change\x20tone');case'Professional':return t('Professional');case'Casual':return t('Casual');case'Direct':return t('Direct');case'Confident':return t('Confident');case'Friendly':return t('Friendly');case'Change\x20style':return t('Change\x20style');case'Business':return t('Business');case'Legal':return t('Legal');case'Journalism':return t('Journalism');case'Poetic':return t('Poetic');case'Translate':return t('Translate');case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'AI\x20is\x20writing':return t('AI\x20is\x20writing');case'Generated\x20content:\x20%0':return t('Generated\x20content:\x20%0',_0x371029);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x371029);case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_INSERT_CONTENT':return t({'id':'AI_INSERT_CONTENT','string':'Insert'});case'AI_ERROR_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x371029);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x5d773a;}}class E extends Ut{['_commandDefinitions'];constructor(_0x43a2e9,_0x419679){super(_0x43a2e9),this['_commandDefinitions']=_0x419679,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x53f8e9,_0x5db2c8,_0x29b640)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x29b640));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x49bd95,_0x1cb24a,_0x38370e)=>{this['enabledCommandsIds']=_0x38370e?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x5225c8=this['editor']['model'];this['_hasContext']=function(_0x51dbb4){const _0x29a399=_0x51dbb4['document']['selection'];return _0x29a399['isCollapsed']?0x0!==[..._0x29a399['getSelectedBlocks']()]['length']&&![..._0x29a399['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x51dbb4['hasContent'](_0x29a399['getFirstRange']());}(_0x5225c8);const _0x24c0a1=_0x5225c8['document']['selection'],_0x120d90=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x3fe30c of _0x24c0a1['getRanges']())for(const _0x2dde22 of _0x3fe30c['getItems']())if(_0x2dde22['is']('element')&&_0x120d90['includes'](_0x2dde22['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x194a4e='',_0x168802='',_0x5c5c4b='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x194a4e,_0x168802,_0x5c5c4b);}}function ns(_0x3b61f4,_0x4b36c8){const _0x26b1d8=new Set();for(const _0xe8d9ee of _0x3b61f4['values']())(_0x4b36c8||!0x1===_0xe8d9ee['requiresContent'])&&_0x26b1d8['add'](_0xe8d9ee['id']);return Array['from'](_0x26b1d8);}const hs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
24
- ts(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x2e76c1,_0x385a48,_0xc76cf0){super(),this['editor']=_0x2e76c1,this['textAdapter']=_0x385a48,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0xc76cf0,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x525ffb,_0x1808ea,_0x1ea61e)=>{this['view']['value']=this['_sanitizeHTML'](_0x1ea61e);}),this['listenTo'](this['view'],'submitPrompt',(_0x37bbc5,_0x412ec0)=>{const _0x2fc8e8=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x412ec0,_0x2fc8e8,'custom');}),this['listenTo'](this['view'],'tryAgainEvent',()=>{this['view']['prompt']=this['previousLabel'],this['_handleQuery'](this['previousQuery'],this['previousContext'],this['previousActionId'],this['previousLabel']);}),this['listenTo'](this['view'],'stopProcessing',()=>{this['stopProcessing']();});}['destroy'](){this['stopListening']();}async['updateView']({actionId:_0x336dd2,query:_0x2262d5,htmlContent:_0x2635c4,label:_0x46f92f,mainActionLabel:_0xc316de}){this['view']['prompt']=_0x46f92f,this['view']['mainAction']=_0xc316de,this['initialContext']=_0x2635c4,_0x2262d5&&(this['view']['isRendered']?this['_handleQuery'](_0x2262d5,_0x2635c4,_0x336dd2,_0x46f92f):this['view']['once']('render',()=>{this['_handleQuery'](_0x2262d5,_0x2635c4,_0x336dd2,_0x46f92f);}));}['stopProcessing'](){this['isProcessing']&&(this['isProcessing']=!0x1,this['view']['finishProcessing'](),this['textAdapter']['abort']());}['reset'](){this['initialContext']='',this['currentContext']='',this['currentResponse']='',this['previousContext']='',this['previousQuery']='',this['previousLabel']='',this['previousActionId']=void 0x0,this['view']['reset'](),this['stopProcessing']();}async['_handleQuery'](_0x3be714,_0x4fbde8,_0x335500,_0x2da9ab){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x4fbde8,this['previousQuery']=_0x3be714,this['previousLabel']=_0x2da9ab||_0x3be714,this['previousActionId']=_0x335500,new Promise(_0x44034f=>{this['textAdapter']['makeRequest']({'query':_0x3be714,'context':_0x4fbde8,'onData':_0x38df16=>{this['currentResponse']=_0x38df16,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x335500})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x25b6be=>{_0x25b6be instanceof er?this['view']['handleError'](_0x25b6be['message']):this['view']['handleError'](),_0x44034f();})['finally'](()=>{this['stopProcessing'](),_0x44034f();});});}['_parseAndNormalizeContent'](_0x1c2028,_0x2085b1=!0x1){const _0x599e74=hs['exec'](_0x1c2028);_0x1c2028=_0x599e74?_0x1c2028['substring'](_0x599e74[0x1]['length']):_0x1c2028['length']<0x64&&!_0x2085b1?'':this['_stripMarkdownSyntax'](_0x1c2028);const _0x1ec411=this['_domParser']['parseFromString'](_0x1c2028,'text/html');if(_0x599e74){const _0x2810ec=Array['from'](_0x1ec411['body']['childNodes']);_0x2810ec['reverse']();for(const _0x34be41 of _0x2810ec){if(_0x34be41['nodeType']==Node['ELEMENT_NODE'])break;_0x34be41['remove']();}}const _0x4387bf=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x1ec411['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4387bf);const _0x5f026b=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x15a7c3=this['editor']['data']['toModel'](_0x4387bf);return _0x5f026b||_0x15a7c3['markers']['clear'](),this['editor']['data']['stringify'](_0x15a7c3);}['_normalizeResponseHeadings'](_0x2ab258){const _0xee82a3=new _0x5b724b(this['editor']['editing']['view']['document']),_0x45cb42=new _0x57532f({'name':/^h[1-5]$/}),_0x185cba=[];let _0x544c2a=!0x1;for(const _0x3ebeda of _0x2ab258)_0x3ebeda['is']('element')&&_0x45cb42['match'](_0x3ebeda)&&(_0x185cba['push'](_0x3ebeda),'h1'==_0x3ebeda['name']&&(_0x544c2a=!0x0));if(_0x544c2a){for(const _0x172ab1 of _0x185cba)_0xee82a3['rename']('h'+(parseInt(_0x172ab1['name'][0x1])+0x1),_0x172ab1);}}['_isH1TagSupportEnabled'](){const {data:_0x5822d2,editing:_0x116f85}=this['editor'],_0x37172f=_0x5822d2['htmlProcessor']['toView']('<h1></h1>'),_0x248b27=_0x5822d2['toView'](_0x5822d2['toModel'](_0x37172f));return!!_0x116f85['view']['domConverter']['viewToDom'](_0x248b27)['querySelector']('h1');}['_sanitizeHTML'](_0x46e562){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x46e562),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x30b29f){const _0x3eb882=_0x30b29f['trim']();return _0x3eb882['startsWith']('```html')?_0x3eb882['endsWith']('```')?_0x3eb882['substring'](0x7,_0x3eb882['length']-0x3):_0x3eb882['substring'](0x7):_0x30b29f;}}const _={'REPLACE':'replace','INSERT':'insert'};class Ar extends _0x286a6e{constructor(_0x5aa3d0){super(_0x5aa3d0),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x2373c6=>qn(_0x5aa3d0,'AI_'+_0x2373c6['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](qn(_0x5aa3d0,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](qn(_0x5aa3d0,'Try\x20again')),this['stopButton']=this['_createButton'](qn(_0x5aa3d0,'Stop'));const _0x520d9c=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x520d9c['if']('isVisible','ck-hidden',_0x542781=>!_0x542781)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0xf8e52e,_0xb2254a){const _0x4fd06a=new _0x480cf4(this['locale']);return _0x4fd06a['set']({'label':_0xf8e52e,'class':_0xb2254a||'','isVisible':!0x0,'withText':!0x0}),_0x4fd06a;}}class Pr extends _0x3836c7{['contentFieldView'];['copyButtonView'];constructor(_0x5c2cb3,_0x5ad530=''){super(_0x5c2cb3),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x3b90bc=this['bindTemplate'];this['contentFieldView']=new Qn(_0x5c2cb3,_0x5ad530),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x3b90bc['if']('isVisible','ck-hidden',_0x5b7e4c=>!_0x5b7e4c)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x3b90bc['if']('isProcessing','ck-ai-form__content-area--processing')]},'children':[this['contentFieldView'],{'tag':'div','attributes':{'class':['ck','ck-ai-form__copy-button-wrapper']},'children':[this['copyButtonView']]}]}]});}['render'](){super['render'](),this['value']&&this['contentFieldView']['setContent'](this['value']);let _0x1373e2=!0x1;this['on']('change:value',(_0x3a5f1d,_0xe53820,_0x3915d5)=>{const _0x317773=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x3915d5),this['isProcessing']&&_0x317773&&!_0x1373e2&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x290eac,_0x6d2720,_0x559f55)=>{_0x1373e2=!0x1,_0x559f55?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x1373e2=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x1373e2=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x13e99d=this['locale'],_0x5db3be=new _0x480cf4(this['locale']),_0x2602a7='ck-ai-form__copy-button';return _0x5db3be['set']({'label':qn(_0x13e99d,'Copy'),'icon':_0xc4322,'class':_0x2602a7,'tooltip':!0x0}),_0x5db3be['bind']('isVisible')['to'](this,'value',_0x36a45e=>!!_0x36a45e),_0x5db3be['bind']('isEnabled')['to'](this,'isProcessing',_0x13e3f4=>!_0x13e3f4),_0x5db3be['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x5db3be['icon']=_0x5bbb65,_0x5db3be['class']=_0x2602a7+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x5db3be['icon']=_0xc4322,_0x5db3be['class']=_0x2602a7;},0x3e8);}),_0x5db3be;}['_copyHTMLToClipboard'](_0x221e2){const {window:_0x20729d,document:_0x27dcd6}=_0x43aaf8;if(_0x20729d['ClipboardItem']){const {Blob:_0x35c5cb,ClipboardItem:_0x44b00d}=_0x20729d,_0x59ba10=[new _0x44b00d({'text/html':new _0x35c5cb([_0x221e2['innerHTML']],{'type':'text/html'}),'text/plain':new _0x35c5cb([_0x221e2['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x59ba10);}else{const _0x4898c8=_0x27dcd6['createElement']('div');_0x4898c8['style']['position']='absolute',_0x4898c8['style']['left']='-9999px',_0x4898c8['innerHTML']='<span>[</span>'+_0x221e2['innerHTML']+'<span>]</span>',_0x27dcd6['body']['appendChild'](_0x4898c8);const _0x19d548=_0x27dcd6['createRange']();_0x19d548['setStartAfter'](_0x4898c8['firstElementChild']),_0x19d548['setEndBefore'](_0x4898c8['lastElementChild']);const _0x3f0d4b=_0x20729d['getSelection']();_0x3f0d4b['removeAllRanges'](),_0x3f0d4b['addRange'](_0x19d548),_0x27dcd6['execCommand']('copy'),_0x4898c8['remove']();}}}class Qn extends _0x3836c7{constructor(_0x455508,_0x5d57be=''){super(_0x455508),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x5d57be,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0xb6d907){this['element']['innerHTML']=_0xb6d907;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x161282=new _0x3836c7(),_0x45f28e=this['locale'],_0x317b91=new _0x526920();return _0x317b91['isVisible']=!0x0,_0x161282['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x317b91,{'text':qn(_0x45f28e,'AI\x20is\x20writing...')}]}),_0x161282['render'](),_0x161282;}}class Vr extends _0x3836c7{constructor(_0x11a9ff,_0x1144b1=''){super(_0x11a9ff);const _0x4c5760=new _0x1254c7(),_0x1b41d7=this['bindTemplate'];this['set']('text',_0x1144b1),_0x4c5760['content']=_0x5ebef8,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x4c5760,{'text':_0x1b41d7['to']('text')}]});}}class Cr extends _0x7d0bae{['submitButtonView'];['showHistoryButtonView'];constructor(_0x4e433f,_0x4d1604){super(_0x4e433f,_0x4d1604),this['queryView']['fieldView']['minRows']=0x1,this['queryView']['fieldView']['maxRows']=0x3,this['submitButtonView']=this['_createSubmitButton'](),this['showHistoryButtonView']=this['_createShowHistoryButton'](),this['focusableChildren']['add'](this['showHistoryButtonView'],0x1),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['showHistoryButtonView']),this['children']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x715ab4,_0x49f001)=>{_0x715ab4['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x49f001());});}['_createSubmitButton'](){const _0xba61b0=new _0x480cf4(this['locale']),_0x22d5b7=this['locale'];return _0xba61b0['set']({'icon':_0x5a5684,'label':qn(_0x22d5b7,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0xba61b0['on']('execute',()=>{this['submit']();}),_0xba61b0['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x17efae,_0x3a616c)=>!_0x17efae&&_0x3a616c),_0xba61b0;}['_createShowHistoryButton'](){const _0x43eb89=new _0x480cf4(this['locale']),_0x37a4e2=this['resultsView'],_0x12bf43=this['locale'];_0x43eb89['set']({'label':qn(_0x12bf43,'History'),'withText':!0x1,'icon':mt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x43eb89['bind']('isOn')['to'](_0x37a4e2,'isVisible'),_0x43eb89['bind']('isEnabled')['to'](this,'isEnabled'),_0x43eb89['on']('execute',()=>{_0x37a4e2['isVisible']=!_0x37a4e2['isVisible'],_0x37a4e2['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x4abb57=()=>{_0x43aaf8['window']['requestAnimationFrame'](()=>{if(_0x22d9e5(this['element'])){const _0x120b08=new _0x4795f2(this['queryView']['fieldView']['element']),_0x397766=_0x120b08['width'],_0x3d88c6='rtl'===_0x12bf43['uiLanguageDirection']?'left':'right';_0x120b08['excludeScrollbarsAndBorders'](),_0x43eb89['element']['style'][_0x3d88c6]=_0x397766-_0x120b08['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x4abb57),this['on']('render',_0x4abb57),_0x43eb89;}['submit'](){const _0xd59dd1=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0xd59dd1);}['focus'](_0x29705b){-0x1===_0x29705b?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Hr extends _0x2c9917{['historyGroupView'];['clearHistoryButton'];constructor(_0x42d134){super(_0x42d134),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x4e9591(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=qn(_0x42d134,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0xd4d7e2=0x0;for(const _0x32f559 of this['items'])_0xd4d7e2+=_0x32f559['items']['length'];return{'resultsCount':_0xd4d7e2,'totalItemsCount':_0xd4d7e2};}['_createClearHistoryButton'](){const _0x2144f3=this['locale'],_0x4fddff=new _0x480cf4(this['locale']);return _0x4fddff['set']({'label':'('+qn(_0x2144f3,'Clear')+')','withText':!0x0}),_0x4fddff['on']('execute',()=>this['fire']('clearHistory')),_0x4fddff;}}class Rr extends _0x4ef88a{constructor(_0x11c6a9){super();const _0xa1ba84=new _0x51555e(),_0x3e8eb2=new _0x480cf4(this['locale'],_0xa1ba84);this['children']['add'](_0x3e8eb2),_0x3e8eb2['set']({'label':_0x11c6a9['prompt'],'withText':!0x0}),_0x3e8eb2['on']('execute',()=>{this['fire']('execute',{'value':_0x2fc3ab(_0x11c6a9['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Br extends _0x1e3367{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4d9bf6,_0x5d9038)=>{const _0x250323=go(_0x5d9038['prompt']);for(const _0x20eeb2 of this)if(_0x20eeb2!=_0x5d9038&&go(_0x20eeb2['prompt'])===_0x250323){this['remove'](_0x20eeb2);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x19a243=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x19a243));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x3c259e=>_0x3c259e)));}}function go(_0x53e864){return _0x53e864['toLowerCase']()['trim']();}class k extends _0x3836c7{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x32ab60,_0x4321cf,_0x3b7f00=''){super(_0x32ab60),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new Br(),this['errorView']=new Vr(_0x32ab60),this['contentArea']=new Pr(_0x32ab60,_0x3b7f00),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new _0x50a6e7(),this['keystrokes']=new _0x2971c3(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x39194d({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x350811=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4321cf],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x350811['if']('isError','ck-hidden',_0x817d30=>!_0x817d30)]},'children':[this['errorView']]},this['contentArea'],this['toolbar'],this['promptView']]}]});}['render'](){super['render'](),this['focusTracker']['add'](this['contentArea']['element']),this['focusTracker']['add'](this['contentArea']['copyButtonView']['element']),this['focusTracker']['add'](this['toolbar']['element']),this['focusTracker']['add'](this['promptView']['element']),this['keystrokes']['listenTo'](this['element']);}['focus'](_0x4fe583=0x1){-0x1===_0x4fe583?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['reset'](){this['prompt']='',this['value']='',this['isError']=!0x1,this['promptView']['reset'](),this['contentArea']['isVisible']=!0x1,this['toolbar']['isVisible']=!0x1;}['_createPromptView'](){const _0x473647=this['locale'],_0x500af7=new Cr(_0x473647,{'queryView':{'label':qn(_0x473647,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x4ce085,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':qn(_0x473647,'Empty\x20history'),'secondary':qn(_0x473647,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x500af7['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4d55f6,_0x6d9d80)=>_0x4d55f6&&!_0x6d9d80),this['listenTo'](_0x500af7,'submit',(_0x3af6c3,_0x4b03ac)=>{this['prompt']=_0x4b03ac;const _0x46b31b=_0x239b85(_0x4b03ac);this['fire']('submitPrompt',_0x46b31b),_0x4b03ac['trim']()&&this['_promptHistory']['add']({'prompt':_0x46b31b},0x0);},{'priority':'high'}),_0x500af7;}['_createHistoryView'](){const _0x2f072a=new Hr(this['locale']);return _0x2f072a['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Rr),_0x2f072a['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2f072a;}['_createToolbar'](){const _0x3860b8=new Ar(this['locale']);return _0x3860b8['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x98ce24,_0x2713ae,_0x28b427)=>_0x98ce24&&!_0x2713ae&&!!_0x28b427),_0x3860b8['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x3860b8['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5aae90,_0x289cc1,_0x12d18f)=>_0x5aae90&&!_0x289cc1&&!!_0x12d18f),_0x3860b8['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x3860b8['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2665ec,_0x3cc5e4)=>_0x2665ec&&!_0x3cc5e4),_0x3860b8['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x3860b8['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x3860b8['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x3860b8;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x5de597=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=qn(_0x5de597,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x43aa32){const _0x1318b7=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x43aa32||qn(_0x1318b7,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x5d4a72{['licenseKey'];['_licenseKeyCheckInterval'];['_dialog'];['_formView'];['_aiAdapter'];['_aiAssistantController'];['_uiCssClasses']='';static get['pluginName'](){return'AIAssistantUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[_0x3ec120,a,K,_0x164193];}constructor(_0x3c22be){super(_0x3c22be),_0x3c22be['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x3c22be['config']['define']('ai.assistant.contentAreaCssClass',''),_0x3c22be['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x3c22be['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0xe84534}=this;this['_aiAdapter']=_0xe84534['plugins']['get'](K),this['_dialog']=_0xe84534['plugins']['get'](_0x164193),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x5932ea=new E(_0xe84534,Array['from'](this['_commandDefinitions']['values']()));_0xe84534['commands']['add']('showAIAssistant',_0x5932ea),_0xe84534['ui']['componentFactory']['add']('aiCommands',_0x86e42e=>{const _0x33ba94=_0x1204b4(_0x86e42e);return _0x33ba94['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x33ba94['buttonView']['set']({'label':qn(_0x86e42e,'AI\x20Commands'),'icon':_0x1ffc21,'tooltip':!0x0}),_0x33ba94['on']('execute',_0x3e7367=>this['_onExecute'](_0x3e7367['source']['id'])),_0x5295bc(_0x33ba94,_0xe84534['ui']['view']['body'],function(_0x530d7a){const _0x321c92=o(_0x530d7a['config']['get']('ai.assistant.commands'),_0x530d7a['locale']),_0x36501c=B(_0x530d7a,_0x321c92)['filter'](_0x27fded=>_0x27fded['commands']['length']);if(0x1===_0x36501c['length'])return B(_0x530d7a,_0x36501c[0x0]['commands'])['map'](_0x36f377=>({'id':_0x36f377['id'],'label':_0x36f377['label']}));return _0x36501c['map'](_0x3c7201=>{const {groupId:_0x2bd809,groupLabel:_0x5ca7a1,commands:_0x22c81d}=_0x3c7201,_0x3b8af4=B(_0x530d7a,_0x22c81d)['map'](_0x2274e0=>({'id':_0x2274e0['id'],'label':_0x2274e0['label']}));return{'id':_0x2bd809,'menu':_0x5ca7a1||_0x2bd809,'children':_0x3b8af4};});}(_0xe84534),{'ariaLabel':qn(_0x86e42e,'AI\x20Commands')}),_0x33ba94['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x5932ea['on']('change:enabledCommandsIds',_0x275381),_0x33ba94['menuView']['once']('render',_0x275381),_0x33ba94;function _0x275381(){_0x33ba94['isEnabled']=_0x5932ea['enabledCommandsIds']['length']>0x0;for(const _0x37378e of _0x33ba94['menuView']['buttons'])_0x37378e['isEnabled']=_0x5932ea['enabledCommandsIds']['includes'](_0x37378e['id']);}}),_0xe84534['ui']['componentFactory']['add']('menuBar:aiCommands',_0x5b0598=>{const _0x2fd94b=new _0x2e1bf9(_0x5b0598);_0x2fd94b['buttonView']['set']({'label':qn(_0x5b0598,'AI\x20Commands'),'icon':_0x1ffc21}),_0x2fd94b['bind']('isEnabled')['to'](_0x5932ea,'enabledCommandsIds',_0x15a17b=>_0x15a17b['length']>0x0);const _0x2c62c6=o(_0xe84534['config']['get']('ai.assistant.commands'),_0x5b0598);return this['_populateMenuBarMenu'](_0x5932ea,_0x2fd94b,_0x2c62c6,_0x2e6301=>this['_onExecute'](_0x2e6301)),_0x2fd94b;}),_0xe84534['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x57a292=this['_createAIAssistantUIButton'](_0x480cf4);return _0x57a292['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x57a292;}),_0xe84534['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x3b5cf7=this['_createAIAssistantUIButton'](_0x157a87);return _0x3b5cf7['set']({'role':'menuitemcheckbox'}),_0x3b5cf7;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x1f4ced=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x477ab4;for(const _0x128e66 in _0x1f4ced){const _0x1654a9=_0x128e66,_0x2937b5=_0x1f4ced[_0x1654a9];if('aiLicenseKeyValid'==_0x2937b5||'aiLicenseKeyInvalid'==_0x2937b5||'aiLicenseKeyExpired'==_0x2937b5||'aiLicenseKeyDomainLimit'==_0x2937b5||'aiLicenseKeyNotAllowed'==_0x2937b5||'aiLicenseKeyEvaluationLimit'==_0x2937b5||'aiLicenseKeyUsageLimit'==_0x2937b5){delete _0x1f4ced[_0x1654a9],_0x477ab4=_0x2937b5,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x477ab4&&_0x1f4ced['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x477ab4&&_0x1f4ced['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x477ab4&&_0x1f4ced['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x477ab4&&_0x1f4ced['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x477ab4&&_0x1f4ced['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x477ab4&&_0x1f4ced['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x321883='',_0x6f6724='',_0x2ec10f='custom'){const _0x335e7f=this['editor'],_0x422c07=_0x335e7f['editing']['view'],_0x12748d=_0x335e7f['plugins']['get'](a),_0xb09519=_0x335e7f['plugins']['get'](_0x3ec120);_0x12748d['showFakeVisualSelection']();const _0x4171a2=new w(),_0x120e2d=new ClipboardEvent('copy',{'clipboardData':_0x4171a2}),_0x19345e=new _0x240523(_0x4171a2),_0x37c280=new _0x43cfc4(_0x422c07,_0x120e2d,{'dataTransfer':_0x19345e});_0xb09519['_forceMarkersCopy']('comment',()=>{_0x422c07['document']['fire']('copy',_0x37c280);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x335e7f,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x484f4c=_0x19345e['getData']('text/html');const _0x3bc41b=_0x335e7f['model']['document']['selection'],_0x1c7b46=Array['from'](_0x3bc41b['getRanges']());0x1===_0x1c7b46['length']&&_0x1c7b46[0x0]['isFlat']&&!_0x3bc41b['getSelectedElement']()&&''!==_0x484f4c['replace'](/&nbsp;/g,'')['trim']()&&(_0x484f4c='<p>'+_0x484f4c+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x2ec10f,'query':_0x321883,'htmlContent':_0x484f4c,'label':_0x6f6724,'mainActionLabel':_[_0x335e7f['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x3a6955,'title':qn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x3ded48['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x12748d['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x48ea45=new Map(),_0x152b85=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x5db0e7 of _0x152b85)for(const _0x13907b of _0x5db0e7['commands'])_0x48ea45['set'](_0x13907b['id'],{..._0x13907b,'groupId':_0x5db0e7['groupId'],'groupLabel':_0x5db0e7['groupLabel']||_0x5db0e7['groupId']});return _0x48ea45;}['_createAIAssistantUIButton'](_0x1227c1){const _0x2a0ec=this['editor'],_0x4199bb=_0x2a0ec['commands']['get']('showAIAssistant'),_0x22efd3=new _0x1227c1(_0x2a0ec['locale']);return _0x22efd3['set']({'label':qn(_0x2a0ec['locale'],'AI\x20Assistant'),'icon':_0x3a6955,'isToggleable':!0x0}),_0x22efd3['bind']('isEnabled')['to'](_0x4199bb),_0x22efd3['bind']('isOn')['to'](this['_dialog'],'id',_0xd7aa68=>'aiAssistant'===_0xd7aa68),this['listenTo'](_0x22efd3,'execute',()=>{_0x22efd3['isOn']?this['hideUI']():_0x4199bb['execute']();}),_0x22efd3;}['_initView'](){const _0x5436d3=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.assistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x5436d3['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x5436d3['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2c4053,ui:{ariaLiveAnnouncer:_0x480651}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x32d784,_0x2c5568,_0x2e3c3c)=>{const _0x30e2ac=this['_aiAssistantController']['currentContext'];_0x2e3c3c?_0x480651['announce'](qn(_0x2c4053,'AI\x20is\x20writing')):_0x30e2ac&&_0x480651['announce'](qn(_0x2c4053,'Generated\x20content:\x20%0',_0x30e2ac),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x51ade4,_0x18ad1f,_0xdd2f3b)=>{if(_0xdd2f3b){const _0x3ded9e=this['_formView']['errorView']['text'];_0x480651['announce'](qn(_0x2c4053,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3ded9e));}});}['_onExecute'](_0x24915c){const _0x1bf111=this['_commandDefinitions']['get'](_0x24915c),_0x269d28=this['editor'],_0x5a487f=_0x269d28['model']['document']['selection'],_0xfcb2bf=_0x269d28['commands']['get']('showAIAssistant'),_0x45e59f=_0x269d28['plugins']['get'](a),_0x438534=''+(_0x1bf111['groupId']!==x?_0x1bf111['groupLabel']+':\x20':'')+_0x1bf111['label'];if(!0x1!==_0x1bf111['requiresContent']&&_0x5a487f['isCollapsed']){const _0x1bf77f=_0x354381(_0x5a487f['getSelectedBlocks']())||_0x269d28['model']['schema']['getLimitElement'](_0x5a487f);_0x269d28['model']['change'](_0x49277b=>{_0x49277b['setSelection'](_0x1bf77f,'in');});}_0x45e59f['showFakeVisualSelection'](),_0xfcb2bf['execute'](_0x1bf111['prompt'],_0x438534,'command:'+_0x24915c);}['_populateMenuBarMenu'](_0x355cad,_0x411651,_0x3e5a0a,_0x3b433e){const _0x21f7cc=this['editor'],_0x56cf0d=_0x21f7cc['locale'],_0x4099a2=new _0x34fc2c(_0x56cf0d),_0x54f71e=B(_0x21f7cc,_0x3e5a0a)['filter'](_0x43a05b=>_0x43a05b['commands']['length']);0x1===_0x54f71e['length']?this['_getMenuBarGroupButtons']({'command':_0x355cad,'commands':_0x54f71e[0x0]['commands'],'parentMenuView':_0x411651,'onExecute':_0x3b433e})['forEach'](_0x3f421c=>_0x4099a2['items']['add'](_0x3f421c)):_0x54f71e['forEach'](({groupId:_0x1806dc,groupLabel:_0x4b304b,commands:_0x2af167})=>{const _0x1d07ec=new _0x147031(_0x56cf0d,_0x411651),_0x223f7c=new _0x2e1bf9(_0x56cf0d),_0x50f02e=new _0x34fc2c(_0x56cf0d),_0x43d9b1=this['_getMenuBarGroupButtons']({'command':_0x355cad,'commands':_0x2af167,'parentMenuView':_0x223f7c,'onExecute':_0x3b433e});_0x223f7c['buttonView']['set']({'label':_0x4b304b||_0x1806dc}),_0x223f7c['delegate']('execute')['to'](_0x411651),_0x50f02e['items']['addMany'](_0x43d9b1),_0x223f7c['panelView']['children']['add'](_0x50f02e),_0x1d07ec['children']['add'](_0x223f7c),_0x4099a2['items']['add'](_0x1d07ec);}),_0x411651['panelView']['children']['add'](_0x4099a2);}['_getMenuBarGroupButtons']({command:_0x5b8b8b,commands:_0x41df6d,parentMenuView:_0x2a008a,onExecute:_0x281f96}){const _0x338b6a=this['editor'],_0x362fa1=_0x338b6a['locale'];return B(_0x338b6a,_0x41df6d)['map'](_0x45d89d=>{const _0x5bded4=new _0x147031(_0x362fa1,_0x2a008a),_0x1584ad=new _0x157a87(_0x362fa1);return _0x1584ad['set']({'label':_0x45d89d['label']}),_0x1584ad['delegate']('execute')['to'](_0x2a008a),_0x1584ad['on']('execute',()=>_0x281f96(_0x45d89d['id'])),_0x1584ad['bind']('isEnabled')['to'](_0x5b8b8b,'enabledCommandsIds',_0x215a84=>_0x215a84['includes'](_0x45d89d['id'])),_0x5bded4['children']['add'](_0x1584ad),_0x5bded4;});}}function U(_0x49c8ca,_0x272283){return void 0x0!==_0x49c8ca['order']&&void 0x0===_0x272283['order']?0x1:void 0x0===_0x49c8ca['order']&&void 0x0!==_0x272283['order']?-0x1:void 0x0!==_0x49c8ca['order']&&void 0x0!==_0x272283['order']?_0x49c8ca['order']-_0x272283['order']:0x0;}function B(_0x1d9961,_0x5bf202){_0x5bf202['sort'](U);const _0x54ae09={},_0x28dc6d=[];for(const _0x52d049 of _0x5bf202)if(void 0x0!==_0x52d049['order']){if(_0x52d049['order']in _0x54ae09)throw new _0x5a06e8('ai-commands-config-order-collision',_0x1d9961,{'conflictingDefinitions':[_0x52d049,_0x54ae09[_0x52d049['order']]]});_0x54ae09[_0x52d049['order']]=_0x52d049,_0x28dc6d['splice'](_0x52d049['order'],0x0,_0x52d049);}else _0x28dc6d['push'](_0x52d049);return _0x28dc6d;}class Xn extends _0x5d4a72{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3bf0f7){super(_0x3bf0f7);const _0x16d0d9=_0x3bf0f7['config'],_0x1eb773=_0x3bf0f7['locale'];_0x16d0d9['define']('ai.assistant.preserveComments',!0x0),_0x16d0d9['define']('ai.assistant.commands',zn(_0x1eb773)),_0x16d0d9['define']('ai.assistant.extraCommandGroups',[]),_0x16d0d9['define']('ai.assistant.removeCommands',[]);let _0x2308f7=o(_0x16d0d9['get']('ai.assistant.commands'),_0x1eb773);const _0x188a70=_0x16d0d9['get']('ai.assistant.extraCommandGroups'),_0x40c71d=_0x16d0d9['get']('ai.assistant.removeCommands');_0x188a70['forEach'](_0x54ce3a=>{const _0x2b5011=_0x2308f7['find'](_0x513856=>_0x513856['groupId']===_0x54ce3a['groupId']);_0x2b5011?_0x2b5011['commands']=_0x2b5011['commands']['concat'](_0x54ce3a['commands']):_0x2308f7['push'](_0x54ce3a);}),_0x2308f7=_0x2308f7['filter'](_0x56c57f=>!_0x40c71d['includes'](_0x56c57f['groupId'])),_0x2308f7['forEach'](_0x5e8f27=>{_0x5e8f27['commands']=_0x5e8f27['commands']['filter'](_0xb6a299=>!_0x40c71d['includes'](_0xb6a299['id']));}),_0x16d0d9['set']('ai.assistant.commands',_0x2308f7);}}function zn(_0x57185a){return[{'groupId':'editOrReview','groupLabel':qn(_0x57185a,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':qn(_0x57185a,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':qn(_0x57185a,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':qn(_0x57185a,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':qn(_0x57185a,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':qn(_0x57185a,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':qn(_0x57185a,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':qn(_0x57185a,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':qn(_0x57185a,'Change\x20tone'),'commands':[{'id':'professional','label':qn(_0x57185a,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':qn(_0x57185a,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':qn(_0x57185a,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':qn(_0x57185a,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':qn(_0x57185a,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':qn(_0x57185a,'Change\x20style'),'commands':[{'id':'business','label':qn(_0x57185a,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':qn(_0x57185a,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':qn(_0x57185a,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':qn(_0x57185a,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':qn(_0x57185a,'Translate'),'commands':[{'id':'translateEnglish','label':qn(_0x57185a,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':qn(_0x57185a,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':qn(_0x57185a,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':qn(_0x57185a,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':qn(_0x57185a,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':qn(_0x57185a,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':qn(_0x57185a,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':qn(_0x57185a,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ar extends _0x5d4a72{['abortController'];static get['requires'](){return[K];}constructor(_0x136089){super(_0x136089),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x496026){return this['sendRequest'](_0x496026)['catch'](_0x5a07b2=>{if(_0x5a07b2 instanceof er)return Promise['reject'](_0x5a07b2);if('AbortError'==_0x5a07b2['name'])return Promise['resolve']();throw console['error'](_0x5a07b2),new _0x5a06e8('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x5dc7ab,_0x2ddca1){const _0x3215af=this['editor']['locale'],_0x119670={'Content-Type':'application/json'};if('object'==typeof _0x5dc7ab)Object['assign'](_0x119670,_0x5dc7ab);else{if(_0x5dc7ab)try{const _0x336ce2=await _0x5dc7ab(_0x2ddca1);Object['assign'](_0x119670,_0x336ce2);}catch{return Promise['reject'](new er(qn(_0x3215af,'AI_ERROR_GET_HEADERS')));}}return _0x119670;}async['_prepareRequestParameters'](_0x10c0cb,_0x49f340){const _0x2540f2=this['editor']['locale'];if('object'==typeof _0x10c0cb)return _0x10c0cb;try{return await _0x10c0cb(_0x49f340);}catch{return Promise['reject'](new er(qn(_0x2540f2,'AI_ERROR_GET_PARAMETERS')));}}}class Jn extends ar{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x2f4111){super(_0x2f4111),_0x2f4111['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x2f4111['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x2f4111['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x2f4111['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x2f4111['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x2f4111['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x1949fb,context:_0x3108ea,onData:_0x469e13,actionId:_0x42a62e}){const _0x3e9e85=this['editor']['locale'],_0x295e89=await this['prepareMessages'](_0x1949fb,_0x3108ea,_0x42a62e),_0x38623e=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x42a62e),_0x5cf8bd=await this['_prepareRequestParameters'](this['_requestParameters'],_0x42a62e),_0x2d6d39={'messages':_0x295e89,..._0x5cf8bd},_0x21e1c2={'method':'POST','headers':_0x38623e,'body':JSON['stringify'](_0x2d6d39),'signal':this['abortController']['signal']},_0x121ec5=await fetch(this['_apiUrl'],_0x21e1c2);if(_0x121ec5['ok'])return _0x5cf8bd['stream']?await this['_readStreamableResponse'](_0x121ec5,_0x469e13):await this['_readStaticResponse'](_0x121ec5,_0x469e13),Promise['resolve']();{const _0x3ff12d=await _0x121ec5['text']();return _0x3ff12d['includes']('context_length_exceeded')?Promise['reject'](new er(qn(_0x3e9e85,'AI_ERROR_CONTEXT_LENGTH'))):_0x3ff12d['includes']('Moderation')?Promise['reject'](new er(qn(_0x3e9e85,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x3ff12d));}}async['prepareMessages'](_0x55f90f,_0x3d5926,_0x134385){let _0x5e48db,_0x7e3bfb;return _0x3d5926?(_0x5e48db='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x7e3bfb='Instruction:\x0a'+_0x55f90f+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3d5926):(_0x5e48db='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x7e3bfb=_0x55f90f),[{'role':'system','content':_0x5e48db},{'role':'user','content':_0x7e3bfb}];}async['_readStreamableResponse'](_0x4bdb59,_0x4a949e){const _0x5aa43f=_0x4bdb59['body']['getReader'](),_0x43b916=new TextDecoder();let _0x331ef9='',_0x4c048a='',_0x3b6f6a='',_0x1de17e=!0x1;for(;!_0x1de17e;){const {done:_0x5c0833,value:_0x4554e8}=await _0x5aa43f['read'](),_0x5694e3=_0x331ef9+_0x43b916['decode'](_0x4554e8);let _0x43a7f4='';_0x1de17e=_0x5c0833;try{_0x43a7f4=this['_cleanUpData'](_0x5694e3),_0x331ef9='';}catch{_0x331ef9=_0x5694e3;continue;}_0x4c048a+=_0x43a7f4,!_0x1de17e&&this['_isBufferIncomplete'](_0x4c048a)||_0x4c048a&&(_0x3b6f6a+=_0x4c048a,_0x4c048a='',_0x4a949e(_0x3b6f6a));}return Promise['resolve']();}async['_readStaticResponse'](_0x100d65,_0x3c9b32){return _0x3c9b32((await _0x100d65['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x41ced9){const _0x5ac025=_0x41ced9['split']('<')['length']!==_0x41ced9['split']('>')['length'],_0x2c9c4e=_0x41ced9['length']<0x1e;return _0x5ac025&&_0x2c9c4e;}['_cleanUpData'](_0x3b95b6){return _0x3b95b6['split'](/\n(?![^{]*\})/g)['map'](_0x572b06=>_0x572b06['replace']('data:\x20',''))['filter'](_0x5a81e6=>_0x5a81e6&&_0x5a81e6['length']>0x0&&'[DONE]'!==_0x5a81e6)['map'](_0x37b72f=>{const {choices:_0x18e96a}=JSON['parse'](_0x37b72f);if(_0x18e96a[0x0]?.['delta']?.['content'])return _0x18e96a[0x0]['delta']['content'];})['filter'](_0x5e67e5=>_0x5e67e5)['join']('');}}class Zn extends ar{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),_0x365bde('ai-aws-adapter-not-supported');}async['sendRequest'](_0x18d073){throw pt('ai-aws-adapter-not-supported'),new er(qn(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ia extends _0x480cf4{constructor(_0x382638,_0x3e801a={}){super(_0x382638),this['isToggleable']=!0x0,this['set']('side',_0x3e801a['side']||'top');const _0x5dc2ed=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x4695c6(_0x3e801a['class']||[]),_0x5dc2ed['to']('side',_0xce956b=>'ck-tab-button_'+_0xce956b),_0x5dc2ed['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x3836c7{['children'];constructor(_0x5454b0,_0x18f906={}){super(_0x5454b0);const _0x4d4132=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x4695c6(_0x18f906['class']||[]),_0x4d4132['to']('class'),_0x4d4132['if']('isVisible','ck-hidden',_0x26d076=>!_0x26d076)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x3836c7{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x2a76ec,_0x5f46b0={}){super(_0x2a76ec),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x5f46b0['side']||'top'),this['set']('isMaximized',!0x1);const _0x282783=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x4695c6(_0x5f46b0['class']||[]),_0x282783['to']('side',_0x3a8ef3=>'ck-tabs_'+_0x3a8ef3),_0x282783['to']('class'),_0x282783['to']('isMaximized',_0x2c5e4f=>_0x2c5e4f?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x282783['to']('side',_0x306249=>'ck-tabs__buttons-container_'+_0x306249)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x282783['to']('side',_0x1033f2=>'ck-tabs__panels-container_'+_0x1033f2)]},'children':this['panelViews']},..._0x4695c6(_0x5f46b0['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x11bdeb){const _0x5bff91=this['_tabs']['get'](_0x11bdeb);return _0x5bff91||null;}['addTab'](_0x2e8e83){const _0xeb50a6=this['_setupButton']({'id':_0x2e8e83['id'],'label':_0x2e8e83['buttonLabel'],'icon':_0x2e8e83['buttonIcon'],'order':_0x2e8e83['order']}),_0x18bf2a=new ea(this['locale']);return _0x18bf2a['render'](),_0x2e8e83['content']&&_0x18bf2a['children']['add'](_0x2e8e83['content']),this['panelViews']['add'](_0x18bf2a),this['_tabs']['set'](_0x2e8e83['id'],{'button':_0xeb50a6,'panel':_0x18bf2a,'order':void 0x0!==_0x2e8e83['order']?_0x2e8e83['order']:null}),this['fire']('addTab:'+_0x2e8e83['id'],{'id':_0x2e8e83['id'],'button':_0xeb50a6,'panel':_0x18bf2a}),null===this['activeTab']?this['activateTab'](_0x2e8e83['id']):this['_hidePanel'](_0x2e8e83['id']),{'button':_0xeb50a6,'panel':_0x18bf2a};}['activateTab'](_0x44daf5){if(null!==_0x44daf5&&!this['getTab'](_0x44daf5))throw new _0x5a06e8('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x44daf5});this['activeTab']!==_0x44daf5&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x44daf5,_0x44daf5&&this['_showPanel'](_0x44daf5),this['fire']('activateTab:'+_0x44daf5,_0x44daf5));}['showTab'](_0x5c9ee2){if(!this['getTab'](_0x5c9ee2))throw new _0x5a06e8('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x5c9ee2});this['_showPanel'](_0x5c9ee2),this['_showButton'](_0x5c9ee2),this['fire']('show:'+_0x5c9ee2,_0x5c9ee2);}['hideTab'](_0x37e9a1){if(!this['getTab'](_0x37e9a1))throw new _0x5a06e8('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x37e9a1});const _0x48cbac=this['activeTab'];this['_hidePanel'](_0x37e9a1),this['_hideButton'](_0x37e9a1);const _0x5c6014=this['getTabIds']();_0x48cbac===_0x37e9a1&&_0x5c6014['length']>0x1&&this['activateTab'](_0x5c6014['find'](_0x49d24c=>_0x49d24c!==_0x37e9a1)),this['fire']('hide:'+_0x37e9a1,_0x37e9a1);}['_getPanel'](_0x26372c){const _0x53afde=this['_tabs']['get'](_0x26372c);return _0x53afde?_0x53afde['panel']:null;}['_showPanel'](_0x3bb546){null!==this['activeTab']&&this['activeTab']!==_0x3bb546||this['_getPanel'](_0x3bb546)['show']();}['_hidePanel'](_0xfcef6d){const _0x4ed4df=this['_getPanel'](_0xfcef6d);_0x4ed4df['isVisible']&&(this['activeTab']===_0xfcef6d&&(this['activeTab']=null),_0x4ed4df['hide']());}['_getButton'](_0x3b341a){const _0xf0c930=this['_tabs']['get'](_0x3b341a);return _0xf0c930?_0xf0c930['button']:null;}['_showButton'](_0x13c68e){this['_getButton'](_0x13c68e)['show']();}['_hideButton'](_0x5da8d5){this['_getButton'](_0x5da8d5)['hide']();}['_setupButton'](_0x2aeac5){const _0x26ca1c=new ia(this['locale'],{'side':this['side']}),_0x44e49f=this['buttonViews'];if(_0x26ca1c['set']({'label':_0x2aeac5['label'],'icon':_0x2aeac5['icon'],'tooltip':!0x0,'withText':!0x0}),_0x26ca1c['bind']('isOn')['to'](this,'activeTab',_0x48fe1f=>_0x48fe1f===_0x2aeac5['id']),_0x26ca1c['bind']('side')['to'](this,'side'),_0x2aeac5['order']){const _0x39ce65=[...this['_tabs']]['reduce']((_0xacc94d,_0x5e5745)=>{const _0x2af075=_0x5e5745[0x0],{order:_0x4de643}=_0x5e5745[0x1];return!_0x4de643||_0x4de643>_0x2aeac5['order']?_0xacc94d:_0x4de643>=_0xacc94d['order']?{'id':_0x2af075,'order':_0x4de643}:_0xacc94d;},{'id':'','order':0x0}),_0x5cc596=_0x44e49f['getIndex'](this['_getButton'](_0x39ce65['id']));_0x44e49f['add'](_0x26ca1c,_0x5cc596+0x1);}else _0x44e49f['add'](_0x26ca1c);return _0x26ca1c['on']('execute',()=>{this['activateTab'](_0x2aeac5['id']);}),_0x26ca1c;}}const ni=['overlay','sidebar','custom'],oi=['left','right'];class hi extends ss{constructor(_0x1472cd,_0x353547={}){super(_0x1472cd,_0x353547),this['set']('type',_0x353547['type']||'sidebar'),this['set']('side',_0x353547['side']||'right'),this['set']('isVisible',_0x353547['visibleByDefault']??!0x0);const _0x1180ca=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x1180ca['if']('type','ck-ai-tabs__overlay',_0x274aa3=>'overlay'===_0x274aa3),_0x1180ca['if']('type','ck-ai-tabs__sidebar',_0x19654c=>'sidebar'===_0x19654c),_0x1180ca['if']('isVisible','ck-hidden',_0x4af4fe=>!_0x4af4fe)]}}),this['buttonViews']['on']('add',(_0x441ff5,_0x2b9e3a)=>{_0x2b9e3a['set']('withText',!0x1);});}}class _t extends _0x5aeef2{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x22966f){super(_0x22966f);const _0xb52090=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0xb52090)throw new _0x5a06e8('ai-tabs-configuration-not-found');if(void 0x0!==_0xb52090['showResizeButton']&&(this['showResizeButton']=_0xb52090['showResizeButton']),'sidebar'!==_0xb52090['type']&&'overlay'!==_0xb52090['type']||_0xb52090['side']&&(this['side']=_0xb52090['side']),'sidebar'===_0xb52090['type']){if(this['container']=_0xb52090['element'],this['set']('type','sidebar'),!this['container'])throw new _0x5a06e8('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0xb52090['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new hi(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0xb52090['visibleByDefault']||_0xb52090['visibleByDefault']}),this['view']['render'](),this['view']['bind']('side')['to'](this,'side'),this['view']['bind']('type')['to'](this,'type'),this['container']&&this['container']['appendChild'](this['view']['element']),this['context']instanceof dt&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x5a9b59){if(_0x5a9b59&&this['type']!==_0x5a9b59){if(!ni['includes'](_0x5a9b59))throw new _0x5a06e8('ai-tabs-unsupported-ui-type');this['type']=_0x5a9b59;}}['switchSide'](_0x57b5d9){if(_0x57b5d9&&this['side']!==_0x57b5d9){if(!oi['includes'](_0x57b5d9))throw new _0x5a06e8('ai-tabs-unsupported-ui-side');this['side']=_0x57b5d9;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class q extends _0x5aeef2{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xabd455){super(_0xabd455),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl'),this['_token']=null,this['_decoder']=new TextDecoder();}['init'](){const _0x5cf455=this['context']['plugins']['get']('CloudServices');if(!_0x5cf455['token'])throw new _0x5a06e8('ai-missing-token',this);this['_token']=_0x5cf455['token'];}['startConversation'](_0x1421f2,_0x2d6c0e){const _0x2b1676=this['_sendApiRequest']('/conversations','POST',{'id':_0x1421f2,'group':_0x2d6c0e});return{'getConversation':async()=>(await _0x2b1676['request'])['json'](),'abortController':_0x2b1676['abortController']};}['queryAssistant']({message:_0x21f27f,conversationId:_0xa7802d,parts:_0x31a555,capabilities:_0x14d8e0,model:_0x68d8b9,attributes:_0x5a8170}){const _0x266e30={'prompt':_0x21f27f,'content':_0x31a555,'model':_0x68d8b9,..._0x14d8e0&&{'capabilities':_0x14d8e0},..._0x5a8170&&{'attributes':_0x5a8170}},_0x1eccc1=this['_sendApiRequest']('/conversations/'+_0xa7802d+'/messages','POST',_0x266e30);return{'getStream':async()=>{const _0x43114a=(await _0x1eccc1['request'])['body'];return this['_getStreamReader'](_0x43114a);},'abortController':_0x1eccc1['abortController']};}['executeCustomAction']({content:_0x5389ba,message:_0x55b9c3,model:_0x2fca65,outputFormat:_0x45bcb2}){const _0x51d361={'content':[{'type':'text','content':_0x5389ba}],'prompt':_0x55b9c3,'model':_0x2fca65,'outputFormat':_0x45bcb2},_0x1acf01=this['_sendApiRequest']('/actions/custom/calls','POST',_0x51d361);return{'getStream':async()=>{const _0x4f0d53=(await _0x1acf01['request'])['body'];return this['_getStreamReader'](_0x4f0d53);},'abortController':_0x1acf01['abortController']};}['executeAction']({actionName:_0x236afd,content:_0x2b85e8,args:_0x577a66}){const _0x2c9506={'content':[{'type':'text','content':_0x2b85e8}],'args':_0x577a66},_0x26183b=this['_sendApiRequest']('/actions/system/'+_0x236afd+'/calls','POST',_0x2c9506);return{'getStream':async()=>{const _0x473c7d=(await _0x26183b['request'])['body'];return this['_getStreamReader'](_0x473c7d);},'abortController':_0x26183b['abortController']};}['uploadFile'](_0x4627c5,_0x255f86,_0x379df5){const _0x2e15fb=new FormData();_0x2e15fb['append']('file',_0x255f86,_0x255f86['name']),_0x379df5&&_0x2e15fb['append']('attributes',JSON['stringify'](_0x379df5));const _0x5bcca9=this['_sendApiRequest']('/conversations/'+_0x4627c5+'/files','POST',_0x2e15fb);return{'getId':async()=>(await _0x5bcca9['request'])['json'](),'abortController':_0x5bcca9['abortController']};}['fetchDocument'](_0x42dacb,_0x1e626a){const _0x10501c=this['_sendApiRequest']('/conversations/'+_0x42dacb+'/documents/'+_0x1e626a,'GET');return{'getDocument':async()=>(await _0x10501c['request'])['json'](),'abortController':_0x10501c['abortController']};}['uploadDocument'](_0x27ee33,_0x2b7ba8,_0x599e47){const _0x3350d1={'content':_0x2b7ba8};_0x599e47&&(_0x3350d1['attributes']=_0x599e47);const _0x3e4e55=this['_sendApiRequest']('/conversations/'+_0x27ee33+'/documents','POST',_0x3350d1);return{'getId':async()=>(await _0x3e4e55['request'])['json'](),'abortController':_0x3e4e55['abortController']};}['fetchConversations'](_0x52fc3e,_0x5d06c0={}){const _0x5c05ff=new URLSearchParams();_0x5c05ff['append']('group',_0x52fc3e),_0x5c05ff['append']('excludeEmpty',!0x1!==_0x5d06c0['excludeEmpty']?'true':'false'),_0x5c05ff['append']('limit',_0x5d06c0['limit']?_0x5d06c0['limit']['toString']():'100'),_0x5c05ff['append']('sortBy',_0x5d06c0['sortBy']?_0x5d06c0['sortBy']:'createdAt'),_0x5c05ff['append']('order',_0x5d06c0['order']?_0x5d06c0['order']:'desc');const _0x6af3aa=this['_sendApiRequest']('/conversations?'+_0x5c05ff['toString'](),'GET');return{'getConversations':async()=>{const _0x359fc9=await _0x6af3aa['request'];return(await _0x359fc9['json']())['items'];},'abortController':_0x6af3aa['abortController']};}['deleteConversation'](_0x34422b){const _0x39ea40=this['_sendApiRequest']('/conversations/'+_0x34422b,'DELETE');return{'execute':async()=>{await _0x39ea40['request'];},'abortController':_0x39ea40['abortController']};}['updateConversation'](_0x45efd1,_0x4adb9e){const _0xfe0f38=this['_sendApiRequest']('/conversations/'+_0x45efd1,'PATCH',_0x4adb9e);return{'getResult':async()=>(await _0xfe0f38['request'],_0x4adb9e),'abortController':_0xfe0f38['abortController']};}['fetchConversation'](_0x1174e8){const _0x42d5ab=this['_sendApiRequest']('/conversations/'+_0x1174e8,'GET');return{'getConversation':async()=>(await _0x42d5ab['request'])['json'](),'abortController':_0x42d5ab['abortController']};}['fetchConversationMessages'](_0xd8491a){const _0x2f3b7a=this['_sendApiRequest']('/conversations/'+_0xd8491a+'/messages','GET');return{'getMessages':async()=>{const _0x2fcaf4=await _0x2f3b7a['request'];return(await _0x2fcaf4['json']())['items'];},'abortController':_0x2f3b7a['abortController']};}['uploadUrl'](_0x4b4599,_0x23eef2,_0x26c488){const _0x2a1936=this['_sendApiRequest']('/conversations/'+_0x4b4599+'/web-resources','POST',{'url':_0x23eef2,'attributes':_0x26c488});return{'getId':async()=>(await _0x2a1936['request'])['json'](),'abortController':_0x2a1936['abortController']};}['getModels'](_0x58ac05='en'){const _0x3f60ab=new URLSearchParams();_0x3f60ab['append']('language',_0x58ac05);const _0x310516='/models/1?'+_0x3f60ab['toString'](),_0x1b0b62=this['_sendApiRequest'](_0x310516,'GET');return{'list':async()=>await(await _0x1b0b62['request'])['json'](),'abortController':_0x1b0b62['abortController']};}['deleteFile'](_0xb3c8de,_0x284180){const _0x2d2ccd=this['_sendApiRequest']('/conversations/'+_0xb3c8de+'/files/'+_0x284180,'DELETE');return{'execute':async()=>{await _0x2d2ccd['request'];},'abortController':_0x2d2ccd['abortController']};}['deleteDocument'](_0x47083a,_0x5ddf20){const _0x120941=this['_sendApiRequest']('/conversations/'+_0x47083a+'/documents/'+_0x5ddf20,'DELETE');return{'execute':async()=>{await _0x120941['request'];},'abortController':_0x120941['abortController']};}['deleteWebResource'](_0x2cdce9,_0x3dccb6){const _0x3e70e3=this['_sendApiRequest']('/conversations/'+_0x2cdce9+'/web-resources/'+_0x3dccb6,'DELETE');return{'execute':async()=>{await _0x3e70e3['request'];},'abortController':_0x3e70e3['abortController']};}['callSystemReview']({reviewName:_0x1b44a9,content:_0x3d87db,args:_0x55d450}){const _0x12021d=this['_sendApiRequest']('/reviews/system/'+_0x1b44a9+'/calls','POST',{'content':[{'type':'text','content':_0x3d87db}],'args':_0x55d450});return{'getStream':async()=>{const _0x551c07=(await _0x12021d['request'])['body'];return this['_getStreamReader'](_0x551c07);},'abortController':_0x12021d['abortController']};}['callCustomReview']({content:_0x5d5fcd,prompt:_0x266301,model:_0x4a7671}){const _0x3e2037=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x5d5fcd}],'prompt':_0x266301,'model':_0x4a7671});return{'getStream':async()=>{const _0x3884d1=(await _0x3e2037['request'])['body'];return this['_getStreamReader'](_0x3884d1);},'abortController':_0x3e2037['abortController']};}['upsertAIChatRating'](_0x185d3a,_0x25f08c,_0x32f6a7){const _0x2cfa17=this['_sendApiRequest']('/conversations/'+_0x185d3a+'/messages/'+_0x25f08c+'/ratings','PUT',{'positiveCount':_0x32f6a7['positiveCount'],'totalCount':_0x32f6a7['totalCount'],'modificationId':_0x32f6a7['modificationId']});return{'execute':async()=>{await _0x2cfa17['request'];},'abortController':_0x2cfa17['abortController']};}['upsertAIActionRating'](_0x532d6e,_0x228490,_0x332a25){const _0x187d82=this['_sendApiRequest']('/actions/system/'+_0x532d6e+'/calls/'+_0x228490+'/ratings','PUT',{'positiveCount':_0x332a25['positiveCount'],'totalCount':_0x332a25['totalCount']});return{'execute':async()=>{await _0x187d82['request'];},'abortController':_0x187d82['abortController']};}['upsertCustomAIActionRating'](_0x610354,_0x52e2cb){const _0x127217=this['_sendApiRequest']('/actions/custom/calls/'+_0x610354+'/ratings','PUT',{'positiveCount':_0x52e2cb['positiveCount'],'totalCount':_0x52e2cb['totalCount']});return{'execute':async()=>{await _0x127217['request'];},'abortController':_0x127217['abortController']};}['upsertAIReviewRating'](_0x2ccad5,_0x449784,_0x4bc1a5,_0x4fb66d){const _0x1cc235=this['_sendApiRequest']('/reviews/system/'+_0x2ccad5+'/calls/'+_0x449784+'/ratings','PUT',{'positiveCount':_0x4bc1a5['positiveCount'],'totalCount':_0x4bc1a5['totalCount'],'dataId':_0x4fb66d});return{'execute':async()=>{await _0x1cc235['request'];},'abortController':_0x1cc235['abortController']};}['upsertCustomAIReviewRating'](_0x432733,_0x510627,_0x54209d){const _0xad26a4=this['_sendApiRequest']('/reviews/custom/calls/'+_0x432733+'/ratings','PUT',{'positiveCount':_0x510627['positiveCount'],'totalCount':_0x510627['totalCount'],'dataId':_0x54209d});return{'execute':async()=>{await _0xad26a4['request'];},'abortController':_0xad26a4['abortController']};}['_sendApiRequest'](_0x5402ad,_0x5792aa,_0x59d736){const _0x1e5bc2=new AbortController(),_0x50d3fe=_0x59d736 instanceof FormData,_0x2a15ff={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x59d736&&!_0x50d3fe&&(_0x2a15ff['Content-Type']='application/json');const _0x5a8ec3={'method':_0x5792aa,'headers':_0x2a15ff,'signal':_0x1e5bc2['signal']};return _0x59d736&&(_0x5a8ec3['body']=_0x50d3fe?_0x59d736:JSON['stringify'](_0x59d736)),{'request':fetch(''+this['_apiUrl']+_0x5402ad,_0x5a8ec3)['catch'](_0x20b9f4=>{this['_handleError'](_0x20b9f4);})['then'](_0x39548d=>_0x39548d['ok']?_0x39548d:_0x39548d['json']()['then'](_0x29c37f=>{throw{'url':this['_apiUrl'],'path':_0x5402ad,'method':_0x5792aa,'body':_0x59d736,'status':(_0x39548d||{})['status'],'statusText':(_0x39548d||{})['statusText'],'code':_0x29c37f['code'],'message':_0x29c37f['message'],'traceId':_0x29c37f['traceId']};})),'abortController':_0x1e5bc2};}async*['_getStreamReader'](_0x4d4077){const _0x5313fc=[],_0xbba201=_0x4d4077['getReader'](),_0x22eba0=$t({'onError':_0x5dd0c3=>{this['_handleError'](_0x5dd0c3);},'onEvent':_0x507e4e=>{_0x507e4e['data']=JSON['parse'](_0x507e4e['data']),_0x5313fc['push'](_0x507e4e);}});try{let _0x3f3d0f=!0x1;for(;!_0x3f3d0f;){const {done:_0x434e9d,value:_0x2d71ee}=await _0xbba201['read']();_0x434e9d&&(_0x3f3d0f=!0x0),_0x22eba0['feed'](this['_decoder']['decode'](_0x2d71ee,{'stream':!0x0})),yield*_0x5313fc,_0x5313fc['length']=0x0;}}catch(_0x4b1ccb){this['_handleError'](_0x4b1ccb);}finally{_0xbba201['releaseLock'](),_0x22eba0['reset']();}}['_handleError'](_0x1c6d43){if(_0x1c6d43 instanceof _0x5a06e8)throw _0x1c6d43;if(_0x1c6d43 instanceof Error&&'AbortError'===_0x1c6d43['name'])throw new _0x5a06e8('ai-request-aborted',this,{'originalError':_0x1c6d43});throw new _0x5a06e8('ai-request-failed',this,{'originalError':_0x1c6d43});}}function i(_0x45a04e,_0x213fe5,_0x169516){const t=_0x45a04e['t'];switch(_0x213fe5){case'AI_SUGGESTION_HEADER_TITLE':return t({'id':'AI_SUGGESTION_HEADER_TITLE','string':'Proposed\x20changes'});case'AI_SUGGESTION_BUTTON_SHOW_CHANGES':return t({'id':'AI_SUGGESTION_BUTTON_SHOW_CHANGES','string':'Show\x20details'});case'AI_MINI_TOOLBAR_LIKE':return t({'id':'AI_MINI_TOOLBAR_LIKE','string':'I\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_DISLIKE':return t({'id':'AI_MINI_TOOLBAR_DISLIKE','string':'I\x20don\x27t\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_COPY':return t({'id':'AI_MINI_TOOLBAR_COPY','string':'Copy\x20to\x20clipboard'});case'AI_SUGGESTION_CONTENT_PART_TITLE':return t({'id':'AI_SUGGESTION_CONTENT_PART_TITLE','string':'Change\x20%0'},_0x169516);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi!\x20I\x20can\x20help\x20you\x20draft,\x20rewrite,\x20and\x20improve\x20your\x20text,\x20explore\x20ideas,\x20research\x20topics,\x20and\x20solve\x20problems.\x20How\x20can\x20I\x20help\x20right\x20now?'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x169516);case'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES','string':'Unable\x20to\x20load\x20resources\x20from\x20%0.\x20Please\x20try\x20again.'},_0x169516);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x169516);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0x169516);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x169516);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x169516);case'AI_CHAT_MODEL_SELECTOR_GROUP':return t({'id':'AI_CHAT_MODEL_SELECTOR_GROUP','string':'Models'});case'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP','string':'Select\x20a\x20model'});case'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP','string':'Start\x20a\x20new\x20conversation\x20to\x20change\x20the\x20model'});case'AI_CHAT_CAPABILITIES_YES':return t({'id':'AI_CHAT_CAPABILITIES_YES','string':'Yes'});case'AI_CHAT_CAPABILITIES_NO':return t({'id':'AI_CHAT_CAPABILITIES_NO','string':'No'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT','string':'The\x20selected\x20model\x20is\x20no\x20longer\x20available,\x20so\x20you\x20cannot\x20continue\x20this\x20conversation.\x20Please\x20'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON','string':'start\x20a\x20new\x20one.'});case'AI_CHAT_CONTEXT_SOURCES_LABEL':return t({'id':'AI_CHAT_CONTEXT_SOURCES_LABEL','string':'Sources'});case'AI_CHAT_HISTORY_HEADING':return t({'id':'AI_CHAT_HISTORY_HEADING','string':'Chat\x20History'});case'AI_CHAT_HISTORY_SEARCH_LABEL':return t({'id':'AI_CHAT_HISTORY_SEARCH_LABEL','string':'Search\x20history'});case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY','string':'No\x20chats\x20were\x20found\x20matching\x20\x22%0\x22.'},_0x169516);case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY','string':'Please\x20try\x20a\x20different\x20phrase\x20or\x20check\x20the\x20spelling.'});case'AI_CHAT_HISTORY_EMPTY_MESSAGE':return t({'id':'AI_CHAT_HISTORY_EMPTY_MESSAGE','string':'Your\x20chat\x20history\x20for\x20current\x20document\x20will\x20appear\x20here.'});case'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON':return t({'id':'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON','string':'Go\x20to\x20chat'});case'AI_CHAT_HISTORY_PIN_BUTTON':return t({'id':'AI_CHAT_HISTORY_PIN_BUTTON','string':'Pin'});case'AI_CHAT_HISTORY_SHOW_MORE_ITEMS':return t({'id':'AI_CHAT_HISTORY_SHOW_MORE_ITEMS','string':'Show\x20more\x20items'});case'AI_CHAT_HISTORY_EDIT_NAME':return t({'id':'AI_CHAT_HISTORY_EDIT_NAME','string':'Edit\x20name'});case'AI_CHAT_HISTORY_REMOVE':return t({'id':'AI_CHAT_HISTORY_REMOVE','string':'Remove'});case'AI_CHAT_HISTORY_REMOVE_CONFIRM':return t({'id':'AI_CHAT_HISTORY_REMOVE_CONFIRM','string':'Do\x20you\x20want\x20to\x20remove\x20this\x20chat?'});case'AI_CHAT_HISTORY_ACCEPT':return t({'id':'AI_CHAT_HISTORY_ACCEPT','string':'Accept'});case'AI_CHAT_HISTORY_CANCEL':return t({'id':'AI_CHAT_HISTORY_CANCEL','string':'Cancel'});case'AI_CHAT_HISTORY_LOADING_REMOVING':return t({'id':'AI_CHAT_HISTORY_LOADING_REMOVING','string':'Removing\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_RENAMING':return t({'id':'AI_CHAT_HISTORY_LOADING_RENAMING','string':'Renaming\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_PINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_PINNING','string':'Pinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_UNPINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_UNPINNING','string':'Unpinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_CATEGORY_PINNED':return t({'id':'AI_CHAT_HISTORY_CATEGORY_PINNED','string':'Pinned'});case'AI_CHAT_HISTORY_CATEGORY_TODAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_TODAY','string':'Today'});case'AI_CHAT_HISTORY_CATEGORY_YESTERDAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_YESTERDAY','string':'Yesterday'});case'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS','string':'Last\x2014\x20days'});case'AI_CHAT_HISTORY_CATEGORY_LATER':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LATER','string':'Later'});case'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE','string':'Failed\x20to\x20change\x20the\x20\x22%0\x22\x20chat\x20name.\x20Please\x20try\x20again\x20later.'},_0x169516);case'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED','string':'Failed\x20to\x20%0\x20the\x20\x22%1\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0x169516);case'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM':return t({'id':'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM','string':'Failed\x20to\x20delete\x20the\x20\x22%0\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0x169516);case'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS':return t({'id':'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS','string':'Failed\x20to\x20load\x20the\x20chat\x20history.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_ERROR_GENERIC':return t({'id':'AI_CHAT_HISTORY_ERROR_GENERIC','string':'Something\x20went\x20wrong.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_PIN_ACTION':return t({'id':'AI_CHAT_HISTORY_PIN_ACTION','string':'pin'});case'AI_CHAT_HISTORY_UNPIN_ACTION':return t({'id':'AI_CHAT_HISTORY_UNPIN_ACTION','string':'unpin'});case'AI_BALLOON_HEADER_TITLE':return t({'id':'AI_BALLOON_HEADER_TITLE','string':'Change\x20%0'},_0x169516);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x169516);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE','string':'This\x20conversation\x20is\x20loaded\x20from\x20chat\x20history\x20from\x20a\x20previous\x20session,\x20so\x20you\x20can’t\x20apply,\x20reject,\x20or\x20suggest\x20changes.'});case'AI_SUGGESTION_DISABLED_FEED_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_FEED_MESSAGE','string':'Actions\x20aren’t\x20available\x20for\x20changes\x20from\x20a\x20previous\x20session.'});default:return _0x213fe5;}}function Ci(_0x26dfba,_0x321190){const _0x2ab269=new _0x480cf4(_0x26dfba),_0x39d491=i(_0x26dfba,'AI_TABS_LABEL_MINIMIZE'),_0x3f5499=i(_0x26dfba,'AI_TABS_LABEL_MAXIMIZE');return _0x2ab269['set']({'withText':!0x1,'icon':_0x4fb61d,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0x2ab269['bind']('label')['to'](_0x321190,'isMaximized',_0x1152bc=>_0x1152bc?_0x39d491:_0x3f5499),_0x2ab269['bind']('icon')['to'](_0x321190,'isMaximized',_0x5956a1=>_0x5956a1?_0x318834:_0x4fb61d),_0x2ab269['bind']('isOn')['to'](_0x321190,'isMaximized'),_0x2ab269['on']('execute',()=>{_0x321190['fire']('resizeTabs');}),_0x2ab269;}function mr(_0x522963){return _0x239f9b(_0x522963);}function xt(_0xad28d9){return _0x262be4(_0xad28d9);}function Dt(_0x54b938,_0x593cb9,_0x53f11d){const _0x1979a7=null!==_0x593cb9?_0x1d5324=>_0x1d5324['attribs'][_0x54b938]===_0x593cb9:_0x216583=>Boolean(_0x216583['attribs'][_0x54b938]);return vt(_0x2ba6c5=>_0x58cce0(_0x2ba6c5)&&_0x1979a7(_0x2ba6c5),_0x53f11d);}function Ni(_0xb1faf1,_0x1d64c,_0x5a8292){const _0x3274d3=null!==_0x1d64c?_0x3d85ae=>_0x3d85ae['attribs'][_0xb1faf1]===_0x1d64c:_0x5b1473=>Boolean(_0x5b1473['attribs'][_0xb1faf1]);return _0x37344(_0x247d87=>_0x58cce0(_0x247d87)&&_0x3274d3(_0x247d87),_0x5a8292);}function wt(_0x552124,_0x1d142c){return _0x552124&&_0x58cce0(_0x552124)?_0x552124['attribs'][_0x1d142c]:null;}function qi(_0x9c9b46,_0x348ca5,_0x50a6a1){_0x58cce0(_0x9c9b46)&&(null===_0x50a6a1?delete _0x9c9b46['attribs'][_0x348ca5]:_0x9c9b46['attribs'][_0x348ca5]=_0x50a6a1);}function Wi(_0x21a3a8,_0x41eb53,_0x29844){const _0x152a87=_0x41eb53['cloneNode'](!0x0);'beforebegin'===_0x29844?_0x6339ff(_0x21a3a8,_0x152a87):'afterbegin'===_0x29844?_0x331d1d(_0x21a3a8,_0x152a87):'beforeend'===_0x29844?_0x537ec9(_0x21a3a8,_0x152a87):'afterend'===_0x29844&&_0x44d3ba(_0x21a3a8,_0x152a87);}function Ji(_0x25d9a2){const _0x485454=[];let _0x241ed7=_0x25d9a2;for(;_0x241ed7;)_0x241ed7=_0x5d8f7d(_0x241ed7),_0x241ed7&&_0x485454['push'](_0x241ed7);return _0x485454;}function Or(_0x13bb2a){return _0x13bb2a['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Ki(_0x15b45c){let _0x57fafa=0x0;for(;_0x15b45c['parentNode'];)_0x15b45c=_0x15b45c['parentNode'],_0x57fafa++;return _0x57fafa;}function Qi(_0x400ddc){const _0x32273b=[];let _0x3bc8ef=_0x400ddc['nextSibling'];for(;_0x3bc8ef;)_0x32273b['push'](_0x3bc8ef),_0x3bc8ef=_0x3bc8ef['nextSibling'];_0x32273b['forEach'](_0x16150e=>{_0x1a4c2d(_0x16150e);});}class tn extends/* #__PURE__ -- @preserve */
25
- ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x46c045();}['convertMarkdownToHTML'](_0x3302fc){const _0x4b330c=this['_m2html']['parse'](_0x3302fc);return this['parseAndNormalizeHTML'](_0x4b330c);}['parseAndNormalizeHTML'](_0x30a4df){return this['_parseHTML'](_0x30a4df);}['_parseHTML'](_0xd06c63){const _0x2eac8a=mr('<dummy>'+_0xd06c63['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x2eac8a['children']=_0x2eac8a['children'][0x0]['children'],_0x2eac8a;}}class en extends/* #__PURE__ -- @preserve */
26
- ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x4fd530){super(),this['_generateUid']=_0x4fd530||_0x46d503;}['merge'](_0x4b0bfc,_0x4c7e70,_0x5015c5){const _0x2a0021=_0x4b0bfc['cloneNode'](!0x0);if(0x0===_0x4c7e70['childNodes']['length']){const _0x1e5348=[];return Ni('data-id','new-element',_0x2a0021)['forEach'](_0x54cf27=>{const _0x1c59a1=this['_generateUid']();qi(_0x54cf27,'data-id',_0x1c59a1),_0x1e5348['push'](_0x1c59a1);}),this['_removeSpecialComments'](_0x2a0021),{'parsedContent':_0x2a0021,'newNodeIds':_0x1e5348,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x5015c5&&_0x5015c5['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x2a0021),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ni('data-id',null,_0x4c7e70)['map'](_0x2c6986=>wt(_0x2c6986,'data-id'))['filter'](_0x3e0e47=>!!_0x3e0e47));let _0xee58dd=-0x1,_0x559c02=!0x1;const _0x5e0ccd=_0x2a0021['childNodes'],_0x992467=Array['from'](_0x5e0ccd)['filter'](_0x51b238=>!(0x3===_0x51b238['nodeType']&&''===xt(_0x51b238)['trim']())),_0x4a5e81=_0x992467['length'];for(let _0x4e765c=0x0;_0x4e765c<_0x4a5e81;_0x4e765c++){const _0x527e2a=_0x992467[_0x4e765c],_0x6ca827=_0x992467[_0x4e765c+0x1];if(this['_isNewNode'](_0x527e2a)){if(-0x1===_0xee58dd&&(_0xee58dd=_0x4e765c),this['_markWrappedElements'](_0x527e2a),!this['_isNewNode'](_0x6ca827)){const [_0x86042f,_0x5996ff]=this['_findReferenceNode'](_0x527e2a,_0x559c02,_0x4c7e70);if(_0x86042f){const _0x1e7eba=Array['from'](_0x992467)['slice'](_0xee58dd,_0x4e765c+0x1);this['_insertNodes'](_0x86042f,_0x1e7eba,_0x5996ff),_0xee58dd=-0x1;}}}else{if(this['_isExistingContentComment'](_0x527e2a))_0x559c02=!0x0;else{if(this['_isExistingNode'](_0x527e2a)){const _0x401b44=wt(_0x527e2a,'data-id');if(_0x401b44&&this['_existingDataIds']['has'](_0x401b44)){const _0x29a776=Dt('data-id',_0x401b44,_0x4c7e70);this['_replaceNode'](_0x29a776,_0x527e2a);}if(this['_touchedNodesState']['removedIds']['includes'](_0x401b44)){const _0x2d8c00=this['_touchedNodesState']['removedIds']['indexOf'](_0x401b44);this['_touchedNodesState']['removedIds']['splice'](_0x2d8c00,0x1);}}else{if(this['_isDelNode'](_0x527e2a)){const _0x47f598=wt(_0x527e2a,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x47f598)||this['_storeDeletedElementIds'](_0x527e2a);}}}}}for(const _0x35491f of this['_touchedNodesState']['removedIds']){const _0x3ccad4=Dt('data-id',_0x35491f,_0x4c7e70);if(_0x3ccad4){if(_0x5015c5&&_0x5015c5['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x35491f;const _0x280312=_0x5015c5['replaceRemovedWith']['cloneNode'](!0x0);qi(_0x280312,'data-id',_0x35491f),qi(_0x280312,'data-removed','true'),_0x3e3729(_0x3ccad4,_0x280312);}else _0x1a4c2d(_0x3ccad4);}}if(Ni('data-wrapped-id',null,_0x4c7e70)['forEach'](_0x176162=>{const _0x319f5a=Dt('data-id',wt(_0x176162,'data-wrapped-id'),_0x4c7e70);var _0x4b6016,_0x48e6de;_0x319f5a&&(_0x48e6de=_0x176162,_0x1a4c2d(_0x4b6016=_0x319f5a),_0x3e3729(_0x48e6de,_0x4b6016));}),Ni('data-id','new-element',_0x4c7e70)['forEach'](_0x2c4695=>{const _0xcb72=this['_getUid'](_0x2c4695);qi(_0x2c4695,'data-id',_0xcb72),this['_touchedNodesState']['newIds']['push'](_0xcb72);}),this['_removeSpecialComments'](_0x4c7e70),_0x5015c5&&_0x5015c5['markUnstableElements']&&this['_markUnstableElements'](_0x4c7e70,_0x5015c5['markUnstableElementsDepth']||0x0),_0x5015c5&&_0x5015c5['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x43c5b6=Dt('data-id',this['_touchedNodesState']['lastTouchedId'],_0x4c7e70);for(;_0x43c5b6;)Qi(_0x43c5b6),_0x43c5b6=_0x43c5b6['parentNode'];}return{'parsedContent':_0x4c7e70,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x2d03a6,_0xd150d4,_0x2fc53f){for(const _0x527352 of _0xd150d4){const _0x264d94=this['_getUid'](_0x527352);qi(_0x527352,'data-id',_0x264d94),this['_touchedNodesState']['newIds']['push'](_0x264d94),this['_touchedNodesState']['lastTouchedId']=_0x264d94;}const _0x5c7a49='afterbegin'===_0x2fc53f||'afterend'===_0x2fc53f?_0xd150d4['reverse']():_0xd150d4;for(const _0x14f074 of _0x5c7a49)Wi(_0x2d03a6,_0x14f074,_0x2fc53f);}['_replaceNode'](_0x12221d,_0x3dacea){if(!_0x12221d)return;if(_0x55cdda=_0x3dacea,Or(xt(_0x12221d))===Or(xt(_0x55cdda)))return;var _0x55cdda;const _0x13d218=this['_getUid'](_0x12221d);qi(_0x3dacea,'data-id',_0x13d218),this['_touchedNodesState']['modifiedIds']['push'](_0x13d218),this['_touchedNodesState']['lastTouchedId']=_0x13d218,_0x3e3729(_0x12221d,_0x3dacea['cloneNode'](!0x0));}['_findReferenceNode'](_0xa6688,_0x1a46b3,_0xf46001){const _0x4ff65f=this['_findPrevElementWithDataId'](_0xa6688,!0x1);if(_0x4ff65f){const _0x2b340c=this['_getNodeDataId'](_0x4ff65f),_0x11976e=Dt('data-id',_0x2b340c,_0xf46001);if(_0x11976e)return[_0x11976e,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x2b340c);}const _0x5e0366=this['_findNextElementWithDataId'](_0xa6688,!0x1);if(_0x5e0366){const _0x387d46=this['_getNodeDataId'](_0x5e0366),_0x516fa2=Dt('data-id',_0x387d46,_0xf46001);if(_0x516fa2)return[_0x516fa2,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x387d46);}return _0x1a46b3?_0xa6688['nextSibling']?this['_findFallbackReferenceNode'](_0xa6688,_0xf46001):[_0xf46001['childNodes'][_0xf46001['childNodes']['length']-0x1],'afterend']:[_0xf46001['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x5793dc,_0x589271){const _0x1c990a=[],_0x4bd94d=this['_findPrevElementWithDataId'](_0x5793dc,!0x0);if(_0x4bd94d){const _0x3c2bc1=Dt('data-id',this['_getNodeDataId'](_0x4bd94d),_0x589271);_0x3c2bc1&&_0x1c990a['push']([_0x3c2bc1,'afterend']);}const _0x1fb6f1=this['_findNextElementWithDataId'](_0x5793dc,!0x0);if(_0x1fb6f1){const _0x1308d1=Dt('data-id',this['_getNodeDataId'](_0x1fb6f1),_0x589271);_0x1308d1&&_0x1c990a['push']([_0x1308d1,'beforebegin']);}if(_0x1c990a['length']>0x1)return Ki(_0x1c990a[0x0][0x0])<=Ki(_0x1c990a[0x1][0x0])?_0x1c990a[0x0]:_0x1c990a[0x1];return 0x1===_0x1c990a['length']?_0x1c990a[0x0]:[_0x589271['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0xbb0cef,_0x53f9f9){let _0x416add=_0xbb0cef['nextSibling'],_0x3c1dcd=null,_0x369b31=!0x1;for(;_0x416add;){if(_0x28fdd0(_0x416add)){if(this['_isDelNode'](_0x416add)&&(_0x3c1dcd=_0x416add),this['_isExistingContentComment'](_0x416add)&&_0x53f9f9&&!_0x369b31){_0x369b31=!0x0,_0x416add=_0x416add['nextSibling'];continue;}break;}const _0x59680a=wt(_0x416add,'data-id');if(_0x59680a&&'new-element'!==_0x59680a&&this['_existingDataIds']['has'](_0x59680a)){_0x3c1dcd=_0x416add;break;}_0x416add=_0x416add['nextSibling'];}return _0x3c1dcd;}['_findPrevElementWithDataId'](_0x1175dd,_0x39bc7c){let _0x1df4c7=_0x1175dd['previousSibling'],_0x193689=null,_0x40dce0=!0x1;for(;_0x1df4c7;){if(_0x28fdd0(_0x1df4c7)){if(this['_isDelNode'](_0x1df4c7)&&(_0x193689=_0x1df4c7),this['_isExistingContentComment'](_0x1df4c7)&&_0x39bc7c&&!_0x40dce0){_0x40dce0=!0x0,_0x1df4c7=_0x1df4c7['previousSibling'];continue;}break;}const _0x4a1029=wt(_0x1df4c7,'data-id');if(_0x4a1029&&'new-element'!==_0x4a1029&&this['_existingDataIds']['has'](_0x4a1029)){_0x193689=_0x1df4c7;break;}_0x1df4c7=_0x1df4c7['previousSibling'];}return _0x193689;}['_markWrappedElements'](_0x332c9f){_0x58cce0(_0x332c9f)&&Ni('data-id',null,_0x332c9f)['forEach'](_0x11d846=>{this['_isExistingNode'](_0x11d846)&&!this['_hasWrappedParent'](_0x11d846)&&(qi(_0x11d846,'data-wrapped-id',wt(_0x11d846,'data-id')),qi(_0x11d846,'data-id',null));});}['_getNodeDataId'](_0x55614d){if(!_0x55614d)return null;if(_0x58cce0(_0x55614d))return wt(_0x55614d,'data-id');if(_0x28fdd0(_0x55614d)){const _0x4df87f=xt(_0x55614d)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x4df87f&&_0x4df87f[0x1])return _0x4df87f[0x1];}return null;}['_storeDeletedElementIds'](_0x3ea89c){if(_0x28fdd0(_0x3ea89c)){const _0x78ee73=xt(_0x3ea89c)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x78ee73&&_0x78ee73[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x78ee73[0x1]);}}['_getUid'](_0x373c51){return this['_isExistingNode'](_0x373c51)?wt(_0x373c51,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x2b17c6){(function(_0x49565d){return _0x1b4703(_0x112f3c=>_0x28fdd0(_0x112f3c),_0x49565d,!0x0,0x1/0x0);}(_0x2b17c6)['filter'](_0x2b5a5a=>this['_isDelNode'](_0x2b5a5a)||this['_isExistingContentComment'](_0x2b5a5a))['forEach'](_0x4884d9=>{_0x1a4c2d(_0x4884d9);}));}['_markLastTagElementUnstable'](_0x16e48a){const _0x1a6b4a=_0x16e48a['childNodes'],_0x230a6d=_0x1a6b4a[_0x1a6b4a['length']-0x1];_0x230a6d&&_0x58cce0(_0x230a6d)&&qi(_0x230a6d,'data-unstable','true');}['_markUnstableElements'](_0x146818,_0x5ce79b){const _0x3c79c9=Dt('data-unstable','true',_0x146818);if(!_0x3c79c9)return;const _0x5cfc29=Ji(_0x3c79c9)['slice'](0x0,-0x1),_0x20d801=_0x5cfc29['length'];let _0x315d92=_0x3c79c9;if(_0x20d801>_0x5ce79b){let _0x34d842=_0x20d801,_0xc19dae=null;for(;_0x34d842>_0x5ce79b&&_0x34d842>=0x0;)_0x34d842--,_0xc19dae=_0x5cfc29[_0x34d842];_0xc19dae&&(_0x315d92=_0xc19dae,qi(_0x3c79c9,'data-unstable',null),qi(_0xc19dae,'data-unstable','true'));}else{if(_0x20d801<_0x5ce79b){let _0xd356a8=_0x20d801,_0x4f0718=_0x3c79c9;for(;_0xd356a8<_0x5ce79b;){const _0x2f46a3=_0x4f0718['childNodes']['filter'](_0x45a145=>_0x58cce0(_0x45a145));if(0x0===_0x2f46a3['length'])break;_0xd356a8++,_0x4f0718=_0x2f46a3[_0x2f46a3['length']-0x1];}_0x4f0718&&(_0x315d92=_0x4f0718,qi(_0x3c79c9,'data-unstable',null),qi(_0x4f0718,'data-unstable','true'));}}let _0x3af3bf=_0x315d92;for(;_0x3af3bf;){for(;_0x3af3bf['nextSibling'];)_0x3af3bf=_0x3af3bf['nextSibling'],_0x58cce0(_0x3af3bf)&&qi(_0x3af3bf,'data-unstable','true');_0x3af3bf=_0x3af3bf['parentNode'];}}['_isNewNode'](_0x5afcb9){return Boolean('new-element'===wt(_0x5afcb9,'data-id'));}['_isExistingNode'](_0x42f055){return Boolean((wt(_0x42f055,'data-id')||'')['length']>0x0&&'new-element'!==wt(_0x42f055,'data-id'));}['_isDelNode'](_0x447bd7){return!!_0x447bd7&&Boolean(_0x28fdd0(_0x447bd7)&&xt(_0x447bd7)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x553a83){let _0xd6e2f0=_0x553a83['parentNode'];for(;_0xd6e2f0;){if(wt(_0xd6e2f0,'data-wrapped-id'))return!0x0;_0xd6e2f0=_0xd6e2f0['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x397ec2){return Boolean(_0x28fdd0(_0x397ec2)&&xt(_0x397ec2)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function J({editor:_0x307d8d,changeGroups:_0x531487,documentContextContent:_0x3d957f,showDiff:_0x3497dd,trimUnchanged:_0x396fd5=!0x0}){return _0x531487['map'](_0x221ad0=>{const _0x5c82f0=new Ot([]),_0x5d0b01=new Ot([]);for(const _0x1d6483 of _0x221ad0['changes'])if(_0x3497dd&&'removed'==_0x1d6483['type']||_0x5d0b01['children']['push'](_0x1d6483['node']['cloneNode'](!0x0)),'new'!=_0x1d6483['type']&&(_0x3497dd||'removed'!=_0x1d6483['type'])){const _0x4948d0=vt(_0x325c31=>wt(_0x325c31,'data-id')==_0x1d6483['id'],_0x3d957f,!0x0);_0x4948d0&&_0x5c82f0['children']['push'](_0x4948d0['cloneNode'](!0x0));}const {content:_0x39edc2,hasChanges:_0x558535}=function(_0x43cdd3,_0x1ab70b,_0x8edbb8,_0xea6fce,_0x3836f0=!0x0){const _0x4eb223=_0x43cdd3['plugins']['get']('DocumentCompare'),_0x51c395=xt(_0x1ab70b),_0x349529=xt(_0x8edbb8),_0xd299b6=_0x43cdd3['data']['parse'](_0x51c395,'$root'),_0x281dd1=_0x43cdd3['model']['createPositionAt'](_0xd299b6,0x0),_0x318d75=_0x4eb223['getDiff'](_0x51c395,_0x349529,{'anchor':_0x281dd1,'markDeletions':_0xea6fce}),_0x9a8945=_0x318d75['getOperations']();if(0x0==_0x9a8945['length'])return{'content':_0x1ab70b['cloneNode'](!0x0),'hasChanges':!0x1};_0xea6fce?function(_0x34bd3b,_0x4832b5,_0x178596){if(0x0==_0x34bd3b['length'])return;const _0x13b826=_0x178596['plugins']['get']('DocumentCompare'),_0x9b0bff=_0x178596['plugins']['get']('SuggestionsConversion');_0x178596['model']['change'](_0x17f34d=>{const _0x21ca29=new Set();for(let _0x3c9d47=0x0;_0x3c9d47<_0x34bd3b['length'];_0x3c9d47++){const _0x3c54d1=_0x34bd3b[_0x3c9d47];if(_0x3c54d1['baseVersion']=null,_0x3c54d1['isDocumentOperation']=!0x1,_0x13b826['isMarkedRemoveOperation'](_0x3c54d1)){const _0x511cf6=_0x2fe16d(_0x3c54d1['newRange'],_0x178596['model']),_0x635330='suggestion:deletion:'+_0x46d503()+':$aiSuggestion';_0x4832b5['markers']['set'](_0x635330,_0x511cf6);}else switch(_0x3c54d1['type']){case'rename':{if(_0x3c54d1['oldName']==_0x3c54d1['newName'])break;_0x17f34d['batch']['addOperation'](_0x3c54d1),_0x178596['model']['applyOperation'](_0x3c54d1);const _0x43263a='$elementName',_0x56853d=_0x3c54d1['position'],_0x1a5d8b=_0x178596['model']['createRange'](_0x56853d,_0x178596['model']['createPositionAt'](_0x56853d['nodeAfter'],'end')),_0x3f6acd='suggestion:attribute:'+_0x43263a+':'+_0x46d503()+':$aiSuggestion';_0x4832b5['markers']['set'](_0x3f6acd,_0x1a5d8b);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x3c54d1['oldValue']==_0x3c54d1['newValue'])break;_0x17f34d['batch']['addOperation'](_0x3c54d1),_0x178596['model']['applyOperation'](_0x3c54d1);const _0x139dda=_0x3c54d1['key'];if(!_0x9b0bff['isRegisteredAttribute'](_0x139dda))break;const _0x18abcd=_0x2fe16d(_0x3c54d1['range'],_0x178596['model']),_0x5622c4='suggestion:attribute:'+_0x139dda+':'+_0x46d503()+':$aiSuggestion';_0x4832b5['markers']['set'](_0x5622c4,_0x18abcd);break;}case'insert':{_0x17f34d['batch']['addOperation'](_0x3c54d1),_0x178596['model']['applyOperation'](_0x3c54d1);if(_0x34bd3b[_0x3c9d47+0x1]&&'move'==_0x34bd3b[_0x3c9d47+0x1]['type']){no(_0x4832b5,_0x3c54d1);break;}const _0x443bed=_0x3c54d1['position'],_0x516cd8=_0x3c54d1['howMany'],_0xf6f83e=_0x2fe16d(_0x178596['model']['createRange'](_0x443bed,_0x443bed['getShiftedBy'](_0x516cd8)),_0x178596['model']),_0x11bf39='suggestion:insertion:'+_0x46d503()+':$aiSuggestion';_0x4832b5['markers']['set'](_0x11bf39,_0xf6f83e);break;}case'split':{_0x17f34d['batch']['addOperation'](_0x3c54d1),_0x178596['model']['applyOperation'](_0x3c54d1);const _0x199094=_0x3c54d1['splitPosition'],_0x4964d9=_0x3c54d1['moveTargetPosition'],_0x3df2e0=_0x178596['model']['createRange'](_0x199094,_0x4964d9),_0x43e860='suggestion:insertion:'+_0x46d503()+':$aiSuggestion';_0x4832b5['markers']['set'](_0x43e860,_0x3df2e0);break;}case'move':{_0x17f34d['batch']['addOperation'](_0x3c54d1),_0x178596['model']['applyOperation'](_0x3c54d1),_0x34bd3b[_0x3c9d47-0x1]&&'insert'==_0x34bd3b[_0x3c9d47-0x1]['type']&&no(_0x4832b5,_0x3c54d1);const _0x64069a=_0x3c54d1['getMovedRangeStart'](),_0x35523a=_0x3c54d1['howMany'];for(let _0x1556b8=0x0;_0x1556b8<_0x35523a;_0x1556b8++){const _0x3da16f=_0x64069a['getShiftedBy'](_0x1556b8)['nodeAfter'];_0x21ca29['add'](_0x3da16f);}break;}case'remove':{const _0x54ee9c=_0x3c54d1['sourcePosition'],_0x40322b=_0x3c54d1['howMany'],_0x9e4f07=new et(_0x54ee9c,_0x40322b);_0x17f34d['batch']['addOperation'](_0x9e4f07),_0x178596['model']['applyOperation'](_0x9e4f07);break;}}}for(const _0x3e897d of _0x21ca29){const _0x220b58=_0x178596['model']['createRangeOn'](_0x3e897d),_0xaaf603='suggestion:formatBlock:$fakeWrap:'+_0x46d503()+':$aiSuggestion';_0x4832b5['markers']['set'](_0xaaf603,_0x2fe16d(_0x220b58,_0x178596['model']));}});}(_0x9a8945,_0xd299b6,_0x43cdd3):_0x43cdd3['model']['change'](_0x134084=>{for(const _0x40482b of _0x9a8945)if('remove'==_0x40482b['type']){const _0x8e698d=_0x40482b['sourcePosition'],_0x3a139f=_0x40482b['howMany'],_0x59ae72=new et(_0x8e698d,_0x3a139f);_0x134084['batch']['addOperation'](_0x59ae72),_0x43cdd3['model']['applyOperation'](_0x59ae72);}else{if('marker'==_0x40482b['type']){const _0x46334e=_0x40482b['name'],_0x560132=_0x40482b['newRange'];null!==_0x560132?_0xd299b6['markers']['set'](_0x46334e,_0x560132):_0xd299b6['markers']['delete'](_0x46334e);}else _0x40482b['baseVersion']=null,_0x40482b['isDocumentOperation']=!0x1,_0x134084['batch']['addOperation'](_0x40482b),_0x43cdd3['model']['applyOperation'](_0x40482b);}});if(_0x3836f0){const _0x5417c6=St(_0x43cdd3,_0x9a8945,_0xd299b6);Et(_0x43cdd3['model'],_0x5417c6),function(_0x2a773b,_0x1fdc9e){const _0x136462=_0x1fdc9e['getFirstRange']()['start'];let _0x1619db=_0x1fdc9e['getFirstRange']()['end'];const _0x182dc3=_0x136462['root'];(_0x1619db['textNode']||_0x1619db['nodeAfter']&&_0x1619db['nodeAfter']['is']('$text'))&&(_0x5b9e4f(_0x1619db,'...'),_0x1619db=_0x1619db['getShiftedBy'](0x3)),(_0x136462['textNode']||_0x136462['nodeBefore']&&_0x136462['nodeBefore']['is']('$text'))&&(_0x5b9e4f(_0x136462,'...'),function(_0x48b02c,_0x6fcd2f,_0xf7f32a){for(let [_0x13c8ee,_0x4be2e0]of _0x48b02c['markers']){const _0x537b30=_0x4be2e0['_getTransformedByInsertion'](_0x6fcd2f,_0xf7f32a,!0x1);_0x4be2e0=_0x537b30[0x0],_0x48b02c['markers']['set'](_0x13c8ee,_0x4be2e0);}}(_0x182dc3,_0x136462,0x3),_0x136462['parent']==_0x1619db['parent']&&(_0x1619db=_0x1619db['getShiftedBy'](0x3)));const _0x535c38=_0x2a773b['createRange'](_0x2a773b['createPositionAt'](_0x182dc3,0x0),_0x136462),_0x3e3820=_0x2a773b['createRange'](_0x1619db,_0x2a773b['createPositionAt'](_0x182dc3,'end')),_0x487a30=[..._0x535c38['getMinimalFlatRanges'](),..._0x3e3820['getMinimalFlatRanges']()];_0x487a30['reverse']();for(const _0x55029c of _0x487a30)to(_0x55029c),Nr(_0x182dc3,_0x55029c);}(_0x43cdd3['model'],_0x5417c6);}const _0x3e71a7=_0x43cdd3['data']['stringify'](_0xd299b6,{'showSuggestionHighlights':!0x0});return{'content':mr(_0x3e71a7),'hasChanges':!0x0};}(_0x307d8d,_0x5c82f0,_0x5d0b01,_0x3497dd,_0x396fd5);return{'type':_0x221ad0['changes'][0x0]['type'],'index':_0x221ad0['index'],'content':_0x39edc2,'hasChanges':_0x558535};});}function no(_0xb2fd8e,_0x77cae6){for(const [_0x13113a,_0x424b0b]of _0xb2fd8e['markers']){const _0x44f393=it['_createFromRanges'](_0x424b0b['getTransformedByOperation'](_0x77cae6));_0xb2fd8e['markers']['set'](_0x13113a,_0x44f393);}}function St(_0x6422f5,_0x57ee03,_0x50fc5b){const _0xee3ed5=_0x6422f5['plugins']['get']('DocumentCompare');let _0x1592c3=_0x6422f5['model']['createPositionAt'](_0x50fc5b,Number['POSITIVE_INFINITY']),_0x1055d2=_0x6422f5['model']['createPositionAt'](_0x50fc5b,0x0);for(const _0x552a7a of _0x57ee03){let _0x1f7f20,_0x322b8a;if(_0xee3ed5['isMarkedRemoveOperation'](_0x552a7a))_0x1f7f20=_0x552a7a['newRange']['start'],_0x322b8a=_0x552a7a['newRange']['end'];else switch(_0x1592c3=_0x1592c3['getTransformedByOperation'](_0x552a7a),_0x1055d2=_0x1055d2['getTransformedByOperation'](_0x552a7a),_0x552a7a['type']){case'rename':_0x1f7f20=_0x552a7a['position'],_0x322b8a=_0x1f7f20['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x1f7f20=_0x552a7a['range']['start'],_0x322b8a=_0x552a7a['range']['end'];break;case'insert':_0x1f7f20=_0x552a7a['position'],_0x322b8a=_0x1f7f20['getShiftedBy'](_0x552a7a['howMany']);break;case'split':_0x1f7f20=_0x552a7a['splitPosition'],_0x322b8a=_0x552a7a['moveTargetPosition'];break;case'merge':{const _0x6ca176=_0x552a7a['targetPosition']['path']['slice'](0x0,-0x1);_0x1f7f20=_0x6422f5['model']['createPositionFromPath'](_0x50fc5b,_0x6ca176),_0x322b8a=_0x1f7f20['getShiftedBy'](0x1);break;}case'remove':{const _0x3e8984=_0x552a7a['howMany'],_0x4f1430=_0x552a7a['sourcePosition']['_getTransformedByInsertion'](_0x552a7a['targetPosition'],_0x3e8984),_0xec421c=_0x552a7a['getMovedRangeStart']();'remove'==_0x552a7a['type']?(_0x1f7f20=_0x4f1430,_0x322b8a=_0x4f1430):(_0x1f7f20=_0xec421c,_0x322b8a=_0xec421c['getShiftedBy'](_0x3e8984));break;}}_0x1f7f20&&_0x1f7f20['isBefore'](_0x1592c3)&&(_0x1592c3=_0x1f7f20['clone'](),_0x1592c3['stickiness']='toNone'),_0x322b8a&&_0x322b8a['isAfter'](_0x1055d2)&&(_0x1055d2=_0x322b8a['clone'](),_0x1055d2['stickiness']='toNone');}return _0x6422f5['model']['createSelection'](_0x6422f5['model']['createRange'](_0x1592c3,_0x1055d2));}function Et(_0x1e3110,_0x427054){ro(_0x1e3110,_0x427054,'forward');const _0x56602f=_0x427054['getFirstRange']();_0x427054['setTo']([]),_0x427054['setTo'](_0x56602f,{'backward':!0x0}),ro(_0x1e3110,_0x427054,'backward');}function ro(_0x4560df,_0x4404da,_0x5c65e1){let _0x47fe72=0x14;for(;_0x47fe72;){_0x4560df['modifySelection'](_0x4404da,{'unit':'word','direction':_0x5c65e1}),_0x47fe72--;const _0x1fc5a1=_0x4404da['focus']['forward'==_0x5c65e1?'nodeBefore':'nodeAfter'];if(_0x1fc5a1&&_0x1fc5a1['is']('element')&&_0x4560df['schema']['isBlock'](_0x1fc5a1)&&_0x4560df['schema']['isObject'](_0x1fc5a1))break;}}function Nr(_0x579650,_0x3edc2f){for(const [_0x160387,_0x1811fc]of _0x579650['markers']){const _0x54e19f=_0x1811fc['_getTransformedByDeletion'](_0x3edc2f['start'],_0x3edc2f['end']['offset']-_0x3edc2f['start']['offset']);null!=_0x54e19f?_0x579650['markers']['set'](_0x160387,_0x54e19f):_0x579650['markers']['delete'](_0x160387);}}class Ge extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new Ot([]);['parsedMergedContent']=new Ot([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x2ae68f,content:_0x41bb56='',isDone:_0x6427a6=!0x1,interactionId:_0xd252cb,areActionsDisabled:_0x334e83,documentContextContent:_0x340039,editor:_0x4bc184,id:_0xebaabd}){super(),this['id']=_0xebaabd||_0x46d503(),this['interactionId']=_0xd252cb,this['type']=_0x2ae68f,this['areActionsDisabled']=!!_0x334e83,this['editor']=_0x4bc184,this['aiResponseParser']=new tn(),this['aiResponseApplier']=new en(),this['documentContextContent']=mr(_0x340039||''),this['set']('isDone',_0x6427a6),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x41bb56);}['appendContent'](_0x39c50e){this['set']('content',this['content']+_0x39c50e);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x355bcc,_0x26981d){this['changeGroups'][_0x355bcc]['state']=_0x26981d,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x355bcc,'state':_0x26981d});}['getContentParts']({showDiff:_0x3b8a3b,groupIndex:_0x25f3e5}){if(!this['editor'])throw new _0x5a06e8('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x529bcf=this['_getCachedContentParts'](_0x3b8a3b,_0x25f3e5);if(_0x529bcf)return _0x529bcf;let _0x73d2e5=[];if(void 0x0===_0x25f3e5)_0x73d2e5=this['changeGroups'];else{const _0x2f18f8=this['changeGroups']['find'](({index:_0xafec7e})=>_0xafec7e===_0x25f3e5);if(!_0x2f18f8)throw new _0x5a06e8('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x25f3e5});_0x73d2e5=[_0x2f18f8];}const _0x2871b9=J({'editor':this['editor'],'showDiff':_0x3b8a3b,'changeGroups':_0x73d2e5,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x3b8a3b,_0x2871b9),_0x2871b9;}['_getCachedContentParts'](_0x1fd3fe,_0x2cc249){const _0x2e289f=_0x1fd3fe?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x2e289f]['length'])return null;const _0x2ac2e7=this['cachedSuggestionContentParts'][_0x2e289f];if(void 0x0===_0x2cc249)return _0x2ac2e7['length']>0x0&&_0x2ac2e7['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x1fd3fe,null),null):_0x526ad4(_0x2ac2e7);{const _0x36fab1=_0x2ac2e7['find'](({index:_0x509586})=>_0x509586===_0x2cc249);if(_0x36fab1)return[_0x526ad4(_0x36fab1)];}return null;}['_setCachedContentParts'](_0x47b253,_0x4eef94){const _0x5200a1=_0x47b253?'withDiff':'withoutDiff';_0x4eef94?_0x4eef94['forEach'](_0x366f9e=>{const _0x221bf2=this['cachedSuggestionContentParts'][_0x5200a1],_0x2f1fba=_0x221bf2['find'](({index:_0x1d4956})=>_0x1d4956===_0x366f9e['index']);if(_0x2f1fba){const _0x3e7fc3=_0x221bf2['indexOf'](_0x2f1fba);_0x221bf2['splice'](_0x3e7fc3,0x1,_0x366f9e);}else _0x221bf2['push'](_0x366f9e);}):this['cachedSuggestionContentParts'][_0x5200a1]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x416c75=this['changeGroups'];this['updateChangeGroups']();const _0x425a1d=this['_getDifferentChangeGroups'](_0x416c75,this['changeGroups']);(_0x425a1d['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x425a1d),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x3627a7,_0x18596c){const _0x1f31b1=[];for(const _0x3bd32e of _0x18596c){const _0x250734=_0x3627a7[_0x3bd32e['index']];_0x250734?_0x250734['changes']['length']!==_0x3bd32e['changes']['length']?_0x1f31b1['push'](_0x3bd32e):_0x250734['changes']['forEach']((_0x4b40e3,_0x29682e)=>{const _0x286b7e=_0x3bd32e['changes'][_0x29682e];_0x4b40e3['id']!==_0x286b7e['id']&&_0x1f31b1['push'](_0x3bd32e);}):_0x1f31b1['push'](_0x3bd32e);}return _0x1f31b1;}['updateChangeGroups'](){const _0x7af6d7=new _0x2f67ed('p',{},[new _0x2f67ed('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x231d87(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x4ce352=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x7af6d7,'cutAfterLastChange':!this['isDone']});if(!_0x4ce352['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x4ce352['parsedContent'];let _0x9dea20=[];if(_0x37344(_0xb9f805=>{const _0x3673fa=wt(_0xb9f805,'data-id');if(!_0x3673fa||!_0x570ac3(_0x3673fa))return!0x1;const _0x145b6d=[_0xb9f805,...Ji(_0xb9f805)]['at'](-0x2);if(_0xb9f805!=_0x145b6d){const _0x4ea41d=wt(_0x145b6d,'data-id');_0x570ac3(_0x4ea41d)||(_0x9dea20['push']({'node':_0x145b6d,'id':_0x4ea41d,'type':'modified'}),_0x4ce352['modifiedNodeIds']['push'](_0x4ea41d));}else _0x4ce352['modifiedNodeIds']['includes'](_0x3673fa)?_0x9dea20['push']({'node':_0xb9f805,'type':'modified','id':_0x3673fa}):_0x4ce352['newNodeIds']['includes'](_0x3673fa)?_0x9dea20['push']({'node':_0xb9f805,'type':'new','id':_0x3673fa,'anchorId':wt(_0xb9f805['previousSibling'],'data-id')}):_0x9dea20['push']({'node':_0xb9f805,'type':'removed','id':_0x3673fa});return!0x0;},this['parsedMergedContent']),_0x9dea20=_0x9dea20['filter'](({node:_0x5dcb17})=>[...Ji(_0x5dcb17),_0x5dcb17]['every'](_0x103192=>!wt(_0x103192,'data-unstable'))),0x0==_0x9dea20['length'])return;const _0x623a6e=[[_0x9dea20[0x0]]];for(let _0x5a747d=0x1;_0x5a747d<_0x9dea20['length'];_0x5a747d++){const _0x165799=_0x623a6e[_0x623a6e['length']-0x1],_0x16e3af=_0x165799[_0x165799['length']-0x1];_0x9dea20[_0x5a747d]['node']['previousSibling']==_0x16e3af['node']&&'modified'!=_0x9dea20[_0x5a747d]['type']&&'modified'!=_0x16e3af['type']?_0x165799['push'](_0x9dea20[_0x5a747d]):_0x623a6e['push']([_0x9dea20[_0x5a747d]]);}for(const _0x453f77 of _0x623a6e){const _0x1c993d=_0x453f77[0x0],_0x189484=_0x453f77[_0x453f77['length']-0x1],_0x565b2c=_0x5898a5(_0x1c993d['node']['previousSibling']);_0x565b2c&&_0x453f77['unshift'](_0x565b2c);const _0x55de43=_0x5898a5(_0x189484['node']['nextSibling']);_0x55de43&&_0x453f77['push'](_0x55de43);}function _0x570ac3(_0x53b83b){return _0x4ce352['modifiedNodeIds']['includes'](_0x53b83b)||_0x4ce352['newNodeIds']['includes'](_0x53b83b)||_0x4ce352['removedNodeIds']['includes'](_0x53b83b);}function _0x5898a5(_0x274d03){if(_0x274d03&&wt(_0x274d03,'data-id')&&!wt(_0x274d03,'data-unstable')){const _0x27a5ee=wt(_0x274d03,'data-id');if(!_0x570ac3(_0x27a5ee))return{'node':_0x274d03,'type':'context','id':_0x27a5ee};}return null;}this['changeGroups']=_0x623a6e['map']((_0x1e7869,_0x4a86e4)=>({'changes':_0x1e7869,'state':'pending','index':_0x4a86e4}));}}const ye=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class xe extends _0x3ea0e5(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x69eaa3,editor:_0x1ca5d6}){super(),this['id']=_0x46d503(),this['connector']=_0x69eaa3,this['isStopped']=!0x0,this['editor']=_0x1ca5d6;}async['start'](){const _0x3d000b=[];let _0x1915d5,_0x19b045,_0x587d94;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0xca109a=await this['currentRequest']['getStream']();for await(const _0x5f5543 of _0xca109a){if(this['isStopped'])return;if('error'==_0x5f5543['event'])return void this['fire']('error',{'error':new _0x5a06e8('ai-chat-interaction-error',this)});switch(_0x5f5543['event']){case'message-metadata':this['messageId']=_0x5f5543['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x5f5543['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x5f5543['data']['conversationTitle'],!0x0);break;case'source':_0x3d000b['push'](_0x5f5543['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x1915d5='modification-delta'==_0x5f5543['event']?'modification':'text',_0x19b045='modification-delta'==_0x5f5543['event']?_0x5f5543['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x1915d5&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x1915d5,'interactionId':this['id'],'id':_0x19b045}),'modification'==_0x1915d5&&(this['currentReply']['sources']=_0x3d000b['splice'](0x0))),this['currentReply']['appendContent'](_0x5f5543['data']['textDelta']);break;case'mcp-tool-result':_0x587d94=JSON['parse'](_0x5f5543['data']['result']),this['_handleToolResultData']({'toolName':_0x5f5543['data']['toolName'],'data':_0x587d94['data'],'attributes':_0x587d94['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x5f5543['data']['toolName'],'data':_0x5f5543['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x3d000b['length']>0x0&&(this['currentReply']['sources']=_0x3d000b['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x44557a){return this['replies']['find'](_0x36c869=>_0x36c869['id']===_0x44557a);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0xdd8e1b=>_0xdd8e1b['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0xaf5ce){const _0x224b67=new Ge({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0xaf5ce});return this['replies']['push'](_0x224b67),_0x224b67['delegate'](...ye)['to'](this),this['fire']('replyCreated',_0x224b67),_0x224b67;}['setConversationTitle'](_0x36c190,_0x247719=!0x1){this['fire']('setConversationTitle',_0x36c190,_0x247719);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x5aff58){this['fire']('toolDataReceived',{'type':'result','toolName':_0x5aff58['toolName'],'data':structuredClone(_0x5aff58['data']||{}),'attributes':structuredClone(_0x5aff58['attributes']||{})},this);}['_handleToolNotificationData'](_0x1a0b48){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x1a0b48['toolName'],'data':structuredClone(_0x1a0b48['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var qe=function(_0x3277c5){return _0x3277c5['TOOL']='mcp-tool-context',_0x3277c5['FILE']='file',_0x3277c5['DOCUMENT']='document',_0x3277c5['URL']='web-resource',_0x3277c5['TEXT']='text',_0x3277c5['SELECTION']='selection',_0x3277c5;}({}),$e=function(_0x3d4a2f){return _0x3d4a2f['TEXT']='text',_0x3d4a2f['MARKDOWN']='markdown',_0x3d4a2f['HTML']='html',_0x3d4a2f;}({});const Xe=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),Ye=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Qe extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x346530,config:_0x40bc56,ownerId:_0x3b0252}){super(),this['_connector']=_0x346530,this['_config']=_0x40bc56,this['_ownerId']=_0x3b0252;}['init'](){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_setAddContextOptionsDefaultState']();}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x3e274c){const _0x57f5af=await this['_createContextItemFromContent'](_0x3e274c);return this['_addToConversationContextItem'](_0x57f5af),'current-document'===_0x57f5af['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x57f5af;}async['_createContextItemFromContent'](_0x43eac3){if(_0x43eac3['type']===qe['DOCUMENT']){const _0x12cf4d=await this['_connector']['fetchDocument'](this['_ownerId'],_0x43eac3['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x43eac3['type'],'content':_0x12cf4d['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x12cf4d['attributes']?.['version'],'sessionId':_0x12cf4d['attributes']?.['sessionId']};}if(_0x43eac3['type']===qe['TOOL'])return{'id':_0x43eac3['id'],'uiId':_0x43eac3['id'],'label':_0x43eac3['data']?.['label']||_0x43eac3['id'],'type':qe['TOOL'],'mcpServerName':_0x43eac3['mcpServerName'],'toolName':_0x43eac3['toolName'],'data':_0x43eac3['data']||{}};return{'id':_0x43eac3['id'],'uiId':_0x43eac3['id'],'label':_0x43eac3['attributes']?.['label']||_0x43eac3['name']||_0x43eac3['url']||_0x43eac3['id'],'type':_0x43eac3['type'],..._0x43eac3?.['attributes']?.['resourceId']?{'resourceId':_0x43eac3['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x12c09d){const _0x32d985=this['_pendingContextItems']['get'](_0x12c09d);_0x32d985?.['isReadOnly']||this['_removeContextItem'](_0x12c09d);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x11ed98 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x11ed98['uiId']);const _0xa984d4=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0xa984d4&&this['_addContextItem']({..._0xa984d4,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x49f662){for(const _0x46653a of _0x49f662['values']())this['_addToConversationContextItem'](_0x46653a);this['clearPendingContextItems'](),this['fire']('contextSent',{'contextItems':Array['from'](this['getSentContextItems']()['values']())});}['isCurrentDocumentInContext'](){return this['_pendingContextItems']['has']('current-document');}['isSelectionInContext'](){return this['_pendingContextItems']['has']('selection');}['isCurrentDocumentInConversation'](){return this['_conversationContextItems']['has']('current-document');}static['mapContextItemsToRequestData'](_0x3f5204){return Array['from'](_0x3f5204['values']())['map'](_0x5ef5c7=>this['_mapContextItemToRequestData'](_0x5ef5c7))['filter'](_0x327bc1=>null!==_0x327bc1);}async['addFilesToContext'](_0x1afa3b,_0x35c705,_0x18b23d=qe['FILE']){const _0x12d3ee='files-'+_0x46d503();this['_startUploadOperation'](_0x12d3ee);try{await Promise['all'](_0x1afa3b['map'](async _0x40db6b=>{const _0xab8770='file-'+_0x46d503(),_0x42f3c6=_0x239b85(_0x40db6b['name']);try{this['_addContextItem']({'type':_0x18b23d,'label':_0x35c705?.['label']||_0x42f3c6,'uiId':_0xab8770,'resourceId':_0x35c705?.['resourceId']},!0x0);const _0xe35725=this['_connector']['uploadFile'](this['_ownerId'],_0x40db6b,_0x35c705);this['_ongoingUploads']['set'](_0xab8770,_0xe35725['abortController']);const {id:_0x250a7d}=await _0xe35725['getId']();this['_ongoingUploads']['delete'](_0xab8770),this['_finishContextItemLoading']({'type':_0x18b23d,'id':_0x250a7d,'label':_0x35c705?.['label']||_0x42f3c6,'uiId':_0xab8770,'resourceId':_0x35c705?.['resourceId']},!0x1);}catch(_0x53bc42){this['_ongoingUploads']['delete'](_0xab8770);if(!(_0x53bc42 instanceof _0x5a06e8&&_0x53bc42['message']['startsWith']('ai-request-aborted'))){const _0x59930a=Xe['get'](_0x53bc42['code'])||'ai-chat-file-upload-failed',_0x1e17d3=new _0x5a06e8(_0x59930a,null,{'fileName':_0x42f3c6,..._0x53bc42});_0x1e17d3['stack']=_0x53bc42['stack'],this['fire']('error',{'error':_0x1e17d3});}this['_removeContextItem'](_0xab8770);}}));}finally{this['_finishUploadOperation'](_0x12d3ee);}}['addCurrentDocumentToContext'](_0x23266b){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x26b7da={'type':qe['DOCUMENT'],'uiId':'current-document','label':_0x23266b,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x26b7da);}async['updateCurrentDocument'](_0x1e074f,_0x10e1b7,_0x271f3b,_0x2ed45c){const _0x402fa6=this['_pendingContextItems']['get']('current-document');if(_0x402fa6&&_0x1e074f){_0x402fa6['selection']=_0x2ed45c?_0x2ed45c['map'](_0x588834=>({'start':_0x588834['start'],'end':_0x588834['end']})):[];try{if(_0x402fa6['version']===_0x10e1b7)return;const {id:_0x265b8e}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x1e074f,{'version':_0x10e1b7,'sessionId':_0x271f3b})['getId']();_0x402fa6['id']=_0x265b8e,_0x402fa6['content']=_0x1e074f,_0x402fa6['version']=_0x10e1b7,_0x402fa6['sessionId']=_0x271f3b;}catch(_0x48d9fa){const _0x385640=new _0x5a06e8('ai-chat-document-upload-failed',null);_0x385640['stack']=_0x48d9fa['stack'],this['fire']('error',{'error':_0x385640});}}}['addSelectionToContext'](_0xd46975){this['_addContextItem']({'type':qe['SELECTION'],'label':_0xd46975,'uiId':'selection','content':_0xd46975});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x3ec2b6,_0x15eb5b){const _0x24f17e='url-'+_0x46d503();this['_startUploadOperation'](_0x24f17e);const _0x1bfa83='url-'+_0x46d503();try{this['_addContextItem']({'type':qe['URL'],'label':_0x15eb5b?.['label']||_0x3ec2b6,'uiId':_0x1bfa83,'resourceId':_0x15eb5b?.['resourceId']},!0x0);const _0x3b4d8e=this['_connector']['uploadUrl'](this['_ownerId'],_0x3ec2b6,_0x15eb5b);this['_ongoingUploads']['set'](_0x1bfa83,_0x3b4d8e['abortController']);const {id:_0xe60c24}=await _0x3b4d8e['getId']();this['_ongoingUploads']['delete'](_0x1bfa83),this['_finishContextItemLoading']({'type':qe['URL'],'id':_0xe60c24,'label':_0x15eb5b?.['label']||_0x3ec2b6,'uiId':_0x1bfa83,'resourceId':_0x15eb5b?.['resourceId']},!0x1);}catch(_0x1f1f10){this['_ongoingUploads']['delete'](_0x1bfa83),(_0x1f1f10['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x5a06e8('ai-chat-url-upload-failed',this,{'url':_0x3ec2b6,'originalError':_0x1f1f10}),'url':_0x3ec2b6}),this['_removeContextItem'](_0x1bfa83));}finally{this['_finishUploadOperation'](_0x24f17e);}}['addToolItemToContext'](_0x54dd45){_0x54dd45['id']=_0x54dd45['id']??_0x46d503()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x54dd45['uiId'],_0x54dd45),this['fire']('contextItemAdded',{'contextItem':_0x54dd45,'isLoading':!0x1});}async['loadSourceResources'](_0x70a4f5,_0xbe0fd2,_0x2a65bd){const _0x42b756=this['_addContextOptionsState']['sources']['find'](_0x2c394f=>_0x2c394f['id']===_0x70a4f5);if(!_0x42b756)return this['fire']('error',{'error':new _0x5a06e8('ai-chat-source-not-found',this,{'sourceId':_0x70a4f5}),'sourceId':_0x70a4f5}),[];try{const _0x37f9ab=(await _0x42b756['getResources'](_0xbe0fd2))['map'](_0x42d77d=>{const _0x5975e6=this['_isResourceInContext'](_0x42d77d['id']);return{..._0x42d77d,'isInContext':_0x5975e6};});return _0x42b756['resources']=_0x37f9ab,this['fire']('sourceResourcesLoaded',{'sourceId':_0x70a4f5,'source':_0x42b756,'resources':_0x37f9ab,'uid':_0x2a65bd}),_0x37f9ab;}catch(_0x25efca){return this['fire']('error',{'error':new _0x5a06e8('ai-chat-source-resources-load-failed',this,{'sourceId':_0x70a4f5,'originalError':_0x25efca}),'sourceId':_0x70a4f5,'sourceLabel':_0x42b756['label']}),[];}}async['addResourceToContext'](_0x2a9113,_0x21ffa8){if(this['_isResourceInContext'](_0x21ffa8['id']))return;let _0x47c781=_0x21ffa8['data'];if(!_0x47c781&&_0x2a9113['getData'])try{_0x47c781=await _0x2a9113['getData'](_0x21ffa8['id']);}catch(_0x397d54){return void this['fire']('error',{'error':new _0x5a06e8('ai-chat-resource-load-failed',this,{'resourceId':_0x21ffa8['id'],'sourceId':_0x2a9113['id'],'originalError':_0x397d54}),'resourceId':_0x21ffa8['id'],'sourceId':_0x2a9113['id']});}if(_0x47c781)switch(_0x21ffa8['type']){case qe['URL']:if('string'!=typeof _0x47c781)return void this['fire']('error',{'error':new _0x5a06e8('ai-chat-context-invalid-data',this,{'resourceId':_0x21ffa8['id'],'sourceId':_0x2a9113['id'],'expectedType':'string','actualType':typeof _0x47c781}),'resourceId':_0x21ffa8['id'],'sourceId':_0x2a9113['id']});await this['addUrlToContext'](_0x47c781,{'label':_0x21ffa8['label'],'resourceId':_0x21ffa8['id']});break;case qe['FILE']:if(!(_0x47c781 instanceof File))return void this['fire']('error',{'error':new _0x5a06e8('ai-chat-context-invalid-data',this,{'resourceId':_0x21ffa8['id'],'sourceId':_0x2a9113['id'],'expectedType':'File','actualType':typeof _0x47c781}),'resourceId':_0x21ffa8['id'],'sourceId':_0x2a9113['id']});await this['addFilesToContext']([_0x47c781],{'label':_0x21ffa8['label'],'resourceId':_0x21ffa8['id']});break;case qe['TEXT']:if('object'!=typeof _0x47c781||!('content'in _0x47c781)||!('type'in _0x47c781))return void this['fire']('error',{'error':new _0x5a06e8('ai-chat-context-invalid-data',this,{'resourceId':_0x21ffa8['id'],'sourceId':_0x2a9113['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x47c781}),'resourceId':_0x21ffa8['id'],'sourceId':_0x2a9113['id']});_0x47c781=Qe['_convertTextResourceToFile'](_0x47c781,_0x21ffa8['label']),await this['addFilesToContext']([_0x47c781],{'label':_0x21ffa8['label'],'resourceId':_0x21ffa8['id']},qe['TEXT']);break;case qe['TOOL']:break;default:this['fire']('error',{'error':new _0x5a06e8('ai-chat-context-unsupported-type',this,{'resourceId':_0x21ffa8['id'],'sourceId':_0x2a9113['id'],'resourceType':_0x21ffa8['type']}),'resourceId':_0x21ffa8['id'],'sourceId':_0x2a9113['id']});}else this['fire']('error',{'error':new _0x5a06e8('ai-chat-resource-no-data',this,{'resourceId':_0x21ffa8['id'],'sourceId':_0x2a9113['id']}),'resourceId':_0x21ffa8['id'],'sourceId':_0x2a9113['id']});}static['_convertTextResourceToFile'](_0x330694,_0x4a2df2){switch(_0x330694['type']){case $e['MARKDOWN']:return new File([_0x330694['content']],_0x4a2df2,{'type':'text/markdown'});case $e['HTML']:return new File([_0x330694['content']],_0x4a2df2,{'type':'text/html'});default:return new File([_0x330694['content']],_0x4a2df2,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x51e0e6){switch(_0x51e0e6['type']){case qe['FILE']:return{'type':qe['FILE'],'id':_0x51e0e6['id']};case qe['URL']:return{'type':qe['URL'],'id':_0x51e0e6['id']};case qe['DOCUMENT']:return{'type':qe['DOCUMENT'],'id':_0x51e0e6['id'],..._0x51e0e6['selection']?.['length']&&{'selection':_0x51e0e6['selection']}};case qe['TEXT']:return{'type':qe['FILE'],'id':_0x51e0e6['id']};case qe['TOOL']:{const _0x178d35=_0x51e0e6;return{'type':qe['TOOL'],'mcpServerName':_0x178d35['mcpServerName'],'toolName':_0x178d35['toolName'],'data':_0x178d35['data'],'id':_0x178d35['id']};}default:return null;}}['_addContextItem'](_0x421f07,_0x249699=!0x1){if(this['_pendingContextItems']['set'](_0x421f07['uiId'],_0x421f07),_0x421f07['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x421f07,'isLoading':_0x249699}),'current-document'===_0x421f07['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x421f07['resourceId']){const _0x2ff1b3=this['_findSourceIdsByResourceId'](_0x421f07['resourceId']);_0x2ff1b3&&_0x2ff1b3['forEach'](_0x24c8ef=>{this['_updateResourceInContextState'](_0x24c8ef,_0x421f07['resourceId'],!0x0);});}}['_removeContextItem'](_0x179852){const _0xe3d4a3=this['_pendingContextItems']['get'](_0x179852),_0x271a71=this['_ongoingUploads']['get'](_0x179852);if(_0x271a71&&(_0x271a71['abort'](),this['_ongoingUploads']['delete'](_0x179852)),_0xe3d4a3?.['resourceId']){const _0x3eef4d=this['_findSourceIdsByResourceId'](_0xe3d4a3['resourceId']);_0x3eef4d&&_0x3eef4d['forEach'](_0x3b9c5b=>{this['_updateResourceInContextState'](_0x3b9c5b,_0xe3d4a3['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x179852),this['fire']('contextItemRemoved',{'uiId':_0x179852,'type':_0xe3d4a3?.['type']}),'current-document'===_0x179852&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x23c0cc,_0x38e94b){if(this['_pendingContextItems']['has'](_0x23c0cc['uiId'])&&(this['_pendingContextItems']['set'](_0x23c0cc['uiId'],_0x23c0cc),this['fire']('contextItemLoadingEnded',{'contextItem':_0x23c0cc,'isLoading':_0x38e94b}),_0x23c0cc['resourceId'])){const _0x19b293=this['_findSourceIdsByResourceId'](_0x23c0cc['resourceId']);_0x19b293&&_0x19b293['forEach'](_0x6deda7=>{this['_updateResourceInContextState'](_0x6deda7,_0x23c0cc['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x3aeac1){this['_conversationContextItems']['set'](_0x3aeac1['uiId'],_0x3aeac1);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState'](),'customItems':this['_config']?.['customItems']?.['map'](_0x3c4574=>({..._0x3c4574,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0xaaaeaa=>({..._0xaaaeaa,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x31485a=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x31485a,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x2acfdd){for(const _0x2fb3b1 of this['_pendingContextItems']['values']())if(_0x2fb3b1['resourceId']===_0x2acfdd)return!0x0;for(const _0xd28206 of this['_conversationContextItems']['values']())if(_0xd28206['resourceId']===_0x2acfdd)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x5d9c50){const _0x1bccd7=[];for(const _0x516253 of this['_addContextOptionsState']['sources']){_0x516253['resources']['find'](_0x5cc5ff=>_0x5cc5ff['id']===_0x5d9c50)&&_0x1bccd7['push'](_0x516253['id']);}return 0x0===_0x1bccd7['length']?null:_0x1bccd7;}['_updateResourceInContextState'](_0x5ea525,_0x4b7329,_0x11a206){const _0x2c0fe9=this['_addContextOptionsState']['sources']['find'](_0x33389b=>_0x33389b['id']===_0x5ea525);if(!_0x2c0fe9)return;const _0x358d63=_0x2c0fe9['resources']['find'](_0x3de0ee=>_0x3de0ee['id']===_0x4b7329);_0x358d63&&(_0x358d63['isInContext']=_0x11a206,this['fire']('resourceStateChanged',{'sourceId':_0x5ea525,'resourceId':_0x4b7329,'isInContext':_0x11a206}));}['_startUploadOperation'](_0x2bbd4f){this['_ongoingUploadOperations']['set'](_0x2bbd4f,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x2dc5c2){this['_ongoingUploadOperations']['delete'](_0x2dc5c2),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Mi=['capabilitiesUpdated'];class Ze extends _0x3ea0e5(){['_isWebSearchEnabled'];['_isReasoningEnabled'];constructor(){super(),this['_isWebSearchEnabled']=!0x1,this['_isReasoningEnabled']=!0x1;}['init'](){this['reset']();}['reset'](){this['setWebSearch'](!0x1),this['setReasoning'](!0x1);}['getCapabilitiesConfig'](){return{'isWebSearchEnabled':this['_isWebSearchEnabled'],'isReasoningEnabled':this['_isReasoningEnabled']};}static['getCapabilitiesRequestData'](_0x4fc18c){const _0x110550={};return _0x4fc18c&&_0x4fc18c['isWebSearchEnabled']&&(_0x110550['webSearch']={}),_0x4fc18c&&_0x4fc18c['isReasoningEnabled']&&(_0x110550['reasoning']={}),_0x110550;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x128bd2){_0x128bd2!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x128bd2,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x139347){_0x139347!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x139347,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Di extends xe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x42104a){super(_0x42104a),this['conversationId']=_0x42104a['conversationId'],this['contextItems']=_0x42104a['contextItems'],this['capabilities']=_0x42104a['capabilities'],this['userMessage']=_0x42104a['userMessage'],this['model']=_0x42104a['model'],this['attributes']=_0x42104a['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Qe['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ze['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class Ct extends _0x3ea0e5(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x27a3bc){super(),this['options']=_0x27a3bc,this['connector']=_0x27a3bc['connector'],this['chatModels']=_0x27a3bc['chatModels'],this['id']=_0x27a3bc['conversationId'],this['isFromHistory']=_0x27a3bc['isFromHistory'];}async['init'](_0xc0214e){try{this['chatContext']=new Qe({'connector':this['connector'],'config':_0xc0214e,'ownerId':this['id']}),this['chatContext']['delegate'](...Ye)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ze(),this['chatCapabilities']['delegate'](...Mi)['to'](this),this['chatCapabilities']['init']();const _0x45321c=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x45321c});const _0x492df0=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x492df0&&await this['setModel'](_0x492df0);}catch(_0x5b430f){const _0x52a046=new _0x5a06e8('ai-chat-conversation-init-failed',null,{'message':_0x5b430f['message']||_0x5b430f});_0x52a046['stack']=_0x5b430f['stack'],this['fire']('error',{'error':_0x52a046});}}async['start'](){if(this['isStarted'])throw new _0x5a06e8('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x5a06e8('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x1cbda0}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x1cbda0,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x1ecdee){const _0x55017a=new _0x5a06e8('ai-chat-conversation-start-failed',null,{'message':_0x1ecdee['message'],'conversationId':this['id']});throw _0x55017a['stack']=_0x1ecdee['stack'],this['fire']('error',{'error':_0x55017a}),_0x55017a;}}async['load'](_0x3a1f0c,_0x4ceaa2){try{const _0x2b0a6f=await this['connector']['fetchConversation'](_0x3a1f0c)['getConversation'](),_0x37de82=await this['connector']['fetchConversationMessages'](_0x3a1f0c)['getMessages'](),_0x1ef409=_0x37de82[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x2b0a6f['id'],'title'in _0x2b0a6f?this['fire']('setConversationTitle',_0x2b0a6f['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x818f6f=(await this['chatModels']['getAll']())['find'](_0x339feb=>_0x339feb['id']['toLowerCase']()===_0x1ef409['toLowerCase']());return this['selectedModel']=_0x818f6f,this['fire']('modelSelected',{'selectedModel':_0x818f6f,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x37de82,_0x4ceaa2,_0x1ef409),this['currentInteraction']=void 0x0,this;}catch(_0x5626d1){const _0x484da6=new _0x5a06e8('ai-chat-conversation-init-from-id-failed',null,{'message':_0x5626d1['message'],'conversationId':_0x3a1f0c});throw _0x484da6['stack']=_0x5626d1['stack'],this['fire']('error',{'error':_0x484da6}),_0x484da6;}}async['_processMessagesToInteractions'](_0x1f8fdf,_0x51c320,_0x4fa6fc){let _0x5067cf;for(const _0x32e99e of _0x1f8fdf)if('user'===_0x32e99e['role']){const _0x44a96a=await this['_extractContextItems'](_0x32e99e),_0x169f72={'isReasoningEnabled':Object['hasOwn'](_0x32e99e['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x32e99e['capabilities'],'webSearch')};_0x5067cf=this['createInteraction']({'userMessage':_0x32e99e['prompt'],'contextItems':_0x44a96a,'capabilities':_0x169f72,'modelId':_0x4fa6fc,'attributes':_0x32e99e['attributes']}),this['currentInteraction']=_0x5067cf,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x32e99e['role']&&_0x5067cf){const _0x52e3f7=[];for(const _0x97bf23 of _0x32e99e['content'])switch(_0x97bf23['type']){case'text':case'modification':{const _0x736f0e=_0x5067cf['getDocumentContext']()?.['sessionId']!==_0x51c320;_0x5067cf['currentReply']=_0x5067cf['createReply']({'type':_0x97bf23['type'],'isDone':!0x0,'interactionId':_0x5067cf['id'],'areActionsDisabled':_0x736f0e}),_0x5067cf['currentReply']['appendContent'](_0x97bf23['content']),_0x52e3f7['length']>0x0&&(_0x5067cf['currentReply']['sources']=_0x52e3f7['splice'](0x0));break;}case'url':_0x52e3f7['push'](_0x97bf23);break;case'mcp-tool-result':{const {data:_0x4306ec,attributes:_0x22d3dd}=JSON['parse'](_0x97bf23['content']);_0x5067cf['_handleToolResultData']({'toolName':_0x97bf23['toolName'],'data':_0x4306ec,'attributes':_0x22d3dd});break;}}}}}async['_extractContextItems'](_0x3ab78b){const _0x56670f=new Map();if(!_0x3ab78b['content'])return _0x56670f;for(const _0x1fdbdc of _0x3ab78b['content']){const _0x194297=await this['chatContext']['populateFromMessage'](_0x1fdbdc);_0x194297&&_0x56670f['set'](_0x194297['id'],_0x194297);}return _0x56670f;}async['handleUserInteraction']({userMessage:_0x39389d,attributes:_0x5d7f85}){if(!this['isStarted'])throw new _0x5a06e8('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x5a06e8('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x301356=this['chatContext']['getPendingContextItems'](),_0xaf6bbf=this['chatCapabilities']['getCapabilitiesConfig'](),_0x4a4d74=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x39389d,'contextItems':_0x301356,'capabilities':_0xaf6bbf,'modelId':_0x4a4d74,'attributes':_0x5d7f85}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x29d0c8){if(_0x29d0c8 instanceof _0x5a06e8)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x29d0c8});else{const _0x493515=Xe['get'](_0x29d0c8['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x5a06e8(_0x493515,null,{'error':_0x29d0c8})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x39c30f,contextItems:_0x351788,capabilities:_0x2fca54,modelId:_0x2f1cc0,attributes:_0x3dd1a8}){const _0x562b00=new Di({'userMessage':_0x39c30f,'contextItems':_0x351788,'capabilities':_0x2fca54,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x2f1cc0,'attributes':_0x3dd1a8});return _0x562b00['delegate'](...ye)['to'](this),this['interactions']['push'](_0x562b00),this['fire']('interactionCreated',_0x562b00),_0x562b00;}['getInteraction'](_0x401814){return this['interactions']['find'](_0x45a826=>_0x45a826['id']===_0x401814);}['removeInteraction'](_0x45e746){const _0x1f6a9d=this['getInteraction'](_0x45e746);_0x1f6a9d&&(_0x1f6a9d['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x1f6a9d),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x33df50){this['chatContext']['addCurrentDocumentToContext'](_0x33df50);}async['updateCurrentDocumentInContext']({content:_0x571d33,version:_0x373e11,sessionId:_0x469b68,selections:_0xdd2ef1}){await this['chatContext']['updateCurrentDocument'](_0x571d33,_0x373e11,_0x469b68,_0xdd2ef1);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x538152){this['chatContext']['addSelectionToContext'](_0x538152);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x10cf0f){this['chatContext']['addFilesToContext'](_0x10cf0f);}['addUrlToContext'](_0x143deb){this['chatContext']['addUrlToContext'](_0x143deb);}['addToolItemToContext'](_0x1c6554){this['chatContext']['addToolItemToContext'](_0x1c6554);}['addResourceToContext'](_0x31a746,_0x5ac309){this['chatContext']['addResourceToContext'](_0x31a746,_0x5ac309);}['loadSourceResources'](_0x43125b,_0x1d2466,_0x44b7fc){return this['chatContext']['loadSourceResources'](_0x43125b,_0x1d2466,_0x44b7fc);}['removeFromContext'](_0x5ec83a){this['chatContext']['removeFromContext'](_0x5ec83a);}['setWebSearch'](_0x21756b){this['chatCapabilities']['setWebSearch'](_0x21756b);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x35b84b){this['chatCapabilities']['setReasoning'](_0x35b84b);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x40aae4){_0x40aae4?!0x1===await this['chatModels']['isAvailable'](_0x40aae4)&&(_0x365bde('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x40aae4}),_0x40aae4=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x365bde('ai-chat-conversation-set-model-null',{'conversation':this}),_0x40aae4=(await this['chatModels']['getAvailableModels']())[0x0]),_0x40aae4['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x40aae4,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x40aae4}));}}class yt extends _0x3ea0e5(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x594daf,config:_0x254356,locale:_0x582eeb}){super(),this['_connector']=_0x594daf,this['_config']=_0x254356,this['_locale']=_0x582eeb;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get['_defaultModelId'](){return this['_config']?.['defaultModelId'];}async['getAll'](){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()),this['_modelsRequest'];}async['getAvailableModels'](){const _0x45060e=await this['getAll']();let _0x551ed8;return _0x551ed8=this['_availableModels']?this['_filterModels'](_0x45060e,this['_availableModels']):_0x45060e['filter'](_0x1b740b=>_0x1b740b['recommended']),_0x551ed8;}async['getModel'](_0x170d92){const _0x52fd4f=await this['getAll']();if(!_0x52fd4f['length'])return null;if(_0x170d92){const _0x4f5367=this['_getModelById'](_0x52fd4f,_0x170d92);if(_0x4f5367)return _0x4f5367;_0x365bde('ai-chat-model-id-unrecognized',{'modelId':_0x170d92,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x65e7e0=await this['getAvailableModels']();if(!_0x65e7e0['length'])return null;if(this['_defaultModelId']){const _0x5592ef=this['_getModelById'](_0x65e7e0,this['_defaultModelId']);if(_0x5592ef)return _0x5592ef;_0x365bde('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x65e7e0[0x0]['id']});}return _0x65e7e0[0x0];}async['isAvailable'](_0xc22658){return(await this['getAvailableModels']())['some'](_0x218748=>_0x218748['name']===_0xc22658['name']&&_0x218748['provider']===_0xc22658['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x5840ea=this['_locale']['uiLanguage']||'en',_0x44fd77=this['_connector']['getModels'](_0x5840ea),_0x3864bb=await _0x44fd77['list']();this['_modelList']=_0x3864bb['items']['map'](_0x2290f3=>Xi(_0x2290f3)?{..._0x2290f3,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x2290f3);}catch(_0x4af9b5){throw pt('ai-models-unable-to-retrieve',{'error':_0x4af9b5}),_0x4af9b5;}return[...this['_modelList']];}['_filterModels'](_0x4f6c70,_0xdbc4ff){let _0x1d1bee;if(_0xdbc4ff){_0x1d1bee=[];const _0x5bb9a6=new Set(),_0x39b810='string'==typeof _0xdbc4ff?[_0xdbc4ff['toLocaleLowerCase']()]:_0xdbc4ff['map'](_0x2f0659=>_0x2f0659['toLocaleLowerCase']());for(const _0x1e0264 of _0x39b810)for(const _0x578a15 of _0x4f6c70)!_0x5bb9a6['has'](_0x578a15['id'])&&this['_isMatchingFilter'](_0x578a15,_0x1e0264)&&(_0x1d1bee['push'](_0x578a15),_0x5bb9a6['add'](_0x578a15['id']));}else _0x1d1bee=_0x4f6c70;return _0x1d1bee;}['_isMatchingFilter'](_0x515d3e,_0x1e43c1){const _0x181d83=_0x515d3e['id']['toLocaleLowerCase'](),_0x383a51=_0x515d3e['name']['toLocaleLowerCase'](),_0x3bb4fd=_0x515d3e['provider']['toLocaleLowerCase']();return _0x181d83===_0x1e43c1||_0x383a51===_0x1e43c1||Xi(_0x515d3e)&&'auto'===_0x1e43c1||_0x3bb4fd===_0x1e43c1||_0x181d83['startsWith'](_0x1e43c1);}['_getModelById'](_0x55ce91,_0x1c35c1){return _0x55ce91['find'](_0x58f073=>Xi(_0x58f073)&&'auto'===_0x1c35c1?_0x58f073:_0x58f073['id']===_0x1c35c1)||null;}}function Xi(_0x3312c2){return _0x3312c2['id']['startsWith']('agent');}function T(_0xbe3ec9){if(_0xbe3ec9 instanceof dt)return _0xbe3ec9;if(_0xbe3ec9?.['editors']&&_0xbe3ec9['editors']['get'](0x0))return _0xbe3ec9['editors']['length']>0x1&&console['warn']('AIChat:\x20Multiple\x20editor\x20instances\x20detected.\x20Only\x20the\x20first\x20editor\x20instance\x20will\x20be\x20used\x20for\x20AI\x20operations.\x20This\x20configuration\x20is\x20not\x20fully\x20supported\x20and\x20may\x20lead\x20to\x20unexpected\x20behavior.'),_0xbe3ec9['editors']['get'](0x0);throw new _0x5a06e8('ai-get-editor-from-context-no-editor');}function Z({editor:_0xdddfa8,interaction:_0x4aa7e5,reply:_0x1ae0e2,groups:_0x228b8f,transform:_0x1c4881,documentCompare:_0x483f11,documentCompareOptions:_0x399d83}){const _0x10799a=_0x4aa7e5['getDocumentContext']();if(!_0x10799a)return[];const _0x41c1b9=_0x10799a['content'],_0x270acf=_0x10799a['version'],_0x43442c=_0x1ae0e2['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x4c6dfa}of _0x228b8f){const _0x40ba80=_0x4c6dfa['filter'](_0x352a3d=>'new'!=_0x352a3d['type'])['map'](_0x3b139d=>Dt('data-id',_0x3b139d['id'],_0x43442c)),_0x1256d9=_0x4c6dfa['filter'](_0x292a05=>'removed'!=_0x292a05['type'])['map'](_0x4c1256=>_0x4c1256['node']['cloneNode'](!0x0));let _0xbdf994=null;if(_0x40ba80['length']){_0xbdf994=_0x40ba80[0x0]['previousSibling'];for(let _0x190430=0x0;_0x190430<_0x40ba80['length'];_0x190430++)_0x1a4c2d(_0x40ba80[_0x190430]);}if(_0x1256d9['length']){_0xbdf994||(_0x4c6dfa[0x0]['anchorId']?_0xbdf994=Dt('data-id',_0x4c6dfa[0x0]['anchorId'],_0x43442c):(_0xbdf994=_0x1256d9['shift'](),_0x331d1d(_0x43442c,_0xbdf994)));for(let _0x199ebe=0x0;_0x199ebe<_0x1256d9['length'];_0x199ebe++)_0x44d3ba(_0xbdf994,_0x1256d9[_0x199ebe]),_0xbdf994=_0x1256d9[_0x199ebe];}}const _0x1b50a9=xt(_0x43442c),_0x238a53=_0x483f11['getDiff'](_0x41c1b9,_0x1b50a9,_0x399d83)['getOperations']();if(_0x1c4881){const _0x5769e9=_0xdddfa8['model']['document']['history']['getOperations'](_0x270acf),_0x524e37={'document':_0xdddfa8['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return nt(_0x238a53,_0x5769e9,_0x524e37)['operationsA'];}return _0x238a53;}function Y(_0x4921c7,_0x405ce4){if('marker'!=_0x405ce4['type'])return;const _0x3b179e=_0x4921c7['model']['markers']['get'](_0x405ce4['name']);_0x3b179e&&(_0x405ce4['oldRange']=_0x3b179e['getRange']());}class ht extends _0x5aeef2{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[q,_0x4df951];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x1424e8(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new yt({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x2f053d=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x3d87e7,_0xea6a5a)=>{this['_handleUIUserMessage']({'userMessage':_0xea6a5a});}),this['listenTo'](_0x2f053d,'resizedTabs',(_0x181ba6,_0x5f49b2)=>{this['_setIsMaximized'](_0x5f49b2);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x2f053d['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x23897d,_0x2234bc)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x2234bc));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x4006a1,_0x2d11ec)=>{this['activeConversation']?.['addUrlToContext'](_0x2d11ec);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x3e8cb3,_0x4a41b9)=>{_0x4a41b9['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x2478f5,_0x16f299)=>{this['activeConversation']?.['addResourceToContext'](_0x16f299['source'],_0x16f299['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x2b45c6,_0x27a276)=>{this['_removeFromContext'](_0x27a276);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x1c4cad,_0x52e8b8)=>{this['activeConversation']?.['loadSourceResources'](_0x52e8b8['sourceId'],_0x52e8b8['query'],_0x52e8b8['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x2fad54,_0x12f0e7)=>{this['activeConversation']?.['setModel'](_0x12f0e7);}),this['listenTo'](this['_aiChatUi'],'like',(_0x6c7de3,{replyId:_0x24d49f})=>{console['log']('Liked\x20response',_0x24d49f);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x45d5f1,{replyId:_0x52e6ac})=>{console['log']('Disliked\x20response',_0x52e6ac);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x57533a,_0x4092e9)=>{this['_insertSuggestion'](_0x4092e9);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x3193ab,{replyId:_0x185e5,partIndex:_0x9226c8})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x185e5,_0x9226c8);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x10b541,{replyId:_0x3f185b,partIndex:_0x474d46})=>{const _0x3a2391=this['_getDocumentRangeForReplyChanges'](_0x3f185b,_0x474d46);_0x3a2391&&'$graveyard'!=_0x3a2391['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x3a2391['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x3dcc4c,_0x2aaa55)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x2aaa55);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x164ff5,{replyId:_0x1582d4,showDiff:_0x2ed397})=>{const {reply:_0x20d51c}=this['getInteractionAndReplyById'](_0x1582d4),_0x5403e8=_0x20d51c['getContentParts']({'showDiff':_0x2ed397});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x20d51c['id'],'parts':_0x5403e8,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x1498e5,{replyId:_0xaf8e9a,partIndex:_0xf399bb})=>{this['_rejectSuggestion']({'replyId':_0xaf8e9a,'partIndex':_0xf399bb}),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon'),this['set']('_aiChatBalloonShowDiff',!0x1),this['_aiChatBalloon']['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](this['_aiChatBalloon'],'toggleSuggestionDisplayMode',()=>{const {replyId:_0x41f26f,partIndex:_0x98cca}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x26aecc}=this['getInteractionAndReplyById'](_0x41f26f),_0x1ce19e=_0x26aecc['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x98cca});this['_aiChatBalloon']['updateContent']({'part':_0x1ce19e[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x26f77c,partIndex:_0x45508f}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x26f77c,'partIndex':_0x45508f}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0xd7792a,partIndex:_0x1d2d04}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0xd7792a,'partIndex':_0x1d2d04}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x2edc89,partIndex:_0x144b5f}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x2edc89,'partIndex':_0x144b5f}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x547c01,partIndex:_0x319ce7}=this['_currentPreviewedChangeGroup'],_0x44262d=this['_getPresentableSiblingContentPartIndex'](_0x547c01,_0x319ce7,'next');null!==_0x44262d&&this['_openBalloonFor'](_0x547c01,_0x44262d);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x1938dd,partIndex:_0x514d1f}=this['_currentPreviewedChangeGroup'],_0x1d8bc7=this['_getPresentableSiblingContentPartIndex'](_0x1938dd,_0x514d1f,'previous');null!==_0x1d8bc7&&this['_openBalloonFor'](_0x1938dd,_0x1d8bc7);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x4ae733,{id:_0x334879})=>{if('aiChatBalloon'!==_0x334879)return;const {replyId:_0x3f51e2,partIndex:_0x161fee}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x3f51e2,'index':_0x161fee,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x4fc274,_0xd7b03c)=>{_0xd7b03c['on']('ready',()=>{this['_integrateEditor'](_0xd7b03c);});});const _0x835c9b=this['context']['config']['get']('ai.chat.initialConversation');let _0x5488b3=_0x835c9b;if('lastCreated'!=_0x835c9b||(_0x5488b3=await this['_getLastCreatedConversationId'](),_0x5488b3))return'new'==_0x5488b3?this['_startConversationSafely']():this['loadConversation'](_0x5488b3);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x6eaa33){const _0x34885d=T(this['context']);if(!_0x34885d['plugins']['has']('TrackChanges'))throw new _0x5a06e8('ai-no-track-changes',null);const _0x32a653=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x38dae4,interaction:_0x598abb}=this['getInteractionAndReplyById'](_0x6eaa33['replyId']),_0x4ef3d8=this['_getDocumentRangeForReplyChanges'](_0x6eaa33['replyId'],_0x6eaa33['partIndex']),_0x3f02f9=void 0x0!==_0x6eaa33['partIndex']?[_0x38dae4['changeGroups'][_0x6eaa33['partIndex']]]:_0x38dae4['changeGroups']['filter'](_0x198e0b=>'pending'==_0x198e0b['state']),_0xbc2e27=_0x3f02f9['map'](_0xf87f73=>_0x38dae4['changeGroups']['indexOf'](_0xf87f73));if(!_0x4ef3d8||'$graveyard'==_0x4ef3d8['range']['root']['rootName'])return void _0xbc2e27['forEach'](_0x5be530=>_0x38dae4['setChangeGroupState'](_0x5be530,'outdated'));_0xbc2e27['forEach'](_0x399d63=>_0x38dae4['setChangeGroupState'](_0x399d63,'accepted'));const _0x5a4c45=Z({'editor':_0x34885d,'reply':_0x38dae4,'interaction':_0x598abb,'groups':_0x3f02f9,'transform':!0x0,'documentCompare':_0x32a653,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0xe569cf;_0x4ef3d8&&this['_scrollToSuggestionRange'](_0x4ef3d8['range']),_0x34885d['model']['change'](_0x4dbcf1=>{_0xe569cf=_0x4dbcf1['batch'],_0x34885d['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x5a4c45),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0xe569cf,{'interactionId':_0x598abb['id'],'replyId':_0x38dae4['id'],'indexes':_0xbc2e27['slice']()}),this['_updateRatings'](_0x38dae4);}['_applySuggestion'](_0x2fd8ff){const _0x43918b=T(this['context']),_0x240c45=this['context']['plugins']['get'](_0x4df951),{reply:_0x2984de,interaction:_0x490e22}=this['getInteractionAndReplyById'](_0x2fd8ff['replyId']),_0x429f7b=this['_getDocumentRangeForReplyChanges'](_0x2fd8ff['replyId'],_0x2fd8ff['partIndex']),_0xf9d0b2=void 0x0!==_0x2fd8ff['partIndex']?[_0x2984de['changeGroups'][_0x2fd8ff['partIndex']]]:_0x2984de['changeGroups']['filter'](_0x26489c=>'pending'==_0x26489c['state']),_0xba8abe=_0xf9d0b2['map'](_0x2583f7=>_0x2984de['changeGroups']['indexOf'](_0x2583f7));if(!_0x429f7b||'$graveyard'==_0x429f7b['range']['root']['rootName'])return void _0xba8abe['forEach'](_0x218989=>_0x2984de['setChangeGroupState'](_0x218989,'outdated'));_0xba8abe['forEach'](_0x4ca407=>_0x2984de['setChangeGroupState'](_0x4ca407,'accepted'));const _0x535d96=Z({'editor':_0x43918b,'reply':_0x2984de,'interaction':_0x490e22,'groups':_0xf9d0b2,'transform':!0x0,'documentCompare':_0x240c45,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x573cb8;_0x429f7b&&this['_scrollToSuggestionRange'](_0x429f7b['range']),_0x43918b['model']['change'](_0x128929=>{_0x573cb8=_0x128929['batch'];for(const _0x2b4048 of _0x535d96)_0x2b4048['baseVersion']=_0x43918b['model']['document']['version'],Y(_0x43918b,_0x2b4048),_0x128929['batch']['addOperation'](_0x2b4048),_0x43918b['model']['applyOperation'](_0x2b4048);}),this['_batchToChanges']['set'](_0x573cb8,{'interactionId':_0x490e22['id'],'replyId':_0x2984de['id'],'indexes':_0xba8abe['slice']()}),this['_updateRatings'](_0x2984de);}['_rejectSuggestion'](_0x14adf9){const {reply:_0x49c3fd}=this['getInteractionAndReplyById'](_0x14adf9['replyId']);_0x49c3fd['setChangeGroupState'](_0x14adf9['partIndex'],'rejected');}['_openBalloonFor'](_0x37b8bb,_0x362a6d){if(!this['_aiChatBalloon'])return;const {reply:_0x3bd25b}=this['getInteractionAndReplyById'](_0x37b8bb),_0x55cb47=_0x3bd25b['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x1b7b5f,_0x32fa24;if(void 0x0!==_0x362a6d?(_0x32fa24=_0x55cb47['find'](_0x1b6cc0=>_0x1b6cc0['index']==_0x362a6d),_0x1b7b5f=_0x32fa24?.['index']):(_0x32fa24=_0x55cb47[0x0],_0x1b7b5f=_0x32fa24['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x37b8bb&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x1b7b5f)return;const _0x1c34f4=this['_getUserPresentableContentPartDocumentRange'](_0x37b8bb,_0x3bd25b,_0x32fa24);if(!_0x1c34f4)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x37b8bb,'partIndex':_0x1b7b5f},this['_scrollToSuggestionRange'](_0x1c34f4,!0x0);const _0x413cc2=this['_getPresentableSiblingContentPartIndex'](_0x37b8bb,_0x1b7b5f,'next');this['_aiChatBalloon']['updateContent']({'part':_0x32fa24,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x1b7b5f,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x1b7b5f+0x1)['toString']()),'showRotator':null!==_0x413cc2,'ranges':[_0x1c34f4],'areActionsDisabled':_0x3bd25b['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x37b8bb,_0x1b7b5f),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x37b8bb,'index':_0x1b7b5f,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x3fac16,_0x2c0d81,_0xd91c6){const {reply:_0x49d804}=this['getInteractionAndReplyById'](_0x3fac16),_0x3c8b04=_0x49d804['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x3c8b04['length'])return null;const _0xf1fd39=_0x3c8b04['findIndex'](_0x856efb=>_0x856efb['index']==_0x2c0d81),_0x3c28b0='next'==_0xd91c6?0x1:-0x1;let _0x22c66d=_0x3c8b04['at']((_0xf1fd39+_0x3c28b0)%_0x3c8b04['length'])['index'],_0x856bd6=_0x3c8b04[_0x22c66d];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x3fac16,_0x49d804,_0x856bd6);){if(_0x22c66d=_0x3c8b04['at']((_0x22c66d+_0x3c28b0)%_0x3c8b04['length'])['index'],_0x22c66d===_0xf1fd39)return null;_0x856bd6=_0x3c8b04[_0x22c66d];}return _0x22c66d;}['_getUserPresentableContentPartDocumentRange'](_0x52b771,_0x43e00a,_0x1e932c){const _0x160f2a=_0x43e00a['changeGroups'];if(!_0x1e932c['hasChanges'])return null;const _0x2eadf7=_0x160f2a['find'](_0x1594e2=>_0x1594e2['index']==_0x1e932c['index']);if('pending'!==_0x2eadf7?.['state'])return null;const _0x40dfc0=this['_getDocumentRangeForReplyChanges'](_0x52b771,_0x1e932c['index']);if(!_0x40dfc0)return null;const {range:_0x572419,currentIndex:_0x51eb86}=_0x40dfc0;return'$graveyard'==_0x572419['root']['rootName']?(_0x43e00a['setChangeGroupState'](_0x51eb86,'outdated'),null):_0x40dfc0['range'];}['_getDocumentRangeForReplyChanges'](_0x5159ba,_0x5917c5){const _0x287192=T(this['context']),{reply:_0x4c59b9,interaction:_0x58966d}=this['getInteractionAndReplyById'](_0x5159ba),_0x261557=_0x4c59b9['changeGroups']['filter'](_0x96dc9a=>'pending'==_0x96dc9a['state']),_0xee5888=_0x261557['map'](_0x3bf28e=>_0x4c59b9['changeGroups']['indexOf'](_0x3bf28e));void 0x0===_0x5917c5&&(_0x5917c5=_0xee5888[0x0]);const _0x1483c3=_0xee5888['indexOf'](_0x5917c5);if(-0x1==_0x1483c3)return null;const _0x54a00f=_0x261557[_0x1483c3],_0xfd5c45=new Ot([]),_0x572201=new Ot([]);for(const _0x3a39e9 of _0x54a00f['changes'])if('removed'!=_0x3a39e9['type']&&_0x572201['children']['push'](_0x3a39e9['node']['cloneNode'](!0x0)),'new'!=_0x3a39e9['type']){const _0xfb6a4c=vt(_0x3ba457=>wt(_0x3ba457,'data-id')==_0x3a39e9['id'],_0x4c59b9['documentContextContent'],!0x0);_0xfd5c45['children']['push'](_0xfb6a4c['cloneNode'](!0x0));}if(0x0==_0xfd5c45['children']['length']){if(_0x54a00f['changes'][0x0]['anchorId']){const _0x8588de=Dt('data-id',_0x54a00f['changes'][0x0]['anchorId'],_0x4c59b9['documentContextContent']);_0xfd5c45['children']['unshift'](_0x8588de['cloneNode'](!0x0)),_0x572201['children']['unshift'](_0x8588de['cloneNode'](!0x0)),_0x8588de['nextSibling']&&(_0xfd5c45['children']['push'](_0x8588de['nextSibling']['cloneNode'](!0x0)),_0x572201['children']['push'](_0x8588de['nextSibling']['cloneNode'](!0x0)));}else{const _0x8ffef=_0x4c59b9['documentContextContent']['children'][0x0];if(!_0x8ffef)return null;_0xfd5c45['children']['push'](_0x8ffef['cloneNode'](!0x0)),_0x572201['children']['push'](_0x8ffef['cloneNode'](!0x0));}}const _0x3b40bb=_0x58966d['getDocumentContext'](),_0x163f36=_0x287192['data']['parse'](_0x3b40bb['content']),_0x58ad82=xt(_0xfd5c45),_0x1517f6=_0x287192['data']['parse'](_0x58ad82),_0x5b9121=_0x287192['data']['parse'](_0x58ad82),_0x13fe9d=_0x287192['model']['createPositionAt'](_0x1517f6,0x0),_0x145383=xt(_0x572201),_0x47d63c={'anchor':_0x13fe9d,'markDeletions':!0x1},_0xa3bd06=_0x287192['plugins']['get'](_0x4df951)['getDiff'](_0x58ad82,_0x145383,_0x47d63c)['getOperations']();if(!_0xa3bd06['length'])return null;_0x287192['model']['change'](_0x574244=>{for(const _0x381dd0 of _0xa3bd06)if('remove'==_0x381dd0['type']){const _0x239618=_0x381dd0['sourcePosition'],_0x354b7d=_0x381dd0['howMany'],_0x56aebe=new et(_0x239618,_0x354b7d);_0x574244['batch']['addOperation'](_0x56aebe),_0x287192['model']['applyOperation'](_0x56aebe);}else'marker'!==_0x381dd0['type']&&(_0x381dd0['baseVersion']=null,_0x381dd0['isDocumentOperation']=!0x1,_0x574244['batch']['addOperation'](_0x381dd0),_0x287192['model']['applyOperation'](_0x381dd0));});const _0x3dc7b6=St(_0x287192,_0xa3bd06,_0x1517f6);Et(_0x287192['model'],_0x3dc7b6);const _0x252080=_0x3dc7b6['getFirstRange']()['start']['path']['slice'](),_0x14f8f7=_0x3dc7b6['getFirstRange']()['end']['path']['slice'](),_0x17b8e9=[];let _0x3baee1=_0x1517f6,_0x3a570b=_0x5b9121;for(let _0x209b6d=0x0;_0x209b6d<_0x14f8f7['length'];_0x209b6d++){const _0x4e3ac8=_0x3baee1['maxOffset']-_0x14f8f7[_0x209b6d];_0x17b8e9[_0x209b6d]=_0x3a570b['maxOffset']-_0x4e3ac8,_0x3baee1=_0x3baee1['getChildAtOffset'](_0x14f8f7[_0x209b6d]),_0x3a570b=_0x3a570b['getChildAtOffset'](_0x17b8e9[_0x209b6d]);}const _0x36079a=_0x287192['model']['createRange'](_0x287192['model']['createPositionFromPath'](_0x5b9121,_0x252080),_0x287192['model']['createPositionFromPath'](_0x5b9121,_0x17b8e9)),_0x597bef=_0x5b9121['getChild'](0x0)['getAttribute'](At),_0x51d745=Array['from'](_0x163f36['getChildren']())['find'](_0x558cd=>_0x558cd['getAttribute'](At)==_0x597bef)['getPath'](),_0xdd0aef=_0x36079a['start']['path']['slice'](),_0x3d4410=_0x36079a['end']['path']['slice']();_0xdd0aef[0x0]=_0x51d745[0x0]+_0xdd0aef[0x0],_0x3d4410[0x0]=_0x51d745[0x0]+_0x3d4410[0x0];let _0x4d0268=_0x287192['model']['createRange'](_0x287192['model']['createPositionFromPath'](_0x287192['model']['document']['getRoot'](),_0xdd0aef),_0x287192['model']['createPositionFromPath'](_0x287192['model']['document']['getRoot'](),_0x3d4410));const _0x34a05f=_0x287192['model']['document']['history']['getOperations'](_0x3b40bb['version']);for(const _0x11163d of _0x34a05f)_0x4d0268=it['_createFromRanges'](_0x4d0268['getTransformedByOperation'](_0x11163d));return{'range':_0x4d0268,'currentIndex':_0x5917c5};}['_integrateEditor'](_0x3e798a){if(!_0x3e798a['plugins']['has']('Undo'))return;const _0x20f6ff=_0x3e798a['commands']['get']('undo'),_0x148b4d=_0x3e798a['commands']['get']('redo');this['listenTo'](_0x20f6ff,'revert',(_0x4477f2,_0x32e5f5,_0x4f610f)=>{const _0x1ad906=this['_batchToChanges']['get'](_0x32e5f5);if(!_0x1ad906)return;const _0x5a09dc=this['activeConversation']['getInteraction'](_0x1ad906['interactionId'])['getReply'](_0x1ad906['replyId']);_0x1ad906['indexes']['forEach'](_0x388e8f=>_0x5a09dc['setChangeGroupState'](_0x388e8f,'pending')),this['_batchToChanges']['delete'](_0x32e5f5),this['_batchToChanges']['set'](_0x4f610f,_0x1ad906);}),this['listenTo'](_0x148b4d,'revert',(_0x3eef8a,_0x1f9af1,_0x348104)=>{const _0x24d838=this['_batchToChanges']['get'](_0x1f9af1);if(!_0x24d838)return;const _0x3714cd=this['activeConversation']['getInteraction'](_0x24d838['interactionId'])['getReply'](_0x24d838['replyId']);_0x24d838['indexes']['forEach'](_0x7c140=>_0x3714cd['setChangeGroupState'](_0x7c140,'accepted')),this['_batchToChanges']['delete'](_0x1f9af1),this['_batchToChanges']['set'](_0x348104,_0x24d838);});}async['loadConversation'](_0x1c7e8e){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](_t)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x1c7e8e)['getConversation'](),await this['_startConversationSafely'](_0x1c7e8e),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x1c7e8e,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x49ec0c){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x1c7e8e}),this['_logError'](new _0x5a06e8('ai-chat-conversation-not-found',this,{'error':_0x49ec0c}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0x5158aa=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x3b429a=await _0x5158aa['getConversations']();return _0x3b429a['length']?_0x3b429a[0x0]['id']:'new';}catch(_0x2f2896){return this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x46d503()}),this['_logError'](new _0x5a06e8('ai-chat-conversation-init-failed',this,{'error':_0x2f2896})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x40fefc){this['activeConversation']['id']===_0x40fefc&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x19682b=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x19682b),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x1ecb65,attributes:_0x3f26e5}){await this['_handleUIUserMessage']({'userMessage':_0x1ecb65,'attributes':_0x3f26e5});}['getGroupId'](){const _0x37f988=this['context']['config']['get']('collaboration.channelId');if(!_0x37f988)throw new _0x5a06e8('ai-chat-missing-channel-id',this);return _0x37f988;}async['_startConversationSafely'](_0x42916d){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x42916d);}catch(_0x57ff37){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x42916d||_0x46d503()}),console['error'](_0x57ff37),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x21ae87){let _0x5a7474;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x21ae87||!this['activeConversation']?_0x5a7474=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x5a7474=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x36d65a=this['getGroupId'](),_0x437483=_0x21ae87||_0x46d503();this['activeConversation']=new Ct({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x5a7474,'conversationId':_0x437483,'group':_0x36d65a,'getEditor':()=>T(this['context']),'isFromHistory':!!_0x21ae87}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x37d4b9,_0x4752b3)=>{this['_aiChatUi']['createConversation'](_0x4752b3),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x21ae87||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x5da39c,_0x3eb1f4)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x3eb1f4['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x5ab42a,_0x5a6659)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x5a6659);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x36852=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x36852);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x3611e6=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x3611e6);}),this['activeConversation']['on']('webSearchFinished',(_0x44d774,_0x3d5289)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3d5289,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x337b6e,_0xecb3be)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0xecb3be,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x4ffe3c,_0x121385)=>{this['_aiChatUi']['removeFeedInteraction'](_0x121385['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x326f72,_0x298a8b,_0x94c263)=>{this['updateConversationTitle'](_0x298a8b,_0x94c263);}),this['activeConversation']['on']('replyCreated',(_0x5baace,_0x1e5aa4)=>{'text'===_0x1e5aa4['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x1e5aa4):this['_aiChatUi']['addFeedItemAISuggestion'](_0x1e5aa4);}),this['activeConversation']['on']('replyContentUpdated',async(_0x3ef80f,_0x26b914)=>{await this['_updateReplyContent']({'reply':_0x26b914});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x525c49,{reply:_0x3f9953,index:_0x1ac42e,state:_0x3a65e5})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x3f9953['id'],'index':_0x1ac42e,'state':_0x3a65e5}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x3f9953['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x1ac42e&&this['_aiChatBalloon']?.['setState'](_0x3a65e5);}),this['activeConversation']['on']('contextItemAdded',(_0x1eb8fc,_0x13bdcd)=>{if(this['_aiChatUi']['addContextItem'](_0x13bdcd['contextItem'],_0x13bdcd['isLoading']),'selection'===_0x13bdcd['contextItem']['type']){const _0x5299c6=[...T(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x5299c6,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x52f181,_0x44ea70)=>{this['_aiChatUi']['removeContextItem'](_0x44ea70['uiId']),'current-document'==_0x44ea70['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x44ea70['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x101135,_0xb807bc)=>{this['_aiChatUi']['setContextItemLoading'](_0xb807bc['contextItem']['uiId'],_0xb807bc['isLoading']);}),this['activeConversation']['on']('contextSent',(_0xce2e93,_0x359890)=>{this['_aiChatUi']['setConversationContext'](_0x359890['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x23bd45,_0x571cbf)=>{this['_aiChatUi']['setAddContextOptions'](_0x571cbf['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x1a0072,_0xf5781e)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0xf5781e['sourceId'],_0xf5781e['source'],_0xf5781e['resources'],_0xf5781e['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x471405,_0x3e53b7)=>{this['_aiChatUi']['updateResourceState'](_0x3e53b7['sourceId'],_0x3e53b7['resourceId'],_0x3e53b7['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x46d7a3,_0x36e7af)=>{this['_aiChatUi']['updateCapabilities'](_0x36e7af);}),this['activeConversation']['on']('modelSelected',async(_0x245404,_0xa35fd6)=>{const _0x37c820=(await this['_aiChatModels']['getAll']())['find'](_0x262a97=>_0x262a97['id']===_0xa35fd6['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x37c820,_0xa35fd6['isDisabled']);}),this['activeConversation']['on']('error',(_0x3c2e16,{error:_0x285f33,interactionId:_0x372d53,fileName:_0x4cc011,url:_0x5c691c,sourceId:_0x580148,sourceLabel:_0x1cf0b8})=>{const _0x13f3ec=_0x372d53?_0x372d53+':'+_0x46d503():_0x46d503();_0x285f33['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x13f3ec}):_0x285f33['message']['startsWith']('ai-chat-conversation-init-failed')||_0x285f33['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x13f3ec}),this['_logError'](_0x285f33)):_0x285f33['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x4cc011),'id':_0x13f3ec}):_0x285f33['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x5c691c),'id':_0x13f3ec}):_0x285f33['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x13f3ec}):_0x285f33['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x13f3ec}):_0x285f33['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x580148&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x580148),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x1cf0b8||'source'),'id':_0x13f3ec}),this['_logError'](_0x285f33)):_0x285f33['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x13f3ec}),this['_logError'](_0x285f33)):_0x285f33['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x13f3ec}),this['_logError'](_0x285f33)):_0x285f33['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x13f3ec}),this['_logError'](_0x285f33)):_0x285f33['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x13f3ec}),this['_logError'](_0x285f33)):_0x285f33['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x13f3ec}),this['_logError'](_0x285f33)):_0x285f33['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x13f3ec}),this['_logError'](_0x285f33)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x13f3ec}),this['_logError'](_0x285f33));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x21ae87||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x54d286,attributes:_0x38d454}){if(!this['activeConversation'])throw new _0x5a06e8('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x37015e=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x37015e);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x54d286,'attributes':_0x38d454});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0xe85eee){this['_aiChatUi']['setIsMaximized'](_0xe85eee);}['_logError'](_0x1f5e0d){pt(_0x1f5e0d['message']);}['_removeFromContext'](_0x4773c4){this['activeConversation']?.['removeFromContext'](_0x4773c4);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x1a88d1){const [_0x181264,_0x4c9faf]=_0x1a88d1['split'](':'),_0xf5ccfb=this['activeConversation']['getInteraction'](_0x181264),_0x4dcc30=_0xf5ccfb['getReply'](_0x4c9faf);return{'interaction':_0xf5ccfb,'reply':_0x4dcc30};}['_scrollToSuggestionRange'](_0x4904b0,_0x42c9ad=!0x1){const _0x5536ea=T(this['context']),_0x21853c={'target':_0x5536ea['editing']['view']['domConverter']['viewRangeToDom'](_0x5536ea['editing']['mapper']['toViewRange'](_0x4904b0)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x42c9ad};_0x42c9ad&&(_0x21853c['alignToTop']=!0x0),_0x3f0a76(_0x21853c);}['updateConversationTitle'](_0x1b5313,_0x5a3043=!0x1){this['_aiChatUi']['setConversationTitle'](_0x1b5313||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x5a3043);}async['_updateReplyContent']({reply:_0x1804e6,renderingStrategy:_0xc706b3}){const {id:_0x2afc26,interactionId:_0x3cbe0d,isDone:_0x8b1df8,type:_0xa15a34,parsedContent:_0x13d5c8}=_0x1804e6,_0x4e2e20=_0x3cbe0d+':'+_0x2afc26;if('modification'===_0xa15a34){const _0x2432d5=_0x1804e6['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x4e2e20,'parts':_0x2432d5,'renderingStrategy':_0xc706b3,'isDone':_0x8b1df8});}else'text'===_0xa15a34&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x4e2e20,'parsedContent':_0x13d5c8,'renderingStrategy':_0xc706b3,'isDone':_0x8b1df8});_0x8b1df8&&_0x1804e6['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x4e2e20,_0x1804e6['sources']);}async['_stopLastInteraction'](){const _0x35c869=this['activeConversation']?.['lastInteraction'];_0x35c869&&(_0x35c869['stop'](),this['_aiChatUi']['stopInteraction'](_0x35c869));}async['_flushLastInteractionUI'](){const _0x45ee69=this['activeConversation']?.['lastInteraction'];if(_0x45ee69){for await(const _0x5c55af of _0x45ee69['replies'])await this['_updateReplyContent']({'reply':_0x5c55af,'renderingStrategy':'static'});}}['_updateRatings'](_0x4edf87){const _0x121a1e={'positiveCount':_0x4edf87['changeGroups']['filter'](_0x227f1a=>'accepted'===_0x227f1a['state'])['length'],'totalCount':_0x4edf87['changeGroups']['length'],'modificationId':_0x4edf87['id']},_0x587052=this['activeConversation']['getInteraction'](_0x4edf87['interactionId'])['messageId'];_0x587052&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x587052,_0x121a1e);}['_registerToolDataCallback'](_0x35fbca){let _0x446ee6=null,_0x4657a9=null;this['on']('toolDataReceived',(_0x38f584,_0x16c4ec,_0x513dfc)=>{_0x513dfc['id']!==_0x446ee6&&(_0x446ee6=_0x513dfc['id'],_0x4657a9=this['_getAIChatInteractionAPI'](_0x513dfc)),_0x35fbca(_0x16c4ec,_0x4657a9);});}['_getAIChatInteractionAPI'](_0x4640c7){const _0x1fa19a=this['_aiChatUi'],_0xb9042a=()=>{_0x4640c7['resetWebSearchState'](),_0x4640c7['resetReasoningState'](),_0x1fa19a['clearLoadingMessage']();},_0xa2c433=()=>{_0x4640c7['currentReply']&&(_0x4640c7['currentReply']['done'](),_0x4640c7['currentReply']=void 0x0);};return{'insertTextReply':(_0x469332,_0xc4f994)=>{_0xa2c433(),_0xb9042a();const _0x3a9324=_0x4640c7['currentReply']=_0x4640c7['createReply']({'type':'text','interactionId':_0x4640c7['id'],'content':_0x469332,'id':_0xc4f994||_0x46d503()});return _0xa2c433(),_0x3a9324;},'insertCustomElement':async(_0x281041,_0xede583)=>(_0xa2c433(),_0xb9042a(),_0x1fa19a['addFeedItemCustomElement'](_0x281041,_0xede583||_0x46d503())),'setLoadingMessage':_0x173ca7=>{_0x1fa19a['setLoadingMessage'](_0x173ca7);},'clearLoadingMessage':()=>{_0x1fa19a['clearLoadingMessage']();}};}}const R='ai-selection';class D extends _0x5aeef2{constructor(_0x525807){super(_0x525807),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_displayedFakeSelectionId']=null;['_displayedFakeSelectionLocked']=!0x1;['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0xdb59ff=T(this['context']),_0x138664=_0xdb59ff['plugins']['has']('RealTimeCollaborationClient')&&_0xdb59ff['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x138664||_0x46d503();}return this['_sessionId'];}async['getDocumentData'](){const _0x17aa84=T(this['context']),_0x3ee762=_0x17aa84['model'],_0x3e0f5c=_0x17aa84['data']['toView'](_0x3ee762['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x185a93=new Nt(_0x17aa84['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x3e0f5c,_0x185a93);let _0x33ae02=await this['_getDocumentDataStringFromView'](_0x3e0f5c);const _0x524ae8=this['_getMarkersInDocumentOrder'](),_0x32bbee=[];for(const _0xb5bd8 of _0x524ae8){const _0x272e2b='<'+_0xb5bd8['name']+':start></'+_0xb5bd8['name']+':start>',_0x45933d=_0x33ae02['indexOf'](_0x272e2b);_0x33ae02=_0x33ae02['substring'](0x0,_0x45933d)+_0x33ae02['substring'](_0x45933d+_0x272e2b['length']);const _0x1103f4='<'+_0xb5bd8['name']+':end></'+_0xb5bd8['name']+':end>',_0x328591=_0x33ae02['indexOf'](_0x1103f4);_0x33ae02=_0x33ae02['substring'](0x0,_0x328591)+_0x33ae02['substring'](_0x328591+_0x1103f4['length']),_0x32bbee['push']({'markerName':_0xb5bd8['name'],'start':_0x45933d,'end':_0x328591,'htmlFragment':_0x33ae02['substring'](_0x45933d,_0x328591)});}return{'content':_0x33ae02,'version':_0x17aa84['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x32bbee};}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x29a911,_0x275b82)=>{_0x275b82['on']('ready',()=>{this['_integrateEditor'](_0x275b82);});});}['_setOutputDataProcessor'](_0x3c3f92){this['_outputDataProcessor']=_0x3c3f92;}async['_getDocumentDataStringFromView'](_0x346445){let _0x36460a;const _0x5cbe60=T(this['context']);if(this['_outputDataProcessor']){const _0x519f5d=_0x5cbe60['data']['processor']['domConverter']['viewToDom'](_0x346445),_0xd9fcbf=await this['_outputDataProcessor'](_0x519f5d);_0x36460a=_0x5cbe60['data']['processor']['htmlWriter']['getHtml'](_0xd9fcbf);}else _0x36460a=_0x5cbe60['data']['processor']['toData'](_0x346445);return _0x36460a;}['_integrateEditor'](_0x5312be){_0x5312be['conversion']['for']('editingDowncast')['markerToHighlight']({'model':R,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x5312be['conversion']['for']('dataDowncast')['markerToElement']({'model':R,'view':(_0x4c1fc9,{writer:_0x53c04e,options:_0x53af1d})=>_0x53af1d['convertAiChatSelectionMarker']?_0x53c04e['createUIElement'](_0x4c1fc9['markerName']+':'+(_0x4c1fc9['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x10e8a5,_0x189bb9,_0x20f32f=!0x1,_0x288059=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x288059)return!0x1;const _0x882610=T(this['context'])['model'];return _0x882610['change'](_0x5b52bc=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x189bb9,this['_displayedFakeSelectionLocked']=_0x20f32f;let _0xcc4861=0x0;for(let _0xd55cbc of _0x10e8a5){const _0x48aa6a=R+':'+_0xcc4861;if(_0xd55cbc['start']['isAtEnd']){const _0x47ae7a=_0xd55cbc['start']['getLastMatchingPosition'](({item:_0x12e8a8})=>!_0x882610['schema']['isContent'](_0x12e8a8),{'boundaries':_0xd55cbc});_0xd55cbc=_0x5b52bc['createRange'](_0x47ae7a,_0xd55cbc['end']);}_0x5b52bc['addMarker'](_0x48aa6a,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xd55cbc}),_0xcc4861++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x3ff8e3){if(this['_displayedFakeSelectionId']!=_0x3ff8e3)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x465fe8=T(this['context']),_0x37eac6=_0x465fe8['model']['markers']['getMarkersGroup'](R);return _0x465fe8['model']['change'](_0x4a683c=>{for(const _0x25c940 of _0x37eac6)_0x4a683c['removeMarker'](_0x25c940);}),!0x0;}async['modelToDataWithIds'](_0x48eca4){const _0x487d2d=T(this['context']),_0x400640=_0x487d2d['data']['toView'](_0x48eca4),_0x5f4fb3=new Nt(_0x487d2d['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x400640,_0x5f4fb3),this['_getDocumentDataStringFromView'](_0x400640);}['_setDataIdsOnChildren'](_0x25d417,_0x58dfbd){let _0x10da36=!0x1;const _0x5da134=new Set();for(const _0x680019 of _0x25d417['getChildren']()){const _0x2be1b9=_0x680019['is']('emptyElement')||_0x680019['is']('containerElement');if(!_0x680019['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x680019,_0x58dfbd)||_0x2be1b9)&&(_0x58dfbd['setAttribute']('data-id',this['_nextDataId'](_0x5da134),_0x680019),_0x10da36=!0x0);}return _0x10da36;}['_nextDataId'](_0x4cedbc){let _0x48e9d7;do{_0x48e9d7='';for(let _0x2a699b=0x0;_0x2a699b<0x4;_0x2a699b++)_0x48e9d7+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x4cedbc['has'](_0x48e9d7));return _0x4cedbc['add'](_0x48e9d7),_0x48e9d7;}['getSelectionText'](){const {model:_0x985a48}=T(this['context']),_0x437a69=_0x985a48['document']['selection'],_0x586252=[];for(const _0x409f67 of _0x437a69['getRanges']())for(const _0x3bfd66 of _0x409f67['getItems']())_0x3bfd66['is']('$textProxy')?_0x586252['push'](_0x3bfd66['data']):_0x3bfd66['is']('element')&&_0x586252['length']>0x0&&'\x20'!==_0x586252[_0x586252['length']-0x1]&&_0x586252['push']('\x20');return _0x586252['length']?'\x22'+_0x586252['join']('')['trim']()+'\x22':i(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0x5a79ae=T(this['context'])['model'];return Array['from'](_0x5a79ae['markers']['getMarkersGroup'](R))['sort']((_0x139440,_0x4aed2f)=>_0x139440['getStart']()['isBefore'](_0x4aed2f['getStart']())?-0x1:_0x139440['getStart']()['isAfter'](_0x4aed2f['getStart']())?0x1:0x0);}}const ft=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Ft=[...ft,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x587334){this['options']={'delay':_0x587334['delay']??0x14,'textNodeStyle':_0x587334['textNodeStyle'],'onStreamUpdate':_0x587334['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x313efe,targetElement:_0x4d4900,abortSignal:_0x336f68}){this['isStreaming']&&this['stop'](),_0x336f68?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x1eeb47(_0x313efe,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x215bd6=0x0;_0x215bd6<this['currentIndex'];_0x215bd6++)this['nodesList'][_0x215bd6]['shouldBeStreamed']=!0x0;do{const _0x54c802=Date['now'](),_0xa9dcc7=this['nodesList'][this['currentIndex']],_0x18f530=_0x54c802-this['lastUpdateTime'];if(_0xa9dcc7){_0xa9dcc7['shouldBeStreamed']=!0x0;let _0x4063a1=_0xa9dcc7['parent'];for(;_0x4063a1;)_0x4063a1['shouldBeStreamed']=!0x0,_0x4063a1=_0x4063a1['parent'];}if(_0x18f530<this['options']['delay'])try{const {promise:_0x782cb6,abortController:_0x4f7e0e}=Ts(this['options']['delay']-_0x18f530);this['timeoutAbortController']=_0x4f7e0e,await _0x782cb6;}catch(_0x589e9d){return;}_0x547451(_0x4d4900,'<'+_0x4d4900['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x4d4900['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}['reset'](){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}['cleanUpAnimations']({targetElement:_0x491191}){Array['from'](_0x491191['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x57cffb=>{_0x57cffb['replaceWith'](_0x57cffb['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x37fa2d){let _0x12ae01='';if(function(_0x40f4e3){return _0x222dba(_0x40f4e3);}(_0x37fa2d)){for(const _0x5e0116 of _0x37fa2d['children'])_0x12ae01+=this['renderNode'](_0x5e0116);}else{if(Ns(_0x37fa2d)){if(!_0x37fa2d['shouldBeStreamed'])return'';const _0x2ef6a2=_0x37fa2d,_0x48f002=Object['entries'](_0x2ef6a2['attribs'])['map'](([_0x4d5814,_0x34a4ed])=>_0x4d5814+'=\x22'+_0x34a4ed+'\x22')['join']('\x20');_0x12ae01+='<'+_0x2ef6a2['tagName']+(_0x48f002?'\x20'+_0x48f002:'')+'>';for(const _0x2d337a of _0x32f300(_0x2ef6a2))_0x12ae01+=this['renderNode'](_0x2d337a);_0x12ae01+='</'+_0x2ef6a2['tagName']+'>';}else{if(!Ss(_0x37fa2d))return'';if(!_0x37fa2d['shouldBeStreamed'])return'';!function(_0x5485e3){if(!_0x5485e3['parent']||!Ns(_0x5485e3['parent']))return!0x1;if(!ys['includes'](_0x5485e3['parent']['tagName']))return!0x1;return!_0xfa78d1(_0x5485e3)['match'](/^\s*[<>]\s*$/);}(_0x37fa2d)?_0x12ae01+=_0x262be4(_0x37fa2d):_0x12ae01+=_0x262be4(new _0x2f67ed('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x37fa2d]));}}return _0x12ae01;}['getParsedDocumentNodeList'](){const _0x79e489=[];return function(_0x4dba73,_0x74d204){const _0x2b0761=_0x10a9b4=>{if(_0x74d204(_0x10a9b4),_0x10a9b4 instanceof _0x20118f)for(let _0x3358e2=0x0;_0x3358e2<_0x10a9b4['children']['length'];_0x3358e2++){const _0x57d745=_0x10a9b4['children'][_0x3358e2];_0x2b0761(_0x57d745);}};for(let _0x2a8de1=0x0;_0x2a8de1<_0x4dba73['children']['length'];_0x2a8de1++)_0x2b0761(_0x4dba73['children'][_0x2a8de1]);}(this['document'],_0x677fd1=>{if(Ss(_0x677fd1)){const _0x20f014=this['splitTextNodeIntoWordNodes'](_0x677fd1);_0x20f014['length']&&_0x79e489['push'](..._0x20f014);}_0x677fd1['isWordSplitSource']||_0x677fd1['isWordSplitResult']||_0x79e489['push'](_0x677fd1);}),_0x79e489;}['splitTextNodeIntoWordNodes'](_0x62d6be){if(_0x62d6be['isWordSplitSource']||_0x62d6be['isWordSplitResult'])return[];const _0x53a802=_0xfa78d1(_0x62d6be)['match'](/(?:\s*\S+\s*)/g),_0x24822c=[];if(_0x53a802&&_0x53a802['length']>0x1){for(const _0x4c5496 of _0x53a802){const _0x34a6ac=new _0x231d87(_0x4c5496);_0x34a6ac['isWordSplitResult']=!0x0,_0x6339ff(_0x62d6be,_0x34a6ac),_0x24822c['push'](_0x34a6ac);}_0x62d6be['isWordSplitSource']=!0x0,_0x1a4c2d(_0x62d6be);}return _0x24822c;}}const ys=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Ss(_0x2b8dc7){return _0x4cc27e(_0x2b8dc7);}function Ns(_0x3b2ab8){return _0x58cce0(_0x3b2ab8);}function Ts(_0x3d2c46){const _0x5e8390=new AbortController();return{'promise':new Promise((_0x39c1e8,_0x24121c)=>{const _0x42c383=setTimeout(_0x39c1e8,_0x3d2c46);_0x5e8390['signal']['addEventListener']('abort',()=>{clearTimeout(_0x42c383),_0x24121c();});}),'abortController':_0x5e8390};}class Fr extends _0x3836c7{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x2da4f3){super();const _0x2d9022=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x2da4f3,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x2d9022['if']('isDone','ck-ai-chat__feed__item_done'),_0x2d9022['if']('isVisible','ck-hidden',_0x25ad2b=>!_0x25ad2b),'ck-ai-chat__feed__text-item'],'data-cke-ai-id':this['options']['id']},'children':this['children']});}['markAsDone'](){this['htmlStreamer']['cleanUpAnimations']({'targetElement':this['element']}),this['element']['querySelectorAll']('[data-id]')['forEach'](_0x38d709=>{_0x38d709['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x112bd8,_0x298dbc,_0x5a124f){await this['htmlStreamer']['stream']({'document':_0x112bd8,'targetElement':_0x298dbc,'abortSignal':_0x5a124f});}}class oa extends _0x3836c7{['showChangesToggleView'];constructor(_0x874449,_0xe4591){super(_0x874449),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Ur(_0x874449),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x874449,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0xe4591['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x324cca=>_0x324cca?_0x1b1360:_0xb70345),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0xdb49d4=new _0x1254c7();_0xdb49d4['content']=_0x190e7a,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0xe4591['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0xdb49d4,{'tag':'span','children':[i(_0x874449,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Ur extends _0x480cf4{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const Wr={'accepted':_0x38e5bf,'rejected':_0x39c3e0,'outdated':_0x39c3e0};class ws extends _0x3836c7{['stateIconView'];constructor(_0x1f9c19){super(_0x1f9c19);const _0x15cba8=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new Yr(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x15cba8['to']('state',_0x12aca0=>'ck-ai-suggestion__content-part-state_'+_0x12aca0),_0x15cba8['if']('isVisible','ck-hidden',_0x1ef13e=>!_0x1ef13e)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x15cba8['to']('state',_0x4f409c=>{switch(_0x4f409c){case'accepted':return i(_0x1f9c19,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return i(_0x1f9c19,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return i(_0x1f9c19,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x1e0cde){this['state']=_0x1e0cde;}}class Yr extends _0x1254c7{constructor(){super(),this['set']('state','accepted'),this['content']=Wr[this['state']],this['on']('change:state',()=>{this['content']=Wr[this['state']];});}}class cs extends _0x286a6e{['_applyButton'];['_suggestButton'];constructor(_0x1db013,_0x10c317,_0x4918f8){super(_0x1db013);const _0x488d4f=Boolean(_0x4918f8);this['set']('isEnabled',!_0x488d4f),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x9a25d5=[];if(_0x488d4f){const _0x173486=new _0x480cf4(_0x1db013);_0x173486['set']({'label':i(_0x1db013,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x2f68b5}),_0x9a25d5['push'](_0x173486);}else{_0x10c317['includes']('applySuggestion')&&(this['_applyButton']=new _0x480cf4(_0x1db013),this['_applyButton']['set']({'label':i(_0x1db013,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x38e5bf}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x9a25d5['push'](this['_applyButton'])),_0x10c317['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x480cf4(_0x1db013),this['_suggestButton']['set']({'label':i(_0x1db013,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x2bb531}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x9a25d5['push'](this['_suggestButton']));const _0x252b1b=new _0x480cf4(_0x1db013);_0x252b1b['set']({'label':i(_0x1db013,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x39c3e0}),_0x252b1b['bind']('isEnabled')['to'](this),_0x252b1b['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x9a25d5['push'](_0x252b1b);}this['items']['addMany'](_0x9a25d5);const _0x378074=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x378074['if']('isVisible','ck-hidden',_0x17e63e=>!_0x17e63e)]}});}['setButtonsVisibility']({showApplyButton:_0x3936c9,showSuggestButton:_0x1d05f8}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x3936c9),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x1d05f8);}}class Vn extends _0x3836c7{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x322eb1,{part:_0x5bcf6b,uiIndex:_0x595642,availableActions:_0x1f898c,areActionsDisabled:_0x295e47}){super(_0x322eb1),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new cs(_0x322eb1,_0x1f898c,_0x295e47),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x5bcf6b['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x5bcf6b['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x5bcf6b['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new ws(_0x322eb1),this['titleLabelView']=new Sn(_0x322eb1,_0x595642),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],this['toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x492657,_0x439caa,_0x195162,_0x34abcb)=>{'pending'===_0x34abcb?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x195162?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x195162),this['children']['add'](this['stateView']));});}}class Sn extends _0x3836c7{constructor(_0x2c02c6,_0x294ad0){super(_0x2c02c6),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x2c02c6,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x294ad0['toString']())]});}}class as extends _0x3836c7{['htmlStreamer'];constructor(_0x447745){super(_0x447745),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x5df621,renderingStrategy:_0x51d200,abortSignal:_0x33443a}){'streaming'===_0x51d200?await this['htmlStreamer']['stream']({'document':_0x5df621['content'],'targetElement':this['element'],'abortSignal':_0x33443a}):this['element']['innerHTML']=xt(_0x5df621['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0x3836c7{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x573930,{part:_0x1b9184,uiIndex:_0x57aa6b,areActionsDisabled:_0x35991d,availableActions:_0x6f26e8}){super(_0x573930);const _0xb6e64d=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x56c0d1=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x35991d;};this['on']('change:state',_0x56c0d1),this['on']('change:isDone',_0x56c0d1),_0x56c0d1(),this['_children']=this['createCollection'](),this['_headerView']=new Vn(_0x573930,{'part':_0x1b9184,'uiIndex':_0x57aa6b,'availableActions':_0x6f26e8,'areActionsDisabled':_0x35991d}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...ft)['to'](this),this['_streamableContentView']=new as(_0x573930),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0xb6e64d['to']('state',_0x595a0c=>'ck-ai-suggestion__body__content-part_'+_0x595a0c),_0xb6e64d['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0xb6e64d['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0xb6e64d['if']('isVisible','ck-hidden',_0x545ea0=>!_0x545ea0)]},'children':this['_children'],'on':{'mouseenter':_0xb6e64d['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x1b9184['index']});}),'mouseleave':_0xb6e64d['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x1b9184['index']});}),'click':_0xb6e64d['to'](_0x33f85a=>{const _0x46b1da=_0x33f85a['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x46b1da)&&this['fire']('showChangeInText',{'index':_0x1b9184['index']});})}});}async['updateContent']({part:_0x4eb216,renderingStrategy:_0x3ec1f9,showUnchangedParts:_0x419127=!0x1,abortSignal:_0x4cc9e5}){this['partDefinition']=_0x4eb216,this['isVisible']=this['partDefinition']['hasChanges']||_0x419127,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x4eb216,'renderingStrategy':_0x3ec1f9,'abortSignal':_0x4cc9e5});}['markAsDone'](){this['isDone']=!0x0;}}class z extends _0x3ea0e5(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x398671){const _0x1b221f=this['createTask'](_0x398671);return this['queue']['push'](_0x1b221f),this['_processQueue'](),_0x1b221f['completePromise'];}['abort'](){this['isProcessing']&&(this['_abortController']['abort'](),this['_abortController']=void 0x0,this['queue']=[],this['fire']('_queueEmpty'),this['isProcessing']=!0x1);}get['queueEmptyPromise'](){return this['queue']['length']||this['isProcessing']?new Promise(_0x3d1722=>{this['once']('_queueEmpty',()=>{_0x3d1722();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x207ce9=this['queue']['shift']();try{await _0x207ce9['callback'](this['_abortController']['signal']),_0x207ce9['resolve']();}catch(_0x4bdb55){_0x207ce9['reject'](_0x4bdb55);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x4a5969){let _0x125c1f,_0x1c36f7;const _0x5de605=new Promise((_0x267f9c,_0x112312)=>{_0x125c1f=_0x267f9c,_0x1c36f7=_0x112312;});return{'callback':_0x4a5969,'resolve':_0x125c1f,'reject':_0x1c36f7,'completePromise':_0x5de605};}}class We extends Fr{constructor(_0x357876){super(_0x357876),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x357876['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x19ffce){this['element']['innerHTML']=_0x19ffce;}}const ot=['applySuggestion','insertSuggestion'];class ra extends _0x3836c7{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x1749c1,_0x403480=[...ot],_0x4acdf9){super(_0x1749c1);const _0x3853e9=this['bindTemplate'],_0x1f9db4=Boolean(_0x4acdf9);if(this['set']('isEnabled',!_0x1f9db4),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x1f9db4){const _0x52920d=new _0x480cf4(_0x1749c1);_0x52920d['set']({'label':i(_0x1749c1,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x2f68b5});const _0x2cd351=new _0x3836c7(_0x1749c1);_0x2cd351['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[i(_0x1749c1,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x52920d]}]}),this['children']['add'](_0x2cd351);}else this['_applyChangesButton']=new _0x480cf4(_0x1749c1),this['_applyChangesButton']['set']({'label':i(_0x1749c1,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x403480['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x480cf4(_0x1749c1),this['_insertSuggestionsButton']['set']({'label':i(_0x1749c1,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x403480['includes']('insertSuggestion'),'class':'ck-ai-button-secondary'}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x3db7d7=>{_0x3db7d7['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']]);this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x3853e9['if']('isVisible','ck-hidden',_0x8f8ee4=>!_0x8f8ee4)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x3ce205){this['isVisible']=_0x3ce205;}['_switchButtonLabelsPlurality'](_0x47036f){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x47036f?(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class Sr extends _0x3836c7{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x684b1a,_0x2816ca){super(_0x684b1a),this['bodyCollection']=_0x2816ca,this['children']=this['createCollection'](),this['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources',this['bindTemplate']['if']('isVisible','ck-hidden',_0x2eb7ce=>!_0x2eb7ce)]},'children':this['children']});const _0x5a38e7=new _0x3836c7(this['locale']),_0x46c84d=new _0x1254c7();_0x46c84d['content']=_0x650eff,_0x5a38e7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x46c84d,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x5a38e7),this['_setupBalloonPanel'](_0x684b1a);}['addSource'](_0x84f2ca){this['children']['add'](new qr(this['locale'],_0x84f2ca,this['balloonPanelView']));}['_setupBalloonPanel'](_0xba5a91){this['balloonPanelView']=new _0x5019ab(_0xba5a91),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class qr extends _0x480cf4{['balloonPanelView'];['source'];constructor(_0x3c4a54,_0x20176a,_0x3c6b38){super(_0x3c4a54),this['source']=_0x20176a,this['balloonPanelView']=_0x3c6b38,this['set']({'label':_0x20176a['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x5259c4=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x5259c4['to'](()=>{window['open'](_0x20176a['url'],'_blank');}),'mouseenter':_0x5259c4['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x5259c4['to'](()=>{this['_hideTooltip']();})}}),_0x20176a['favicon']){const _0x3c71cf=new _0x3836c7(_0x3c4a54);_0x3c71cf['setTemplate']({'tag':'img','attributes':{'src':_0x20176a['favicon']||_0x650eff,'alt':_0x20176a['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x3c71cf);}else this['set']('icon',_0x650eff);}['_createTooltipContentView'](_0x1320d9,_0xa9621){const _0x16567c=new _0x3836c7(_0x1320d9),_0x3979bf=[];let _0x13d2e2;_0xa9621?.['favicon']?(_0x13d2e2=new _0x3836c7(_0x1320d9),_0x13d2e2['setTemplate']({'tag':'img','attributes':{'src':_0xa9621['favicon'],'alt':_0xa9621['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x13d2e2=new _0x1254c7(),_0x13d2e2['content']=_0x650eff,_0x13d2e2['extendTemplate']({'attributes':{'alt':_0xa9621['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x3979bf['push'](_0x13d2e2);const _0x39d308=new _0x3836c7(_0x1320d9);_0x39d308['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0xa9621['url']},'children':[{'text':new URL(_0xa9621['url'])?.['hostname']}]}),_0x3979bf['push'](_0x39d308);const _0x1f327f=new _0x3836c7(_0x1320d9);_0x1f327f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x3979bf});const _0x3f180d=new _0x3836c7(_0x1320d9);return _0x3f180d['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0xa9621['title']['length']>0x190?_0xa9621['title']['substring'](0x0,0x190)+'...':_0xa9621['title']}]}),_0x16567c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x1f327f,_0x3f180d]}),_0x16567c;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x5019ab['defaultPositions']['northArrowSouth'],_0x5019ab['defaultPositions']['northArrowSouthWest'],_0x5019ab['defaultPositions']['northArrowSouthEast']],'limiter':document['querySelector']('.ck-ai-chat')}),this['balloonPanelView']['show']();}['_hideTooltip'](){this['balloonPanelView']['hide']();}['_updateTooltipContent'](){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0x3e7d79=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x3e7d79);}}class ga extends _0x3836c7{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x3c447f,_0x49c690){super(_0x3c447f);const {areActionsDisabled:_0x2ec4e6,showUnchangedParts:_0x9d4b3,availableActions:_0x56b459}=_0x49c690;this['_areActionsDisabled']=_0x2ec4e6,this['_showUnchangedParts']=_0x9d4b3,this['_availableActions']=_0x56b459,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new z(),this['_emptyPartsWarningView']=new We({'id':'empty-parts-warning','initialContent':i(_0x3c447f,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x3c447f,_0x49c690['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sr(this['locale'],_0x49c690['bodyCollection']),_0x49c690['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...ft)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x5a6d1f,renderingStrategy:_0x2ef14e,abortSignal:_0x26659d}){this['_children']['length']?_0x5a6d1f['forEach'](_0x3bc250=>{const _0x218a28=this['_cachedContentParts']['findIndex'](_0x55347f=>_0x55347f['index']==_0x3bc250['index']);-0x1===_0x218a28?this['_cachedContentParts']['push'](_0x3bc250):this['_cachedContentParts'][_0x218a28]=_0x3bc250;}):this['_cachedContentParts']=_0x5a6d1f;const _0x2039c4=this['_showUnchangedParts']?_0x5a6d1f:_0x5a6d1f['filter'](_0x3fb12e=>_0x3fb12e['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x2039c4['length']>0x1);for(const _0x43dd5f of _0x2039c4)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x31d888=>{let _0xf7c9d9=this['getPartView'](_0x43dd5f['index']);_0xf7c9d9||(_0xf7c9d9=new na(this['locale'],{'part':_0x43dd5f,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0xf7c9d9['delegate'](...ft)['to'](this),this['_children']['add'](_0xf7c9d9),this['hasPendingParts']=!0x0),await _0xf7c9d9['updateContent']({'part':_0x43dd5f,'renderingStrategy':_0x2ef14e,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x31d888}),_0xf7c9d9['markAsDone']();});return _0x26659d?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x4ba46d,_0x146820){const _0x354231=this['getPartView'](_0x4ba46d);_0x354231&&(_0x354231['state']=_0x146820),this['hasPendingParts']='pending'==_0x146820||Array['from'](this['_children'])['some'](_0x52054d=>'pending'==_0x52054d['state']);}['setPartActive'](_0x48aaa8,_0x59e7e7){if(!0x1===_0x48aaa8){for(const _0x589182 of this['_children'])_0x589182['isActive']=!0x1;}else{const _0x44c11d=this['getPartView'](_0x48aaa8);_0x44c11d&&(_0x44c11d['isActive']=_0x59e7e7);}}['updateSources'](_0x4c101c){_0x4c101c['forEach'](_0x80da99=>this['_sourcesView']['addSource'](_0x80da99)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x3cb785){return this['_children']['find'](_0x8bb18f=>_0x8bb18f['partDefinition']['index']==_0x3cb785)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x396fca=!this['_cachedContentParts']['find'](({hasChanges:_0x5910f6})=>_0x5910f6),_0x5b64d8=!!this['_cachedContentParts']['find'](({hasChanges:_0xf884c9})=>!_0xf884c9);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x5b64d8,_0x396fca?this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x351058=>_0x351058['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x4a75e8=>_0x4a75e8['partDefinition']['hasChanges'])['length']>0x0;}}class gn extends _0x3836c7{['bodyView'];['children'];['headerView'];constructor(_0x2d35e1,_0x454235,_0xfc92f6){super(_0x2d35e1);const {showDiff:_0x32d44f,areActionsDisabled:_0x177c9f,showUnchangedParts:_0x26b585,availableActions:_0x284634}=_0x454235;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0x2d35e1,{'showDiff':_0x32d44f}),this['headerView']['on']('toggleShowChanges',(_0x11994c,_0x4adefd)=>{this['areChangesVisible']=_0x4adefd['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x4adefd['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ga(_0x2d35e1,{'areActionsDisabled':_0x177c9f,'showUnchangedParts':!!_0x26b585,'availableActions':_0x284634,'bodyCollection':_0xfc92f6}),this['bodyView']['delegate'](...ft)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x4b9e25){await this['bodyView']['updateContentParts'](_0x4b9e25);}['updateSources'](_0x272f89){this['bodyView']['updateSources'](_0x272f89);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Fe extends Fr{['containerView'];constructor(_0x224fb6,_0x127f74,_0x43f322){super(_0x127f74),this['set']('isTrackChangesOn',!0x1),this['containerView']=new gn(_0x224fb6,{'showDiff':_0x127f74['showDiff'],'areActionsDisabled':_0x127f74['areActionsDisabled'],'availableActions':_0x127f74['availableActions']},_0x43f322),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x278834,_0x4f8859)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x4f8859['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x51ab30,{index:_0x4fc577})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x4fc577});}),this['containerView']['on']('applySuggestion',(_0x3e6570,{index:_0x86a6e}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x86a6e});}),this['containerView']['on']('insertSuggestion',(_0x4215d7,{index:_0x52bceb}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x52bceb});}),this['containerView']['on']('rejectSuggestion',(_0x3852c7,{index:_0x1c9ade})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1c9ade});}),this['containerView']['on']('mouseOverSuggestion',(_0x18d854,{index:_0x436f38})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x436f38});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x241d10,{index:_0x5c328a})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5c328a});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x37e576){await this['containerView']['updateContent'](_0x37e576);}['updatePartState'](_0x5573d8,_0x5944d7){this['containerView']['bodyView']['updatePartState'](_0x5573d8,_0x5944d7);}['setPartActive'](_0x356a4e,_0x475fec){!0x1===_0x356a4e?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x356a4e,_0x475fec);}['updateSources'](_0x4bad42){this['containerView']['updateSources'](_0x4bad42);}['getPartView'](_0x35e389){return this['containerView']['bodyView']['getPartView'](_0x35e389);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class Oe extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x231a4a,_0x392c99,_0xb73d77){super(_0x392c99),this['_bodyCollection']=_0xb73d77,this['locale']=_0x231a4a,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x3836c7(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':mr(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x5211f2,renderingStrategy:_0x4510d4,abortSignal:_0x2c53df}){'streaming'===_0x4510d4?await this['streamIntoElement'](_0x5211f2,this['replyContainer']['element'],_0x2c53df):this['replyContainer']['element']['innerHTML']=_0x262be4(_0x5211f2);}['updateSources'](_0x258ec9){const _0x5635fd=new Sr(this['locale'],this['_bodyCollection']);_0x5635fd['children']['addMany'](_0x258ec9['map'](_0x111b53=>new qr(this['locale'],_0x111b53,_0x5635fd['balloonPanelView']))),_0x5635fd['isVisible']=!0x0,this['children']['add'](_0x5635fd);}}class pi extends _0x526920{constructor(_0x4673c9=void 0x0){super();const _0x5c3acc=_0x4673c9?'ck-ai-spinner_'+_0x4673c9:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x5c3acc]}});}}const bn={'file':_0x3cc08b,'document':_0x5d90b9,'web-resource':_0x133ff9,'text':_0x3cc08b,'selection':_0xc0cfb2,'mcp-tool-context':_0x5d90b9},$r='ck-ai-chat-context-chip',Qr='ck-ai-chat-context-chip_wide',Xr='ck-ai-chat-context-chip_document',Zr='ck-ai-chat-context-chip__label',la='ck-ai-chat-context-chip__type-icon',ua='ck-ai-chat-context-controls__chip-tooltip',vn='n';class Co extends _0x480cf4{constructor(_0x5b231e,_0x1af5e3,_0x256133,_0x196b46,_0xa86e84=!0x1){super(_0x5b231e),this['_isAnimationOnEnterEnabled']=_0x196b46,this['_initializeProperties'](_0x1af5e3,_0x256133,_0xa86e84),this['_setupTemplate']();}['render'](){super['render'](),this['_isAnimationOnEnterEnabled']&&this['element']&&(this['element']['classList']['add']('ck-ai-chat-context-chip_new-chip'),this['_handleAnimationEndOnce'](this['element'],()=>{this['element']&&this['element']['classList']['remove']('ck-ai-chat-context-chip_new-chip');}));}['disableAnimationOnEnter'](){this['_isAnimationOnEnterEnabled']=!0x1,this['element']&&this['element']['classList']['remove']('ck-ai-chat-context-chip_new-chip');}['_initializeProperties'](_0x9b2772,_0x112d6f,_0x403a62){this['set']('label',_0x9b2772['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x9b2772['type']),this['set']('id',_0x9b2772['uiId']),this['set']('readonly',_0x112d6f),this['set']('isLoading',_0x403a62);}['_setupTemplate'](){const _0x524211=this['_createIconView'](),_0x508109=this['_createRemoveButton'](),_0x34f519=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x34f519),'children':this['_createTemplateChildren'](_0x524211,_0x508109,_0x34f519)});}['_createTemplateAttributes'](_0x109bbf){return{'class':[$r,_0x109bbf['if']('itemType',Xr,_0x30e282=>'document'==_0x30e282),_0x109bbf['if']('itemType',Qr,_0x855b7=>'selection'==_0x855b7)],'data-cke-tooltip-text':_0x109bbf['to']('label',yn),'data-cke-tooltip-position':vn,'data-cke-tooltip-class':ua};}['_createTemplateChildren'](_0x11c02b,_0x1a98ba,_0x4e1248){const _0xbac8a6=this['_createLabelElement'](_0x4e1248),_0x3a0e5d=this['_createLoaderIcon']();return this['readonly']?[_0x11c02b,_0xbac8a6]:[_0x11c02b,_0x3a0e5d,_0xbac8a6,_0x1a98ba];}['_createLabelElement'](_0x32e299){return{'tag':'span','attributes':{'class':Zr},'children':[{'text':_0x32e299['to']('label')}]};}['_createRemoveButton'](){const _0x4a9def=new _0x480cf4(this['locale']);return _0x4a9def['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x402a12}),this['_setupRemoveButtonEvent'](_0x4a9def),_0x4a9def;}['_setupRemoveButtonEvent'](_0x123a7d){_0x123a7d['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x33bcc1=this['bindTemplate'],_0x419588=new _0x1254c7();return _0x419588['content']=bn[this['itemType']],_0x419588['extendTemplate']({'attributes':{'class':[la,_0x33bcc1['if']('isLoading','ck-hidden',_0x16fc39=>_0x16fc39)]}}),_0x419588;}['_handleAnimationEndOnce'](_0x3d2aab,_0x1f501d){if(!_0x3d2aab)return;const _0x1ae8d3=()=>{_0x1f501d(),_0x3d2aab['removeEventListener']('animationend',_0x1ae8d3),_0x3d2aab['removeEventListener']('webkitAnimationEnd',_0x1ae8d3);};_0x3d2aab['addEventListener']('animationend',_0x1ae8d3),_0x3d2aab['addEventListener']('webkitAnimationEnd',_0x1ae8d3);}['_createLoaderIcon'](){const _0x5d8780=new pi('small');return _0x5d8780['bind']('isVisible')['to'](this,'isLoading',_0x48cdfc=>_0x48cdfc),_0x5d8780;}}function yn(_0x35f57a){if(!_0x35f57a)return _0x35f57a;if(_0x35f57a['length']<=0x78)return _0x35f57a;const _0x220ccc=_0x35f57a['slice'](0x0,0x78),_0x1aaa93=_0x220ccc['lastIndexOf']('\x20');return(_0x1aaa93>0x0?_0x220ccc['slice'](0x0,_0x1aaa93):_0x220ccc)+'…';}const wn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},dn='300px';class jo{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0xceece3,_0x334268,_0x221ff5,_0x2723fb,_0x43b244){this['_locale']=_0xceece3,this['_visibleChips']=_0x334268,this['_config']={...wn,..._0x221ff5,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x221ff5['cssClasses']}},this['_overflowChips']=new _0x1e3367(),this['_bodyCollection']=_0x2723fb,this['_parentView']=_0x43b244||null;}['setContainerElement'](_0x1f87e8){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x1f87e8,this['_setupVisibilityObserver']();}get['showMoreButtonView'](){return this['_showMoreButtonView'];}get['overflowChips'](){return this['_overflowChips'];}['reorganizeChips'](){requestAnimationFrame(()=>{this['_checkAndHandleOverflow']();});}['showBalloonPanel'](){this['_showMoreButtonView']&&this['_showMoreBalloonPanelView']&&(this['_updateBalloonContent'](),this['_showMoreButtonView']['isOn']=!0x0,this['_showMoreBalloonPanelView']['show'](),this['_showMoreBalloonPanelView']['pin']({'target':this['_showMoreButtonView']['element'],'limiter':document['querySelector']('.ck-ai-chat')}));}['hideBalloonPanel'](){this['_showMoreButtonView']&&this['_showMoreBalloonPanelView']&&(this['_showMoreButtonView']['isOn']=!0x1,this['_showMoreBalloonPanelView']['hide']());}['clear'](){this['_overflowChips']['clear'](),this['hideBalloonPanel'](),this['_updateShowMoreButtonVisibility'](),this['_showMoreButtonView']&&(this['_showMoreButtonView']['label']=''),this['_showMoreBalloonPanelView']&&this['_showMoreBalloonPanelView']['content']['clear']();}['destroy'](){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_showMoreButtonView']&&(this['_showMoreButtonView']['destroy'](),this['_showMoreButtonView']=null),this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['destroy'](),this['_showMoreBalloonPanelView']=null);}['_checkAndHandleOverflow'](){if(!this['_containerElement'])return;if(!this['_isContainerVisible']())return void(this['_pendingCalculation']=!0x0);this['_pendingCalculation']=!0x1;const _0x3df6fe=[...this['_visibleChips'],...this['_overflowChips']],_0x96c7e8=this['_createCalculationContainer'](),_0x23c138=this['_calculateOverflowInContainer'](_0x96c7e8,_0x3df6fe),_0x19601f=_0x96c7e8['_ancestorsToRestore'];_0x19601f&&this['_restoreAncestorVisibility'](_0x19601f),_0x96c7e8['remove'](),this['_applyOverflowResults'](_0x3df6fe,_0x23c138);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x366f04({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x331897=new _0x480cf4(this['_locale']);_0x331897['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x4dd56c=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x4dd56c['push'](this['_config']['cssClasses']['controlsButton']),_0x331897['extendTemplate']({'attributes':{'class':_0x4dd56c}}),_0x331897;}['_createShowMoreBalloonPanelView'](){const _0x2b20d1=new _0x5019ab(this['_locale']);return _0x2b20d1['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x2b20d1),_0x2b20d1;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x543efa=>{_0x543efa['disableAnimationOnEnter']();});const _0x16bddc=new _0x3836c7(this['_locale']);_0x16bddc['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x16bddc);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x40613a=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x40613a?'':'none');}['_repinBalloonPanel'](){this['_showMoreButtonView']?.['isOn']&&this['_showMoreBalloonPanelView']?.['isVisible']&&this['_showMoreButtonView']['element']&&this['_showMoreBalloonPanelView']['pin']({'target':this['_showMoreButtonView']['element'],'limiter':document['querySelector']('.ck-ai-chat')});}['_findTargetContainer'](_0x427c63){const _0x15322b=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x1c385c=this['_containerElement']?.['classList'];if(_0x1c385c){const _0x9fb73=_0x1c385c[0x0]||'',_0x6d99a6=_0x427c63['querySelector']('.'+_0x9fb73),_0x38e2f8=_0x427c63['querySelector'](_0x15322b);return _0x6d99a6||_0x38e2f8||_0x427c63;}return _0x427c63['querySelector'](_0x15322b)||_0x427c63;}['_calculateContainerWidth'](){const _0x25a0d0=this['_parentView']?.['element']||this['_containerElement'];if(!_0x25a0d0)return dn;const _0x1ca6df=window['getComputedStyle'](_0x25a0d0)['width'];if('auto'===_0x1ca6df||'0px'===_0x1ca6df||!_0x1ca6df){const _0x11abf9=_0x25a0d0['parentElement'];if(_0x11abf9){const _0x578901=window['getComputedStyle'](_0x11abf9);return'auto'!==_0x578901['width']?_0x578901['width']:dn;}return dn;}return _0x1ca6df;}['_applyCalculationStyles'](_0x2d7f3e,_0x4e2b25){this['_config']['cssClasses']['calculationContainer']&&_0x2d7f3e['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x2d7f3e['style']['width']=_0x4e2b25,_0x2d7f3e['style']['position']='absolute',_0x2d7f3e['style']['top']='-9999px',_0x2d7f3e['style']['left']='-9999px',_0x2d7f3e['style']['opacity']='0',_0x2d7f3e['style']['pointerEvents']='none',_0x2d7f3e['style']['zIndex']='-1',_0x2d7f3e['style']['visibility']='visible\x20!important',_0x2d7f3e['style']['display']='block\x20!important',_0x2d7f3e['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x5a45df){_0x5a45df['forEach'](({element:_0x1c81ed,originalDisplay:_0x402669,originalVisibility:_0x1c3248})=>{_0x1c81ed['style']['display']=_0x402669,_0x1c81ed['style']['visibility']=_0x1c3248;});}['_makeAncestorsVisible'](_0x5680fc){const _0xe01dca=[];let _0x389a05=_0x5680fc;for(;_0x389a05&&_0x389a05!==document['body'];){const _0x1fc132=window['getComputedStyle'](_0x389a05);'none'!==_0x1fc132['display']&&'hidden'!==_0x1fc132['visibility']||(_0xe01dca['push']({'element':_0x389a05,'originalDisplay':_0x389a05['style']['display'],'originalVisibility':_0x389a05['style']['visibility']}),_0x389a05['style']['display']='block',_0x389a05['style']['visibility']='visible'),_0x389a05=_0x389a05['parentElement'];}return _0xe01dca;}['_createContainerElements'](){let _0x1a4ad6,_0x4659ee;return this['_parentView']?.['element']?(_0x1a4ad6=this['_parentView']['element']['cloneNode'](!0x0),_0x4659ee=this['_findTargetContainer'](_0x1a4ad6)):(_0x1a4ad6=document['createElement']('div'),_0x4659ee=_0x1a4ad6),{'calculationContainer':_0x1a4ad6,'targetContainer':_0x4659ee};}['_createCalculationContainer'](){const {calculationContainer:_0x517e9a,targetContainer:_0x3a577f}=this['_createContainerElements'](),_0x137a15=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x517e9a,_0x137a15);const _0x48c5c6=this['_parentView']?.['element']||this['_containerElement'],_0x3d1514=_0x48c5c6?.['parentElement'];_0x3d1514?_0x3d1514['appendChild'](_0x517e9a):document['body']['appendChild'](_0x517e9a),_0x517e9a['_targetContainer']=_0x3a577f;const _0x2d008a=this['_makeAncestorsVisible'](_0x3d1514||null);return _0x517e9a['offsetWidth'],_0x517e9a['_ancestorsToRestore']=_0x2d008a,_0x517e9a;}['_calculateOverflowInContainer'](_0x596f16,_0x498e96){const _0x27f138=_0x596f16['_targetContainer']||_0x596f16,_0x1aede9=[],{rowCount:_0x5b6111}=this['_renderChipsAndCountRows'](_0x27f138,_0x498e96);if(_0x5b6111<=this['_config']['maxVisibleRows'])return _0x1aede9;const _0x152a37=_0x498e96['slice']();for(;_0x152a37['length']>0x0;){if(this['_testButtonFit'](_0x596f16,_0x27f138,_0x152a37)){const _0x40076a=_0x498e96['filter'](_0x2d33c2=>!_0x152a37['includes'](_0x2d33c2));_0x1aede9['push'](..._0x40076a);break;}if(!_0x152a37['pop']())break;}return _0x1aede9;}['_renderChipsAndCountRows'](_0x22f5c0,_0x553031){_0x22f5c0['innerHTML']='',_0x553031['forEach'](_0xef9b56=>{if(_0xef9b56['element']){const _0x41d1fd=_0xef9b56['element']['cloneNode'](!0x0);_0x22f5c0['appendChild'](_0x41d1fd);}}),_0x22f5c0['offsetWidth'];const _0x3cb747=_0x22f5c0['children'],_0x3fbbd0=[];return Array['from'](_0x3cb747)['forEach'](_0xa6e361=>{const _0x443fe8=_0xa6e361['getBoundingClientRect']()['top'];_0x3fbbd0['some'](_0x31759f=>Math['abs'](_0x31759f-_0x443fe8)<this['_config']['rowDetectionTolerance'])||_0x3fbbd0['push'](_0x443fe8);}),{'rowCount':_0x3fbbd0['length']};}['_createMockButton'](){const _0x3a83bf=document['createElement']('button');return _0x3a83bf['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x3a83bf['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x3a83bf['textContent']='+\x201',_0x3a83bf;}['_testButtonFit'](_0x10e590,_0x14acce,_0x1838c6){this['_renderChipsAndCountRows'](_0x14acce,_0x1838c6);const _0x14ae60=this['_createMockButton']();_0x10e590['appendChild'](_0x14ae60),_0x10e590['offsetWidth'];const _0x4b64de=[..._0x14acce['children'],_0x14ae60],_0x45e6e4=[];_0x4b64de['forEach'](_0x5f04c3=>{const _0x2592da=_0x5f04c3['getBoundingClientRect']()['top'];_0x45e6e4['some'](_0x40fd00=>Math['abs'](_0x40fd00-_0x2592da)<this['_config']['rowDetectionTolerance'])||_0x45e6e4['push'](_0x2592da);});const _0x48551b=_0x45e6e4['length'];return _0x14ae60['remove'](),_0x48551b<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x4d2917,_0x3e93a1){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x4d2917['forEach'](_0x492973=>{_0x3e93a1['includes'](_0x492973)?this['_overflowChips']['add'](_0x492973):this['_visibleChips']['add'](_0x492973);});}['_updateOverflowUI'](_0x211dea){if(_0x211dea>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x211dea>0x0&&this['_showMoreButtonView']){const _0x390525=''+this['_config']['showMoreLabelPrefix']+(_0x211dea<0x63?_0x211dea:'99');this['_showMoreButtonView']['label']=_0x390525;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x36c045,_0x24c43c){this['_distributeChips'](_0x36c045,_0x24c43c),this['_updateOverflowUI'](_0x24c43c['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x1e8bd1=>{_0x1e8bd1[0x0]['isIntersecting']&&this['_pendingCalculation']&&requestAnimationFrame(()=>{this['_checkAndHandleOverflow']();});},{'threshold':0.01,'rootMargin':'50px'}),this['_intersectionObserver']['observe'](this['_containerElement']));}['_isContainerVisible'](){if(!this['_containerElement'])return!0x1;if(!this['_containerElement']['isConnected'])return!0x1;const _0x371e93=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x371e93['width']||0x0===_0x371e93['height'])return!0x1;const _0x5a7468=window['innerHeight']||document['documentElement']['clientHeight'],_0x444d07=window['innerWidth']||document['documentElement']['clientWidth'],_0x46bf92=0xc8;return _0x371e93['bottom']>=-0xc8&&_0x371e93['top']<=_0x5a7468+_0x46bf92&&_0x371e93['right']>=-0xc8&&_0x371e93['left']<=_0x444d07+_0x46bf92;}}const da='ck-ai-chat__feed__context-chips',Aa='ck-ai-chat-context-chips-wrapper',Ia='ck-ai-chat-context-chips-wrapper-balloon',Ea='ck-ai-chat-controls-button',Ta='ck-ai-chat-controls_context_show-more-button',pa='ck-ai-chat-context-controls__show-more-balloon-panel';class th extends _0x3836c7{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x15fdd2,_0x10014e,_0x58252e){super(_0x15fdd2),this['_bodyCollection']=_0x58252e,this['_createContextChips'](_0x10014e);const _0x3cbafd={'cssClasses':{'showMoreButton':Ta,'showMoreBalloon':pa,'overflowContainer':Ia,'controlsButton':Ea}};this['_overflowManager']=new jo(_0x15fdd2,this['_contextChips'],_0x3cbafd,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[da,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Aa},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x4d7bed=this['element']['querySelector']('.'+Aa);_0x4d7bed&&(this['_overflowManager']['setContainerElement'](_0x4d7bed),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0xb01e38){for(const _0x35a001 of _0xb01e38){const _0x5ba219=new Co(this['locale'],_0x35a001,!0x0,!0x1);this['_contextChips']['add'](_0x5ba219);}}}class Be extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x1c4a9a,_0x24b733,_0x15802d){super(_0x24b733),this['_locale']=_0x1c4a9a,this['_bodyCollection']=_0x15802d,this['_createContextChipsView'](),this['_createMessageContentView'](),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__user-message']}});}['_createContextChipsView'](){this['options']['contextItems']&&this['options']['contextItems']['length']>0x0&&(this['_contextChipsView']=new th(this['_locale'],this['options']['contextItems']['filter'](_0x39fdbf=>!_0x39fdbf['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x3836c7(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class bt extends Fr{['capabilities'];constructor(_0x456ec1,_0x19a96a){super(_0x19a96a);const {isWebSearchEnabled:_0x3da1a7,isReasoningEnabled:_0x146467}=_0x19a96a['capabilities'],_0x15e371=[];let _0x2bc341='';_0x3da1a7&&_0x146467?(_0x2bc341=i(_0x456ec1,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x15e371['push'](ca(_0x650eff)),_0x15e371['push'](ca(_0x3fa3c9))):_0x3da1a7?(_0x2bc341=i(_0x456ec1,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x15e371['push'](ca(_0x650eff))):_0x146467&&(_0x2bc341=i(_0x456ec1,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x15e371['push'](ca(_0x3fa3c9))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x2bc341?'':'ck-hidden']}});const _0x5af714=new _0x3836c7();_0x5af714['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x15e371,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x2bc341]}]}),this['children']['add'](_0x5af714),this['capabilities']=_0x19a96a['capabilities'];}}function ca(_0x5992f3){const _0x364c45=new _0x1254c7();return _0x364c45['content']=_0x5992f3,_0x364c45;}const Fs=['wheel','touchstart','pointerdown','keydown'],Us=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Je{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x2838d6){this['element']=_0x2838d6,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x466979 of Fs){const _0x1e8536='keydown'!==_0x466979;this['element']['addEventListener'](_0x466979,this['_onUserEvent']['bind'](this),{'passive':_0x1e8536,'signal':this['abortController']['signal']});}}['start'](){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}['stop'](){requestAnimationFrame(()=>{this['_stop']();});}['destroy'](){this['_stop'](),this['abortController']['abort']();}['_stop'](){null!==this['animationFrameId']&&(cancelAnimationFrame(this['animationFrameId']),this['animationFrameId']=null),this['isRunning']&&(this['isRunning']=!0x1),this['isUserPaused']=!0x1;}['_onUserEvent'](_0x4bd7cd){if(this['isRunning']){if('keydown'===_0x4bd7cd['type']){const _0x495ace=_0x4bd7cd['key'];if(!Us['includes'](_0x495ace))return;}_0x4bd7cd instanceof WheelEvent?_0x4bd7cd['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x5e923,scrollHeight:_0x1e85bc,clientHeight:_0x504555}=this['element'];return _0x1e85bc-_0x5e923-_0x504555<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class Ei extends _0x3836c7{constructor(_0x3e27ec,_0x45abeb){super(_0x3e27ec),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x45abeb)});}['_createSkeletonItems'](_0x461e75){const _0x2d5066=['ck','ck-ai-skeleton__item'];return _0x461e75['map'](_0x51f491=>{let _0x52b9f7='';switch(_0x51f491['attributes']['align']){case'right':_0x52b9f7='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x52b9f7='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x52b9f7='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x51f491['tag'],'attributes':{'class':[..._0x2d5066,_0x51f491['attributes']['class']?_0x51f491['attributes']['class']:''],'style':'width:\x20'+_0x51f491['attributes']['width']+';\x20height:\x20'+_0x51f491['attributes']['height']+';'+_0x52b9f7}};});}}const Si={'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':ta(0x5,'100%','44px','right'),'aiChatResources':ta(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function ta(_0x10d485,_0x26866c,_0xbe2a28,_0x15208c){return new Array(_0x10d485)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x26866c,'height':_0xbe2a28,'align':_0x15208c}}));}class Ke extends Fr{constructor(_0x21113d){super(_0x21113d),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class ji extends _0x3836c7{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x1c497f,_0x3c5d9b){super(_0x1c497f),this['_bodyCollection']=_0x3c5d9b,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Ft)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Je(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x4e90c8,_0x583751){let _0x453463;return'ai-reply'===_0x4e90c8?_0x453463=new Oe(this['locale'],_0x583751,this['_bodyCollection']):'ai-suggestion-reply'===_0x4e90c8?(_0x453463=new Fe(this['locale'],_0x583751,this['_bodyCollection']),_0x453463['bind']('isTrackChangesOn')['to'](this)):_0x453463='user-message'===_0x4e90c8?new Be(this['locale'],_0x583751,this['_bodyCollection']):'interaction-header'===_0x4e90c8?new bt(this['locale'],_0x583751):'custom-element'===_0x4e90c8?new Ke(_0x583751):new We(_0x583751),this['children']['add'](_0x453463),_0x453463;}async['updateReplyItem']({id:_0x12e5d4,parsedContent:_0x5aa394,renderingStrategy:_0x170951,abortSignal:_0x40a4fc}){const _0x18049d=this['getItemById'](_0x12e5d4);if(!(_0x18049d instanceof Oe))throw new _0x5a06e8('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x18049d,'id':_0x12e5d4,'parsedContent':_0x5aa394});await _0x18049d['updateContent']({'parsedContent':_0x5aa394,'renderingStrategy':_0x170951,'abortSignal':_0x40a4fc});}async['updateWebSources'](_0x556508,_0x48bd91){const _0x16b92d=this['getItemById'](_0x556508);if(_0x16b92d instanceof Fe)_0x16b92d['updateSources'](_0x48bd91);else{if(!(_0x16b92d instanceof Oe))throw new _0x5a06e8('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x16b92d,'id':_0x556508,'sources':_0x48bd91});_0x16b92d['updateSources'](_0x48bd91);}}async['updateSuggestionItem']({id:_0x978542,parts:_0x41c2b9,renderingStrategy:_0x2d9411,abortSignal:_0x40b960}){const _0x441f87=this['getItemById'](_0x978542);if(!(_0x441f87 instanceof Fe))throw new _0x5a06e8('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x441f87,'id':_0x978542,'parts':_0x41c2b9});await _0x441f87['updateContent']({'parts':_0x41c2b9,'renderingStrategy':_0x2d9411,'abortSignal':_0x40b960});}['updateSuggestionPartState']({id:_0x2f4c60,index:_0x2cf877,state:_0x2aee82}){const _0x4e5a7c=this['getItemById'](_0x2f4c60);if(!(_0x4e5a7c instanceof Fe))throw new _0x5a06e8('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x2f4c60});_0x4e5a7c['updatePartState'](_0x2cf877,_0x2aee82);}['setSuggestionPartActive']({id:_0x1feeb9,index:_0xc3c4a7,isActive:_0x478fea}){const _0x11a23a=this['getItemById'](_0x1feeb9);if(!(_0x11a23a instanceof Fe))throw new _0x5a06e8('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x1feeb9});this['children']['filter'](_0x93f74d=>_0x93f74d instanceof Fe)['forEach'](_0x313df3=>{_0x313df3['setPartActive'](!0x1);}),_0x11a23a['setPartActive'](_0xc3c4a7,_0x478fea);}['markItemAsDone'](_0x1938b4){this['getItemById'](_0x1938b4)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x4df507=>_0x4df507['options']['id']);}['removeItem'](_0x43f3ce){this['children']['remove'](this['getItemById'](_0x43f3ce));}['hasItem'](_0x49fd9a){return!!this['children']['find'](_0x32d35f=>_0x32d35f['options']['id']['includes'](_0x49fd9a));}['scrollToSuggestion'](_0x2c5288,_0x4bb576){const _0x471fdd=this['getItemById'](_0x2c5288);if(!(_0x471fdd instanceof Fe))return void _0x365bde('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x2c5288,'partIndex':_0x4bb576});const _0x4299ae=_0x471fdd['getPartView'](_0x4bb576);_0x4299ae?_0x2da007(_0x4299ae['element'],0x14,this['element']['parentElement'],!0x0,!0x0):_0x365bde('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x2c5288,'partIndex':_0x4bb576});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x26fefa=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x26fefa,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x2c8cdd=new Ei(this['locale'],Si['aiFeed']);return _0x2c8cdd['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x349aae=>!_0x349aae)]}}),_0x2c8cdd;}['_createFeedItems'](){const _0x35e062=new _0x3836c7(this['locale']);return _0x35e062['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x35e062;}['_createFeedLoader'](){const _0x4a54fa=new _0x3836c7(this['locale']);return _0x4a54fa['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x440545=>!_0x440545)]},'children':this['_createLoaderChildren']()}),_0x4a54fa;}['_createLoaderChildren'](){const _0x77adf1=new pi();return _0x77adf1['isVisible']=!0x0,[_0x77adf1,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x40f4ef){const _0x3fc0c5=this['children']['find'](_0x4b0969=>_0x4b0969['options']['id']['includes'](_0x40f4ef));if(!_0x3fc0c5)throw new _0x5a06e8('ai-chat-feed-view-item-not-found',this,{'id':_0x40f4ef});return _0x3fc0c5;}['setLoadingMessage'](_0x2db2f4){this['set']('loadingMessage',_0x2db2f4);}['toggleLoadingSkeleton'](_0x49e22d){this['set']('isLoadingSkeletonVisible',_0x49e22d);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class ah extends _0x2c9917{['filter'](){let _0xf9873f=0x0;for(const _0x40237c of this['items'])_0xf9873f+=_0x40237c['items']['length'];return{'resultsCount':_0xf9873f,'totalItemsCount':_0xf9873f};}}const ph='ck-ai-chat__prompt-input_highlighted';class _s extends _0x7d0bae{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x52bbd0,_0x2d2b93){super(_0x52bbd0,{'queryView':{'label':'','creator':_0x4ce085,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new ah(_0x52bbd0),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x2d2b93,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=_s['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=_s['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x382f02,_0x5dfca4)=>!_0x382f02&&!_0x5dfca4),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x5d1896,_0x3352ad)=>{this['isUploadInProgress']||this['isEmpty']||_0x5d1896['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3352ad());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x552426=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x552426)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x423796=_0x239b85(_0x552426);this['fire']('sendUserMessage',_0x423796),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0xa9a1be){this['queryView']['fieldView']['set']('placeholder',_0xa9a1be);}['focus'](_0x535cb0=!0x1){super['focus'](),_0x535cb0&&(this['element']['classList']['contains'](ph)||(this['element']['classList']['add'](ph),setTimeout(()=>{this['element']['classList']['remove'](ph);},0x320)));}['_createSubmitButton'](){const _0x494b8f=new _0x480cf4(this['locale']);return _0x494b8f['set']({'icon':_0x5a5684,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x494b8f['on']('execute',()=>{this['submit']();}),_0x494b8f;}['setIsUploadInProgress'](_0x1ba4a7){this['isUploadInProgress']=_0x1ba4a7;}['_setUpAddContextButtonPositioning'](){const _0x4042a6=this['locale'],_0xeee368=()=>{_0x43aaf8['window']['requestAnimationFrame'](()=>{if(_0x22d9e5(this['element'])){const _0x281e93=new _0x4795f2(this['queryView']['fieldView']['element']),_0x22d361=new _0x4795f2(this['_addContextButtonView']['element']),_0x4e885f=_0x281e93['width'],_0xd2b0b9='rtl'===_0x4042a6['uiLanguageDirection']?'right':'left';_0x281e93['excludeScrollbarsAndBorders']();const _0x3df64f=_0x4e885f-_0x281e93['width']+0x1;this['_addContextButtonView']['element']['style'][_0xd2b0b9]='calc('+(_0x4e885f-_0x22d361['width']-_0x3df64f)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0xeee368),this['on']('render',()=>{_0xeee368(),this['_queryViewResizeObserver']=new _0x1d4c5e(this['queryView']['fieldView']['element'],()=>{_0xeee368();});});}}const ma='ck-ai-chat__prompt-capabilities',Ca='ck-ai-chat-controls-button',wa='ck-ai-chat-controls-button--commands',fa='ck-ai-button-tertiary',Sa='ck-ai-chat-controls__model-selection',ba='ck-ai-chat-controls__model-selection__item-name',Ra='ck-ai-chat-controls__model-selection__item-description',Oa='ck-ai-chat-controls__model-selection__item-capabilities',ka='n';class vs extends _0x3836c7{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x825ec7){super(_0x825ec7),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelDisplayMode','selector'),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x192408=>'selector'===_0x192408),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x516002=>_0x516002?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x2ef7ba=>_0x2ef7ba),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x9d0d51=>_0x9d0d51),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x3250be=>i(this['locale'],_0x3250be?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x48daf7=>_0x48daf7),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x35bef3=>i(this['locale'],_0x35bef3?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ma]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x1e3367(),_0x158054(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x315ebc,_0x72078c){if(_0x72078c)this['set']('modelDisplayMode','hidden');else{const _0x308afd=0x1===_0x315ebc['length'];this['set']('modelDisplayMode',_0x308afd?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x315ebc?.['length'])for(const _0x29d0b3 of _0x315ebc){const _0xfcee7a=new _0x2ab5f1({'label':_0x29d0b3['name'],'withText':!0x0,'role':'menuitemradio','id':_0x29d0b3['id'],'model':_0x29d0b3});_0xfcee7a['bind']('isOn')['to'](this,'activeModelId',_0x4080e1=>_0x4080e1===_0x29d0b3['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xfcee7a,'labelView':new Na(this['locale'],_0x29d0b3)});}}['setWebSearch'](_0x3cd1d2){this['set']('webSearchActive',_0x3cd1d2);}['setReasoning'](_0x199e03){this['set']('reasoningActive',_0x199e03);}['setModel'](_0x31bf6a){if(!_0x31bf6a)return;this['activeModelId']=_0x31bf6a['id'],this['activeModelName']=_0x31bf6a['name']||_0x31bf6a['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x31bf6a['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x31bf6a['name']);const _0x30e83b=_0x31bf6a['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x30e83b),this['_webSearchButton']['set']('isVisible',_0x30e83b);const _0x42cd82=_0x31bf6a['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x42cd82),this['_reasoningButton']['set']('isVisible',_0x42cd82);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0xb5d067){this['set']('modelSelectorEnabled',!0x1),_0xb5d067&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x20942b=new _0x480cf4();return _0x20942b['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x650eff,'class':Ca,'isToggleable':!0x0,'tooltipPosition':ka}),_0x20942b['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x20942b;}['_createReasoningButton'](){const _0x1f9bd5=new _0x480cf4();return _0x1f9bd5['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x3fa3c9,'class':Ca,'isToggleable':!0x0,'tooltipPosition':ka}),_0x1f9bd5['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x1f9bd5;}['_createCommandsButton'](){const _0x41d43b=new _0x480cf4();return _0x41d43b['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x6e5fda,'withText':!0x0,'class':Ca,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':ka}),_0x41d43b['extendTemplate']({'attributes':{'class':[wa]}}),_0x41d43b['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x41d43b;}['_createModelSelectionDropdown'](){const _0x216baf=_0x1204b4(this['locale']);return _0x216baf['set']({'panelPosition':'ne','class':[Sa]}),_0x216baf['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':ka,'class':fa}),this['listenTo'](_0x216baf,'execute',_0x312e45=>{this['fire']('selectModel',_0x312e45['source']['model']);}),_0x216baf;}['_createModelNameView'](){const _0x128c2c=new va(this['locale']);return _0x128c2c['bind']('text')['to'](this,'activeModelName',_0x40cd8d=>_0x40cd8d??''),_0x128c2c['bind']('isVisible')['to'](this,'modelDisplayMode',_0x4ca63e=>'name'===_0x4ca63e),_0x128c2c;}}let Na=class extends _0x51555e{constructor(_0x29cb68,_0x1cbf35){super();const _0x383126=this['bindTemplate'],_0x232bdf=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x383126['to']('style'),'id':_0x383126['to']('id')},'children':[{'tag':'div','attributes':{'class':[ba]},'children':[{'text':_0x383126['to']('text')}]},{'tag':'div','attributes':{'class':[Ra]},'children':[{'tag':'span','children':[{'text':_0x1cbf35['description']}]}]},{'tag':'div','attributes':{'class':[Oa]},'children':_0x232bdf}]}),_0x232bdf['addMany'](this['_getCapabilityParts'](_0x29cb68,_0x650eff,'AI_CHAT_SEARCH_WEB',_0x1cbf35['capabilities']['webSearch']?.['enabled']??!0x1)),_0x232bdf['addMany'](this['_getCapabilityParts'](_0x29cb68,_0x3fa3c9,'AI_CHAT_REASONING',_0x1cbf35['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x4a2da0,_0x3b26fa,_0x3fa48e,_0x1d652f){const _0xb4d4f3=new _0x1254c7();_0xb4d4f3['content']=_0x3b26fa;const _0x56855e=new _0x3836c7(_0x4a2da0);_0x56855e['setTemplate']({'tag':'span','children':[{'text':i(_0x4a2da0,_0x3fa48e)+':\x20'}]});const _0x5e52bb=new _0x3836c7(_0x4a2da0);return _0x5e52bb['setTemplate']({'tag':'span','children':[{'text':i(_0x4a2da0,_0x1d652f?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0xb4d4f3,_0x56855e,_0x5e52bb];}},va=class extends _0x3836c7{constructor(_0xf10c57){super(_0xf10c57),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x1b9733=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x1b9733['if']('isVisible','ck-hidden',_0x2ee3bf=>!_0x2ee3bf)]},'children':[{'text':_0x1b9733['to']('text')}]});}};const ya='ck-ai-chat-context-controls__url-form',xa='ck-ai-chat-context-controls__url-input-section';class Oo extends _0x3836c7{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x353f6){super(_0x353f6),this['focusTracker']=new _0x50a6e7(),this['keystrokes']=new _0x2971c3(),this['backButton']=this['_createBackButton'](),this['urlInputField']=this['_createUrlInputField'](),this['confirmButton']=this['_createConfirmButton'](),this['_focusables']=this['createCollection']([this['backButton'],this['urlInputField'],this['confirmButton']]),this['focusCycler']=new _0x39194d({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x33fe6f=>{this['focusTracker']['add'](_0x33fe6f['element']),this['keystrokes']['listenTo'](_0x33fe6f['element']);}),_0x5effbf({'view':this}),this['focus']();}['destroy'](){super['destroy'](),this['focusTracker']['destroy'](),this['keystrokes']['destroy']();}['focus'](){this['urlInputField']['focus']();}['getValue'](){return this['urlInputField']['fieldView']['element']?.['value']?.['trim']()||'';}['clear'](){this['urlInputField']['fieldView']['element']['value']='',this['urlInputField']['errorText']=null,this['confirmButton']['isEnabled']=!0x1;}['setError'](_0x1c6753){this['urlInputField']['errorText']=_0x1c6753,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x5f5101=new _0x480cf4(this['locale']);return _0x5f5101['set']({'icon':_0x5009b4,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x275774,_0xc0e236,_0x313a7b)=>{_0x5f5101['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x313a7b?'':'\x20ck-hidden')]});}),_0x5f5101;}['_createUrlInputField'](){const _0x3467cc=new _0x50a78e(this['locale'],_0x526de1);return _0x3467cc['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x3467cc['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x3467cc;}['_createConfirmButton'](){const _0x2075de=new _0x480cf4(this['locale']);return _0x2075de['set']({'icon':_0x688d01,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x2075de;}['_setupTemplate'](){const _0x48f7bb=new _0x4631d7(this['locale'],{'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x48f7bb['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':ya,'tabindex':'-1'},'children':[_0x48f7bb,{'tag':'div','attributes':{'class':xa},'children':[this['urlInputField'],this['confirmButton']]}]});}['_setupEventHandlers'](){this['backButton']['on']('execute',()=>{this['clear'](),this['fire']('cancel');}),this['urlInputField']['fieldView']['on']('input',()=>{this['clearError'](),this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}),this['on']('submit',_0x60a2e6=>{_0x60a2e6['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x1e863d,_0x44ee2d)=>{this['clear'](),this['fire']('cancel'),_0x44ee2d();});}['_handleSubmit'](){const _0x46a6ac=this['getValue']()['trim']();_0x46a6ac?this['_isValidUrl'](_0x46a6ac)?(this['clearError'](),this['fire']('submitUrl',_0x46a6ac)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x27716d=this['getValue']()['trim'](),_0x2e11bb=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x27716d['length']>0x0&&!_0x2e11bb;}['_isValidUrl'](_0x89d414){try{return!!new URL(_0x89d414);}catch{return!0x1;}}}const La='ck-ai-chat-resources__item',Da='ck-ai-chat-resources__item--in-context',Pa='ck-ai-chat-resources__item-title',Ha='ck-ai-chat-resources__item__icon';class oc extends _0x4ef88a{['resource'];['_titleView'];['_iconView'];constructor(_0x12c777,_0x175265){super(_0x12c777),this['resource']=_0x175265,this['set']('isInContext',!!_0x175265['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x178549){if(_0x178549['isInContext'])return _0x688d01;switch(_0x178549['type']){case qe['DOCUMENT']:return _0x5d90b9;case qe['URL']:return _0x133ff9;case qe['FILE']:case qe['TEXT']:return _0x3cc08b;default:return _0x2199df;}}['highlightText'](_0x3a9558){if(!_0x3a9558||''===_0x3a9558['trim']())return void this['_titleView']['highlightText'](null);const _0x26ff85=new RegExp(_0x440618(_0x3a9558),'gi');this['_titleView']['highlightText'](_0x26ff85);}['updateResourceState'](_0x2ff339){this['resource']['isInContext']=_0x2ff339,this['isInContext']=_0x2ff339,this['_updateIcon']();}['_createTitleView'](){const _0x1c8e48=new _0x3dba21();return _0x1c8e48['text']=this['resource']['label'],_0x1c8e48['extendTemplate']({'tag':'span','attributes':{'class':[Pa]}}),_0x1c8e48;}['_createIconView'](){const _0x54b741=new _0x1254c7();return _0x54b741['content']=this['getResourceIcon'](this['resource']),_0x54b741;}['_setupTemplate'](){const _0x7017eb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[La,_0x7017eb['if']('isVisible','ck-hidden',_0x47a4c4=>!_0x47a4c4),_0x7017eb['if']('isInContext',Da)]},'children':[{'tag':'div','attributes':{'class':[Ha]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x7017eb['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const Ma='ck-ai-chat-resources__list';class Lr extends _0x2c9917{['_source'];constructor(_0x5fe22a,_0x57111e){super(_0x5fe22a),this['_source']=_0x57111e,this['extendTemplate']({'attributes':{'class':[Ma]}});}['setResources'](_0x362b65,_0x3773c4){this['items']['clear']();let _0x3e5ba3=_0x362b65;if(this['_source']['useDefaultFiltering']&&_0x3773c4&&''!==_0x3773c4['trim']()){const _0x122b8f=new RegExp(_0x3773c4['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x3e5ba3=_0x362b65['filter'](_0x419506=>_0x122b8f['test'](_0x419506['label']));}for(const _0x7db8fd of _0x3e5ba3){const _0x402e83=new oc(this['locale'],_0x7db8fd);_0x402e83['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x7db8fd);}),this['items']['add'](_0x402e83);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x3773c4);}['highlightText'](_0x109d60){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x20caa2=>{_0x20caa2['highlightText'](_0x109d60);});}['updateResourceState'](_0x206e4f,_0x4b6c55){for(const _0x433bbe of this['items']){const _0xf840da=_0x433bbe;_0xf840da['resource']['id']===_0x206e4f&&_0xf840da['updateResourceState'](_0x4b6c55);}}['_handleResourceSelection'](_0x5e8cdb,_0xa46e41){this['fire']('addResourceToContext',{'source':_0x5e8cdb,'resource':_0xa46e41});}}class Tr extends _0x50a78e{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x335371){const t=_0x335371['t'],_0x39331c={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x526de1,'label':i(_0x335371,'AI_CHAT_SEARCH_RESOURCES')};super(_0x335371,_0x39331c['creator']),this['label']=_0x39331c['label'],this['_viewConfig']=_0x39331c,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x335371,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x1adfce){this['fire']('search',_0x1adfce);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x1254c7(),this['iconView']['content']=_0x2b63a5,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x17e450,t){this['resetButtonView']=new _0x480cf4(_0x17e450),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x5a4b4,'class':'ck-search__reset','isVisible':!0x1,'tooltip':!0x0}),this['resetButtonView']['on']('execute',()=>{this['reset'](),this['focus'](),this['fire']('reset');}),this['resetButtonView']['bind']('isVisible')['to'](this['fieldView'],'isEmpty',_0x721480=>!_0x721480),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class nc extends _0x3836c7{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x4b4e97,_0x41e12e){super(_0x4b4e97),this['_source']=_0x41e12e['source'],this['_searchInputVisibleFrom']=_0x41e12e['searchInputVisibleFrom']??0x7,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView'](),this['_searchSection']=this['_createSearchSection'](),this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0x1b8196([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Tr(this['locale']);}['_createSearchSection'](){const _0x404bf0=new _0x3836c7(this['locale']);return _0x404bf0['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x2aa6d2,_0x32b13b)=>{this['loadResources'](_0x32b13b),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x32b13b);}),_0x404bf0;}['_createResourcesListView'](){const _0x197e50=new Lr(this['locale'],this['_source']);return _0x197e50['delegate']('addResourceToContext')['to'](this),_0x197e50['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x197e50;}['_createSkeletonView'](){const _0x1ab0a3=new Ei(this['locale'],Si['aiChatResources']);return _0x1ab0a3['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x9862be=>!_0x9862be)]}}),_0x1ab0a3;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x4f9b33){const _0x2dd989=_0x46d503();this['_latestLoadResourcesUid']=_0x2dd989,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x4f9b33,'uid':_0x2dd989}),this['isLoading']=!0x0;}['setResources'](_0x16bcc5,_0x59625c){if(_0x59625c&&_0x59625c!==this['_latestLoadResourcesUid'])return;const _0x215574=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x16bcc5,_0x215574),_0x16bcc5['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x12d26e,_0x3e6e45){this['_resourcesListView']['updateResourceState'](_0x12d26e,_0x3e6e45);}}const Ua='ck-ai-chat-context-controls__source-balloon-panel',Va='ck-button-icon\x20ck-button-back',Ba='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Uo{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x1527e4,_0x259c82,_0x22755c){this['_locale']=_0x1527e4,this['_bodyCollection']=_0x259c82,this['_config']=_0x22755c;}['showSourceResourcesBalloon']({source:_0xc407a0,withBackButton:_0x41b951}){let _0x3b1a40=this['_sourceResourceBalloons']['get'](_0xc407a0['id']);_0x3b1a40||(_0x3b1a40=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0xc407a0['id'],_0x3b1a40),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x3b1a40)),this['_addSourceResourceContent']({'balloonPanel':_0x3b1a40,'source':_0xc407a0,'withBackButton':_0x41b951}),_0x3b1a40['show']();const _0x2b8151=this['_config']['getTargetElement']();_0x2b8151&&_0x3b1a40['pin']({'target':_0x2b8151,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x59336a,_0x8f03b4,_0x4ed515){const _0x5d7de4=this['_sourceResourceBalloons']['get'](_0x59336a);if(!_0x5d7de4)return;const _0x339065=this['_getResourcesViewFromBalloon'](_0x5d7de4);_0x339065&&(_0x339065['setResources'](_0x8f03b4,_0x4ed515),_0x339065['once']('change:isLoading',()=>{_0x5d7de4['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x48af7e){const _0x2cb723=this['_sourceResourceBalloons']['get'](_0x48af7e);_0x2cb723&&requestAnimationFrame(()=>{_0x2cb723['hide'](),this['_sourceResourceBalloons']['delete'](_0x48af7e),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x34f360 of this['_sourceResourceBalloons']['values']())if(_0x34f360['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x4687dd,_0x52c953,_0xf0a37){const _0x54fcc6=this['_sourceResourceBalloons']['get'](_0x4687dd);if(!_0x54fcc6||!_0x54fcc6['isVisible'])return;const _0x1a655b=this['_config']['getTargetElement']();if(!_0x1a655b)return;_0x54fcc6['pin']({'target':_0x1a655b,'limiter':this['_config']['getLimiterElement']()});const _0x20aae1=this['_getResourcesViewFromBalloon'](_0x54fcc6);_0x20aae1&&_0x20aae1['updateResourceState'](_0x52c953,_0xf0a37);}['destroy'](){for(const _0x3cf899 of this['_sourceResourceBalloons']['values']())_0x3cf899['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x387e78=new _0x5019ab(this['_locale']);return _0x387e78['extendTemplate']({'attributes':{'class':Ua}}),this['_bodyCollection']['add'](_0x387e78),_0x387e78;}['_addSourceResourceContent']({balloonPanel:_0x1cadf9,source:_0x39cb61,withBackButton:_0x2ca8a7}){_0x1cadf9['content']['clear']();const _0x27084a=this['_createBalloonHeader']({'balloonPanel':_0x1cadf9,'source':_0x39cb61,'withBackButton':_0x2ca8a7});_0x1cadf9['content']['add'](_0x27084a);const _0x1ba0da=this['_createBalloonResourcesView'](_0x39cb61);_0x1cadf9['content']['add'](_0x1ba0da);}['_createBalloonHeader']({balloonPanel:_0x36c0c8,source:_0x5899c5,withBackButton:_0x122941}){const _0x42e953=new _0x4631d7(this['_locale'],{'label':_0x5899c5['label'],'class':Ba});return _0x122941&&_0x42e953['children']['add'](this['_createBackButton'](_0x36c0c8),0x0),_0x42e953;}['_createBackButton'](_0x59e885){const _0x4f811d=new _0x480cf4(this['_locale']);return _0x4f811d['set']({'icon':_0x5009b4,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Va}),_0x4f811d['on']('execute',()=>{_0x59e885['hide'](),this['_config']['onBackToContext']();}),_0x4f811d;}['_createBalloonResourcesView'](_0x10ca2d){const _0xef44ba=new nc(this['_locale'],{'source':_0x10ca2d,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0xef44ba['on']('loadSourceResources',(_0x3e1024,_0x191fa5)=>{this['_config']['onLoadSourceResources'](_0x191fa5);}),_0xef44ba['on']('addResourceToContext',(_0x5b69b9,_0x4a247f)=>{this['_config']['onResourceSelected'](_0x4a247f['source'],_0x4a247f['resource']),this['closeSourceResourceBalloon'](_0x10ca2d['id']);}),_0xef44ba;}['_getResourcesViewFromBalloon'](_0x5bf09e){const _0x2e0738=_0x5bf09e['content']['get'](0x1);return _0x2e0738 instanceof nc?_0x2e0738:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x39b352){_0x366f04({'emitter':_0x39b352,'contextElements':[_0x39b352['element']],'callback':()=>{_0x39b352['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x39b352['isVisible']});}}const xs=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Lo='ck-ai-chat-context-controls',No='ck-ai-chat-context-controls__pending-contexts',Ho='ck-ai-chat-context-controls__add-context-balloon-panel',Xo='ck-ai-chat-context-controls__add-context-button',Do='ck-ai-chat-context-controls__url-balloon-panel',$o='ck-ai-chat-context-controls__balloon-button',Wo='ck-ai-chat-context-controls__balloon-button-source',Fo='ck-ai-chat-controls-button',qo='ck-ai-chat-context-chips-wrapper-balloon',Io='ck-ai-chat-controls_context_show-more-button',Vo='ck-ai-chat-context-controls__show-more-balloon-panel',zo='ck-ai-chat',Go=[_0x5019ab['defaultPositions']['northArrowSouthWest'],_0x5019ab['defaultPositions']['northArrowSouth'],_0x5019ab['defaultPositions']['northArrowSouthEast'],_0x5019ab['defaultPositions']['southArrowNorthWest'],_0x5019ab['defaultPositions']['southArrowNorth'],_0x5019ab['defaultPositions']['southArrowNorthEast']];class Is extends _0x3836c7{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x27c19c,_0x24e0b4){super(_0x27c19c),this['bodyCollection']=_0x24e0b4['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x27c19c),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x27c19c),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x27c19c),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x27c19c,_0x24e0b4);const _0x394168={'cssClasses':{'showMoreButton':Io,'showMoreBalloon':Vo,'overflowContainer':qo,'controlsButton':Fo}};this['_overflowManager']=new jo(_0x27c19c,this['_currentContextsChips'],_0x394168,this['bodyCollection'],this),this['_addContextBalloonConfig']={'buttonView':this['addContextButtonView'],'balloonView':this['_addContextBalloonPanelView'],'hideMethod':this['hideAddContextBalloonPanel']['bind'](this),'showMethod':this['showAddContextBalloonPanel']['bind'](this)},this['_setupTemplate'](),this['_bindEventHandlers']();}['render'](){super['render'](),this['_setupAllBalloonClickOutsideHandlers'](),this['_overflowManager']['setContainerElement'](this['element']),this['_overflowManager']['reorganizeChips']();}['destroy'](){super['destroy'](),this['_overflowManager']['destroy'](),this['_resourcesBalloonView']['destroy']();}['addContextItem'](_0x2739b7,_0x4b2682){const _0xe78cb3=this['_createContextButton'](_0x2739b7,'current',!0x0,_0x4b2682);this['_addContextToCollection'](_0xe78cb3,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x386791){this['_removeContextFromCollection'](_0x386791,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x386791,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x48deb6,_0x22a2ea){let _0x4ce69f=this['_currentContextsChips']['find'](_0x4bf2c1=>_0x4bf2c1['id']===_0x48deb6);_0x4ce69f||(_0x4ce69f=this['_overflowManager']['overflowChips']['find'](_0x967a27=>_0x967a27['id']===_0x48deb6)),_0x4ce69f&&(_0x4ce69f['isLoading']=_0x22a2ea);}['setConversationContext'](_0x17e730){this['_conversationContextsChips']['clear']();for(const _0x5bae5b of _0x17e730){const _0xbfabbe=this['_createContextButton'](_0x5bae5b,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0xbfabbe,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0xed2d59,_0x5ba4db,_0x5e7925){this['_resourcesBalloonView']['updateResourceState'](_0xed2d59,_0x5ba4db,_0x5e7925);}['hideAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x1);}['showAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x0);}['hideUrlBalloonPanel'](){this['_urlBalloonPanelView']['hide'](),this['addContextButtonView']['isOn']=!0x1,this['_urlInputView']&&this['_urlInputView']['clear']();}['showUrlBalloonPanel'](){this['_urlBalloonPanelView']['show'](),this['addContextButtonView']['isOn']=!0x0;}['_showSourceResourcesBalloon']({source:_0x579b3e,withBackButton:_0xbbdc7b}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x579b3e,'withBackButton':_0xbbdc7b}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x772134,_0x1b1d6d,_0x5bc159,_0x152837){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x772134,_0x5bc159,_0x152837);}['closeSourceResourceBalloon'](_0x3c3359){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x3c3359),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x3609f6){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x3609f6),this['_setAddContextButtonEnabled'](_0x3609f6);}['_setAddContextButtonEnabled'](_0xde734c){const _0x55ded9=!_0xde734c['document']['isHidden']&&_0xde734c['document']['enabled'],_0x3bb793=_0xde734c['urls']['enabled'],_0x1873ee=_0xde734c['files']['enabled'],_0x502787=_0xde734c['sources']['length']>0x0,_0x57d65e=_0xde734c['customItems']&&_0xde734c['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x55ded9||_0x3bb793||_0x1873ee||_0x502787||_0x57d65e;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Lo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':No},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x2d7805){const _0x124b4b=new _0x480cf4(_0x2d7805);return _0x124b4b['set']({'label':i(_0x2d7805,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Fo+'\x20'+Xo,'icon':_0x4fa1c0,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x124b4b;}['_createAddContextBalloonPanelView'](_0x3d0103){return this['_createBaseBalloonPanel'](_0x3d0103,Ho);}['_createUrlBalloonPanelView'](_0xcf6c5f){const _0x172e68=this['_createBaseBalloonPanel'](_0xcf6c5f,Do);return this['_addUrlContent'](_0x172e68,_0xcf6c5f),_0x172e68;}['_createResourcesBalloonView'](_0xf9c9fe,_0x59ab9e){const _0x1e5722={'searchInputVisibleFrom':_0x59ab9e['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Go});},'onResourceSelected':(_0x323907,_0x9ce171)=>{this['fire']('addResourceToContext',{'source':_0x323907,'resource':_0x9ce171});},'onLoadSourceResources':_0x511810=>{this['fire']('loadSourceResources',_0x511810);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Uo(_0xf9c9fe,_0x59ab9e['bodyCollection'],_0x1e5722);}['_getLimiterElement'](){return this['element']?.['closest']('.'+zo)||document['body'];}['_createBaseBalloonPanel'](_0x429ee7,_0x45a166){const _0x3922e1=new _0x5019ab(_0x429ee7);return _0x3922e1['extendTemplate']({'attributes':{'class':_0x45a166}}),this['bodyCollection']['add'](_0x3922e1),_0x3922e1;}['_setBalloonPanelContent'](_0x26fe1e,_0x45d1f6,_0x4aa12d){if(_0x26fe1e['content']['clear'](),!_0x4aa12d['document']['isHidden']&&_0x4aa12d['document']['enabled']){const _0x24fde1=this['_createBalloonButton'](_0x45d1f6,{'label':i(_0x45d1f6,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x5d90b9});_0x24fde1['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x26fe1e['content']['add'](_0x24fde1);}if(_0x4aa12d['urls']['enabled']){const _0x3147b2=this['_createBalloonButton'](_0x45d1f6,{'label':i(_0x45d1f6,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x133ff9});_0x3147b2['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Go}),this['_urlInputView']['focus']();}),_0x26fe1e['content']['add'](_0x3147b2);}if(_0x4aa12d['files']['enabled']){const _0x3bd639=new _0x287ba4(_0x45d1f6);_0x3bd639['set']({'label':i(_0x45d1f6,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x5b1772,'withText':!0x0,'tooltip':!0x0,'class':$o,'allowMultipleFiles':!0x0}),_0x3bd639['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x3bd639['on']('done',(_0x505630,_0x46a298)=>{this['fire']('addFileToContext',_0x46a298);}),_0x3bd639['tooltip']=!0x0,_0x26fe1e['content']['add'](_0x3bd639);}for(const _0x4139a7 of _0x4aa12d['sources']){const _0x44cff3=this['_createBalloonButton'](_0x45d1f6,{'label':_0x4139a7['label'],'icon':_0x4139a7['icon']||_0x2199df,'type':'source'});_0x26fe1e['content']['add'](_0x44cff3),_0x44cff3['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x4139a7,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x2a5cb6 of _0x4aa12d['customItems']||[]){const _0x41c8a9=this['_createBalloonButton'](_0x45d1f6,{'label':_0x2a5cb6['label'],'icon':_0x2a5cb6['icon']||_0x2199df,'type':'customItem'});_0x26fe1e['content']['add'](_0x41c8a9),_0x41c8a9['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x2a5cb6);});}this['_hasExactlyOneSource']=0x1===_0x26fe1e['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x12c792,_0x279938){this['_urlInputView']=new Oo(_0x279938),this['_urlInputView']['on']('submitUrl',(_0x5c0bb9,_0x5efb41)=>{this['_handleUrlSubmit'](_0x5efb41);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Go}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Go});}),_0x12c792['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x352c17,_0x3e3eb8){const _0x577403='source'===_0x3e3eb8['type']?new Ga(_0x352c17):new _0x480cf4(_0x352c17);return _0x577403['set']({'label':_0x3e3eb8['label'],'icon':_0x3e3eb8['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':$o}),_0x577403;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x366f04({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x53619a){const _0x5d462f=this['_addContextBalloonConfig'];_0x5d462f['buttonView']['isOn']=_0x53619a,_0x53619a?_0x5d462f['balloonView']['show']():_0x5d462f['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x212052,buttonView:_0x2eb1cb,hideMethod:_0x17170d}=this['_addContextBalloonConfig'];_0x366f04({'emitter':_0x212052,'contextElements':[_0x212052['element'],_0x2eb1cb['element']],'callback':()=>{_0x17170d();},'activator':()=>_0x2eb1cb['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x28bf79,_0x204704,_0x399abc=!0x1,_0x419b1c=!0x1){const _0x43567e='conversation'===_0x204704||!0x0===_0x28bf79['isReadOnly'],_0x19eef1=new Co(this['locale'],_0x28bf79,_0x43567e,_0x399abc,_0x419b1c);return _0x43567e||_0x19eef1['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x19eef1['id']);}),_0x19eef1;}['_addContextToCollection'](_0x4c6969,_0x1aaf7a){_0x1aaf7a['add'](_0x4c6969,0x0);}['_removeContextFromCollection'](_0x3e27b3,_0x3673ec){const _0x32ffdf=_0x3673ec['find'](_0x4e49d8=>_0x4e49d8['id']===_0x3e27b3);_0x32ffdf&&_0x3673ec['remove'](_0x32ffdf);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Go}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x286ea3){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x286ea3);}}class Ga extends _0x480cf4{['arrowView'];constructor(_0x43f5b0){super(_0x43f5b0),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Wo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x29a02b=new _0x1254c7();return _0x29a02b['content']=_0x3f3220,_0x29a02b['extendTemplate']({'attributes':{'class':Wo+'__arrow'}}),_0x29a02b;}}class Cs extends _0x3836c7{['_cancelButtonView'];['_loaderView'];constructor(_0x44dc95){super(_0x44dc95),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_loaderView']=this['_createLoaderView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-loader-wrapper','ck-reset_all']},'children':[this['_loaderView'],this['_cancelButtonView']]});}['_createCancelButtonView'](){const _0x432a9b=new _0x480cf4(this['locale']);return _0x432a9b['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x33c6ee}),_0x432a9b['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x432a9b;}['_createLoaderView'](){const _0x3d2de8=new _0x3836c7(this['locale']);return _0x3d2de8['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}}]},{'text':i(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x3d2de8;}}class vi extends _0x3836c7{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x313291,_0x4ec76d){super(_0x313291),this['_contextPanelView']=this['_createContextPanelView'](_0x313291,{'bodyCollection':_0x4ec76d['bodyCollection'],'searchInputVisibleFrom':_0x4ec76d['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x313291),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x313291),this['_loaderView']=this['_createLoaderView'](_0x313291),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x313291),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...xs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x35d41e=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x35d41e['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x35d41e['if']('isLoading','ck-hidden',_0x5ee027=>_0x5ee027||!this['isModelAvailable']),_0x35d41e['if']('isModelAvailable','ck-hidden',_0xc90958=>!_0xc90958||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x35d41e['if']('isLoading','ck-hidden',_0x2d7f1f=>!_0x2d7f1f)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x35d41e['if']('isModelAvailable','ck-hidden',_0x4c4669=>_0x4c4669)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x366f04({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x20e327,_0x213601){return new Is(_0x20e327,_0x213601);}['_createPromptInputView'](_0x3129a4){return new _s(_0x3129a4,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x2df0f4){return new vs(_0x2df0f4);}['_createLoaderView'](_0x24c614){return new Cs(_0x24c614);}['_createModelUnavailableMessageView'](_0x1d3a1e){const _0x3d430e=new As(_0x1d3a1e);return _0x3d430e['delegate']('startConversation')['to'](this),_0x3d430e;}['_handlePromptInputFocus'](_0x93699e,_0x547833,_0x5902e4){_0x5902e4?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x20b262,_0x4c0c0a){this['_contextPanelView']['addContextItem'](_0x20b262,_0x4c0c0a);}['removeContextItem'](_0x2988e9){this['_contextPanelView']['removeContextItem'](_0x2988e9);}['setContextItemLoading'](_0x284280,_0x495733){this['_contextPanelView']['setContextItemLoading'](_0x284280,_0x495733);}['setIsUploadInProgress'](_0x289a67){this['_promptInputView']['setIsUploadInProgress'](_0x289a67);}['setConversationContext'](_0x2e3396){this['_contextPanelView']['setConversationContext'](_0x2e3396);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0xda87e4,_0x1cdbf5,_0x32550f){this['_contextPanelView']['updateResourceState'](_0xda87e4,_0x1cdbf5,_0x32550f);}['setWebSearch'](_0x3d32ac){this['_promptCapabilitiesView']['setWebSearch'](_0x3d32ac);}['setReasoning'](_0x2ffc97){this['_promptCapabilitiesView']['setReasoning'](_0x2ffc97);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x3435d0){this['_contextPanelView']['setAddContextOptions'](_0x3435d0);}['setInputPlaceholder'](_0x1d6765){this['_promptInputView']['setPlaceholderText'](_0x1d6765);}['setModelList'](_0x49e255,_0x438850){this['_promptCapabilitiesView']['setModelList'](_0x49e255,_0x438850);}['setModel'](_0x8f8a69){_0x8f8a69?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x8f8a69)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x1c52cf){this['_promptCapabilitiesView']['disableModelSelector'](_0x1c52cf);}['populateSourceResourceBalloon'](_0x49c199,_0x2afb5e,_0x2301a9,_0x3344f5){this['_contextPanelView']['populateSourceResourceBalloon'](_0x49c199,_0x2afb5e,_0x2301a9,_0x3344f5);}['closeSourceResourceBalloon'](_0x1f96fd){this['_contextPanelView']['closeSourceResourceBalloon'](_0x1f96fd);}['focusPromptInput'](_0x33bc86=!0x1){this['_promptInputView']['focus'](_0x33bc86);}['setPromptInputValue'](_0x2e17e8){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x2e17e8;}}class As extends _0x3836c7{constructor(_0x332a79){super(_0x332a79);const _0xad7f56=new _0x480cf4(_0x332a79);_0xad7f56['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0xad7f56['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0xad7f56]}]});}}class xi extends _0x4631d7{['conversationStartButton'];['resizeButton'];constructor(_0x5c573e,_0x48fb71){super(_0x5c573e,{'label':i(_0x5c573e,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Mt}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x5c573e),this['children']['add'](this['conversationStartButton']),_0x48fb71&&(this['resizeButton']=Ci(_0x5c573e,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x21be6b){const _0x4adbaf=new _0x480cf4(_0x21be6b);return _0x4adbaf['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x163062,'class':'ck-ai-chat__start-conversation'}),_0x4adbaf['on']('execute',()=>{this['fire']('startConversation');}),_0x4adbaf;}}class Ri extends _0x3836c7{constructor(_0x5f300a){super(_0x5f300a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x5f300a,'AI_DISCLAIMER_TEXT')}]}]});}}class Pt extends _0x3836c7{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x267809,_0x197162){super(_0x267809),this['_bodyCollection']=new _0x1424e8(_0x267809),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new xi(_0x267809,_0x197162['showResizeButton']),this['chatHeader']['delegate'](...Ft)['to'](this),this['chatFeed']=new ji(_0x267809,this['_bodyCollection']),this['chatFeed']['delegate'](...Ft)['to'](this),this['chatControls']=new vi(_0x267809,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x197162['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Ft)['to'](this),this['chatDisclaimer']=new Ri(_0x267809),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x267809['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x51763d,_0x3cc523,_0x4d8dfd,_0x2852c4){this['chatControls']['populateSourceResourceBalloon'](_0x51763d,_0x3cc523,_0x4d8dfd,_0x2852c4);}['closeSourceResourceBalloon'](_0x5efeae){this['chatControls']['closeSourceResourceBalloon'](_0x5efeae);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ut extends _0x5aeef2{static get['requires'](){return[_t];}['_view'];static get['pluginName'](){return'AIChatUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['feedItemRenderingStrategy']='streaming';['showDiff']=!0x0;['_promiseQueue'];['_interactionPromiseResolver'];['_titleAnimationInterval']=void 0x0;['_isTrackChangesCommandValueBound']=!0x1;constructor(_0x51f78d){super(_0x51f78d);const _0x5d1754=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new z(),this['_view']=new Pt(this['context']['locale'],{'showResizeButton':_0x5d1754['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Ft)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x3879b6,{showDiff:_0xb96e6c})=>{this['showDiff']=_0xb96e6c;}),_0x5d1754['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':Mt,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0xb5980a=>_0xb5980a),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x4f0f23=>_0x4f0f23),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x4675d2){const _0x93021=this['context']['config']['get']('ai.chat.welcomeMessage')??i(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x4675d2['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x93021}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0x4d6901,staticMessage:_0x3e7db9}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x4d6901,'initialContent':'<p>'+_0x3e7db9+'</p>'});}['addFeedItemUserMessage'](_0x206762){const _0x58b811=_0x206762['attributes']?.['displayedPrompt']||_0x206762['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x206762['contextItems']['values']()),'initialContent':'<p>'+_0x58b811+'</p>','id':_0x206762['id']});}['addFeedItemError']({errorMessage:_0x575081,id:_0x4794ea}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x575081+'</p>','id':_0x4794ea});}['addFeedItemAIReply'](_0x5f5005){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x5f5005['interactionId']+':'+_0x5f5005['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x3553b2){const _0x10ad7f=T(this['context']);let _0x18042b=_0x10ad7f['config']['get']('ai.availableReplyActions')||[...ot];if(_0x10ad7f['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x3b4a7e=_0x10ad7f['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x3b4a7e,'value');}}else _0x18042b=_0x18042b['filter'](_0x3cc816=>'insertSuggestion'!=_0x3cc816);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x3553b2['interactionId']+':'+_0x3553b2['id'],'areActionsDisabled':_0x3553b2['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x18042b}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x1d8e92,_0x4c98b1){const _0x1f9bd3=this['_view']['chatFeed']['children']['last'];if(_0x1f9bd3 instanceof bt)return this['_view']['chatFeed']['children']['remove'](_0x1f9bd3),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x1d8e92['id'],'capabilities':{'isWebSearchEnabled':_0x1f9bd3['capabilities']['isWebSearchEnabled']||_0x4c98b1['isWebSearchEnabled'],'isReasoningEnabled':_0x1f9bd3['capabilities']['isReasoningEnabled']||_0x4c98b1['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x1d8e92['id'],'capabilities':_0x4c98b1});}async['addFeedItemCustomElement'](_0x93658c,_0x5c677e){let _0x169a6a;return await this['_promiseQueue']['enqueue'](async()=>{_0x169a6a=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x93658c,'id':_0x5c677e});}),_0x169a6a;}['removeFeedItem'](_0x45f8ef){this['_view']['chatFeed']['removeItem'](_0x45f8ef);}['hasFeedItem'](_0x38a575){return this['_view']['chatFeed']['hasItem'](_0x38a575);}['updateFeedInteractionHeader'](_0x488b9d){const _0x50f448=this['_view']['chatFeed']['children']['find'](_0x10cf0a=>_0x10cf0a['options']['id']==_0x488b9d['id']&&_0x10cf0a instanceof bt);_0x50f448&&_0x50f448['set']('isVisible',_0x488b9d['isVisible']);}async['updateFeedItemAIReplyContent'](_0x2a009b){const _0x3885d8=_0x2a009b['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0xd9badc=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x2a009b,'abortSignal':_0xd9badc,'renderingStrategy':_0x3885d8}),_0x2a009b['isDone']&&this['markFeedItemAsDone'](_0x2a009b['id']);});}['updateFeedItemAIReplySources'](_0xc48e88,_0x587bf2){this['_view']['chatFeed']['updateWebSources'](_0xc48e88,_0x587bf2);}async['updateFeedItemAIReplySuggestionContent'](_0x2266f2){const _0x2ec355=_0x2266f2['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x29d00d=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x2266f2,'abortSignal':_0x29d00d,'renderingStrategy':_0x2ec355}),_0x2266f2['isDone']&&this['markFeedItemAsDone'](_0x2266f2['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x55ff75){this['_view']['chatFeed']['updateSuggestionPartState'](_0x55ff75);}['setFeedItemAIReplySuggestionPartActive'](_0x1007c8){this['_view']['chatFeed']['setSuggestionPartActive'](_0x1007c8);}['markFeedItemAsDone'](_0x1fb88d){this['_view']['chatFeed']['markItemAsDone'](_0x1fb88d);}['removeFeedInteraction'](_0x2baab1){this['_view']['chatFeed']['getItemIds']()['filter'](_0x1fa7c3=>_0x1fa7c3['startsWith'](_0x2baab1))['forEach'](_0x3e6d91=>this['_view']['chatFeed']['removeItem'](_0x3e6d91));}['startInteraction'](){const _0x3f09db=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x3f09db),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x3a6cf0){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x27778d=>_0x27778d['startsWith'](_0x3a6cf0['id']))['forEach'](_0x24aec5=>this['markFeedItemAsDone'](_0x24aec5)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x11a152,_0x527608){this['_view']['chatControls']['addContextItem'](_0x11a152,_0x527608);}['removeContextItem'](_0x10e1bf){this['_view']['chatControls']['removeContextItem'](_0x10e1bf);}['setContextItemLoading'](_0x1af6be,_0x418873){this['_view']['chatControls']['setContextItemLoading'](_0x1af6be,_0x418873);}['setIsUploadInProgress'](_0x712df3){this['_view']['chatControls']['setIsUploadInProgress'](_0x712df3);}['setConversationContext'](_0x32f827){this['_view']['chatControls']['setConversationContext'](_0x32f827);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x406a4b,_0x5b2f2d,_0x4bf1b3){this['_view']['chatControls']['updateResourceState'](_0x406a4b,_0x5b2f2d,_0x4bf1b3);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x28ce10){this['_view']['chatControls']['setAddContextOptions'](_0x28ce10);}['updateCapabilities'](_0x113a8f){this['_view']['chatControls']['setWebSearch'](_0x113a8f['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x113a8f['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x113a8f));}['setSelectedModel'](_0x5397c4,_0x645e10){this['_view']['chatControls']['setModel'](_0x5397c4),_0x645e10&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x3f66b0){this['feedItemRenderingStrategy']=_0x3f66b0;}['toggleLoadingSkeleton'](_0x4464be){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x4464be);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x139b49,_0x4b4b0b=!0x1){if(_0x4b4b0b&&!Rt()&&_0x139b49['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x139b49);this['_view']['chatHeader']['label']=_0x139b49;}['setLoadingMessage'](_0x180526){this['_view']['chatFeed']['setLoadingMessage'](_0x180526);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x4da08a){let _0x42d396=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x4da08a[_0x42d396],_0x42d396++,_0x42d396===_0x4da08a['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x5557ed){this['_view']['chatHeader']['isMaximized']=_0x5557ed;}['prepareLoadingMessage'](_0x13bb29){return _0x13bb29['isWebSearchEnabled']&&_0x13bb29['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x13bb29['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x13bb29['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x57867a){return _0x57867a?_0x57867a['isWebSearchEnabled']&&_0x57867a['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x57867a['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x57867a['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x4d986f,_0x597e86,_0x3aefed,_0x1fef35){this['_view']['populateSourceResourceBalloon'](_0x4d986f,_0x597e86,_0x3aefed,_0x1fef35);}['closeSourceResourceBalloon'](_0x5473d8){this['_view']['closeSourceResourceBalloon'](_0x5473d8);}['setPromptInputValue'](_0x202dcb){this['_view']['chatControls']['setPromptInputValue'](_0x202dcb);}['focusPromptInput'](_0x1520f0=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x1520f0);}['scrollFeedToSuggestion'](_0x8f7f0b,_0x121fe2){this['_view']['chatFeed']['scrollToSuggestion'](_0x8f7f0b,_0x121fe2);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class bi extends _0x2c9917{['sections'];constructor(_0x48f2c5,_0x3bf680){super(_0x48f2c5),this['sections']=_0x3bf680,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x5ce210){let _0x20bc54=0x0,_0x5ee5e2=0x0;for(const _0x531658 of this['sections']){const {resultsCount:_0x5cad26,totalItemsCount:_0x1433a7}=_0x531658['filter'](_0x5ce210);_0x20bc54+=_0x5cad26,_0x5ee5e2+=_0x1433a7;}return{'resultsCount':_0x20bc54,'totalItemsCount':_0x5ee5e2};}}class yi extends _0x4ef88a{['title'];['itemsViews'];['_itemsListView'];constructor(_0x2a0a4e,{title:_0x449c59,items:_0x27f037}){super(_0x2a0a4e);const _0x2bdceb=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x449c59,this['itemsViews']=_0x27f037;const _0x22af58=new _0x3836c7(_0x2a0a4e);_0x22af58['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x2c9917(_0x2a0a4e),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x2bdceb['if']('isVisible','ck-hidden',_0x1b8c0c=>!_0x1b8c0c)]},'children':[_0x22af58,this['_itemsListView']]});}['filter'](_0x2d10b6){const _0x49ecd3=this['itemsViews']['length'];let _0x45119d=0x0;for(const _0x341f48 of this['itemsViews']){if(_0x2d10b6){const _0x41a459=_0x341f48['isMatching'](_0x2d10b6);_0x341f48['isVisible']=!!_0x41a459,_0x341f48['highlightText'](_0x2d10b6);}else _0x341f48['isVisible']=!0x0,_0x341f48['highlightText'](null);_0x341f48['isVisible']&&_0x45119d++;}return this['isVisible']=_0x45119d>0x0,{'resultsCount':_0x45119d,'totalItemsCount':_0x49ecd3};}['getItem'](_0x31150a){return this['itemsViews']['find'](_0x3ca954=>_0x3ca954['id']===_0x31150a);}['removeItem'](_0x5da4dc){const _0x4fafb2=this['itemsViews']['indexOf'](_0x5da4dc);-0x1!==_0x4fafb2&&(this['itemsViews']['splice'](_0x4fafb2,0x1),this['_itemsListView']['items']['remove'](_0x5da4dc));}}class gi extends/* #__PURE__ -- @preserve */
27
- _0x385611(_0x4ef88a){['id'];static ['LOADING_LABELS']={'remove':'AI_CHAT_HISTORY_LOADING_REMOVING','rename':'AI_CHAT_HISTORY_LOADING_RENAMING','pin':'AI_CHAT_HISTORY_LOADING_PINNING','unpin':'AI_CHAT_HISTORY_LOADING_UNPINNING'};['actions'];['mainContent'];['_titleView'];constructor(_0x46da65,_0x417831){super(_0x46da65);const _0x278cd9=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x417831['pinned']),this['set']('loadingState',null),this['id']=_0x417831['id'];const {title:_0x3eec37,createdAt:_0x4c83a5,active:_0x4e4d9d=!0x1}=_0x417831;this['_titleView']=new _0x3dba21(),this['_titleView']['text']=_0x3eec37,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x395940=this['_createCheckView'](),_0x506613=this['_createPinButtonView'](_0x46da65),_0xa0bdc6=this['_createMenuDropdownView'](),_0x23dbbb=this['_createEditInputView'](_0x46da65,_0x3eec37),_0x5db7c6=this['_createAcceptEditButtonView'](_0x46da65,_0x23dbbb),_0x3fc3a3=this['_createCancelEditButtonView'](_0x46da65,_0x23dbbb);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x506613),this['actions']['add'](_0xa0bdc6),this['on']('change:isEdit',(_0x4100b1,_0x175e57,_0x4f7dbd)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x4f7dbd?(this['actions']['add'](_0x5db7c6),this['actions']['add'](_0x3fc3a3),this['mainContent']['add'](_0x23dbbb),_0x23dbbb['element']['focus']()):(this['actions']['add'](_0x506613),this['actions']['add'](_0xa0bdc6),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x4e4d9d?'ck-ai-chat-history__item--active':'',_0x278cd9['if']('isVisible','ck-hidden',_0x150afb=>!_0x150afb),_0x278cd9['if']('isEdit','ck-ai-chat-history__item--edit')],'role':'listitem'},'children':[{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-check-container']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-check',_0x278cd9['if']('loadingState','ck-hidden',_0x55cf42=>!!_0x55cf42)]},'children':_0x4e4d9d?[_0x395940]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x278cd9['if']('loadingState','ck-hidden',_0x36ecec=>!_0x36ecec)]},'children':[this['_createSpinnerView']()]}]},{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-row']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-content']},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-title',_0x278cd9['if']('loadingState','ck-hidden',_0x57381a=>!!_0x57381a)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x278cd9['if']('loadingState','ck-hidden',_0x4186d0=>!_0x4186d0)]},'children':[{'text':_0x278cd9['to']('loadingState',_0x961c23=>_0x961c23?i(this['locale'],gi['LOADING_LABELS'][_0x961c23]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x4c83a5]}]},{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-actions']},'children':this['actions']}]}]}),this['on']('click',()=>{this['isEdit']||this['fire']('selectConversation',{'id':this['id']});});}['updateTitle'](_0x220395){this['_titleView']['text']=_0x239b85(_0x220395);}['updateLoadingState'](_0x172aae,_0x5f1ba8){this['set']('loadingState',_0x5f1ba8?_0x172aae:null);}['_createCheckView'](){const _0x4c5ce5=new _0x1254c7();return _0x4c5ce5['set']({'content':_0x5bbb65}),_0x4c5ce5;}['_createPinButtonView'](_0x5ce258){const _0x2cda96=new _0x480cf4(_0x5ce258);return _0x2cda96['set']({'label':i(_0x5ce258,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0xf31172,'withText':!0x1,'tooltip':!0x0}),_0x2cda96['bind']('isOn')['to'](this,'pinned'),_0x2cda96['on']('execute',()=>{const _0x24771f=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x24771f});}),_0x2cda96;}['_createMenuDropdownView'](){const _0x444ab9=_0x1204b4(this['locale'],_0x2eec87),_0x553635=_0x444ab9['panelView']['children'];_0x444ab9['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x2069a2}),_0x444ab9['panelPosition']='sw';const _0x4be1f6=new _0x480cf4(this['locale']);_0x4be1f6['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x4be1f6['withText']=!0x0,_0x4be1f6['on']('execute',()=>{this['isEdit']=!0x0;});const _0x1569c4=new _0x480cf4(this['locale']);_0x1569c4['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x1569c4['withText']=!0x0,_0x1569c4['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x5072ce=new _0x2c9917(this['locale']),_0x48ac3c=new _0x4ef88a(this['locale']);_0x48ac3c['children']['add'](_0x4be1f6);const _0x2f84c0=new _0x4ef88a(this['locale']);return _0x2f84c0['children']['add'](_0x1569c4),_0x5072ce['items']['addMany']([_0x48ac3c,_0x2f84c0]),_0x553635['add'](_0x5072ce),_0x444ab9;}['_createEditInputView'](_0x19ce4a,_0x355acf){const _0x1afbd6=new _0x426b41(_0x19ce4a),_0x4d21a2=_0x1afbd6['bindTemplate'];return _0x1afbd6['value']=_0x355acf,_0x1afbd6['extendTemplate']({'on':{'keydown':_0x4d21a2['to'](_0x686af3=>{'Enter'==_0x686af3['key']&&this['_commitEditInputValue'](_0x1afbd6);})}}),_0x1afbd6;}['_createAcceptEditButtonView'](_0x49291e,_0x58ffd1){const _0x340a21=new _0x480cf4(_0x49291e);return _0x340a21['set']({'icon':_0x5bbb65,'withText':!0x1,'tooltip':i(_0x49291e,'AI_CHAT_HISTORY_ACCEPT')}),_0x340a21['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x340a21['on']('execute',()=>{this['_commitEditInputValue'](_0x58ffd1);}),_0x340a21;}['_commitEditInputValue'](_0x21defb){const _0x52f50a=_0x21defb['element']['value']||'';this['_titleView']['text']=_0x52f50a,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x52f50a});}['_createCancelEditButtonView'](_0x2c9e0e,_0x51dc20){const _0x17a678=new _0x480cf4(_0x2c9e0e);return _0x17a678['set']({'icon':_0x5a4b4,'withText':!0x1,'tooltip':i(_0x2c9e0e,'AI_CHAT_HISTORY_CANCEL')}),_0x17a678['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x17a678['on']('execute',()=>{this['isEdit']=!0x1,_0x51dc20['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x17a678;}['_createSpinnerView'](){const _0x178d2e=new pi('tiny');return _0x178d2e['isVisible']=!0x0,_0x178d2e;}['isMatching'](_0x45d71d){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x45d71d)?{'title':!0x0}:null;}['highlightText'](_0x480f87){this['_titleView']['highlightText'](_0x480f87);}}class It extends _0x3836c7{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x5d783c,_0x5cd1c2){super(_0x5d783c),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x47e8e8=new _0x4631d7(_0x5d783c,{'label':i(_0x5d783c,'AI_CHAT_HISTORY_HEADING'),'icon':mt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x5cd1c2&&(this['resizeButton']=Ci(_0x5d783c,this),_0x47e8e8['children']['add'](this['resizeButton'])),this['sectionsView']=new bi(_0x5d783c,[]),this['sectionsView']['delegate'](...Hi)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0x53dd6c=>!_0x53dd6c)]}}),this['on']('change:isLoading',()=>this['_updateViewVisibility']()),this['on']('change:hasItems',()=>this['_updateViewVisibility']()),this['on']('change:errorMessage',()=>this['_updateViewVisibility']()),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat-history','ck-rounded-corners'],'dir':'ltr'},'children':[_0x47e8e8,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['mainErrorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'],this['isMainErrorViewVisible']=!this['isSearchViewVisible']&&!!this['errorMessage'];}['_createSearchView'](){const _0x1b92de=new _0x283161(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x594a44=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x594a44),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x3f4720=this['_createErrorView']();return _0x3f4720['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x35ea4b=>!_0x35ea4b)]}}),_0x1b92de['on']('render',()=>{_0x1b92de['children']['add'](_0x3f4720,0x1);}),_0x1b92de['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x5d330e=>!_0x5d330e)]}}),_0x1b92de;}['_createSkeletonView'](){const _0x138f8a=new Ei(this['locale'],Si['aiHistory']);return _0x138f8a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x5f5148=>!_0x5f5148)]}}),_0x138f8a;}['_createErrorView'](){const _0x36d06c=new _0x3836c7(this['locale']),_0x3060da=new _0x480cf4(this['locale']);_0x3060da['set']({'withText':!0x1,'icon':_0x5a4b4,'class':'ck-ai-notification_error__dismiss-button'}),_0x3060da['bind']('isVisible')['to'](this,'hasItems',_0xbb4b6e=>!!_0xbb4b6e),_0x3060da['on']('execute',()=>{this['errorMessage']='';});const _0x31f8ad=this['bindTemplate'];return _0x36d06c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x31f8ad['to']('errorMessage')}]},_0x3060da]}),_0x36d06c;}['_createEmptyStateView'](){const _0x5aa56e=new _0x480cf4(this['locale']);_0x5aa56e['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x163062,'class':'ck-ai-chat__start-conversation'}),_0x5aa56e['on']('execute',()=>{this['fire']('openChat');});const _0x24a7ea=new _0x3836c7(this['locale']);return _0x24a7ea['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x24a08f=>!_0x24a08f)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x5aa56e]}),_0x24a7ea;}['_createListItemViews'](_0x12c187,_0x1e29b7){const _0xe0fc2b=[];for(const _0x31bcca of _0x12c187){const _0x3d2e5d=new gi(_0x1e29b7,_0x31bcca);_0x3d2e5d['delegate'](...Hi)['to'](this),_0xe0fc2b['push'](_0x3d2e5d);}return _0xe0fc2b;}['updateHistoryItemsWithCategories'](_0x26c5a9){const _0x3cbe65=this['locale']||'en',_0x50f2db=[];for(const _0x48d571 of _0x26c5a9){const _0xc31435=this['_createListItemViews'](_0x48d571['items'],_0x3cbe65);_0x50f2db['push'](new yi(_0x3cbe65,{'title':_0x48d571['title'],'items':_0xc31435}));}this['sectionsView']['sections']=_0x50f2db,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x50f2db),this['hasItems']=_0x26c5a9['some'](_0x6dbabf=>_0x6dbabf['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x52b6bb){for(const _0xafdd57 of this['sectionsView']['sections']){const _0x5def00=_0xafdd57['getItem'](_0x52b6bb);if(_0x5def00){if(_0xafdd57['removeItem'](_0x5def00),0x0===_0xafdd57['itemsViews']['length']){const _0x1fa096=this['sectionsView']['sections']['indexOf'](_0xafdd57);-0x1!==_0x1fa096&&(this['sectionsView']['sections']['splice'](_0x1fa096,0x1),this['sectionsView']['items']['remove'](_0xafdd57));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x575f24,_0x34a2e4){for(const _0x7ba296 of this['sectionsView']['sections']){const _0x41c1ee=_0x7ba296['getItem'](_0x575f24);if(_0x41c1ee){_0x41c1ee['updateTitle'](_0x34a2e4);break;}}}['updateItemLoadingState'](_0x196025,_0x15bafa,_0x127f4e){for(const _0x29ce8e of this['sectionsView']['sections']){const _0x522156=_0x29ce8e['getItem'](_0x196025);if(_0x522156){_0x522156['updateLoadingState'](_0x15bafa,_0x127f4e);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x39c7e4=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x39c7e4);}}}const Hi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class ct extends _0x5aeef2{static get['requires'](){return[_t];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x20b331){super(_0x20b331);const _0x45557d=this['context']['plugins']['get']('AITabs');this['_historyView']=new It(this['context']['locale'],_0x45557d['showResizeButton']),this['_historyView']['delegate'](...Hi)['to'](this),_0x45557d['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':mt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x5df39f){this['_historyView']['removeHistoryItem'](_0x5df39f);}['updateItems'](_0x309523){this['_historyView']['updateHistoryItemsWithCategories'](_0x309523);}['updateItemTitle'](_0x2181c2,_0x14fa3d){this['_historyView']['updateItemTitle'](_0x2181c2,_0x14fa3d);}['updateItemLoadingState'](_0x3a4e54,_0x57bcb7,_0x5d1818){this['_historyView']['updateItemLoadingState'](_0x3a4e54,_0x57bcb7,_0x5d1818);}['setLoadingSkeleton'](_0x245273){this['_historyView']['isLoading']=_0x245273;}['showError'](_0x173af1){this['_historyView']['errorMessage']=_0x173af1;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x2e59f2){this['_historyView']['isMaximized']=_0x2e59f2;}}class Ue extends ts(){['id'];['createdAt'];constructor({id:_0x4fb3a6,title:_0x389781,createdAt:_0x410fa4,updatedAt:_0x27c095,pinned:_0x3a51f5}){super(),this['id']=_0x4fb3a6,this['createdAt']=new Date(_0x410fa4),this['set']('title',_0x389781),this['set']('updatedAt',_0x27c095?new Date(_0x27c095):null),this['set']('pinned',_0x3a51f5||!0x1);}['updateTitle'](_0x94eda){this['set']('title',_0x239b85(_0x94eda)),this['updatedAt']=new Date();}['updatePinned'](_0x4628c5){this['set']('pinned',_0x4628c5),this['updatedAt']=new Date();}}class Tt extends _0x3ea0e5(){['items']=[];['connector'];['group'];constructor({connector:_0x4bfa10,group:_0x376aea}){super(),this['connector']=_0x4bfa10,this['group']=_0x376aea;}async['init'](){try{const _0xd18d85=this['connector']['fetchConversations'](this['group']),_0x41f15f=await _0xd18d85['getConversations']();this['loadItems'](_0x41f15f);}catch(_0xce745d){this['fire']('error',{'error':_0xce745d,'operation':'init'});}}['addItem'](_0x3b8ad0){this['items']['push'](_0x3b8ad0);}async['removeItem'](_0x40b6a8){const _0x3601be=this['items']['findIndex'](_0xcae27d=>_0xcae27d['id']===_0x40b6a8);if(-0x1===_0x3601be)return!0x1;try{return await this['connector']['deleteConversation'](_0x40b6a8)['execute'](),this['items']['splice'](_0x3601be,0x1),this['fire']('itemRemoved',{'itemId':_0x40b6a8}),!0x0;}catch(_0x2e624d){return this['fire']('error',{'error':_0x2e624d,'operation':'removeItem','itemId':_0x40b6a8}),!0x1;}}['getItem'](_0x2f3c95){return this['items']['find'](_0x3dbfdc=>_0x3dbfdc['id']===_0x2f3c95);}async['updateItemTitle'](_0x2b2710,_0x3aa324){const _0x29cec3=this['getItem'](_0x2b2710);if(!_0x29cec3)return!0x1;try{return await this['connector']['updateConversation'](_0x2b2710,{'title':_0x3aa324})['getResult'](),_0x29cec3['updateTitle'](_0x3aa324),this['fire']('itemUpdated',{'itemId':_0x2b2710,'updates':{'title':_0x3aa324}}),!0x0;}catch(_0x469fa1){return this['fire']('error',{'error':_0x469fa1,'operation':'updateItemTitle','itemId':_0x2b2710}),!0x1;}}async['updateItemPinned'](_0x2edd1a,_0x32e0ab){const _0x45f3b3=this['getItem'](_0x2edd1a);if(!_0x45f3b3)return!0x1;try{return await this['connector']['updateConversation'](_0x2edd1a,{'pinned':_0x32e0ab})['getResult'](),_0x45f3b3['updatePinned'](_0x32e0ab),this['fire']('itemUpdated',{'itemId':_0x2edd1a,'updates':{'pinned':_0x32e0ab}}),!0x0;}catch(_0x3269fe){return this['fire']('error',{'error':_0x3269fe,'operation':'updateItemPinned','itemId':_0x2edd1a}),!0x1;}}['loadItems'](_0x4eaab7){try{this['items']=[],_0x4eaab7['map'](_0x16691f=>{this['addItem'](new Ue(_0x16691f));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x40f1ab){this['fire']('error',{'error':_0x40f1ab,'operation':'loadItems'});}}['getItems'](_0x310ff8={}){const _0x2998c3=void 0x0!==_0x310ff8['pinned']&&_0x310ff8['pinned'],_0x24e44b=_0x310ff8['from']?new Date(_0x310ff8['from']['getFullYear'](),_0x310ff8['from']['getMonth'](),_0x310ff8['from']['getDate']()):null,_0x779e61=_0x310ff8['to']?new Date(_0x310ff8['to']['getFullYear'](),_0x310ff8['to']['getMonth'](),_0x310ff8['to']['getDate']()):null;return this['items']['filter'](_0x2ac7e2=>{if(_0x2ac7e2['pinned']!==_0x2998c3)return!0x1;if(_0x779e61){const _0x26cade=new Date(_0x2ac7e2['createdAt']['getFullYear'](),_0x2ac7e2['createdAt']['getMonth'](),_0x2ac7e2['createdAt']['getDate']());return _0x24e44b?_0x24e44b['getTime']()===_0x779e61['getTime']()?_0x26cade['getTime']()===_0x24e44b['getTime']():_0x26cade<_0x779e61&&_0x26cade>=_0x24e44b:_0x26cade<_0x779e61;}return!0x0;});}}class at extends _0x5aeef2{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[q,ht,ct,_t];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](q),this['_aiChatHistoryUi']=this['context']['plugins']['get'](ct),this['_aiChatController']=this['context']['plugins']['get'](ht);const _0x110160=this['context']['plugins']['get'](_t);try{const _0x523525=this['_aiChatController']['getGroupId']();this['history']=new Tt({'connector':this['_aiConnector'],'group':_0x523525}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x32a5b0,_0xec7161)=>{this['_setItemLoading'](_0xec7161['id'],'remove'),this['_handleRemove'](_0xec7161['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x4911a5,_0x2ec7b1)=>{this['_setItemLoading'](_0x2ec7b1['id'],'rename'),this['_handleEditTitle'](_0x2ec7b1['id'],_0x2ec7b1['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x43cb38,_0x53bae5)=>{void 0x0!==_0x53bae5['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x53bae5['itemId'],_0x53bae5['updates']['title']),void 0x0!==_0x53bae5['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x53bae5['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x1900aa,_0x3f781a)=>{this['_aiChatController']['handleRemovedConversation'](_0x3f781a['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x3f781a['itemId']),this['_clearItemLoading'](_0x3f781a['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x3c02dd,_0x35e43f)=>{this['_handleHistoryErrorUI'](_0x35e43f['error'],_0x35e43f['operation'],_0x35e43f['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x198585,_0x260f8f)=>{this['_handleSelectConversation'](_0x260f8f['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x385bc0,_0x4e707d)=>{const _0x21c490=_0x4e707d['pinned']?'pin':'unpin';this['_setItemLoading'](_0x4e707d['id'],_0x21c490),this['_handleTogglePin'](_0x4e707d['id'],_0x4e707d['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x110160['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x110160['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x110160,'resizedTabs',(_0x4ab6f6,_0x417407)=>{this['_setIsMaximized'](_0x417407);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x110160['resize']();});}catch(_0x56b0cd){this['_handleHistoryErrorUI'](_0x56b0cd,'init');}}async['_handleEditTitle'](_0x4cc1c4,_0x3dccee){await this['history']['updateItemTitle'](_0x4cc1c4,_0x3dccee);}async['_handleTogglePin'](_0x33a2b0,_0xf9f2a6){await this['history']['updateItemPinned'](_0x33a2b0,_0xf9f2a6);}async['_handleRemove'](_0x14eab3){await this['history']['removeItem'](_0x14eab3);}async['_handleSelectConversation'](_0x121cba){await this['_aiChatController']['loadConversation'](_0x121cba);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x17f298=this['_aiChatController']['activeConversation']?.['id'],_0x3a5f8d=this['_getCategorizedItems']()['map'](_0x389197=>({'title':_0x389197['title'],'items':_0x389197['items']['map'](_0x5f3f58=>({'id':_0x5f3f58['id'],'title':_0x5f3f58['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x5f3f58['createdAt'])['toLocaleDateString'](),'active':_0x5f3f58['id']===_0x17f298,'pinned':_0x5f3f58['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x3a5f8d);}['_setItemLoading'](_0x4764f3,_0x198684){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x4764f3,_0x198684,!0x0);}['_clearItemLoading'](_0x28c148){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x28c148,null,!0x1);}['_handleHistoryErrorUI'](_0x320174,_0x1acb13,_0x2f069a){const _0x292b8d=this['_generateErrorMessage'](_0x1acb13,_0x2f069a);this['_aiChatHistoryUi']['showError'](_0x292b8d),_0x2f069a&&this['_clearItemLoading'](_0x2f069a),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x4b5381,_0x1d5782){const _0x2707b9=_0x1d5782?this['history']['getItem'](_0x1d5782):null,_0x1bd86d=_0x2707b9?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x4b5381){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x1bd86d);case'updateItemPinned':{const _0x4476d7=i(this['context']['locale'],_0x2707b9?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x4476d7,_0x1bd86d]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x1bd86d);case'init':case'loadItems':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x273a2f=new Date(),_0x3a8a4b=new Date(_0x273a2f['getFullYear'](),_0x273a2f['getMonth'](),_0x273a2f['getDate']()),_0x54ee26=new Date(_0x3a8a4b);_0x54ee26['setDate'](_0x54ee26['getDate']()-0x1);const _0x4f6540=new Date(_0x3a8a4b);_0x4f6540['setDate'](_0x4f6540['getDate']()-0xe);const _0x1f72de=this['history']['getItems']({'pinned':!0x0}),_0x453903=this['history']['getItems']({'from':_0x3a8a4b,'to':_0x3a8a4b}),_0x5ddc19=this['history']['getItems']({'from':_0x54ee26,'to':_0x54ee26}),_0x571567=this['history']['getItems']({'from':_0x4f6540,'to':_0x54ee26}),_0x444824=this['history']['getItems']({'to':_0x4f6540}),_0x37ab0b=[];return _0x1f72de['length']>0x0&&_0x37ab0b['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x1f72de}),_0x453903['length']>0x0&&_0x37ab0b['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x453903}),_0x5ddc19['length']>0x0&&_0x37ab0b['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x5ddc19}),_0x571567['length']>0x0&&_0x37ab0b['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x571567}),_0x444824['length']>0x0&&_0x37ab0b['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x444824}),_0x37ab0b;}['_setIsMaximized'](_0x27e574){this['_aiChatHistoryUi']['setIsMaximized'](_0x27e574);}}class lt extends _0x5aeef2{static get['requires'](){return[at,ct];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Fa extends _0x5aeef2{static get['requires'](){return[ht,D,ut,lt];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2a3592){super(_0x2a3592),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.initialConversation','new');}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](ht)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](ht)['startConversation']();}async['sendMessage']({message:_0x5c95e2,attributes:_0x31f327}){await this['context']['plugins']['get'](ht)['sendMessage']({'message':_0x5c95e2,'attributes':_0x31f327});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](ht)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](ht)['focusPromptInput']();}['registerToolDataCallback'](_0x40e819){this['context']['plugins']['get'](ht)['_registerToolDataCallback'](_0x40e819);}}class ks extends _0x480cf4{['id'];constructor(_0x54db5a,_0x5af8e6){super(_0x54db5a);const {id:_0x13412a,type:_0x2ba5c4,icon:_0x1f8ef8}=_0x5af8e6;this['id']=_0x13412a,this['set']({'label':_0x5af8e6['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x5af8e6['id']}}),_0x1f8ef8?this['icon']=_0x1f8ef8:'chat'===_0x2ba5c4?this['icon']=_0x5d925d:'review'===_0x2ba5c4?this['icon']=_0x2b6ee2:'translate'===_0x2ba5c4&&(this['icon']=Vt);}}class jt extends _0x3836c7{['listView'];constructor(_0x1c1f1a,_0x32bceb){super(_0x1c1f1a);const _0x5414d2=_0x32bceb['map'](_0xd0b704=>{const _0x4cb146=new _0x4ef88a(this['locale']),_0xfe46e4=new ks(this['locale'],_0xd0b704);return _0x4cb146['children']['add'](_0xfe46e4),_0xfe46e4['delegate']('execute')['to'](this),_0x4cb146;});this['listView']=new _0x2c9917(this['locale']),this['listView']['items']['addMany'](_0x5414d2),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const kt='chat-shortcuts';var Ka=function(_0x5b1ac7){return _0x5b1ac7['CHAT']='chat',_0x5b1ac7['REVIEW']='review',_0x5b1ac7['TRANSLATE']='translate',_0x5b1ac7;}({});class Wa extends _0x5aeef2{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[ut];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](ut),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x49cb7b=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x49cb7b['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x49cb7b,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x13793b=Object['values'](Ka);this['_shortcuts']['forEach'](_0x36454d=>{let _0x25f8ef=!0x0;if(_0x36454d['id']&&_0x36454d['label']&&_0x13793b['includes'](_0x36454d['type'])?'chat'===_0x36454d['type']&&(_0x25f8ef='string'==typeof _0x36454d['prompt']):_0x25f8ef=!0x1,!_0x25f8ef)throw new _0x5a06e8('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x36454d});});}['_injectShortcuts'](){const _0x200bcd=this['context']['plugins']['get'](ut);this['_shortcutsView']=new jt(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x200bcd['addFeedItemCustomElement'](this['_shortcutsView']['element'],kt),this['_shortcutsView']['on']('execute',_0x2ad552=>{const _0x525528=_0x2ad552['source']['id'];this['_executeShortcut'](_0x525528);});}['_removeShortcuts'](){const _0xfe5a9d=this['context']['plugins']['get'](ut);_0xfe5a9d['hasFeedItem'](kt)&&_0xfe5a9d['removeFeedItem'](kt),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x27bd9c){const _0x44fe76=this['_shortcuts']['find'](_0x4a7f50=>_0x4a7f50['id']===_0x27bd9c),_0x339d2f=_0x44fe76['type'];'chat'===_0x339d2f?this['_runChatShortcut'](_0x44fe76):'review'===_0x339d2f?_0x44fe76['check']?this['_runReviewShortcut'](_0x44fe76):this['_switchTab']('reviewMode'):'translate'===_0x339d2f&&(_0x44fe76['language']?this['_runTranslateShortcut'](_0x44fe76):this['_switchTab']('translate'));}['_switchTab'](_0xef85f0){if(!this['context']['plugins']['has']('AITabs'))throw new _0x5a06e8('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0xef85f0});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0xef85f0);}async['_runChatShortcut']({prompt:_0x26e385,draftMode:_0x383707,useWebSearch:_0x2a84cb=!0x1,useReasoning:_0x4c386c=!0x1,model:_0x2de88a}){const _0x37c45f=this['context']['plugins']['get']('AIChat'),_0xafd3d7=this['context']['plugins']['get']('AIChatController'),_0x2b231a=_0xafd3d7['activeConversation'];let _0x5f67f9;_0x5f67f9=_0x2de88a?await _0x2b231a['chatModels']['getModel'](_0x2de88a):await _0x2b231a['chatModels']['getDefault'](),_0x5f67f9&&await _0x2b231a['setModel'](_0x5f67f9),_0x2b231a['setWebSearch'](_0x2a84cb),_0x2b231a['setReasoning'](_0x4c386c),_0xafd3d7['addCurrentDocumentToChatContext'](),_0x383707?(this['_aiChatUI']['setPromptInputValue'](_0x26e385),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x37c45f['sendMessage']({'message':_0x26e385});}['_runReviewShortcut']({check:_0xf82830,model:_0x305122,prompt:_0x23afcc,params:_0x19ecc6}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0x5a06e8('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x569112={'id':_0xf82830,'isCustom':'custom'===_0xf82830};_0x305122&&_0x23afcc&&(_0x569112['args']={'model':_0x305122,'prompt':_0x23afcc}),_0x19ecc6&&(_0x569112['params']=_0x19ecc6),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x569112);}['_runTranslateShortcut']({language:_0x25bfc8}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0x5a06e8('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x25bfc8,'args':{'language':_0x25bfc8}});}}class io extends Ut{constructor(_0x31f9b5){super(_0x31f9b5);const _0x49696f=_0x31f9b5['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x49696f,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x3f8a9d=this['editor']['plugins']['get']('AITabs')['view'];_0x3f8a9d['isVisible']=!_0x3f8a9d['isVisible'];}}class qt extends _0x5d4a72{static get['requires'](){return[_t];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x35c3c8=this['editor'];_0x35c3c8['commands']['add']('toggleAi',new io(_0x35c3c8)),_0x35c3c8['ui']['componentFactory']['add']('toggleAi',()=>{const _0x5036a7=this['_createAIUIButton'](_0x480cf4);return _0x5036a7['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x5036a7;}),_0x35c3c8['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x279aa7=this['_createAIUIButton'](_0x157a87);return _0x279aa7['set']({'role':'menuitemcheckbox'}),_0x279aa7;});}['_createAIUIButton'](_0x16a159){const _0x56d226=this['editor'],_0x5d334c=_0x56d226['commands']['get']('toggleAi'),_0x5a2686=new _0x16a159(_0x56d226['locale']);return _0x5a2686['set']({'label':i(_0x56d226['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x471cb9,'isToggleable':!0x0}),_0x5a2686['bind']('isEnabled')['to'](_0x5d334c),_0x5a2686['bind']('isOn')['to'](_0x5d334c,'value',_0x2e61fb=>!!_0x2e61fb),this['listenTo'](_0x5a2686,'execute',()=>{_0x5d334c['execute']();}),_0x5a2686;}}const F=['applySuggestion','insertSuggestion','showNext','showPrevious'];class ls extends _0x3836c7{['_errorView'];constructor(_0x5ac0f3){super(_0x5ac0f3),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x8759ad){this['showError'](_0x8759ad);}['showError'](_0x282903){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x282903,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x407f89=new _0x3836c7(this['locale']),_0xca93d0=new _0x3836c7(this['locale']);return _0xca93d0['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x407f89['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x17425e=>!_0x17425e)]},'children':[_0xca93d0]}),_0x407f89;}}const $=0xa;class Q extends _0x5aeef2{static get['requires'](){return[D];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x4a1b3c){const {id:_0x113400}=this['_currentConfig']??{};this['_currentConfig']=_0x4a1b3c;const {id:_0x141c64}=this['_currentConfig'];this['isOpen']&&_0x113400===_0x141c64?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x13d35d=T(this['context'])['plugins']['get']('Dialog');_0x13d35d['isOpen']&&this['_currentConfig']&&_0x13d35d['id']===this['_currentConfig']['id']&&_0x13d35d['hide']();}['_updateDialog'](){const _0x36bd03=T(this['context'])['plugins']['get']('Dialog'),{icon:_0x42c27b,title:_0x260599}=this['_currentConfig'];_0x36bd03['view']?.['headerView']&&(_0x36bd03['view']['headerView']['label']=_0x260599,_0x36bd03['view']['headerView']['iconView']&&_0x42c27b&&(_0x36bd03['view']['headerView']['iconView']['content']=_0x42c27b)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x36bd03['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](D)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x182300){this['context']['plugins']['get'](D)['hideFakeVisualSelection']('ai-balloon-'+_0x182300);}['_showDialog'](){const _0x3de625=T(this['context'])['plugins']['get']('Dialog'),{id:_0x107806,title:_0x3e4c7e,icon:_0x389b2b,class:_0xd73f00,mainView:_0x2f73bc}=this['_currentConfig'];_0x2f73bc['delegate'](...F)['to'](this),_0x3de625['show']({'title':_0x3e4c7e,'icon':_0x389b2b,'hasCloseButton':!0x0,'id':_0x107806,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0xd73f00||''),'content':_0x2f73bc,'onShow':_0x4da1a7=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x2f073c=this['_getSelectionElements']();_0x2f073c&&_0x2f073c[0x0]&&_0x3f0a76({'target':_0x2f073c[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x4da1a7['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x107806});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x107806}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x519e38,_0x52aa7e){if(!_0x52aa7e)return null;const _0x4c1ae7=this['_getSelectionElements']();if(!_0x4c1ae7||0x0===_0x4c1ae7['length'])return{'left':Math['round'](_0x52aa7e['left']+_0x52aa7e['width']/0x2-_0x519e38['width']/0x2),'top':Math['round'](_0x52aa7e['top']+_0x52aa7e['height']/0x2-_0x519e38['height']/0x2)};const _0x268535=Math['round'](_0x52aa7e['left']+_0x52aa7e['width']/0x2-_0x519e38['width']/0x2),_0x35a0d4=_0x4c1ae7['map'](_0x161423=>new _0x4795f2(_0x161423)),_0x1e5acd=_0x519e38['height'];return{'left':_0x268535,'top':this['_calculateOptimalTopPosition'](_0x35a0d4,_0x1e5acd,_0x52aa7e)};}['_calculateOptimalTopPosition'](_0x559aeb,_0x232a44,_0x54521c){const _0x4ff13c=new _0x4795f2(_0x43aaf8['window']),_0x52bea4=_0x559aeb['map'](_0x1c20a8=>_0x1c20a8['getVisible']())['filter'](_0x2d3278=>_0x2d3278),_0x2f6e0b=_0x4795f2['getBoundingRect'](_0x52bea4);if(!_0x2f6e0b)return Math['round'](_0x54521c['top']+_0x54521c['height']/0x2);const _0xf6e633=_0x4ff13c['getIntersection'](_0x2f6e0b);if(!_0xf6e633)return Math['round'](_0x54521c['top']+_0x54521c['height']/0x2);const _0x47f7b3=_0x54521c['getVisible'](),_0x4627d2=_0x47f7b3&&_0x2f6e0b['height']>_0x47f7b3['height'],_0x3beb0a=_0xf6e633['top'],_0x383319=_0xf6e633['bottom'];if(_0x4627d2){const _0x513e5a=(_0x47f7b3||_0x4ff13c)['height']/0x2-_0x232a44/0x2,_0x12e9ba=_0x3beb0a-$-_0x54521c['top'],_0x27c82f=_0x54521c['bottom']-_0x383319-$;return _0x12e9ba>=_0x232a44?Math['max']($,_0x3beb0a-_0x232a44-$):_0x27c82f>=_0x232a44?_0x383319+$:Math['max']($,_0x513e5a);}const _0x23b5bb=_0x3beb0a-_0x232a44,_0x1f6c9d=_0x54521c['bottom']-_0x383319-$,_0x5ea9bf=_0x3beb0a-$-_0x54521c['top'];let _0x4a4225;if(_0x1f6c9d>=_0x232a44)_0x4a4225=_0x383319+$;else{if(_0x5ea9bf>=_0x232a44)_0x4a4225=_0x23b5bb-$;else _0x4a4225=_0x3beb0a+_0x2f6e0b['height']/0x2-_0x232a44/0x2;}return _0x4a4225;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x259e71=T(this['context']);this['listenTo'](_0x259e71['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0xad0f8e,data:{newRange:_0x1eef0f}}of _0x259e71['model']['document']['differ']['getChangedMarkers']())if(_0xad0f8e['startsWith'](R+':')&&(_0x1eef0f&&(_0x1eef0f['start']['isEqual'](_0x1eef0f['end'])||'$graveyard'==_0x1eef0f['root']['rootName'])||null==_0x1eef0f)){const _0x4ff634=i(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x4ff634),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x269f46=T(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x269f46['model']['document']);}['_getSelectionElements'](){const _0x49cab9=T(this['context']);return _0x5ec425(_0x49cab9['editing'],[..._0x49cab9['model']['markers']['getMarkersGroup']('ai-selection'),..._0x49cab9['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class us extends _0x286a6e{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x4a1a2b,_0x3fbae1={}){super(_0x4a1a2b),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x3fbae1};const _0x490492=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x490492?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['toggleShowChangesEnabled'](_0x3098a9){this['showChangesButton']['isEnabled']=_0x3098a9;}['_setupRatingButtons'](){this['likeButton']=new _0x480cf4(this['locale']),this['likeButton']['set']({'icon':_0x3403e0,'label':i(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x480cf4(this['locale']),this['dislikeButton']['set']({'icon':_0x111706,'label':i(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x480cf4(this['locale']),this['copyButton']['set']({'icon':_0x2d5bcb,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x1cc450=new _0x1254c7();_0x1cc450['set']({'content':_0x688d01}),_0x1cc450['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20ck-ai-mini-toolbar-copy-button_copied',setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button';},0x7d0);}),this['copyButton']['children']['add'](_0x1cc450);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x480cf4(this['locale']),this['showChangesButton']['set']({'icon':_0x14aae7,'label':i(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':'ck-ai-button-tertiary'}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x70e9e8=>_0x70e9e8?_0x108750:_0x14aae7),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class gt extends ls{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x31e368,_0x1a2ded){super(_0x31e368);const _0x73b1be=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _0x50a6e7(),this['_keystrokes']=new _0x2971c3(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x39194d({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x1a2ded,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new as(_0x31e368),this['_partToolbarView']=new cs(_0x31e368,_0x1a2ded['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x1a2ded),this['_stateView']=new ws(_0x31e368),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new us(_0x31e368,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new ms(_0x31e368,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x44f454,_0x12589,_0x2db2e0,_0x45aa2c)=>{let _0x532689,_0x1b52d2;'pending'===_0x45aa2c?(_0x532689=this['_partToolbarView'],_0x1b52d2=this['_stateView']):(_0x532689=this['_stateView'],_0x1b52d2=this['_partToolbarView']),this['_stateView']['setState'](_0x2db2e0),_0x532689['isVisible']=!0x1,_0x1b52d2['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x73b1be['to']('_state',_0x3597f1=>'ck-ai-chat-balloon-main_state_'+_0x3597f1)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x1a2ded);});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_partToolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_partToolbarView'],this['_miniToolbarView']]);}['destroy'](){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}['focusLast'](){this['focusCycler']['focusLast']();}async['updateContent'](_0xb9cbbc){_0xb9cbbc?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0xb9cbbc);}['setState'](_0x5b593c){this['_state']=_0x5b593c;}['showError'](_0x4c523a){super['showError'](_0x4c523a),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x36ed86){super['showBlockingError'](_0x36ed86),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0xd82b50){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0xd82b50;}['togglePartToolbarEnabled'](_0x3c74f0){this['_partToolbarView']['isEnabled']=_0x3c74f0;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x3fcfc9,showSuggestButton:_0x19f885}){_0x3fcfc9=_0x3fcfc9&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x19f885=_0x19f885&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x3fcfc9,'showSuggestButton':_0x19f885});}['_createNextButtonView'](){const _0x1020a6=new _0x480cf4(this['locale']);return _0x1020a6['set']({'icon':_0x1bf910,'label':i(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x1020a6['on']('execute',()=>{this['fire']('showNext');}),_0x1020a6;}['_createPreviousButtonView'](){const _0x4770ba=new _0x480cf4(this['locale']);return _0x4770ba['set']({'icon':_0x4dee81,'label':i(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x4770ba['on']('execute',()=>{this['fire']('showPrevious');}),_0x4770ba;}}class ms extends _0x3836c7{constructor(_0x5311e3,_0x8db253){super(_0x5311e3),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x8db253});}}class zt extends _0x5d4a72{static get['requires'](){return[_0x164193,Q];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x7ce301){super(_0x7ce301),this['set']('showDiff',!0x1);}['open'](_0x5cbc95){const _0x510e97=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x510e97['plugins']['get']('AIBalloon')['open']({..._0x5cbc95,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x5cbc95['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x5cbc95['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x5d2787){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x5d2787);}['setState'](_0x33866b){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x33866b);}['_createChatBalloonView'](){const _0x5626fb=this['editor'],_0x288851=_0x5626fb['plugins']['get']('AIBalloon'),_0x47ecf1=_0x5626fb['commands']['get']('trackChanges');let _0xfd3465=_0x5626fb['config']['get']('ai.availableReplyActions')||[...ot];_0x5626fb['plugins']['has']('TrackChanges')||(_0xfd3465=_0xfd3465['filter'](_0x117e56=>'insertSuggestion'!=_0x117e56));const _0x48e3e8=new gt(_0x5626fb['locale'],{'availableActions':_0xfd3465,'showApplyButton':!0x0,'showSuggestButton':!!_0x47ecf1});return _0x48e3e8['bind']('showDiff')['to'](this),_0x48e3e8['delegate'](...ft)['to'](this),_0x48e3e8['delegate']('showPrevious','showNext')['to'](this),_0x288851['delegate']('dialogClosed')['to'](this),_0x48e3e8['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x48e3e8['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x48e3e8['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x47ecf1&&_0x48e3e8['bind']('isTrackChangesOn')['to'](_0x47ecf1,'value'),_0x48e3e8['render'](),_0x48e3e8;}['_toggleRotatorButtonsInDialogHeader'](_0x1c6727){const _0x123e95=this['editor'],_0x53dc03=_0x123e95['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x1c6727),_0x53dc03['has'](this['_chatBalloonView']['previousButtonView'])||(_0x53dc03['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x123e95['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x53dc03['remove'](this['_chatBalloonView']['previousButtonView']),_0x53dc03['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class Ya extends _0x5d4a72{static get['requires'](){return[qt,zt,Bt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Zt(_0x296275){const {editor:_0x254c77,action:_0x1c63bc,withText:_0x24997d=!0x1,withIcon:_0x33a4c1=!0x0,isInDropdown:_0x3590bc=!0x0,shouldPreventFocus:_0x1eb4ae=!0x1}=_0x296275;return()=>{const _0x26c015=_0x254c77['locale'],_0x431ed0=new _0x480cf4(_0x26c015),_0x5e7216=_0x431ed0['bindTemplate'];_0x3590bc&&_0x431ed0['extendTemplate']({'on':{'mouseenter':_0x5e7216['to'](()=>{_0x1eb4ae&&_0x1eb4ae()||_0x431ed0['focus']();})}});const _0x2a375a=_0x1c63bc['icon']??_0x1c63bc['parent']?.['icon'];return _0x431ed0['set']({'label':_0x1c63bc['displayedPrompt'],'withText':_0x24997d,'role':'menuitem','icon':_0x33a4c1?_0x2a375a??_0x4a31ba:void 0x0,'tooltip':!_0x24997d,'class':'ck-ai-quick-actions-button','isEnabled':_0x1c63bc['isEnabled']}),_0x431ed0['on']('execute',()=>{_0x254c77['editing']['view']['focus'](),_0x254c77['commands']['execute']('aiQuickAction',_0x1c63bc);}),_0x431ed0;};}class Ps extends _0x3a08f3{['arrowView'];constructor(_0x346a81,_0x141751){super(_0x346a81,_0x141751);const _0x3540a9=this['bindTemplate'];this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':['ck-dropdown-menu-list__nested-menu__button'],'aria-haspopup':!0x0,'aria-expanded':this['bindTemplate']['to']('isOn',_0x3d3d99=>String(_0x3d3d99)),'data-cke-tooltip-disabled':_0x3540a9['to']('isOn')},'on':{'mouseenter':_0x3540a9['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x23aa31=new _0x1254c7();return _0x23aa31['content']=_0x3f3220,_0x23aa31['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x23aa31;}}class js extends _0x2c9917{['_allListItems'];['_allSearchableItems'];constructor(_0x35dee0,_0x1499ea,_0x3cc501){super(_0x35dee0),this['_allListItems']=_0x1499ea,this['_allSearchableItems']=_0x3cc501;}['filter'](_0x15b418){if(!_0x15b418)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x5472f0=_0x15b418['source']['toLowerCase']()['trim'](),_0x94d232=this['_allSearchableItems']['filter'](_0x2c7594=>(_0x2c7594['groupLabel']?_0x2c7594['label']+'\x20('+_0x2c7594['groupLabel']+')':_0x2c7594['label'])['toLowerCase']()['includes'](_0x5472f0));return this['items']['clear'](),this['items']['addMany'](_0x94d232['sort']((_0x3ba580,_0x6ad8ec)=>{const _0xf23517=_0x3ba580['groupLabel'],_0x163dc3=_0x6ad8ec['groupLabel'];return _0xf23517||_0x163dc3?_0xf23517?0x1:-0x1:0x0;})['map'](_0xdb9681=>_0xdb9681['item'])),this['_highlightQuery'](_0x5472f0,_0x94d232),{'resultsCount':_0x94d232['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x5cfc4c,_0x1461fe){if(!_0x5cfc4c)return;const _0x407415=new RegExp(_0x440618(_0x5cfc4c),'gi');_0x1461fe['forEach'](_0x1fd93e=>{_0x1fd93e['highlightViews']&&_0x1fd93e['highlightViews']['forEach'](_0x2969f6=>{'function'==typeof _0x2969f6['highlightText']&&_0x2969f6['highlightText'](_0x407415);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x1ad1e8=>{_0x1ad1e8['highlightViews']&&_0x1ad1e8['highlightViews']['forEach'](_0x2c819c=>{'function'==typeof _0x2c819c['highlightText']&&_0x2c819c['highlightText'](null);});});}}const Ls='menu',Qs='menuitem';class co extends _0x3836c7{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x3d9d07,_0x4aa7bd,_0x3f0073,_0x59331d,_0x457950=!0x1){const _0x4fa068=_0x3d9d07['locale'];super(_0x4fa068),this['_bodyCollection']=_0x59331d,this['_hasSearch']=_0x457950;const _0x2457e5=this['_createListItems'](_0x3d9d07,_0x4aa7bd,_0x3f0073);this['optionsListView']=new js(_0x4fa068,_0x2457e5,this['_allSearchableItems']),this['optionsListView']['role']=Ls,this['optionsListView']['items']['addMany'](_0x2457e5),this['focusTracker']=new _0x50a6e7(),this['keystrokes']=new _0x2971c3(),_0x457950&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x2457e5,this['focusCycler']=new _0x39194d({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x457950&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x1d0cfb=_0x457950&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x1b8196(_0x1d0cfb),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x4fa068['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x283161(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x151830=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x151830);}['_createListItems'](_0x31dd3b,_0x47255b,_0x150ae6){const _0x3ff8c9=new _0x1b8196();return _0x47255b['forEach'](_0x1f1029=>{if('actions'in _0x1f1029){const {listItem:_0x34119b}=this['_createActionGroupButton'](_0x31dd3b,_0x1f1029,_0x150ae6);_0x3ff8c9['add'](_0x34119b),_0x1f1029['actions']['forEach'](_0x45dc90=>{this['_createActionButton'](_0x31dd3b,_0x45dc90,_0x1f1029['label'],_0x1f1029['icon']);const {listItem:_0x4d5cca,highlightViews:_0x395989}=this['_createSearchResultActionButton'](_0x31dd3b,_0x45dc90,_0x1f1029['label'],_0x1f1029['icon']);this['_allSearchableItems']['push']({'item':_0x4d5cca,'label':_0x45dc90['displayedPrompt'],'groupLabel':_0x1f1029['label'],'highlightViews':_0x395989});});}else{const {listItem:_0x536cfb}=this['_createActionButton'](_0x31dd3b,_0x1f1029);_0x3ff8c9['add'](_0x536cfb);const _0x5b7cdd=_0x536cfb['children']['first'];if(_0x5b7cdd){const {listItem:_0xf2c081,highlightViews:_0x5477ea}=this['_createSearchResultActionButton'](_0x31dd3b,_0x1f1029);this['_allSearchableItems']['push']({'item':_0xf2c081,'label':_0x5b7cdd['label']||'','highlightViews':_0x5477ea});}}}),_0x3ff8c9;}['_createActionButton'](_0x7d0d87,_0x112856,_0x5d049a,_0x29292a){const _0x360ae1=new _0x4ef88a(this['locale']);if(_0x5d049a&&_0x29292a){const _0x2d6912=new _0x480cf4(this['locale']),_0x189e43=_0x2d6912['bindTemplate'],_0x222bed=new _0x3dba21();_0x222bed['text']=_0x112856['displayedPrompt'];const _0x2b3ce7=new _0x3dba21();_0x2b3ce7['text']=_0x5d049a;const _0x4989d1=new _0x1254c7();_0x4989d1['content']=_0x29292a,_0x4989d1['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0xf7d37=new _0x3836c7(this['locale']);_0xf7d37['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x58dd42=new _0x3836c7(this['locale']);return _0x58dd42['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x2d6912['set']({'label':_0x112856['displayedPrompt']+'\x20('+_0x5d049a+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x2d6912['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x222bed,_0xf7d37,_0x4989d1,_0x2b3ce7,_0x58dd42],'on':{'mouseenter':_0x189e43['to'](()=>{this['_isSearchFocused']()||_0x2d6912['focus']();}),'click':_0x189e43['to'](()=>{_0x2d6912['fire']('execute');})}}),_0x2d6912['on']('execute',()=>{_0x7d0d87['editing']['view']['focus'](),_0x7d0d87['commands']['execute']('aiQuickAction',_0x112856);}),_0x360ae1['children']['add'](_0x2d6912),{'listItem':_0x360ae1,'highlightViews':[_0x222bed,_0x2b3ce7]};}{const _0x16efbe=new _0x4278e2(),_0x10114a=new _0x480cf4(this['locale'],_0x16efbe),_0x201e9b=_0x10114a['bindTemplate'],_0x2dbc05=_0x112856['icon']??_0x112856['parent']?.['icon'],_0x4d5da9=void 0x0!==_0x112856['icon'];return _0x10114a['set']({'label':_0x112856['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x4d5da9?_0x2dbc05??_0x4a31ba:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x10114a['extendTemplate']({'on':{'mouseenter':_0x201e9b['to'](()=>{this['_isSearchFocused']()||_0x10114a['focus']();})}}),_0x10114a['on']('execute',()=>{_0x7d0d87['editing']['view']['focus'](),_0x7d0d87['commands']['execute']('aiQuickAction',_0x112856);}),_0x360ae1['children']['add'](_0x10114a),{'listItem':_0x360ae1,'highlightViews':[_0x16efbe]};}}['_createSearchResultActionButton'](_0x5a37f9,_0xb980f3,_0xa1f56e,_0x5c0423){return _0xa1f56e&&_0x5c0423?this['_createSearchResultGroupedActionButton'](_0x5a37f9,_0xb980f3,_0xa1f56e,_0x5c0423):this['_createSearchResultIndividualActionButton'](_0x5a37f9,_0xb980f3);}['_createSearchResultGroupedActionButton'](_0x27578c,_0x671697,_0x28db98,_0x1922ea){const _0x4f57a9=new _0x4ef88a(this['locale']),_0x27c495=new _0x480cf4(this['locale']),_0x1a57f1=_0x27c495['bindTemplate'],{view:_0x55c0d8,highlightView:_0x48d1d2}=this['_createSearchResultGroupRow'](_0x28db98,_0x1922ea),{view:_0x542693,highlightView:_0x525d4f}=this['_createSearchResultActionRow'](_0x671697['displayedPrompt']),_0x2add90=this['_createSearchResultContentView'](_0x55c0d8,_0x542693);return _0x27c495['set']({'label':_0x671697['displayedPrompt'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1}),_0x27c495['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-search-result-button','ck-ai-quick-actions-search-result-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x2add90],'on':{'mouseenter':_0x1a57f1['to'](()=>{this['_isSearchFocused']()||_0x27c495['focus']();}),'click':_0x1a57f1['to'](()=>{this['_handleSearchResultButtonClick'](_0x27c495);})}}),this['_setupActionButtonExecution'](_0x27c495,_0x27578c,_0x671697),_0x4f57a9['children']['add'](_0x27c495),{'listItem':_0x4f57a9,'highlightViews':[_0x48d1d2,_0x525d4f]};}['_createSearchResultIndividualActionButton'](_0x4f71e5,_0x50846e){const _0x580e1a=new _0x4ef88a(this['locale']),_0x49ebb9=new _0x4278e2(),_0x5b14ad=new _0x480cf4(this['locale'],_0x49ebb9),_0x336f9c=_0x5b14ad['bindTemplate'];return _0x5b14ad['set']({'label':_0x50846e['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x5b14ad['extendTemplate']({'on':{'mouseenter':_0x336f9c['to'](()=>{this['_isSearchFocused']()||_0x5b14ad['focus']();})}}),this['_setupActionButtonExecution'](_0x5b14ad,_0x4f71e5,_0x50846e),_0x580e1a['children']['add'](_0x5b14ad),{'listItem':_0x580e1a,'highlightViews':[_0x49ebb9]};}['_createSearchResultGroupRow'](_0x1dbf9b,_0x53acb8){const _0x20bba5=new _0x3836c7(this['locale']),_0x45c743=new _0x1254c7();_0x45c743['content']=_0x53acb8,_0x45c743['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x4dc7f0=new _0x3dba21();return _0x4dc7f0['text']=_0x1dbf9b,_0x20bba5['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x45c743,_0x4dc7f0]}),{'view':_0x20bba5,'highlightView':_0x4dc7f0};}['_createSearchResultActionRow'](_0x222eeb){const _0x1c4977=new _0x3836c7(this['locale']),_0x7759f7=new _0x3dba21();return _0x7759f7['text']=_0x222eeb,_0x1c4977['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x7759f7]}),{'view':_0x1c4977,'highlightView':_0x7759f7};}['_createSearchResultContentView'](_0x426bd8,_0x5800cd){const _0x332634=new _0x3836c7(this['locale']);return _0x332634['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x426bd8,_0x5800cd]}),_0x332634;}['_setupActionButtonExecution'](_0x547409,_0x458e2f,_0x2fc66a){_0x547409['on']('execute',()=>{_0x458e2f['editing']['view']['focus'](),_0x458e2f['commands']['execute']('aiQuickAction',_0x2fc66a);});}['_createActionGroupButton'](_0x24395d,_0x14a882,_0x485447){const _0x159758=new _0x4ef88a(this['locale']),_0xac55a0=new _0x4278e2(),_0x1568ad=new Ps(this['locale'],_0xac55a0),_0x2ea136=_0x1568ad['bindTemplate'],_0x2d617c=this['_getPanelKeystroke'](_0x485447),_0x2d8d75=this['_createGroupActionsList'](_0x24395d,_0x14a882['actions'],_0x485447);_0x1568ad['set']({'label':_0x14a882['label'],'withText':!0x0,'role':Qs,'icon':_0x14a882['icon']??_0x4a31ba,'isEnabled':_0x14a882['actions']['some'](_0x3bb0dd=>_0x3bb0dd['isEnabled'])}),_0x1568ad['extendTemplate']({'on':{'mouseenter':_0x2ea136['to'](()=>{this['_isSearchFocused']()||_0x1568ad['focus']();})}});const _0x4c7fd9=new _0x5019ab(this['locale']);return _0x4c7fd9['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x2ea136['to'](_0x25422f=>{this['_handlePanelKeydown'](_0x25422f,_0x2d617c,_0x1568ad,_0x4c7fd9);})}}),_0x1568ad['bind']('isOn')['to'](_0x4c7fd9,'isVisible'),this['_bodyCollection']['add'](_0x4c7fd9),_0x4c7fd9['content']['add'](_0x2d8d75),this['_setupGroupMenuBehavior'](_0x1568ad,_0x4c7fd9),_0x159758['children']['add'](_0x1568ad),{'listItem':_0x159758,'highlightView':_0xac55a0};}['_createGroupActionsList'](_0x40744e,_0x1f0a4a,_0x3a3910){const _0x419fa5=new _0x2c9917(this['locale']);return _0x419fa5['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x1f0a4a['forEach'](_0x188320=>{const _0x5fad9f=new _0x4ef88a(this['locale']),_0x33a10f=Zt({'editor':_0x40744e,'action':_0x188320,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x5fad9f['children']['add'](_0x33a10f),_0x3a3910['focusTracker']['add'](_0x33a10f),_0x419fa5['items']['add'](_0x5fad9f);}),_0x419fa5;}['_setupGroupMenuBehavior'](_0x3b5bd0,_0x3d7011){const _0x141924=_0x3b5bd0['bindTemplate'],_0x29d293=this['_getButtonKeystroke'](_0x3b5bd0);_0x3b5bd0['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x141924['to'](()=>{this['_showNestedPanel'](_0x3d7011,_0x3b5bd0);}),'mouseleave':_0x141924['to'](_0x2660a7=>{const _0x443417=_0x2660a7['relatedTarget'];this['_isMovingToNestedMenu'](_0x443417,_0x3d7011)||this['_hideNestedPanel'](_0x3d7011);}),'keydown':_0x141924['to'](_0x1fde6f=>{_0x1fde6f['key']==_0x29d293&&(this['_showNestedPanel'](_0x3d7011,_0x3b5bd0),_0x3d7011['content']['get'](0x0)['focus']());})}}),_0x3d7011['on']('render',()=>{_0x3d7011['element']?.['addEventListener']('mouseleave',_0x25fa9d=>{const _0x29bae3=_0x25fa9d['relatedTarget'];_0x3b5bd0['element']?.['contains'](_0x29bae3)||this['_isMovingToNestedMenu'](_0x29bae3,_0x3d7011)||this['_hideNestedPanel'](_0x3d7011);});});}['_showNestedPanel'](_0x56fa57,_0x34c2ea){this['_openNestedPanels']['forEach'](_0x41775b=>{_0x41775b!==_0x56fa57&&_0x41775b['isVisible']&&_0x41775b['hide']();}),_0x56fa57['show'](),_0x56fa57['pin']({'positions':[_0x4f3002['eastSouth']],'target':_0x34c2ea['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x56fa57);}['_hideNestedPanel'](_0xb7c9b9){_0xb7c9b9['hide'](),this['_openNestedPanels']['delete'](_0xb7c9b9);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x2b0f2a=>_0x2b0f2a['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x23c27f,_0x1addba){if(!_0x23c27f)return!0x1;if(_0x1addba['element']?.['contains'](_0x23c27f))return!0x0;const _0x3af3cf=_0x23c27f;return _0x3af3cf['closest']&&(null!==_0x3af3cf['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x3af3cf['closest']('.ck-ai-quick-actions-group-list')||null!==_0x3af3cf['closest']('.ck-ai-quick-actions-group-button'));}['resetSearch'](){this['_searchTextView']&&this['_searchTextView']['reset']();}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['_searchTextView']?this['_searchTextView']['focus']():this['optionsListView']['focus']();}['_getPanelKeystroke'](_0x3c40af){return'rtl'===_0x3c40af['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x1a4270){return'rtl'===_0x1a4270['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x1cba93,_0x5330db,_0x1657c2,_0x16e666){_0x1cba93['key']==_0x5330db&&(_0x1657c2['focus'](),this['_hideNestedPanel'](_0x16e666));}['_handleSearchResultButtonClick'](_0x19bc6a){_0x19bc6a['fire']('execute');}}function Xt(_0x9125cf){const {editor:_0x26074e,content:_0x54cb31,buttonDefinition:_0x1c7ef0,bodyCollection:_0x36b282,hasSearch:_0x4c9874=!0x1}=_0x9125cf;return()=>{const _0x35457c=_0x26074e['locale'],_0x35551b=_0x1204b4(_0x35457c);_0x35551b['buttonView']['set']({'icon':_0x1c7ef0['icon']??_0x4a31ba,'label':_0x1c7ef0['label'],'tooltip':!0x0}),_0x35551b['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x58a76a=new co(_0x26074e,_0x54cb31,_0x35551b,_0x36b282,_0x4c9874);if(_0x35551b['panelView']['children']['add'](_0x58a76a),_0x4c9874){const _0xa9802b='ai-quick-actions-dropdown-selection';_0x35551b['on']('change:isOpen',(_0x1f18ff,_0x32627e,_0x4d9be9)=>{if(_0x4d9be9){if(_0x26074e['plugins']['has']('AIEditing')){const _0x1ac629=_0x26074e['plugins']['get'](D),_0x333825=_0x26074e['model']['document']['selection'],_0x531120=Array['from'](_0x333825['getRanges']());_0x531120['length']>0x0&&_0x1ac629['showFakeVisualSelection'](_0x531120,_0xa9802b,!0x1,!0x0);}}else _0x26074e['plugins']['has']('AIEditing')&&_0x26074e['plugins']['get'](D)['hideFakeVisualSelection'](_0xa9802b),_0x58a76a['resetSearch']();});}return _0x35551b;};}const ee='<task>For\x20given\x20selected\x20part\x20of\x20HTML\x20document\x20you\x20must\x20explain\x20the\x20meaning\x20of\x20it\x27s\x20content\x20clearly\x20and\x20in\x20plain\x20language.</task><rules>1.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is:-\x20If\x20it\x20looks\x20like\x20a\x20definition\x20explain\x20the\x20concept\x20in\x20simple\x20terms.-\x20If\x20it\x20looks\x20like\x20a\x20description\x20clarify\x20what\x20it\x20is\x20describing\x20and\x20why\x20it\x20matters.-\x20If\x20it\x20contains\x20technical\x20terms\x20or\x20jargon\x20break\x20them\x20down\x20into\x20everyday\x20language.-\x20If\x20it\x20looks\x20instructional\x20restate\x20as\x20clear\x20steps\x20someone\x20can\x20follow.-\x20If\x20it\x20provides\x20examples\x20explain\x20what\x20the\x20example\x20shows\x20and\x20why\x20it\x27s\x20relevant.-\x20If\x20it\x20presents\x20an\x20argument\x20or\x20claim\x20restate\x20the\x20claim\x20neutrally\x20and\x20explain\x20its\x20purpose.-\x20If\x20it\x20is\x20narrative/story-like\x20explain\x20what\x20event\x20or\x20situation\x20is\x20being\x20described.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20explain\x20what\x20the\x20data\x20indicates.-\x20If\x20it\x20is\x20a\x20quotation\x20explain\x20the\x20meaning\x20of\x20the\x20quote\x20in\x20context.-\x20If\x20it\x20compares/contrasts\x20things\x20explain\x20the\x20key\x20differences\x20or\x20similarities\x20simply.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20give\x20a\x20clear,\x20plain-language\x20explanation\x20of\x20its\x20meaning,\x20focusing\x20on\x20usefulness.2.\x20Provide\x20context\x20if\x20the\x20meaning\x20could\x20be\x20unclear\x20without\x20it.\x20(e.g.,\x20explain\x20where\x20such\x20a\x20term\x20might\x20be\x20used,\x20or\x20why\x20it\x20is\x20important).3.\x20Keep\x20the\x20explanation\x20short\x20but\x20complete\x20(2–5\x20sentences).Avoid\x20overly\x20technical\x20detail\x20unless\x20it\x20is\x20necessary\x20for\x20understanding.4.\x20Do\x20not\x20simply\x20repeat\x20the\x20original\x20text\x20—\x20restate\x20and\x20expand\x20it\x20in\x20plain\x20words.5.\x20If\x20possible,\x20add\x20a\x20short\x20example\x20or\x20analogy\x20to\x20make\x20it\x20easier\x20to\x20understand.6.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20explanation.7.\x20Your\x20explanation\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20explanation.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',ie='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20summarize\x20its\x20content\x20in\x20a\x20few\x20sentences,\x20keeping\x20only\x20the\x20essential\x20meaning.</task><rules>1.\x20Your\x20summary\x20should\x20be\x20short\x20and\x20clear:-\x20Aim\x20for\x202–4\x20sentences\x20unless\x20the\x20text\x20is\x20extremely\x20short.-\x20Focus\x20on\x20capturing\x20the\x20main\x20idea(s)\x20without\x20unnecessary\x20detail.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20summary\x20style:-\x20If\x20it\x20is\x20descriptive\x20condense\x20the\x20description\x20into\x20its\x20core\x20idea.-\x20If\x20it\x20is\x20argumentative\x20or\x20opinion-based\x20summarize\x20the\x20main\x20claim\x20and\x20reasoning\x20neutrally.-\x20If\x20it\x20is\x20narrative/story-like\x20capture\x20the\x20main\x20event\x20or\x20outcome\x20without\x20side\x20details.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20summarize\x20what\x20the\x20data\x20shows\x20in\x20plain\x20language.-\x20If\x20it\x20is\x20instructional\x20restate\x20the\x20overall\x20purpose\x20of\x20the\x20steps\x20without\x20listing\x20every\x20step.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20provide\x20a\x20general\x20concise\x20summary.3.\x20Provide\x20context\x20if\x20necessary\x20for\x20clarity:-\x20Mention\x20the\x20subject\x20or\x20topic\x20explicitly\x20so\x20the\x20summary\x20can\x20stand\x20alone.4.\x20Do\x20not\x20simply\x20copy\x20sentences\x20from\x20the\x20original\x20text\x20—\x20rephrase\x20in\x20plain\x20language.5.\x20Avoid\x20adding\x20new\x20information\x20or\x20interpretation\x20not\x20present\x20in\x20the\x20text.6.\x20Summarize\x20in\x20a\x20way\x20that\x20would\x20make\x20sense\x20to\x20someone\x20who\x20has\x20not\x20read\x20the\x20original\x20text.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20summary.8.\x20Your\x20summary\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20summary.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',ne='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</task><rules>1.\x20Present\x20the\x20output\x20as\x20a\x20clear,\x20structured\x20list\x20(bullets\x20or\x20numbered).-\x20Each\x20point\x20should\x20be\x20concise\x20(one\x20sentence\x20or\x20less).-\x20Do\x20not\x20merge\x20distinct\x20ideas\x20into\x20one\x20bullet.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20extraction\x20style:-\x20If\x20it\x20is\x20descriptive\x20capture\x20the\x20main\x20attributes\x20or\x20features.-\x20If\x20it\x20is\x20argumentative\x20extract\x20the\x20main\x20claim\x20and\x20supporting\x20reasons\x20separately.-\x20If\x20it\x20is\x20narrative/story-like\x20extract\x20the\x20main\x20events\x20in\x20chronological\x20order.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20highlight\x20the\x20most\x20important\x20facts\x20or\x20numbers.-\x20If\x20it\x20is\x20instructional\x20list\x20the\x20steps\x20or\x20main\x20actions\x20in\x20simplified\x20form.-\x20If\x20it\x20provides\x20comparisons\x20extract\x20the\x20contrasted\x20items\x20and\x20their\x20differences/similarities.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20category\x20above\x20extract\x20the\x20main\x20ideas\x20in\x20plain,\x20short\x20statements.3.\x20Keep\x20the\x20list\x20between\x203–7\x20items\x20where\x20possible.-\x20If\x20the\x20text\x20is\x20very\x20short,\x20fewer\x20items\x20are\x20fine.-\x20If\x20it\x20is\x20very\x20long,\x20focus\x20on\x20the\x20most\x20important\x20ideas\x20only.4.\x20Do\x20not\x20copy\x20long\x20text\x20fragments\x20—\x20restate\x20in\x20simple\x20words.5.\x20Do\x20not\x20add\x20interpretation,\x20evaluation,\x20or\x20commentary\x20beyond\x20the\x20text.6.\x20Ensure\x20the\x20list\x20can\x20stand\x20alone\x20without\x20requiring\x20the\x20reader\x20to\x20see\x20the\x20original\x20document.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20key\x20points.8.\x20Your\x20key\x20points\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>';var Lt=function(_0x271709){return _0x271709['CHAT']='CHAT',_0x271709['ACTION']='ACTION',_0x271709['REVIEW']='REVIEW',_0x271709;}({}),$a=function(_0x46534c){return _0x46534c['CHAT']='AIChat',_0x46534c['ACTION']='AIActions',_0x46534c['REVIEW']='AIReviewMode',_0x46534c;}({});class ii extends _0x5d4a72{static get['requires'](){return[te,q];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0xc8a560=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0xc8a560),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x228f03){return function(_0x3e263a){const _0x15cb5c=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x3e263a['uiLanguage']),_0x54984c=_0x15cb5c||'English',_0x11fc09=[{'id':'ask-ai','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Ht},{'id':'chat-commands','label':i(_0x3e263a,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Ht,'actions':[{'id':'explain','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ee['replace']('%0',_0x54984c),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ie['replace']('%0',_0x54984c),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ne['replace']('%0',_0x54984c),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Wt},{'id':'continue','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Yt},{'id':'fix-grammar','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Gt},{'id':'adjust-length','label':i(_0x3e263a,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Qt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x3e263a,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Kt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x3e263a,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Vt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x3e263a,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x3e263a,'AI_QUICK_ACTIONS_OTHER'),'icon':Jt,'actions':[]}];return _0x11fc09;}(_0x228f03);}async['_getDefaultAndCustomActions'](){const _0x27220e=ii['getDefaultQuickActions'](this['editor']['locale']),_0x4b7f0a=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0xf48feb=[];try{_0xf48feb=await new yt({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x146b71){const _0x2e905c=new _0x5a06e8('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x146b71});pt(_0x2e905c['message']);}finally{const _0x16b51e=_0x4b7f0a['map'](_0x4c9c56=>({..._0x4c9c56,'icon':void 0x0}));_0x27220e['find'](_0x4361d5=>'other'===_0x4361d5['id'])['actions']['push'](..._0x16b51e),_0x27220e['forEach'](_0x447dfa=>{if('actions'in _0x447dfa)_0x447dfa['actions']['forEach'](_0x331c19=>{if(_0x331c19['isEnabled']=!!_0xf48feb['find'](_0x5dc205=>_0x5dc205['id']===_0x331c19['model'])||void 0x0===_0x331c19['model'],!_0x331c19['isEnabled']){const _0x4326e6=new _0x5a06e8('ai-quick-actions-unavailable-model',this,{'actionId':_0x331c19['id'],'modelId':_0x331c19['model']});pt(_0x4326e6['message']);}});else{if(_0x447dfa['isEnabled']=!!_0xf48feb['find'](_0x10335d=>_0x10335d['id']===_0x447dfa['model'])||void 0x0===_0x447dfa['model'],!_0x447dfa['isEnabled']){const _0x27c3b8=new _0x5a06e8('ai-quick-actions-unavailable-model',this,{'actionId':_0x447dfa['id'],'modelId':_0x447dfa['model']});pt(_0x27c3b8['message']);}}});}return _0x27220e;}['_initializeQuickActionsComponentsAndCommands'](){const _0x6c7013=new _0x1424e8(this['editor']['locale']);_0x6c7013['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x6c7013),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x6c7013);}['_initializeQuickActionsDropdown'](_0x2e5374){const _0x33389a=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Xt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x4a31ba,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x2e5374,'hasSearch':_0x33389a}));}['_prepareQuickActionsDefinition'](_0x4a71fd){this['_quickActionsDefinition']=_0x4a71fd['map'](_0x467ace=>{if('actions'in _0x467ace){const _0x5673e5=_0x467ace;return{..._0x5673e5,'actions':_0x5673e5['actions']['map'](_0x18b934=>{const {actions:_0x3bc61b,..._0xdff99b}=_0x5673e5;return{..._0x18b934,'parent':_0xdff99b};})['filter'](_0x3e584e=>this['_shouldIncludeAction'](_0x3e584e))};}return _0x467ace;})['filter'](_0xb3a449=>'actions'in _0xb3a449?_0xb3a449['actions']['length']>0x0:this['_shouldIncludeAction'](_0xb3a449));}['_shouldIncludeAction'](_0x45aee2){const _0x5e8948=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has']($a[_0x45aee2['type']])&&!_0x5e8948['includes'](_0x45aee2['id'])&&!('CHAT'===_0x45aee2['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x5a3f6c){this['_quickActionsDefinition']['forEach'](_0x3219ba=>{if('actions'in _0x3219ba){const _0x309371=Xt({'editor':this['editor'],'content':_0x3219ba['actions'],'buttonDefinition':_0x3219ba,'bodyCollection':_0x5a3f6c});this['editor']['ui']['componentFactory']['add'](_0x3219ba['id'],_0x309371),_0x3219ba['actions']['forEach'](_0x175a4c=>{const _0x8c47a7=Zt({'editor':this['editor'],'action':_0x175a4c});this['editor']['ui']['componentFactory']['add'](_0x175a4c['id'],_0x8c47a7);});}else{const _0x5f1f64=Zt({'editor':this['editor'],'action':_0x3219ba,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x3219ba['id'],_0x5f1f64);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x4d8eee=>{const _0x5b0835=new _0x2e1bf9(_0x4d8eee),_0x19fd97=i(_0x4d8eee,'AI_QUICK_ACTIONS_HEADING');_0x5b0835['buttonView']['set']({'label':_0x19fd97,'icon':_0x4a31ba});const _0x4bb679=new _0x34fc2c(_0x4d8eee);_0x4bb679['set']({'ariaLabel':_0x19fd97,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x27b1fa=>{if('actions'in _0x27b1fa){const _0x43fd86=_0x27b1fa,_0x1f474f=new _0x147031(_0x4d8eee,_0x5b0835),_0x557f37=new _0x2e1bf9(_0x4d8eee),_0x381971=new _0x34fc2c(_0x4d8eee);_0x557f37['buttonView']['set']({'label':_0x43fd86['label'],'icon':_0x43fd86['icon']}),_0x43fd86['actions']['forEach'](_0x441e38=>{const _0x5e0a2e=new _0x147031(_0x4d8eee,_0x557f37),_0x2a7efc=new _0x157a87(_0x4d8eee);_0x2a7efc['set']({'label':_0x441e38['displayedPrompt'],'icon':_0x441e38['icon'],'role':'menuitem','isEnabled':_0x441e38['isEnabled']}),_0x2a7efc['on']('execute',()=>{this['_executeQuickAction'](_0x441e38);}),_0x2a7efc['delegate']('execute')['to'](_0x557f37),_0x5e0a2e['children']['add'](_0x2a7efc),_0x381971['items']['add'](_0x5e0a2e);}),_0x557f37['panelView']['children']['add'](_0x381971),_0x1f474f['children']['add'](_0x557f37),_0x4bb679['items']['add'](_0x1f474f);}else{const _0x143bd2=_0x27b1fa,_0x92b820=new _0x147031(_0x4d8eee,_0x5b0835),_0x1087ec=new _0x157a87(_0x4d8eee);_0x1087ec['set']({'label':_0x143bd2['displayedPrompt'],'icon':_0x143bd2['icon'],'role':'menuitem','isEnabled':_0x143bd2['isEnabled']}),_0x1087ec['on']('execute',()=>{this['_executeQuickAction'](_0x143bd2);}),_0x1087ec['delegate']('execute')['to'](_0x5b0835),_0x92b820['children']['add'](_0x1087ec),_0x4bb679['items']['add'](_0x92b820);}});const _0x1dc593=Object['values']($a)['some'](_0x5b2a7e=>this['editor']['plugins']['has'](_0x5b2a7e));return _0x5b0835['set']({'isEnabled':_0x1dc593}),_0x5b0835['panelView']['children']['add'](_0x4bb679),_0x5b0835;});}['_executeQuickAction'](_0x4383ce){const _0x588b53=this['editor'];_0x588b53['editing']['view']['focus'](),_0x588b53['commands']['execute']('aiQuickAction',_0x4383ce);const _0x44395a=_0x588b53['ui']['view']['menuBarView'];_0x44395a&&_0x44395a['close']&&_0x44395a['close']();}}class ci extends Ut{['execute'](_0x464ece){switch(this['_expandSelectionIfCollapsed'](),_0x464ece['type']){case Lt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x3dd87c=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x5a06e8('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x3dd87c});}this['_handleAIChatAction'](_0x464ece);break;case Lt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x13d8c2=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x5a06e8('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x13d8c2});}this['_handleAIActionsAction'](_0x464ece);break;case Lt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x376cfb=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x5a06e8('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x376cfb});}this['_handleAIReviewAction'](_0x464ece);}}async['_handleAIChatAction'](_0x5dccc7){const _0x52e30c=this['editor']['plugins']['get']('AIChat'),_0x531db8=this['editor']['plugins']['get']('AIChatController'),_0x94052=this['editor']['plugins']['get']('AITabs')['view'];if(_0x94052['isVisible']||(_0x94052['isVisible']=!0x0),'chat'!==_0x94052['activeTab']&&_0x94052['activateTab']('chat'),'ask-ai'===_0x5dccc7['id'])_0x531db8['removeSelectionFromChatContext'](),await _0x52e30c['addSelectionToChatContext'](),_0x52e30c['focusPromptInput']();else await _0x52e30c['startConversation'](),_0x531db8['removeSelectionFromChatContext'](),await _0x52e30c['addSelectionToChatContext'](),_0x52e30c['focusPromptInput'](),await _0x52e30c['sendMessage']({'message':_0x5dccc7['prompt']||_0x5dccc7['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x5dccc7['id']},'displayedPrompt':_0x5dccc7['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x421792=this['editor'],_0x3f4b5f=_0x421792['model']['document']['selection'];if(!_0x3f4b5f['isCollapsed'])return;const _0x19a322=_0x354381(_0x3f4b5f['getSelectedBlocks']())||_0x421792['model']['schema']['getLimitElement'](_0x3f4b5f);_0x421792['model']['change'](_0x342d8e=>{_0x342d8e['setSelection'](_0x19a322,'in');});}['_handleAIActionsActionLabel'](_0x25f3ab){return _0x25f3ab['parent']?.['label']&&'other'!==_0x25f3ab['parent']?.['id']?_0x25f3ab['parent']['label']+':\x20'+_0x25f3ab['displayedPrompt']:_0x25f3ab['displayedPrompt'];}async['_handleAIActionsAction'](_0x43b526){const _0x26572b=this['editor']['plugins']['get']('AIActions'),_0x1e8791=_0x43b526['prompt']?{'userMessage':_0x43b526['prompt'],'model':_0x43b526['model']}:{'actionName':_0x43b526['actionName']||_0x43b526['id'],'args':_0x43b526['args']},_0x1522c7=this['_handleAIActionsActionLabel'](_0x43b526);await _0x26572b['executeAction'](_0x1e8791,_0x1522c7,_0x43b526['icon']);}async['_handleAIReviewAction'](_0x28c130){console['log']('handleAIReviewAction',_0x28c130);}}class ti extends _0x5d4a72{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4e2af6=this['editor'],_0x1da4fa=new ci(this['editor']);if(_0x4e2af6['commands']['add']('aiQuickAction',_0x1da4fa),_0x4e2af6['plugins']['has']('AIChat')){const _0x322700=this['editor']['plugins']['get']('AIChat');_0x4e2af6['model']['document']['selection']['on']('change:range',(_0x5c9845,_0x159946)=>{_0x159946['directChange']&&_0x322700['removeSelectionFromChatContext']();});}}}class De extends Ge{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x3b6f53=this['documentContextContent']['children']['map'](_0x84ff3a=>({'node':_0x84ff3a,'id':wt(_0x84ff3a,'data-id')})),_0x231412=this['parsedMergedContent']['children']['map'](_0x19b69f=>({'node':_0x19b69f,'id':wt(_0x19b69f,'data-id')||_0x46d503()})),_0x47525b=_0x5dceb(_0x3b6f53,_0x231412,{'comparator':(_0x43d760,_0x32443e)=>_0x43d760['id']==_0x32443e['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x47525b['length']&&_0x47525b[_0x47525b['length']-0x1]['removed'];)_0x47525b['pop']();}const _0x4c4d6d=_0x47525b['map'](_0x33ab2=>{const _0x24a0fc=_0x33ab2['added']?'new':_0x33ab2['removed']?'removed':'modified';return{'node':_0x33ab2['value'][0x0]['node'],'type':_0x24a0fc,'id':_0x33ab2['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x4c4d6d,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x3056a8,_0x504cbb){return _0x504cbb;}}class W extends xe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x35d0a8){super(_0x35d0a8),this['content']=_0x35d0a8['content'],this['version']=_0x35d0a8['version'],this['actionName']=_0x35d0a8['actionName'],this['args']=_0x35d0a8['args'],this['userMessage']=_0x35d0a8['userMessage'],this['model']=_0x35d0a8['model'];}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':qe['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x172875){const _0x59e4ee=new De({'editor':this['editor'],'documentContextContent':this['content'],..._0x172875});return this['replies']['push'](_0x59e4ee),_0x59e4ee['delegate'](...ye)['to'](this),this['fire']('replyCreated',_0x59e4ee),_0x59e4ee;}}class Bn extends _0x286a6e{constructor(_0x2d5552,_0x2e25ef=!0x0,_0x3d6561=!0x0){super(_0x2d5552),this['set']('isEnabled',!0x1),_0x2e25ef&&(this['applyButton']=this['_createButton'](i(_0x2d5552,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x3d6561&&(this['suggestButton']=this['_createButton'](i(_0x2d5552,'AI_BALLOON_SUGGEST_BUTTON'),_0x2e25ef?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x2e25ef,'showSuggestButton':_0x3d6561}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x2ff8e4,showSuggestButton:_0x39da2c}){this['applyButton']&&(this['applyButton']['isVisible']=_0x2ff8e4),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x39da2c);}['_createButton'](_0x4f2fed,_0x2f6b94){const _0x3b3da6=new _0x480cf4(this['locale']);return _0x3b3da6['set']({'label':_0x4f2fed,'class':_0x2f6b94,'isVisible':!0x0,'withText':!0x0}),_0x3b3da6;}}class Nn extends _0x3836c7{constructor(_0x5e816f){super(_0x5e816f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':i(_0x5e816f,'AI_DISCLAIMER_TEXT')}]}]});}}class jn extends _0x3836c7{constructor(_0x3a7827){super(_0x3a7827),this['set']('isVisible',!0x0);const _0x1352cc=new pi('small');_0x1352cc['isVisible']=!0x0;const _0x408ccb=new _0x3836c7(this['locale']);_0x408ccb['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[i(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x2070d1=>!_0x2070d1)]},'children':[_0x1352cc,_0x408ccb]});}}class rt extends ls{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x2299d5,_0x59b6a8){super(_0x2299d5),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x59b6a8,this['_focusTracker']=new _0x50a6e7(),this['_keystrokes']=new _0x2971c3(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x39194d({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x1b8196(),this['_addContentWrapper'](_0x59b6a8),this['_addDisclaimerView'](),this['_addToolbar'](_0x59b6a8),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main']},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x59b6a8);});}['render'](){super['render']();for(const _0x53dabc of this['_focusables'])this['_focusTracker']['add'](_0x53dabc['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x5214e4){-0x1===_0x5214e4?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x146579){this['_isLoading']=_0x146579;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x5142fc){super['showError'](_0x5142fc),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x3df49a){super['showBlockingError'](_0x3df49a),this['setErrorState']();}['addMiniToolbarItem'](_0x455d45){this['_miniToolbarView']['items']['has'](_0x455d45)||this['_miniToolbarView']['items']['add'](_0x455d45);}['removeMiniToolbarItem'](_0x5d7706){this['_miniToolbarView']['items']['has'](_0x5d7706)&&this['_miniToolbarView']['items']['remove'](_0x5d7706);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x56de2f,showSuggestButton:_0x585834}){_0x56de2f=_0x56de2f&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x585834=_0x585834&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x56de2f,'showSuggestButton':_0x585834});}async['updateContent'](_0x466486){await this['_streamableContentView']['update'](_0x466486);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x3b45b6){this['_contentWrapper']=new _0x3836c7(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x3b45b6['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new Nn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x4271b5,showSuggestButton:_0x2ad833}){this['_toolbarView']=new Bn(this['locale'],_0x4271b5,_0x2ad833),this['_toolbarView']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['_toolbarView']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x1876b4,_0x4449b3,_0x474a69)=>!(_0x1876b4||_0x4449b3||_0x474a69)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x4271b5,'showSuggestButton':_0x2ad833}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x3beb91){return this['_miniToolbarView']=new us(this['locale'],_0x3beb91),this['_miniToolbarView']['delegate'](...ft)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x1c7481,_0x4339d6)=>!(_0x1c7481||_0x4339d6)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new jn(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new as(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x372a09=new _0x480cf4(this['locale']),_0x16f2a2=new _0x480cf4(this['locale']),_0x97bcab=new Pn(this['locale']),_0x45febd=new _0x480cf4(this['locale']);_0x372a09['set']({'icon':_0x7b1602,'label':i(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x16f2a2['set']({'icon':_0x5009b4,'tooltip':i(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x45febd['set']({'icon':_0xcfb6e3,'tooltip':i(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x372a09['bind']('isEnabled')['to'](this,'isBusy',_0x4a8ab0=>!_0x4a8ab0),_0x372a09['on']('execute',()=>{this['fire']('tryAgain');}),_0x16f2a2['bind']('isEnabled')['to'](this,'isBusy',_0x2ce7e0=>!_0x2ce7e0),_0x16f2a2['on']('execute',()=>{this['fire']('showPrevious');}),_0x45febd['bind']('isEnabled')['to'](this,'isBusy',_0x1c5c12=>!_0x1c5c12),_0x45febd['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x16f2a2,this['_navigationCounter']=_0x97bcab,this['_navigationNextButton']=_0x45febd,this['_navigationTryAgainButton']=_0x372a09;}['updateMiniToolbarButtons'](_0x420008,_0x5a34cb){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x21bb85=_0x420008>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x21bb85){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x3d67b2=_0x420008-_0x5a34cb;this['_navigationCounter']['setInteractionCount'](_0x3d67b2+'/'+_0x420008),this['_navigationPreviousButton']['isEnabled']=_0x5a34cb<_0x420008-0x1,this['_navigationNextButton']['isEnabled']=_0x5a34cb>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}['disableMiniToolbarButtons'](){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}['startAutoScroll'](){this['_initializeScrollManager'](),this['_scrollManager']&&this['_scrollManager']['start']();}['stopAutoScroll'](){this['_scrollManager']&&this['_scrollManager']['stop']();}['toggleIsLoading'](_0x491f02){this['_isLoading']=_0x491f02;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x5e942a=this['_getScrollableElement']();_0x5e942a&&!this['_scrollManager']&&(this['_scrollManager']=new Je(_0x5e942a));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Pn extends _0x3836c7{constructor(_0x4f2229){super(_0x4f2229);const _0xb78bb=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0xb78bb['to']('interactionCount')}]});}['setInteractionCount'](_0x43b145){this['set']('interactionCount',_0x43b145);}}class ri extends _0x5d4a72{static get['requires'](){return[q,_0x164193,D,Q,_0x4df951];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];constructor(_0x5d9d84){super(_0x5d9d84),this['_bodyCollection']=new _0x1424e8(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new z();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x5506ca,_0x396ff9,_0xc1ee0){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x33900f,anchorData:_0x212691}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x5506ca,_0x33900f,_0x212691,_0x396ff9,_0xc1ee0);}}const {modelFragment:_0x14ef48,anchorData:_0x56f3f3}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x5506ca,_0x14ef48,_0x56f3f3,_0x396ff9,_0xc1ee0);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x2d7bf3=this['editor']['plugins']['has']('TrackChanges');let _0x3ebe5d=this['editor']['config']['get']('ai.availableReplyActions')||[...ot];_0x2d7bf3||(_0x3ebe5d=_0x3ebe5d['filter'](_0x4d9711=>'insertSuggestion'!=_0x4d9711));const _0x48a207=this['editor']['commands']['get']('trackChanges'),_0x42bbef=new rt(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x2d7bf3,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x3ebe5d});return _0x42bbef['bind']('isBusy')['to'](this),_0x48a207&&_0x42bbef['bind']('isTrackChangesOn')['to'](_0x48a207,'value'),_0x42bbef['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x42bbef['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x42bbef['on']('showNext',()=>{this['_navigateToNext']();}),_0x42bbef;}['_getExecuteDataRegular'](){const _0x1f0de3=this['editor']['model']['document']['selection'];if(_0x1f0de3['isCollapsed']){const _0x589cbf=_0x354381(_0x1f0de3['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x1f0de3);this['editor']['model']['change'](_0x18b293=>{_0x18b293['setSelection'](_0x589cbf,'in');});}const _0x45a426=_0x1f0de3['getFirstRange'](),_0x4e58f9=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x1f0de3),_0x45a426['start'],_0x45a426['end']);this['_copyMarkersToFragment'](_0x4e58f9,_0x1f0de3,{'isTableSelection':!0x1});const _0x396e59=_0x1f0de3['getFirstRange']()['start'],_0x245513=new Map();let _0x49323b=_0x4e58f9;for(let _0x74a65a=0x0;_0x74a65a<_0x396e59['path']['length'];_0x74a65a++)_0x245513['set'](_0x49323b,_0x396e59['path'][_0x74a65a]),_0x49323b=_0x49323b['getChild'](0x0);return{'modelFragment':_0x4e58f9,'anchorData':_0x245513};}['_getExecuteDataInTable'](){const _0x50bb83=this['editor']['model']['document']['selection'],_0x22a448=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x44740d=_0x50bb83['getFirstRange']()['start']['parent']['parent'],_0x2d1bd7=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x44740d),this['editor']['model']['createPositionAfter'](_0x44740d)),_0x297d00=this['_wrapWithCommonAncestors'](_0x22a448,_0x2d1bd7['start'],_0x2d1bd7['end']);this['_copyMarkersToFragment'](_0x297d00,_0x50bb83,{'isTableSelection':!0x0});const _0x394f20=_0x50bb83['getFirstRange']()['start'],_0x25d963=new Map();let _0xb0ad78=_0x297d00;for(let _0x46708f=0x0;_0x46708f<_0x394f20['path']['length'];_0x46708f++)if(_0x25d963['set'](_0xb0ad78,_0x394f20['path'][_0x46708f]),_0x46708f<_0x394f20['path']['length']-0x1)_0xb0ad78=_0xb0ad78['getChild'](0x0);else{let _0x575301=_0xb0ad78['nextSibling'];for(;_0x575301;)_0x25d963['set'](_0x575301,_0x394f20['path'][_0x46708f]),_0x575301=_0x575301['nextSibling'];}return{'modelFragment':_0x297d00,'anchorData':_0x25d963};}async['_executeAction'](_0x21beee,_0x262a43,_0x43272d,_0x174746,_0x3d7fe){const _0x37b8a7=this['editor']['plugins']['get'](D),_0x5ab11b=this['editor']['plugins']['get'](Q),_0x13a6a6=this['editor']['model']['document']['selection'],_0x53286f=await _0x37b8a7['modelToDataWithIds'](_0x262a43),_0x100503=this['editor']['model']['document']['version'],_0x5dbac9=[..._0x13a6a6['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0x5ab11b['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x174746,'icon':_0x3d7fe||_0x4a31ba,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x5dbac9,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x5ab11b),this['_interactionParams']={'action':_0x21beee,'content':_0x53286f,'version':_0x100503,'aiBalloon':_0x5ab11b,'modelFragment':_0x262a43,'anchorData':_0x43272d},this['_setupApplyListeners'](),this['listenTo'](_0x5ab11b,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x5ab11b,'dialogClosed',(_0x5a1d06,{id:_0x5a107d})=>{if('aiActionsBalloon'===_0x5a107d){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x2de9c4=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0xe7cd3b=_0x2de9c4['changeGroups'][0x0];_0xe7cd3b&&'pending'===_0xe7cd3b['state']&&_0x2de9c4['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x5ab11b);}}),this['_createInteraction'](_0x53286f,_0x100503,_0x5ab11b,_0x21beee);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x3a8aa1,anchorData:_0x414347}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x3a8aa1,_0x414347,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x3a8aa1,_0x414347,!0x0);});}['_wrapWithCommonAncestors'](_0x2b8e42,_0x35b386,_0x17d1a3){const _0x46299a=this['editor']['model']['createRange'](_0x35b386,_0x17d1a3)['getCommonAncestor'](),_0x33c552=_0x46299a['is']('documentFragment')?[]:_0x46299a['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x33c552['length']){const _0x31f3f2=_0x33c552['map'](_0x15fbde=>_0x15fbde['_clone'](!0x1));for(let _0xf22cc0=0x1;_0xf22cc0<_0x31f3f2['length'];_0xf22cc0++)_0x31f3f2[_0xf22cc0-0x1]['_appendChild'](_0x31f3f2[_0xf22cc0]);return _0x31f3f2[_0x31f3f2['length']-0x1]['_appendChild'](_0x2b8e42),new tt(_0x31f3f2[0x0]);}return _0x2b8e42;}['_copyMarkersToFragment'](_0x45598d,_0x3b300c,_0x4a0744={'isTableSelection':!0x1}){const _0x6d40d5=this['editor']['model'],_0xe40f02=Array['from'](_0x3b300c['getRanges']()),_0xfd8309=_0x3b300c['getFirstRange']()['start'];for(const _0x2461f6 of _0x6d40d5['markers']){if(_0x2461f6['name']['startsWith'](R)||!_0x2461f6['affectsData'])continue;const _0x2fc3c6=_0x2461f6['getRange']();if(!_0xe40f02['some'](_0x1cdd50=>_0x1cdd50['containsRange'](_0x2fc3c6,!0x0)))continue;const _0x4ab721=this['_regularCalculateMarkerPath'](_0x2fc3c6['start'],_0xfd8309,_0x4a0744['isTableSelection']),_0x2ed31e=this['_regularCalculateMarkerPath'](_0x2fc3c6['end'],_0xfd8309,_0x4a0744['isTableSelection']),_0x4d08f6=_0x6d40d5['createPositionFromPath'](_0x45598d,_0x4ab721),_0x262c29=_0x6d40d5['createPositionFromPath'](_0x45598d,_0x2ed31e);if(!_0x4d08f6['isEqual'](_0x262c29)){const _0x4b3120=_0x6d40d5['createRange'](_0x4d08f6,_0x262c29);_0x45598d['markers']['set'](_0x2461f6['name'],_0x4b3120);}}}['_regularCalculateMarkerPath'](_0x503dcc,_0x290afc,_0x48ca5d=!0x1){const _0x157707=[..._0x503dcc['path']['slice']()];for(let _0x48c01a=0x0;_0x48c01a<Math['max'](_0x290afc['path']['length'],_0x503dcc['path']['length']);_0x48c01a++){const _0x22a337=_0x290afc['path'][_0x48c01a]||0x0,_0xcb1b52=(_0x503dcc['path'][_0x48c01a]||0x0)-_0x22a337;if(_0x157707[_0x48c01a]=_0xcb1b52,0x0!==_0xcb1b52&&!_0x48ca5d)break;}return _0x157707;}async['_createInteraction'](_0x17ee9b,_0x2dc929,_0x491d1a,_0x544dda){const _0x523955=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x544dda,'content':_0x17ee9b,'version':_0x2dc929,'aiBalloon':_0x491d1a,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x19643f=new W({'connector':this['_aiConnector'],'editor':_0x523955,'content':_0x17ee9b,'version':_0x2dc929,..._0x544dda});this['_interactions']['push'](_0x19643f);const _0x4f477f=(_0x31131b,_0x583df1=!0x1,_0x4a7a00='streaming')=>this['_promiseQueue']['enqueue'](async _0x15966f=>{try{const _0x57f41a=J({'editor':_0x523955,'changeGroups':_0x31131b['changeGroups'],'documentContextContent':_0x31131b['documentContextContent'],'showDiff':_0x583df1,'trimUnchanged':!0x1});_0x57f41a['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x57f41a[0x0],'renderingStrategy':_0x4a7a00,'abortSignal':_0x15966f});}catch(_0x58a0f){if(this['_isAbortError'](_0x58a0f))return;throw _0x58a0f;}});this['_interaction']['on']('replyCreated',(_0x540b17,_0x235b94)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x4f477f(_0x235b94)['catch'](_0x5519df=>{this['_isAbortError'](_0x5519df)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x5519df),this['_setErrorState'](_0x19643f));});}),this['_interaction']['on']('replyContentUpdated',(_0x2075a9,_0x4667ee)=>{_0x4f477f(_0x4667ee)['catch'](_0x2a9a6f=>{this['_isAbortError'](_0x2a9a6f)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x2a9a6f),this['_setErrorState'](_0x19643f));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0xa52e1f){this['_isAbortError'](_0xa52e1f)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0xa52e1f),this['_setErrorState'](_0x19643f));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x37a9ec,{showDiff:_0x46fda7})=>{try{this['_balloonShowDiff']=_0x46fda7;const _0x862a61=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x862a61&&await _0x4f477f(_0x862a61,_0x46fda7,'static');}catch(_0x35f249){this['_isAbortError'](_0x35f249)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x35f249),this['_setErrorState'](_0x19643f));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x25a905,{reply:_0x9d1624})=>{const _0x149bca={'positiveCount':_0x9d1624['changeGroups']['filter'](_0x3f3bac=>'accepted'===_0x3f3bac['state'])['length'],'totalCount':_0x9d1624['changeGroups']['length']},_0x497cc5=this['_interaction']['actionCallId'],_0x57d34e=this['_interaction']['actionName'];_0x57d34e?this['_aiConnector']['upsertAIActionRating'](_0x57d34e,_0x497cc5,_0x149bca):this['_aiConnector']['upsertCustomAIActionRating'](_0x497cc5,_0x149bca);}),this['_setLoadingState']();try{const _0x1154f3=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x1154f3;}catch(_0x230d65){if(this['_isAbortError'](_0x230d65))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x19643f);}}['_applyChanges'](_0xd088c3,_0x1702c9,_0x4e6364){const _0x52aa35=this['editor'];if(_0x4e6364&&!_0x52aa35['plugins']['has']('TrackChanges'))throw new _0x5a06e8('ai-no-track-changes',null);const _0x51344b=this['editor']['plugins']['get'](_0x4df951),_0x34c4e1=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x34c4e1||!_0x34c4e1['replies']['length'])return;const _0x6f8565=_0x34c4e1['replies'][_0x34c4e1['replies']['length']-0x1],_0x1718e2=_0x6f8565['changeGroups'];_0x6f8565['setChangeGroupState'](0x0,'accepted');let _0x4860c7=Z({'editor':_0x52aa35,'reply':_0x6f8565,'interaction':_0x34c4e1,'groups':_0x1718e2,'transform':!0x1,'documentCompare':_0x51344b,'documentCompareOptions':{'anchor':_0x52aa35['model']['createPositionAt'](_0xd088c3,0x0),'markDeletions':_0x4e6364}});_0x4860c7=this['_filterOperationsOutsideRange'](_0x4860c7,_0x1702c9);for(const _0x265b3b of _0x4860c7)this['_anchorOperation'](_0x1702c9,_0x265b3b,_0x52aa35['model']['document']['getRoot']());const _0x4a43d8=_0x34c4e1['getDocumentContext']()['version'],_0x2528c9=_0x52aa35['model']['document']['history']['getOperations'](_0x4a43d8),_0x595305={'document':_0x52aa35['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x478d48=nt(_0x4860c7,_0x2528c9,_0x595305)['operationsA'];_0x52aa35['model']['change'](_0x3ebd02=>{if(_0x3ebd02['setSelection'](_0x52aa35['model']['document']['selection']['focus']),_0x4e6364)_0x52aa35['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x478d48);else{for(const _0xc2e28b of _0x478d48)_0xc2e28b['baseVersion']=_0x52aa35['model']['document']['version'],Y(_0x52aa35,_0xc2e28b),_0x3ebd02['batch']['addOperation'](_0xc2e28b),_0x52aa35['model']['applyOperation'](_0xc2e28b);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x18be19,_0x482c95){return _0x18be19['filter'](_0x4f2d09=>{if('rename'==_0x4f2d09['type']){const _0x54e7db=_0x4f2d09['position']['nodeAfter'];return!_0x482c95['has'](_0x54e7db);}if(_0x4f2d09['type']['indexOf']('Attribute')>-0x1){const _0xb6bb46=_0x4f2d09['range']['start']['nodeAfter'];return!_0x482c95['has'](_0xb6bb46);}return!0x0;});}['_anchorOperation'](_0x3486bf,_0x4802be,_0x57cd17){const _0x29d95a=_0x4802be['clone']();for(const _0xf3322 in _0x4802be){const _0x72a8f0=_0x4802be[_0xf3322];_0x72a8f0 instanceof it?_0x4802be[_0xf3322]=new it(_0x1197ea(_0x72a8f0['start']),_0x1197ea(_0x72a8f0['end'])):_0x72a8f0 instanceof st&&(_0x4802be[_0xf3322]=_0x1197ea(_0x72a8f0));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x29d95a['type'])){if(_0x29d95a['isDocumentOperation']=!0x1,_0x29d95a['baseVersion']=null,'remove'==_0x29d95a['type']){const _0x112d64=_0x29d95a['sourcePosition'],_0x22ab08=_0x29d95a['howMany'];new et(_0x112d64,_0x22ab08)['_execute']();}else _0x29d95a['_execute']();}function _0x1197ea(_0xd051ee){if('$graveyard'==_0xd051ee['root']['rootName'])return _0xd051ee;const _0xf5005e=[];let _0x169f55=_0xd051ee['root'];for(let _0x483d06=0x0;_0x483d06<_0xd051ee['path']['length'];_0x483d06++){const _0x4a9567=_0x3486bf['get'](_0x169f55)||0x0;_0xf5005e[_0x483d06]=_0xd051ee['path'][_0x483d06]+_0x4a9567,_0x169f55=_0x169f55['getChildAtOffset'](_0xd051ee['path'][_0x483d06]);}return new st(_0x57cd17,_0xf5005e,_0xd051ee['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x327b89,content:_0x9db685,version:_0x2c5e3f,aiBalloon:_0x5b9564}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['showLoader'](),this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0x9db685,_0x2c5e3f,_0x5b9564,_0x327b89)['catch'](_0x64337c=>{this['_isAbortError'](_0x64337c)||console['error']('Error\x20refreshing\x20interaction:',_0x64337c);});}['_isAbortError'](_0x1eaad5){return!!_0x1eaad5['message']&&_0x1eaad5['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x3ba841=this['_interactions']['length'];this['_currentInteractionIndex']<_0x3ba841-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x79d67a){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x79d67a;const _0x200d8b=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x200d8b)return;if(_0x200d8b['hasError'])return this['_setErrorState'](_0x200d8b),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x200d8b['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x1a6110=_0x200d8b['replies'][_0x200d8b['replies']['length']-0x1];if(_0x1a6110){const _0x1be945=this['editor'];try{const _0x58abd0=J({'editor':_0x1be945,'changeGroups':_0x1a6110['changeGroups'],'documentContextContent':_0x1a6110['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0xa39428=>setTimeout(_0xa39428,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x58abd0[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x21ba19){this['_isAbortError'](_0x21ba19)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x21ba19);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x1d241d){const _0x185bd1=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x185bd1),_0x1d241d['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class qa extends _0x5d4a72{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x6c3250){super(_0x6c3250),_0x6c3250['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Ks extends _0x3836c7{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x49a299,_0x2d5be3){super(_0x49a299),this['id']=_0x2d5be3,this['set']('status','pending'),this['set']('changeId',_0x2d5be3),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x49a748,_0x464152)=>{_0x464152&&_0x464152['target']&&'A'===_0x464152['target']['tagName']&&_0x464152['preventDefault'](),this['fire']('activateChange',{'id':_0x2d5be3,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x2d5be3,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x2d5be3,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x45df4e=new _0x3836c7(this['locale']);return _0x45df4e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x55d0d9=>!_0x55d0d9)]}}),_0x45df4e;}['_createAcceptButtonView'](){const _0x27cc4a=new _0x480cf4(this['locale']);return _0x27cc4a['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x27cc4a['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x409ca5=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x409ca5['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x51eef=>'pending'!==_0x51eef&&'accepted'!==_0x51eef),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x1ef187=>'pending'===_0x1ef187),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0xb40ce6=>'accepted'===_0xb40ce6)]}}),this['on']('change:status',(_0x3c9f40,_0x582bee,_0x257aef)=>{_0x27cc4a['isEnabled']='pending'===_0x257aef,'accepted'===_0x257aef&&(_0x27cc4a['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x27cc4a['icon']=_0x5bbb65);}),_0x27cc4a;}['_createDismissButtonView'](){const _0x1b43ac=new _0x480cf4(this['locale']);return _0x1b43ac['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x1b43ac['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x384616=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x384616['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x50e6bf=>'pending'!==_0x50e6bf&&'rejected'!==_0x50e6bf),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x1b95c0=>'pending'===_0x1b95c0),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0xbaad6f=>'rejected'===_0xbaad6f)]}}),this['on']('change:status',(_0x1f1e4b,_0x475e29,_0x245bbc)=>{_0x1b43ac['isEnabled']='pending'===_0x245bbc,'rejected'===_0x245bbc&&(_0x1b43ac['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x1b43ac['icon']=_0x5a4b4);}),_0x1b43ac;}['_createInfoButtonView'](){const _0x347f3d=new _0x480cf4(this['locale']);return _0x347f3d['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x2f68b5,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x347f3d['bind']('isOn')['to'](this,'isInfoToggleOn',_0x9e3cbb=>_0x9e3cbb),_0x347f3d['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x347f3d;}['_createOutdatedButtonView'](){const _0x548cb9=new _0x480cf4(this['locale']);return _0x548cb9['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x40ad6c,'withText':!0x0,'isEnabled':!0x1}),_0x548cb9['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x502e95=>'outdated'!==_0x502e95)],'disabled':'disabled'}}),_0x548cb9;}}class me extends _0x5019ab{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x263540,_0x393bab){super(_0x263540),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['set']('isDiffActive',!0x1),this['content']['add'](this['_createContentView']()),_0x393bab['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x4f922f){this['resultItemView']['changeId']=_0x4f922f['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x4f922f['contentDiffed'];}['showBalloon'](_0x4b7ee5,_0x54a188,_0x30105d,_0x2d4c41,_0x4c65d4,_0x2542b5){const _0x4dd2d6=_0x54a188();if(!_0x4dd2d6)return;this['updateContent'](_0x4b7ee5),this['show']();const _0x2dced8=Array['from'](_0x4dd2d6['getClientRects']())['reverse'](),_0x329c52=this['_getPointedRectIndexFromEvent'](_0x30105d,_0x2dced8),_0x598d09=_0x2dced8[_0x329c52??0x0];'click'===_0x2d4c41?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x54a188(),_0x329c52,_0x4b7ee5['id'],_0x4c65d4,_0x2542b5)||_0x598d09})):'hover'===_0x2d4c41&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x54a188(),_0x329c52,_0x4b7ee5['id'])||_0x598d09}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){_0x366f04({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x2efd40=[this['element']];return this['_pinnedTargetElement']&&_0x2efd40['push'](this['_pinnedTargetElement']),_0x2efd40;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x4171ee=new _0x3836c7();return this['resultItemView']=new Ks(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x4171ee['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai_review-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai_review__suggestion-text']},'children':[this['resultItemView']]}]}),_0x4171ee;}['_getBestRectPositionOnClick'](_0x5a09f4,_0x573154,_0x210e87,_0x5d2ff0,_0xd22f0a){if(!_0x5a09f4)return null;const _0x5370d1=this['position']['replace']('arrow_',''),_0x28dd32=Array['from'](_0x5a09f4['getClientRects']());let _0x52aaa6,_0x508eb3=_0x28dd32['reverse']();return void 0x0!==_0x573154&&this['_isPinnedRectVisible'](_0x508eb3[_0x573154],_0x5d2ff0,_0xd22f0a)?(_0x52aaa6=_0x508eb3[_0x573154],this['_pinnedRectIndex']=_0x573154):this['_isPinnedRectVisible'](_0x508eb3[0x0],_0x5d2ff0,_0xd22f0a)&&void 0x0===_0x573154?_0x52aaa6=_0x508eb3[0x0]:(_0x508eb3='s'==_0x5370d1[0x0]?[..._0x28dd32]['reverse']():_0x28dd32,_0x508eb3['forEach'](_0x309d5f=>{this['_isPinnedRectVisible'](_0x309d5f,_0x5d2ff0,_0xd22f0a)&&(_0x52aaa6=_0x309d5f);})),this['_pinnedTargetChangeId']=_0x210e87,this['_pinnedTargetElement']=_0x5a09f4,_0x52aaa6||_0x5a09f4['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x148b13,_0x891b35,_0x35c2b3){if(!_0x148b13)return null;const _0x367046=Array['from'](_0x148b13['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x891b35&&this['_pinnedTargetChangeId']!==_0x35c2b3)return this['_pinnedRectIndex']=_0x891b35,this['_pinnedTargetElement']=_0x148b13,this['_pinnedTargetChangeId']=_0x35c2b3,_0x367046[_0x891b35];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x35c2b3){if(_0x148b13!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x367046[this['_pinnedRectIndex']];}return void 0x0!==_0x891b35&&this['_pinnedTargetChangeId']!==_0x35c2b3?(this['_pinnedRectIndex']=_0x891b35,this['_pinnedTargetElement']=_0x148b13,this['_pinnedTargetChangeId']=_0x35c2b3,_0x367046[_0x891b35]):_0x148b13['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x598e4d,_0xa54ac8){if(_0x598e4d)for(let _0x131674=0x0;_0x131674<_0xa54ac8['length'];_0x131674++){const _0x28654e=_0xa54ac8[_0x131674];if(_0x598e4d['clientX']>=_0x28654e['left']-0x3&&_0x598e4d['clientX']<=_0x28654e['right']+0x3&&_0x598e4d['clientY']>=_0x28654e['top']-0x3&&_0x598e4d['clientY']<=_0x28654e['bottom']+0x3)return _0x131674;}}['_isPinnedRectVisible'](_0xbc6d0c,_0x3e1bd0,_0x197b59){const _0x44af0a=new _0x4795f2(_0xbc6d0c),_0x3b6e51=_0x3e1bd0||document['documentElement'],_0x22a721=_0x44af0a['getIntersection'](_0x3f8d24(_0x197b59)),_0x4e1db4=new _0x4795f2(_0x3b6e51)['getIntersection'](_0x44af0a);return!!(_0x22a721&&_0x4e1db4&&_0x44af0a['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Me extends _0x5aeef2{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[_t];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3bfbc9){super(_0x3bfbc9),this['_bodyCollection']=new _0x1424e8(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...ih)['to'](this),this['_balloonSuggestionView']=new me(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x564ab1=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x564ab1);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x4fe4b0){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x4f7948=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x4fe4b0,_0x4f7948);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x4c6736){_0x4c6736&&('error-general'!==_0x4c6736['status']?'error-chunk'!==_0x4c6736['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x3217e2){this['_mainView']['addCheckRunResult'](_0x3217e2);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x301e7c){this['_mainView']['showGeneralReviewCoreErrorView'](_0x301e7c??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x283c3a,_0x5d9e1f){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x283c3a,_0x5d9e1f);}['setActiveStateInResults'](_0x1bae6e){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x572cc9=>{_0x572cc9['id']===_0x1bae6e&&_0x572cc9['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x15c475=>_0x15c475['setItemAsInactive']());}['updateChangeState'](_0x1c32a5,_0x151df8){'accepted'===_0x151df8||'rejected'===_0x151df8||'outdated'===_0x151df8?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x1c32a5,_0x151df8):this['_mainView']['reviewCheckResultsView']['showResult'](_0x1c32a5,_0x151df8);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0xb1397,_0x598dcd,_0x565d28,_0xae7fb1,_0x2f4323,_0x3d4d6d){this['_balloonSuggestionView']['showBalloon'](_0xb1397,_0x598dcd,_0x565d28,_0xae7fb1,_0x2f4323,_0x3d4d6d);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x129a14){const _0x1214ec=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x32f273=>_0x32f273['id']===_0x129a14);return _0x1214ec?_0x1214ec['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0x3836c7{constructor(_0x503071){super(_0x503071),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x49b666=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x49b666['if']('isVisible','ck-hidden',_0x1dab2f=>!_0x1dab2f)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x49b666['to']('errorMessage')}]}]});}}class Ae extends _0x3836c7{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x7fac9a,_0x45da44){super(_0x7fac9a),this['reviewCoreHeader']=_0x45da44['header'],this['generalErrorView']=new sh(_0x7fac9a),this['reviewCheckListView']=_0x45da44['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0x45da44['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0x45da44['completed'],this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x12f492){this['reviewCheckResultsView']['addResult'](_0x12f492),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewCoreErrorView'](_0x342b95){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x342b95;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class vr extends _0x480cf4{constructor(_0x31d865,_0x404ce0){super(_0x404ce0),this['set']({'label':_0x31d865,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ve extends _0x4ef88a{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x11aa77,_0x33f730){super(_0x11aa77),this['_contents']=_0x33f730,this['_resultViews']=new _0x1b8196(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['_resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new Ri(_0x11aa77),this['set']('isLoading',!0x1),this['set']('isToggleDiffOn',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('headerSubtitle',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general'),this['set']('isCompleted',!0x1);const _0x32864d=this['_createCombinedSkeletonLoader'](),_0x66eff5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x66eff5['if']('isLoading','ck-ai_review__check-run_loading',_0x1ed51d=>_0x1ed51d),_0x66eff5['if']('isResultReady','ck-ai_review__check-run_ready',_0x3c135b=>_0x3c135b),_0x66eff5['if']('isVisible','ck-hidden',_0x179126=>!_0x179126)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x294353=>_0x294353)]},'children':this['_resultViews']},_0x32864d]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x57cc7a){const _0x2fa0d8=new Ks(this['locale'],_0x57cc7a['id']);_0x2fa0d8['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x2fa0d8),_0x2fa0d8['resultResponseView']['element']['innerHTML']=_0x57cc7a['contentDiffed'];}['hideResult'](_0x3c6184,_0x243ff2){if('pending'===_0x243ff2)return;const _0x4d38cf=this['_resultViews']['find'](_0x5e5c0d=>_0x5e5c0d['id']===_0x3c6184);_0x4d38cf&&(_0x4d38cf['status']=_0x243ff2,_0x4d38cf['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x2d4530,_0x28faec){if('pending'!==_0x28faec)return;const _0x385e7b=this['_resultViews']['find'](_0x4c7bcf=>_0x4c7bcf['id']===_0x2d4530);_0x385e7b&&(_0x385e7b['status']=_0x28faec,_0x385e7b['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x39e33f,_0x21113f){this['headerTitle']=_0x39e33f,this['headerSubtitle']=_0x21113f||'';}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}['resetErrorState'](){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}['_createSkeletonLoader'](){return new Ei(this['locale'],Si['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x189952=new _0x3836c7(this['locale']),_0x4ede0c=[];for(let _0x240407=0x0;_0x240407<0x10;_0x240407++){const _0x28c128=this['_createSkeletonLoader']();_0x28c128['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x4ede0c['push'](_0x28c128);}return _0x189952['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x16456e=>!_0x16456e)]},'children':_0x4ede0c}),_0x189952;}['_createErrorView'](){const _0x45f975=new _0x3836c7(this['locale']),_0x17677b=new _0x480cf4(this['locale']),t=this['locale']['t'];return _0x45f975['delegate']('retryReview')['to'](this),_0x17677b['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x17677b['on']('execute',()=>{this['fire']('retryReview');}),_0x45f975['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x12b614=>!_0x12b614),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x5c3a4f=>'chunk'===_0x5c3a4f)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x5ed1d5=>'chunk'===_0x5ed1d5)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x1891dc=>'general'!==_0x1891dc)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x5348d5=>'chunk'!==_0x5348d5)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x17677b]}),_0x45f975;}['_createCancelButtonView'](){const _0x57909d=new _0x480cf4(this['locale']);return _0x57909d['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x33c6ee}),_0x57909d['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2847ae=>_0x2847ae),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3fa6c6=>_0x3fa6c6)]}}),_0x57909d['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x57909d;}['_createToggleDiffButtonView'](){const _0x5e03d4=new _0x480cf4(this['locale']);_0x5e03d4['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x5e03d4['bind']('isEnabled')['to'](this,'isError',_0x480699=>!_0x480699),_0x5e03d4['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x270fb2=>!_0x270fb2),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x473fb9=>_0x473fb9)]}});const _0x14c7da=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0xdbf6ba=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x5e03d4['bind']('isOn')['to'](this,'isToggleDiffOn',_0x3749c5=>_0x3749c5),_0x5e03d4['bind']('icon')['to'](this,'isToggleDiffOn',_0xb3bb77=>_0xb3bb77?_0x4be72a:_0x449671),_0x5e03d4['bind']('label')['to'](this,'isToggleDiffOn',_0x79cc64=>_0x79cc64?_0x14c7da:_0xdbf6ba),_0x5e03d4['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x5e03d4;}['_createAcceptAllButtonView'](){const _0x3cad21=new _0x480cf4(this['locale']);return _0x3cad21['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x3cad21['bind']('isEnabled')['to'](this,'isError',_0x229ad3=>!_0x229ad3),_0x3cad21['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x29c0b5=>!_0x29c0b5),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4e220a=>_0x4e220a)]}}),_0x3cad21['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x3cad21;}['_createExitReviewButtonView'](){const _0x1b394c=new _0x480cf4(this['locale']);return _0x1b394c['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x1b394c['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5668a3=>!_0x5668a3),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x12bb46=>_0x12bb46)]}}),_0x1b394c['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x1b394c;}['_createResultHeaderView'](){const _0x1757c6=new _0x3836c7(this['locale']),_0x5396a0=this['_createTitleView']();return _0x1757c6['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x2d0b81=>_0x2d0b81)]},'children':[_0x5396a0,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x1757c6;}['_createTitleView'](){const _0x3dd202=new _0x3836c7(this['locale']),_0x33ebcb=new pi();return _0x33ebcb['bind']('isVisible')['to'](this,'isResultReady',_0x5d540d=>!_0x5d540d),_0x3dd202['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x33ebcb,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x40845a=>_0x40845a)]},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5c3e78=>!_0x5c3e78)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x3dd202;}['_createFinishReviewButtonView'](){const _0x5f33f9=new vr(i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x5f33f9['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3da1d0=>!_0x3da1d0)]}}),_0x5f33f9['delegate']('finishReview')['to'](this),_0x5f33f9;}}class be extends _0x4ef88a{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x145db7,_0x4aec76){super(_0x145db7),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x4aec76['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x4aec76['headerText']);const _0x51a1b3=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x51a1b3['if']('isVisible','ck-hidden',_0x1d94da=>!_0x1d94da)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0x4aec76['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x22b8c5){const _0x2481b6=new vr(_0x22b8c5,this['locale']);return _0x2481b6['delegate']('finishReview')['to'](this),_0x2481b6;}['_createResultHeaderView'](_0x277607){const _0x591afa=new _0x3836c7(this['locale']);return _0x591afa['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title']},'children':[{'text':_0x277607}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x591afa;}}class Dr extends _0x3836c7{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x2f0115,_0x214d8d){super(_0x2f0115),this['_defaultValue']=_0x214d8d['default']||(_0x214d8d['data']['length']>0x0?_0x214d8d['data'][0x0]['id']:''),this['_defaultLabel']=_0x214d8d['data']['find'](_0x23cb8f=>_0x23cb8f['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x1204b4(this['locale']);const _0x4e0838=this['_prepareListOptions'](_0x214d8d['data']);_0x158054(this['_dropdownView'],_0x4e0838,{'role':'menu','ariaLabel':_0x214d8d['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2442a1=>{_0x2442a1['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x1b2e1e=>{this['formValue']=_0x1b2e1e['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x1b2e1e['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x4816eb=[]){const _0x53482b=new _0x1e3367();this['resetToDefault']();for(const _0x452580 of _0x4816eb){const _0x2da591=new _0x2ab5f1({'label':_0x452580['label'],'withText':!0x0,'role':'menuitemradio','id':_0x452580['id'],'model':_0x452580});_0x2da591['bind']('isOn')['to'](this,'formValue',_0x1bb326=>_0x1bb326===_0x2da591['id']);const _0x278817={'type':'button','model':_0x2da591};_0x53482b['add'](_0x278817);}return _0x53482b;}}class tc extends _0x4ef88a{['_formItem']=null;constructor(_0x3f7a84,_0x2f469f,_0x4c11d5){super(_0x3f7a84),this['argsKey']=_0x2f469f?.['argsKey'];if('dropdown'===_0x2f469f['formType'])this['_formItem']=new Dr(this['locale'],_0x2f469f);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x1f6ae0=new _0x4bdd31(this['locale'],{'children':[this['_formItem']],'class':[_0x4c11d5?'ck-form__row_with-submit':'']});_0x4c11d5&&_0x1f6ae0['children']['add'](_0x4c11d5),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x1f6ae0]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class mo extends _0x226e4c{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x595309){super(_0x595309),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x2971c3(),this['minRows']=mo['MIN_ROWS'],this['maxRows']=mo['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class sc extends _0x3836c7{['focusTracker']=new _0x50a6e7();['keystrokes']=new _0x2971c3();['focusCycler'];['_focusables']=new _0x1b8196();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x58fbe5,_0x426154,_0x423441=!0x1){super(_0x58fbe5),this['_check']=_0x426154,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x426154['defaultModel']?_0x426154['defaultModel']['id']:'',this['_defaultLabel']=_0x426154['defaultModel']?_0x426154['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x50a78e(this['locale'],()=>new mo(_0x58fbe5)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _0x1e3367(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x423441),_0x158054(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x4bdd31(this['locale'],{'children':[this['promptInputView']]}),new _0x4bdd31(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x4e799d,_0x5c31cb)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x5c31cb()):_0x5c31cb();}),this['focusCycler']=new _0x39194d({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),([this['promptInputView'],this['_modelSelectionDropdown'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x3e014a=>{this['_focusables']['add'](_0x3e014a),this['focusTracker']['add'](_0x3e014a['element']);}),this['keystrokes']['listenTo'](this['element']));}get['modelDefaultValue'](){return this['_defaultValue'];}get['modelDefaultLabel'](){return this['_defaultLabel'];}['resetToDefault'](){this['prompt']='',this['modelId']=this['modelDefaultValue'],this['_modelSelectionDropdown']['buttonView']['label']=this['modelDefaultLabel'],this['resetFormValidationStatus']();}['resetFormValidationStatus'](){this['promptInputView']['errorText']='';}['_isValid'](){this['resetFormValidationStatus']();for(const _0xc1d588 of this['_getFormValidators']()){const _0x3ad87c=_0xc1d588();if(_0x3ad87c)return this['promptInputView']['errorText']=_0x3ad87c,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return i(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x13429d=new _0x480cf4(this['locale']),t=this['locale']['t'];return _0x13429d['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x13429d['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x13429d;}['_createCancelButtonView'](){const _0x317858=new _0x480cf4(this['locale']),t=this['locale']['t'];return _0x317858['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0x317858['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5d054e=>{_0x5d054e['stopPropagation']();})}}),_0x317858['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x317858;}['_setModelList'](_0x5a1527){this['_modelSelectionDropdownItems']['clear']();const _0x5a20bf=this['_check']['models'];if(_0x5a1527)this['set']('modelDisplayMode','hidden');else{const _0x38aa16=0x1===_0x5a20bf['length'];this['set']('modelDisplayMode',_0x38aa16?'name':'selector');}if(this['resetToDefault'](),_0x5a20bf?.['length']){0x1===_0x5a20bf['length']&&this['set']('activeModelName',_0x5a20bf[0x0]['name']||_0x5a20bf[0x0]['id']);for(const _0x3d3c90 of _0x5a20bf){const _0x544884=new _0x2ab5f1({'label':_0x3d3c90['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3d3c90['id'],'model':_0x3d3c90});_0x544884['bind']('isOn')['to'](this,'modelId',_0x2a6d67=>_0x2a6d67===_0x3d3c90['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x544884,'labelView':new po(this['locale'],_0x3d3c90)});}}}['_createModelSelectionDropdown'](){const _0x47cdd8=_0x1204b4(this['locale']);return _0x47cdd8['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x47cdd8['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x47cdd8['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5c40fc=>'selector'===_0x5c40fc),this['listenTo'](_0x47cdd8,'execute',_0x539ded=>{this['modelId']=_0x539ded['source']['model']['id'],_0x47cdd8['buttonView']['label']=_0x539ded['source']['label'];}),_0x47cdd8;}['_createModelNameView'](){const _0x2fdf1c=new wo(this['locale']);return _0x2fdf1c['bind']('text')['to'](this,'activeModelName',_0x42d844=>_0x42d844??''),_0x2fdf1c['bind']('isVisible')['to'](this,'modelDisplayMode',_0x1b2615=>'name'===_0x1b2615),_0x2fdf1c;}['_createActionsFooterView'](){const _0x4b4058=new _0x3836c7(this['locale']);return _0x4b4058['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x4b4058;}}class wo extends _0x3836c7{constructor(_0x3691f2){super(_0x3691f2),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x20bfc6=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x20bfc6['if']('isVisible','ck-hidden',_0x300f6c=>!_0x300f6c)]},'children':[{'text':_0x20bfc6['to']('text')}]});}}class po extends _0x51555e{constructor(_0x1a0579,_0x499585){super();const _0x1957fc=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1957fc['to']('style'),'id':_0x1957fc['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x1957fc['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x499585['description']||'']}]}]});}}class ec extends _0x4ef88a{['_formItemsCollection']=new _0x1b8196();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x100c69,_0x4375ef,_0x133635,_0x356179=!0x1){super(_0x100c69),this['_hideModels']=_0x356179,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x4375ef['isParameterized']);const _0x2ed33f=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0x46c432=>_0x46c432),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x4dcefc=>_0x4dcefc)],'style':{'--ck-ai-review-check-list-item-index':_0x133635}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0x4375ef['title']}]},_0x2ed33f]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x4375ef['description']?[{'text':_0x4375ef['description']}]:[]}]}]},..._0x4375ef['isParameterized']?[this['_createParameterizedView'](_0x4375ef)]:[],...'custom'===_0x4375ef['id']?[this['_createCustomView'](_0x4375ef,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x4375ef['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x4375ef['id'],'args':_0x4375ef['useArgs']?_0x4375ef['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x366f04({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x4b0592=>{_0x4b0592['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x462056=new _0x1254c7();return _0x462056['content']=_0x44aab3,_0x462056['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x462056;}['_createParameterizedView'](_0x23d4e2){const _0x384d98=new _0x3836c7(),_0x1e9e2b=this['_createFormView'](_0x23d4e2);return _0x384d98['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x34642b=>!_0x34642b)]},'children':[_0x1e9e2b]}),_0x384d98;}['_createFormView'](_0x431ca9){const _0xb71d9a=new _0x3836c7(),_0x400764=Array['isArray'](_0x431ca9['options'])?_0x431ca9['options']:[],_0x1ce6a1=new _0x480cf4(this['locale']),t=this['locale']['t'];_0x1ce6a1['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x1ce6a1['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3e6a0c=>{_0x3e6a0c['stopPropagation']();})}}),_0x1ce6a1['on']('execute',()=>{const _0x7d6e93=[],_0x6e8bea={};this['_formItemsCollection']['forEach'](_0x1a7097=>{_0x7d6e93['push'](_0x1a7097['value']),_0x431ca9['useArgs']&&_0x431ca9['options']&&(_0x6e8bea[_0x1a7097['argsKey']]=_0x1a7097['value']);}),this['fire']('runReviewCheck',{'id':_0x431ca9['id'],'params':_0x7d6e93['length']?_0x7d6e93:void 0x0,'args':Object['keys'](_0x6e8bea)['length']?_0x6e8bea:void 0x0});});const _0x13a571=_0x400764['length'];return _0x400764['forEach']((_0x5840a6,_0x26aad1)=>{const _0x17b2d5=_0x26aad1===_0x13a571-0x1;this['_formItemsCollection']['add'](new tc(this['locale'],_0x5840a6,_0x17b2d5?_0x1ce6a1:null));}),_0xb71d9a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0xb71d9a;}['_createCustomView'](_0x43c918,_0x3d355e=!0x1){return this['_customCheckView']=new sc(this['locale'],_0x43c918,_0x3d355e),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x2fea39=>!_0x2fea39)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x21138e,_0x5e9d25,_0x5ce1ba)=>{_0x5ce1ba||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class je extends _0x4ef88a{['_checkViews'];constructor(_0x4dfbc2){super(_0x4dfbc2),this['_checkViews']=new _0x1b8196(),this['_setupTemplate']();}['setChecks'](_0x5ed1dd,_0x29ac89=!0x1){this['_checkViews']['clear']();for(const [_0x311cd6,_0x5ab79b]of _0x5ed1dd['entries']()){const _0x36eb5b=new ec(this['locale'],_0x5ab79b,_0x311cd6,_0x29ac89);_0x36eb5b['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x36eb5b);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x15ff86 of this['_checkViews'])_0x15ff86 instanceof ec&&_0x15ff86['resetToDefault']();}['_setupTemplate'](){const _0x379260=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x379260['if']('isVisible','ck-hidden',_0x2caaeb=>!_0x2caaeb)]},'children':this['_checkViews']});}}class ge extends Me{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x57c325=this['context']['locale'],_0x55b3c0=new _0x4631d7(_0x57c325,{'label':i(_0x57c325,'AI_REVIEW_MODE'),'icon':_0x5be86e,'class':'ck-ai-header\x20ck-ai-header_review'});return new Ae(this['context']['locale'],{'header':_0x55b3c0,'list':new je(_0x57c325),'results':new Ve(_0x57c325,{'generalErrorText':i(_0x57c325,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x57c325,{'headerText':i(_0x57c325,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':i(_0x57c325,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x57c325,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x48d1e1=this['context']['plugins']['get']('AITabs');_0x48d1e1['view']['on']('activateTab',(_0x54d5f1,_0x143ec2)=>{'reviewMode'===_0x143ec2?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x48d1e1['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x5be86e,'order':0x0,'content':this['_mainView']});}}const fe='review-';class de extends _0x5aeef2{static get['requires'](){return[_0x4df951,D];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0xf83a3b){super(_0xf83a3b),this['_domEmitter']=new(_0x177b01())(),this['_eventEmitter']=new(_0x3ea0e5())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x21e568=T(this['context']);_0x21e568['conversion']['for']('editingDowncast')['markerToElement']({'model':fe+'insert','view':(_0x1d8308,{writer:_0x1d432e})=>{const _0x928aa6=this['_markers']['get'](_0x1d8308['markerName']),_0x5b6ec0={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x928aa6?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x1d8308['markerName']};return _0x1d432e['createUIElement']('span',_0x5b6ec0,function(_0x3db1b7){const _0x28ecf0=this['toDomElement'](_0x3db1b7);return _0x28ecf0['innerHTML']=_0x928aa6?.['content']?.['asString']||'',_0x28ecf0;});}}),_0x21e568['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-only','view':_0x385ec9=>{const _0x2b6f13=this['_markers']['get'](_0x385ec9['markerName']),_0x1fbeb9=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x2b6f13?.['id']||'')&&_0x1fbeb9['push']('ck-ai_review__change_active'),{'classes':_0x1fbeb9,'attributes':{'data-marker-id':_0x385ec9['markerName']}};}}),_0x21e568['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-context','view':_0x444f08=>{const _0x24ab70=this['_markers']['get'](_0x444f08['markerName']),_0x2b354e=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x24ab70?.['id']||'')&&_0x2b354e['push']('ck-ai_review__change_active'),{'classes':_0x2b354e,'attributes':{'data-marker-id':_0x444f08['markerName']}};}}),_0x21e568['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-text','view':_0x5bae4d=>{const _0x2c9428=this['_markers']['get'](_0x5bae4d['markerName']),_0x526320=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x2c9428?.['id']||'')&&_0x526320['push']('ck-ai_review__change_active'),{'classes':_0x526320,'attributes':{'data-marker-id':_0x5bae4d['markerName']}};}}),_0x21e568['conversion']['for']('dataDowncast')['markerToElement']({'model':fe+'suggestion-context','view':(_0x5f4860,{writer:_0x3372b9})=>_0x3372b9['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x5f4860['isOpening']?'start':'end')})}),_0x21e568['conversion']['for']('downcast')['attributeToAttribute']({'model':At,'view':_0x497ca9});const _0x122211=_0x21e568['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x122211,'mouseup',(_0x746d8b,_0x50b2cd)=>{const _0x1470dc=_0x50b2cd['target'],_0x3ffd01=this['_findMarkerElement'](_0x1470dc);if(!_0x3ffd01)return;const _0x3ea013=_0x3ffd01['getAttribute']('data-marker-id'),_0xe1835d=_0x3ea013['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x3ea013,'changeId':_0xe1835d,'markerElement':()=>this['_findMarkerElementById'](_0x3ea013),'domEvent':_0x50b2cd});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x122211,'mouseover',(_0x107503,_0x3f6279)=>{const _0x51ba35=_0x3f6279['target'],_0x1b52ff=_0x3f6279['relatedTarget'];let _0x114fb7=this['_findMarkerElement'](_0x51ba35);if(!_0x114fb7&&_0x1b52ff&&(_0x114fb7=this['_findMarkerElement'](_0x1b52ff)),!_0x114fb7)return;const _0x2e0f61=_0x114fb7['getAttribute']('data-marker-id'),_0x5c56eb=_0x2e0f61['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x5c56eb,'markerElement':()=>this['_findMarkerElementById'](_0x2e0f61),'domEvent':_0x3f6279});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x3ac262((_0x7a0f2c,_0x21b00d)=>{const _0x517dac=_0x21b00d['target'];if(this['_findMarkerElement'](_0x517dac))return;_0x517dac['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x21e568['model']['document']['registerPostFixer'](_0x5e462e=>this['_validateMarkers'](_0x21e568,_0x5e462e)),_0x21e568['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x21e568));}['getDocumentData'](){const _0x94a8e9=this['context']['plugins']['get']('AIEditing'),_0x15f587=T(this['context']),_0x496bec=_0x15f587['model'],_0x3cf975=new tt();for(const _0x25780f of _0x496bec['document']['getRoot']()['getChildren']()){const _0x1a083c=_0x25780f['_clone'](!0x0);_0x3cf975['_appendChild'](_0x1a083c);}for(const _0x1fb2d1 of _0x496bec['markers'])_0x3cf975['markers']['set'](_0x1fb2d1['name'],this['_changeRangeOwnerDocument'](_0x1fb2d1['getRange']()['clone'](),_0x3cf975));const _0x1fb4d9=new _0x50564f({'ignoreElementEnd':!0x0,'startPosition':_0x496bec['createPositionAt'](_0x3cf975,0x0)}),_0x38907e=new Set(),_0x2e9f29=new Map();for(const {item:_0x49be7b}of _0x1fb4d9){if(!_0x49be7b['is']('$textProxy'))continue;const _0x23da6=_0x49be7b['parent'];if(_0x23da6&&_0x23da6['is']('element')){const _0x15ade8=this['_upsertDataId'](_0x23da6,()=>_0x94a8e9['_nextDataId'](_0x38907e));_0x38907e['add'](_0x15ade8);for(const _0x22f585 of _0x23da6['getChildren']())_0x22f585['is']('element')&&_0x38907e['add'](this['_upsertDataId'](_0x22f585,()=>_0x94a8e9['_nextDataId'](_0x38907e)));let _0x2f4400=_0x23da6;for(;_0x2f4400['parent']&&!_0x2f4400['parent']['is']('documentFragment');)_0x2f4400=_0x2f4400['parent'],_0x2f4400['hasAttribute'](At)&&_0x2f4400['_removeAttribute'](At);_0x2e9f29['set'](_0x15ade8,{'path':_0x23da6['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x2f4400['_clone'](!0x0),_0x15ade8,_0x15f587['data'])}),_0x1fb4d9['jumpTo'](_0x496bec['createPositionAfter'](_0x23da6));}}return{'content':_0x15f587['data']['processor']['toData'](_0x15f587['data']['toView'](_0x3cf975)),'version':_0x15f587['model']['document']['version'],'elements':_0x2e9f29};}['diffContent'](_0x3c7a9b,_0x2a96f1,_0x35a6e7=!0x1){const _0x19e979=[],_0x393076=T(this['context']),_0x2d5493=_0x393076['data']['parse'](_0x2a96f1,'$documentFragment'),_0x419066=_0x393076['data']['parse'](_0x3c7a9b,'$documentFragment'),_0x48e8f6=_0x393076['model']['createPositionAt'](_0x419066,0x0);if(this['_haveSingleTopLevelElement'](_0x2d5493)){if(!this['_hasSameTopLevelElement'](_0x419066,_0x2d5493))return _0x19e979;}else{const _0x24f546=_0x393076['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x419066,_0x24f546)||!this['_haveOnlyInlineContent'](_0x2d5493,_0x24f546))return _0x19e979;}const _0x86b829=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x3c7a9b,_0x2a96f1,{'anchor':_0x48e8f6,'markDeletions':!0x0})['getOperations']()['filter'](_0x57724e=>'insert'===_0x57724e['type']||'marker'===_0x57724e['type']&&_0x57724e['name']['startsWith']('$markedRemove')),_0x2a3170=this['_groupAdjacentOperations'](_0x86b829),_0x4f42b4=[];if(_0x35a6e7){if(_0x2a3170['length']){const _0x193a5b=_0x2a3170[0x0]['operations'][0x0],_0xe822e4='insert'===_0x193a5b['type']?_0x193a5b['position']:_0x193a5b['newRange']['start'],_0x53121d=this['_getPositionLimitingRange'](_0xe822e4,_0x393076,'inside'),_0x18bba1=_0x53121d?_0x2d5493['getChild'](0x0)['getChildren']():_0x2d5493['getChildren'](),_0x4fcda3=_0x53121d||_0x393076['model']['createRangeIn'](_0x419066),_0x239eff=[new _0x145a38('$markedRemove:synthetic'+_0x46d503(),null,_0x4fcda3,_0x393076['model']['document']['model']['markers'],!0x0,_0x393076['model']['document']['version']+0x1),new _0x3afeab(_0x4fcda3['end'],_0x18bba1,_0x393076['model']['document']['version']+0x2)];_0x4f42b4['push']({'operations':_0x239eff,'operationsIsolated':_0x239eff,'groupOffset':0x0});}}else _0x4f42b4['push'](..._0x2a3170);let _0x175605=0x0;return _0x393076['model']['change'](_0x2c7eeb=>{for(let _0x578935=0x0;_0x578935<_0x4f42b4['length'];_0x578935++){const _0x17b4b4=_0x4f42b4[_0x578935],_0x1ee301=_0x2c7eeb['createDocumentFragment']();for(const _0x428792 of _0x419066['getChildren']())_0x2c7eeb['append'](_0x428792['_clone'](!0x0),_0x1ee301);for(const _0x4acdb9 of _0x17b4b4['operationsIsolated'])if('insert'===_0x4acdb9['type']){const _0x5aa23e=_0x4acdb9;_0x5aa23e['baseVersion']=null,_0x5aa23e['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x5aa23e,_0x1ee301),_0x2c7eeb['batch']['addOperation'](_0x4acdb9),_0x393076['model']['applyOperation'](_0x4acdb9);const _0x465fc0='suggestion:insertion:id:authorId:'+_0x175605++,_0x2f7926=_0x393076['model']['createRange'](_0x5aa23e['position'],_0x5aa23e['position']['getShiftedBy'](_0x5aa23e['howMany']));_0x1ee301['markers']['set'](_0x465fc0,_0x2f7926);}else{if('marker'===_0x4acdb9['type']&&_0x4acdb9['name']['startsWith']('$markedRemove')){const _0x564a03=_0x4acdb9,_0x4c6d46='suggestion:deletion:id:authorId:'+_0x175605++;this['_changeOperationOwnerDocument'](_0x564a03,_0x1ee301),_0x1ee301['markers']['set'](_0x4c6d46,_0x564a03['newRange']);}}if(_0x35a6e7)_0x19e979['push']({..._0x17b4b4,'context':this['_createGetContentFn'](_0x419066,_0x393076['data']),'content':this['_createGetContentFn'](_0x419066,_0x393076['data'])});else{const _0x3d334c=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x17b4b4['operationsIsolated'][0x0]),_0x1ee301),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x17b4b4['operationsIsolated'][_0x17b4b4['operationsIsolated']['length']-0x1]),_0x1ee301));_0x1ee301['markers']['set'](fe+'suggestion-context',new it(_0x3d334c['start'],_0x3d334c['end'])),_0x19e979['push']({..._0x17b4b4,'context':this['_createGetContextFn'](_0x1ee301,_0x393076['data'],{'ellipsisBefore':_0x3d334c['hasContentBefore'],'ellipsisAfter':_0x3d334c['hasContentAfter']}),'content':this['_createGetContentFn'](_0x1ee301,_0x393076['data'])});}}}),_0x19e979;}['markChangePositionInEditorContent'](_0x19fddf,_0x2524ed){if(!_0x19fddf['length'])return;const _0x544208=_0x19fddf[0x0]['parent']['id'],_0x33d6ed=_0x2524ed['elements']['get'](_0x544208);if(!_0x33d6ed)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x544208);const _0x1b76f=_0x33d6ed['path'],_0x3005a3=T(this['context']),_0x129178=_0x3005a3['model']['document']['history']['getOperations'](_0x2524ed['version']),_0x43f5f0=[];for(const _0x430544 of _0x19fddf){const _0x1e73c6=_0x430544['operationsIsolated']['map'](_0x25c829=>this['_translateOperationToEditorContent'](_0x25c829,_0x1b76f,_0x3005a3['model']['document']['getRoots']()[0x0]));if(!_0x1e73c6||!_0x1e73c6['length'])continue;const _0x2d64c7=_0x1e73c6['every'](_0x10f617=>'marker'===_0x10f617['type']&&_0x10f617['name']['startsWith']('$markedRemove')),_0x2be098={'document':_0x3005a3['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x236041=nt(_0x1e73c6,_0x129178,_0x2be098)['operationsA'];for(const _0x581927 of _0x236041)if('insert'===_0x581927['type']){const _0x4df79d=_0x581927,_0x28abe7=_0x4df79d['nodes'];_0x3005a3['model']['change'](_0x37c272=>{const _0x1a1448=_0x37c272['createDocumentFragment']();for(const _0x8ca428 of _0x28abe7)_0x37c272['append'](_0x8ca428['_clone'](!0x0),_0x1a1448);_0x43f5f0['push']({'start':_0x4df79d['position'],'end':_0x4df79d['position'],'type':'insert','groupId':_0x430544['id'],'content':{'asString':this['_createGetContentFn'](_0x1a1448,_0x3005a3['data'])(),'asFragment':_0x1a1448}});});}else{if('marker'===_0x581927['type']&&_0x581927['name']['startsWith']('$markedRemove')){const _0x506ba7=_0x581927;let _0x31b7da='remove-text';if(_0x2d64c7){const _0x162aa3=this['_findAdjacentContextDistance'](_0x506ba7['newRange']['start'],'backward',_0x3005a3['model']['schema']),_0x32faa4=this['_findAdjacentContextDistance'](_0x506ba7['newRange']['end'],'forward',_0x3005a3['model']['schema']);if(_0x162aa3||_0x32faa4){const _0x562151=_0x506ba7['newRange']['start']['getShiftedBy'](-_0x162aa3),_0x43b446=_0x506ba7['newRange']['end']['getShiftedBy'](_0x32faa4);_0x43f5f0['push']({'start':_0x562151,'end':_0x43b446,'groupId':_0x430544['id'],'type':'remove-context'});}else _0x31b7da='remove-only';}_0x43f5f0['push']({'start':_0x506ba7['newRange']['start'],'end':_0x506ba7['newRange']['end'],'groupId':_0x430544['id'],'type':_0x31b7da});}}}this['_insertMarkers'](_0x43f5f0);}['clearAllMarkers'](){const _0x280ef6=T(this['context']);_0x280ef6['model']['change'](_0x15d603=>{for(const _0x381a2b of this['_markers']['keys']())_0x280ef6['model']['markers']['get'](_0x381a2b)&&_0x15d603['removeMarker'](_0x381a2b);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){T(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){T(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x44536c){const _0x1bac76=T(this['context']),_0x17fc12=_0x1bac76['model'],_0x42cd31=_0x44536c['map'](_0x292831=>this['_getMarkersDataForGroup'](_0x292831))['flat']();_0x17fc12['change'](_0x565b14=>{for(const _0x4c01e6 of _0x42cd31){const _0x404fa4=_0x1bac76['model']['markers']['get'](_0x4c01e6['id']);if(_0x404fa4){if('insert'===_0x4c01e6['type']){if(!_0x4c01e6['content'])continue;_0x17fc12['insertContent'](_0x4c01e6['content']['asFragment']||null,_0x404fa4['getRange']()['start']);}else'remove-text'!==_0x4c01e6['type']&&'remove-only'!==_0x4c01e6['type']||_0x17fc12['deleteContent'](_0x17fc12['createSelection'](_0x404fa4['getRange']()));_0x565b14['removeMarker'](_0x4c01e6['id']),this['_markers']['delete'](_0x4c01e6['id']);}}});}['rejectChange'](_0x4c008c){const _0x13c2ec=T(this['context']),_0x1dc0d8=this['_getMarkersDataForGroup'](_0x4c008c);_0x13c2ec['model']['change'](_0x5d6e87=>{for(const _0x38ddef of _0x1dc0d8)_0x5d6e87['removeMarker'](_0x38ddef['id']),this['_markers']['delete'](_0x38ddef['id']);});}['getEditor'](){return T(this['context']);}['getMarkerElementForChange'](_0xddbb9a){const _0x51ea08=Array['from'](this['_markers']['values']())['filter'](_0x3b20ff=>_0x3b20ff['groupId']===_0xddbb9a);if(!_0x51ea08['length'])return null;const _0x467968=0x1===_0x51ea08['length']?_0x51ea08[0x0]:this['_sortMarkers'](_0x51ea08)[0x0],_0x15cbc4=T(this['context'])['model']['markers']['get'](_0x467968['id']);if(!_0x15cbc4)return null;return{'modelRange':_0x15cbc4['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x467968['id'])};}['getContentElementForChange'](_0x4e361b){const _0x2c1b78=Array['from'](this['_markers']['values']())['filter'](_0x487feb=>_0x487feb['groupId']===_0x4e361b);if(!_0x2c1b78['length'])return null;const _0x499288=0x1===_0x2c1b78['length']?_0x2c1b78[0x0]:this['_sortMarkers'](_0x2c1b78)[0x0],_0xb49c18=T(this['context']),_0x1f6cd4=_0xb49c18['model']['markers']['get'](_0x499288['id']);if(!_0x1f6cd4)return null;const _0x396b15=_0x1f6cd4['getRange'](),_0x594c2c=_0xb49c18['editing']['view']['getDomRoot']();if(!_0x594c2c||!_0x396b15)return null;let _0x9d4cce=_0x396b15['start']['parent'];for(;_0x9d4cce['parent']&&'$root'!==_0x9d4cce['parent']['name'];)_0x9d4cce=_0x9d4cce['parent'];if(!_0x9d4cce||!_0x9d4cce['name'])return null;const _0xf47632=_0x594c2c['querySelector']('[data-marker-id=\x22'+_0x499288['id']+'\x22]');if(!_0xf47632)return null;let _0x1549ff=null;_0xb49c18['model']['change'](_0xb639da=>{_0x1549ff=_0xb639da['createDocumentFragment'](),_0xb639da['append'](_0x9d4cce['_clone'](!0x0),_0x1549ff);});const _0x53dece=_0xb49c18['data']['toView'](_0x1549ff)['getChild'](0x0);return _0xf47632['closest'](_0x53dece['name']);}['reactivateMarkers'](_0x368e5e){const _0x53b320=this['_getMarkersDataForGroup'](_0x368e5e);if(!_0x53b320['length'])return;const _0x4aab06=Array['from'](this['_activeMarkers'])['sort'](),_0x3d4441=Array['from'](new Set(_0x53b320['map'](_0x130ff6=>_0x130ff6['id'])))['sort']();_0x4aab06['join']('|')!==_0x3d4441['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x368e5e));}['setMarkersInElementAsActive'](_0x4acccf){const _0x18b71f=this['_getMarkersDataForGroup'](_0x4acccf);if(!_0x18b71f['length'])return;const _0x970358=T(this['context']),_0x13c8eb=new Set(_0x18b71f['map'](_0xa1caa0=>_0xa1caa0['id'])),_0x5855a3=Array['from'](_0x13c8eb['values']())['map'](_0x272093=>_0x970358['model']['markers']['get'](_0x272093))['filter'](_0x21f079=>!!_0x21f079);_0x13c8eb['forEach'](_0x5b96e0=>{this['_activeMarkers']['add'](_0x5b96e0);}),_0x970358['model']['change'](()=>{_0x5855a3['forEach'](_0xc16a16=>{_0x970358['editing']['reconvertMarker'](_0xc16a16);});});}['setAllMarkersAsInactive'](){const _0x283587=Array['from'](this['_activeMarkers']);if(!_0x283587['length'])return;this['_activeMarkers']['clear']();const _0x47c2d7=T(this['context']),_0xb0f3bd=_0x283587['map'](_0x16d262=>_0x47c2d7['model']['markers']['get'](_0x16d262))['filter'](_0x411619=>!!_0x411619);_0x47c2d7['model']['change'](()=>{_0xb0f3bd['forEach'](_0x1134eb=>{_0x47c2d7['editing']['reconvertMarker'](_0x1134eb);});});}['_getPositionLimitingRange'](_0x5da25e,_0x2bdd40,_0x53f273='outside'){if(!_0x5da25e)return null;let _0x4f6920=_0x5da25e['parent'];for(;_0x4f6920&&_0x4f6920['parent']&&'$root'!==_0x4f6920['parent']['name']&&!_0x2bdd40['model']['schema']['isLimit'](_0x4f6920)&&!_0x2bdd40['model']['schema']['isBlock'](_0x4f6920);)_0x4f6920=_0x4f6920['parent'];if(!_0x4f6920||!_0x4f6920['name']||'$root'===_0x4f6920['name'])return null;let _0x3079fa=null;return _0x2bdd40['model']['change'](_0x5abdbe=>{_0x3079fa='inside'===_0x53f273?_0x5abdbe['createRangeIn'](_0x4f6920):_0x5abdbe['createRangeOn'](_0x4f6920);}),_0x3079fa;}['_validateMarkers'](_0x65668e,_0x43b591){const _0xd2493a=Array['from'](this['_markers']['keys']()),_0x54ec9f=new Map();for(const _0x6443ae of _0xd2493a){const _0x27b170=_0x65668e['model']['markers']['get'](_0x6443ae);if(!_0x27b170)continue;const _0x3f6f33=_0x27b170['getStart']()['path'][0x0];_0x54ec9f['has'](_0x3f6f33)||_0x54ec9f['set'](_0x3f6f33,[]),_0x54ec9f['get'](_0x3f6f33)['push'](_0x27b170);}const _0x21afd9=new Set();for(const _0x332d81 of _0x65668e['model']['document']['differ']['getChanges']()){let _0x29e262=-0x1,_0x420f45=null;if('insert'===_0x332d81['type'])_0x420f45=new it(_0x332d81['position'],_0x332d81['position']['getShiftedBy'](_0x332d81['length'])),_0x29e262=_0x332d81['position']['path'][0x0];else{if('remove'!==_0x332d81['type'])continue;_0x420f45=new it(_0x332d81['position']),_0x29e262=_0x332d81['position']['path'][0x0];}const _0x256ca7=_0x54ec9f['get'](_0x29e262)||[];if(_0x256ca7['length']){for(const _0x42967f of _0x256ca7)if(_0x420f45['root']['rootName']===_0x42967f['getRange']()['root']['rootName']&&('insert'!==_0x332d81['type']||!_0x420f45['containsRange'](_0x42967f['getRange']()))&&(_0x420f45['isIntersecting'](_0x42967f['getRange']())||_0x420f45['start']['isTouching'](_0x42967f['getRange']()['end'])||_0x420f45['end']['isTouching'](_0x42967f['getRange']()['start']))){const _0x733dfe=this['_parseMarkerName'](_0x42967f['name']);Array['from'](this['_markers']['values']())['filter'](_0x1f7913=>_0x1f7913['groupId']===_0x733dfe['groupId'])['forEach'](_0x37d2c8=>_0x21afd9['add'](_0x37d2c8['id']));}}}if(_0x21afd9['size']){for(const _0x46ab34 of _0x21afd9)_0x43b591['removeMarker'](_0x46ab34);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x116466){for(const {name:_0x1d04cc,data:_0x228f5c}of _0x116466['model']['document']['differ']['getChangedMarkers']()){if(!_0x1d04cc['startsWith'](fe))continue;const _0x26c331=_0x228f5c['oldRange'],_0x52b14f=_0x228f5c['newRange'],_0x180e85=_0x26c331&&'$graveyard'===_0x26c331['root']['rootName'],_0x22c21e=_0x52b14f&&'$graveyard'===_0x52b14f['root']['rootName'];if(_0x180e85&&_0x22c21e)continue;const _0x339308=this['_parseMarkerName'](_0x1d04cc);this['_markers']['get'](_0x1d04cc)&&(_0x22c21e||!_0x52b14f?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x1d04cc,'changeId':_0x339308['groupId']}):_0x180e85&&_0x52b14f&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x1d04cc,'changeId':_0x339308['groupId']}));}}['_parseMarkerName'](_0x372733){const _0x3aac82=_0x372733['split'](':'),_0x5d62d8=(_0x3aac82[0x1]||'')['split']('_');return{'prefix':_0x3aac82[0x0],'groupId':_0x5d62d8[0x0],'suffix':_0x5d62d8[0x1]};}['_translateOperationToEditorContent'](_0x30d103,_0x59d0e5,_0x53713b){if('insert'===_0x30d103['type']){const _0x350af5=_0x30d103;return new _0x3afeab(this['_changePosition'](_0x59d0e5['concat'](_0x350af5['position']['offset']),_0x53713b),_0x350af5['nodes'],_0x350af5['baseVersion']);}if('marker'===_0x30d103['type']&&_0x30d103['name']['startsWith']('$markedRemove')){const _0x1f5be4=_0x30d103;return new _0x145a38(_0x1f5be4['name'],_0x1f5be4['oldRange'],this['_changeRange'](_0x1f5be4['newRange'],_0x59d0e5['concat'](_0x1f5be4['newRange']['start']['offset']),_0x59d0e5['concat'](_0x1f5be4['newRange']['end']['offset']),_0x53713b),_0x1f5be4['_markers'],_0x1f5be4['affectsData'],_0x1f5be4['baseVersion']);}return _0x30d103;}['_groupAdjacentOperations'](_0x5a1d6d){if(!_0x5a1d6d['length'])return[];const _0x49f584=[];let _0x1b4cac=0x0,_0x1f3953=0x0,_0x4dd96b=[];for(let _0x5b8994=0x0;_0x5b8994<=_0x5a1d6d['length'];_0x5b8994++){const _0x511de6=_0x5a1d6d[_0x5b8994],_0xf0143e=_0x5a1d6d[_0x5b8994-0x1];!_0x511de6||_0xf0143e&&!this['_getOperationEnd'](_0xf0143e)['isTouching'](this['_getOperationStart'](_0x511de6))?(_0x49f584['push']({'operations':_0x4dd96b,'operationsIsolated':_0x4dd96b['map'](_0x3e5910=>this['_shiftOperation'](_0x3e5910['clone'](),-_0x1f3953)),'groupOffset':_0x1b4cac}),_0x4dd96b=_0x511de6?[_0x511de6]:[],_0x1f3953+=_0x1b4cac,_0x1b4cac=0x0):_0x4dd96b['push'](_0x511de6),_0x511de6&&'insert'===_0x511de6['type']&&(_0x1b4cac+=_0x511de6['howMany']);}return _0x49f584;}['_findAdjacentContextDistance'](_0x77caef,_0x26da8d,_0x2148b3,_0x8e2708=0x1){const _0x128101=new _0x50564f({'startPosition':_0x77caef,'direction':_0x26da8d});let _0x1e50c9=0x0;for(let _0x1c956c=0x0;_0x1c956c<_0x8e2708;_0x1c956c++){let _0x520ab5=0x0,_0x120725=!0x1,_0x2b9c99='forward'===_0x26da8d?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x36b8fb}of _0x128101)if(_0x36b8fb['is']('$textProxy')){const _0x1e6b11=_0x2b9c99['exec'](_0x36b8fb['data']);if(_0x1e6b11&&_0x1e6b11['length']){if(_0x520ab5+='forward'===_0x26da8d?_0x1e6b11['index']+_0x1e6b11[0x0]['length']:_0x36b8fb['data']['length']-_0x1e6b11['index'],_0x1e6b11[0x0]['length']!==_0x36b8fb['data']['length'])break;_0x120725=!0x0,_0x2b9c99='forward'===_0x26da8d?/^\w+/:/\w+$/;}else{if(_0x120725)break;_0x520ab5+=_0x36b8fb['offsetSize'];}}else{if(_0x36b8fb['is']('element')){_0x2148b3['isInline'](_0x36b8fb)&&!_0x120725&&(_0x520ab5+=0x1);break;}}_0x1e50c9+=_0x520ab5,_0x128101['jumpTo'](_0x77caef['getShiftedBy']('forward'===_0x26da8d?_0x1e50c9:-_0x1e50c9));}return _0x1e50c9;}['_getChangeContext'](_0x2c84da,_0x24032c){const _0x33d857=T(this['context'])['model']['schema'],_0x1238a3=this['_findAdjacentContextDistance'](_0x2c84da,'backward',_0x33d857,0x6),_0x543780=this['_findAdjacentContextDistance'](_0x24032c,'forward',_0x33d857,0x6),_0x28df97=_0x2c84da['getShiftedBy'](-_0x1238a3),_0x31a294=_0x24032c['getShiftedBy'](_0x543780);return{'start':_0x28df97,'end':_0x31a294,'hasContentBefore':!_0x28df97['isAtStart'],'hasContentAfter':!_0x31a294['isAtEnd']};}['_insertMarkers'](_0x4115d2){const _0x28a927=this['context']['plugins']['get']('AIEditing'),_0x232458=new Set();T(this['context'])['model']['change'](_0x1d4d62=>{for(const _0x1785ea of _0x4115d2){const _0x155b68=''+fe+_0x1785ea['type']+':'+_0x1785ea['groupId']+'_'+_0x28a927['_nextDataId'](_0x232458);this['_markers']['set'](_0x155b68,{'id':_0x155b68,'groupId':_0x1785ea['groupId'],'type':_0x1785ea['type'],'content':_0x1785ea['content']}),_0x1d4d62['addMarker'](_0x155b68,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1d4d62['createRange'](_0x1785ea['start'],_0x1785ea['end'])});}});}['_createGetContextFn'](_0x394458,_0x34620a,_0x809324){let _0x139cf7='';return()=>{if(!_0x139cf7){const _0x254714=_0x34620a['toView'](_0x394458,{'showSuggestionHighlights':!0x0});let _0x40930a=_0x254714['getChild'](0x0);if(_0x40930a['is']('containerElement')||(_0x40930a=_0x254714),!_0x40930a)return'';let _0x52ea2b=!0x1;const _0x2d95a2=[];for(const _0x59ef17 of _0x40930a['getChildren']())_0x59ef17['is']('element','span')&&_0x59ef17['hasClass']('ck-ai_review-marker_context-end')&&(_0x52ea2b=!0x1),_0x52ea2b&&_0x2d95a2['push'](_0x59ef17),_0x59ef17['is']('element','span')&&_0x59ef17['hasClass']('ck-ai_review-marker_context-start')&&(_0x52ea2b=!0x0);_0x40930a['_removeChildren'](0x0,_0x40930a['childCount']),_0x809324?.['ellipsisBefore']&&_0x40930a['_appendChild']('…'),_0x40930a['_appendChild'](_0x2d95a2),_0x809324?.['ellipsisAfter']&&_0x40930a['_appendChild']('…');const _0x4d1dc3=_0x34620a['htmlProcessor']['domConverter']['viewToDom'](_0x254714),_0x576e17=_0x34620a['htmlProcessor']['htmlWriter']['getHtml'](_0x4d1dc3);_0x139cf7=_0x576e17;}return _0x139cf7;};}['_createGetContentFn'](_0x811135,_0x3e1db0){let _0x133dec='';return()=>(_0x133dec||(_0x133dec=_0x3e1db0['stringify'](_0x811135,{'showSuggestionHighlights':!0x0})),_0x133dec);}['_createGetContentUsingDataIdFn'](_0x28cfbc,_0x2a2fac,_0x589c5f){let _0xd8954f='';return()=>{if(!_0xd8954f){const _0x2fdfe9=_0x589c5f['toView'](new tt(_0x28cfbc)),_0x566ed6=_0x589c5f['htmlProcessor']['domConverter']['viewToDom'](_0x2fdfe9)['querySelector']('[data-id=\x22'+_0x2a2fac+'\x22]');_0xd8954f=_0x566ed6?.['outerHTML']||'';}return _0xd8954f;};}['_findMarkerElement'](_0x10fa6b,_0x1f9dbd=0x5){let _0x369dff=_0x10fa6b,_0xa19b27=null;for(let _0x1da415=0x0;_0x1da415<_0x1f9dbd&&_0x369dff;_0x1da415++){if(!_0x369dff['className']){_0x369dff=_0x369dff['parentElement'];continue;}if(!(''+_0x369dff['className'])['includes']('ck-ai_review-marker_')){_0x369dff=_0x369dff['parentElement'];continue;}if(!_0x369dff['getAttribute']('data-marker-id'))break;_0xa19b27=_0x369dff;break;}return _0xa19b27;}['_findMarkerElementById'](_0x3272a4){const _0x370c13=T(this['context']),_0x55ce40=_0x370c13['model']['markers']['get'](_0x3272a4);return _0x55ce40?_0x117596(_0x370c13['editing'],_0x55ce40):null;}['_getMarkersDataForGroup'](_0x1eb26b){return Array['from'](this['_markers']['values']())['filter'](_0x3ade27=>_0x3ade27['groupId']===_0x1eb26b);}['_getOperationStart'](_0x1499cc){return'insert'===_0x1499cc['type']?_0x1499cc['position']:_0x1499cc['newRange']['start'];}['_getOperationEnd'](_0x355394,_0x1571d1=!0x1){return'insert'===_0x355394['type']?_0x1571d1?_0x355394['position']:_0x355394['position']['getShiftedBy'](_0x355394['howMany']):_0x355394['newRange']['end'];}['_shiftOperation'](_0x47275c,_0x388085){return'insert'===_0x47275c['type']?_0x47275c['position']=_0x47275c['position']['getShiftedBy'](_0x388085):'marker'===_0x47275c['type']&&_0x47275c['newRange']&&(_0x47275c['newRange']=new it(_0x47275c['newRange']['start']['getShiftedBy'](_0x388085),_0x47275c['newRange']['end']['getShiftedBy'](_0x388085))),_0x47275c;}['_changeOperationOwnerDocument'](_0x5da22e,_0x1e0ea3){'insert'===_0x5da22e['type']?_0x5da22e['position']=this['_changePositionOwnerDocument'](_0x5da22e['position'],_0x1e0ea3):'marker'===_0x5da22e['type']&&_0x5da22e['newRange']&&(_0x5da22e['newRange']=this['_changeRangeOwnerDocument'](_0x5da22e['newRange'],_0x1e0ea3));}['_changePositionOwnerDocument'](_0x2e767c,_0x1dfc86){return new st(_0x1dfc86,_0x2e767c['path']);}['_changeRangeOwnerDocument'](_0x559402,_0x91ad3c){return new it(this['_changePositionOwnerDocument'](_0x559402['start'],_0x91ad3c),this['_changePositionOwnerDocument'](_0x559402['end'],_0x91ad3c));}['_changePosition'](_0x5a3c5f,_0x539fe1){return new st(_0x539fe1,[..._0x5a3c5f]);}['_changeRange'](_0x29a4c1,_0x5dc53c,_0x169ba8,_0x53e244){return new it(this['_changePosition'](_0x5dc53c,_0x53e244),this['_changePosition'](_0x169ba8,_0x53e244));}['_sortMarkers'](_0x39ab42){const _0x1e6923=_0x1aa017=>{switch(_0x1aa017){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x39ab42['sort']((_0x169561,_0x18fa4b)=>_0x1e6923(_0x169561['type'])-_0x1e6923(_0x18fa4b['type']));}['_hasSameTopLevelElement'](_0x5c64dc,_0x305c6d){const _0x28d533=_0x5c64dc['getChild'](0x0),_0x11e2cb=_0x305c6d['getChild'](0x0);return!(!_0x28d533||!_0x11e2cb)&&((!_0x28d533['is']('element')||!_0x11e2cb['is']('element')||_0x28d533['name']===_0x11e2cb['name'])&&!(_0x28d533['is']('element')&&!_0x11e2cb['is']('element')||!_0x28d533['is']('element')&&_0x11e2cb['is']('element')));}['_haveSingleTopLevelElement'](_0x1e8a6){return 0x1===_0x1e8a6['childCount'];}['_haveOnlyInlineContent'](_0x1ac3e3,_0x4aa6c9){for(const _0x1163ea of _0x1ac3e3['getChildren']())if(_0x1163ea['is']('element')&&!_0x4aa6c9['isInline'](_0x1163ea))return!0x1;return!0x0;}['_upsertDataId'](_0x3142bc,_0x3ac598){let _0xed3c53=_0x3142bc['getAttribute'](At);return _0xed3c53||(_0xed3c53=_0x3ac598(),_0x3142bc['_setAttribute'](At,_0xed3c53)),_0xed3c53;}}class Os extends _0x3ea0e5(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x5cd735,contentNew:_0xf17a24,contentInitial:_0x158098,documentVersion:_0x450e71}){super(),this['id']=_0x5cd735,this['contentNew']=_0xf17a24,this['contentInitial']=_0x158098,this['documentVersion']=_0x450e71;}}class Gs extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x47550d,_0x307b92,_0x8b5ece){super(),this['id']=_0x47550d,this['parent']=_0x8b5ece,this['_data']=_0x307b92,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class Hs extends ts(){['id']=_0x46d503();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x3c4c85,_0x1008c8,_0x5a4395,_0x5da39d,_0x5ab164){super(),this['_sourceCheck']=_0x1008c8,this['_documentData']=_0x3c4c85,this['_aiConnector']=_0x5a4395,this['_reviewParams']=_0x5da39d,this['_reviewArgs']=_0x5ab164,this['on']('change:status',(_0x47db85,_0x2c69d3,_0x6da72d)=>{'aborted'==_0x6da72d&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x6da72d,'run':this,'error':this['_currentError']});}),this['set']('status','initialized');}get['documentData'](){return this['_documentData'];}get['processedResultsCount'](){return this['_results']['size'];}get['title'](){return this['_sourceCheck']['title'];}get['subTitle'](){return'';}get['reviewName'](){return this['_sourceCheck']['id'];}get['hasModifications'](){return!this['_changes']['every'](_0x97b134=>'pending'===_0x97b134['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x26578a){this['_documentData']=_0x26578a;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x5cdd51=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x181811 of _0x5cdd51)'unmodified'!==_0x181811['data']['operation']&&('error'!==_0x181811['data']['operation']?'review-metadata'!==_0x181811['event']?this['_addReviewCheckResult'](_0x181811['data']['dataId'],_0x181811['data']['textDelta']):this['callId']=_0x181811['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']||0x0===this['_changes']['length']?this['status']='unmodified':this['status']='ready');}catch(_0x1dfa1d){this['_currentError']=_0x1dfa1d,_0x1dfa1d instanceof Error&&_0x1dfa1d['message']['includes']('ai-request-aborted')?this['status']='aborted':this['status']='error-general';}finally{this['_activeRequest']=null;}}async['restart'](){this['_results']['clear'](),this['_changes']['length']=0x0,this['_currentError']=void 0x0,await this['start']();}['addResultChanges'](_0x3746e9,_0xd6e85f){const _0x19f4f4=this['_results']['get'](_0x3746e9);if(!_0x19f4f4)return;if(0x0===_0xd6e85f['length'])return;const _0x210bed=[];_0xd6e85f['forEach']((_0xa3376e,_0x3995a3)=>{const _0x2ce57a=new Gs(_0x19f4f4['id']+'-'+_0x3995a3,_0xa3376e,_0x19f4f4);_0x2ce57a['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x2ce57a,'status':_0x2ce57a['status']});}),_0x2ce57a['on']('change:isActivated',()=>{_0x2ce57a['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x2ce57a}):this['fire']('reviewCheckResultDeactivated',{'change':_0x2ce57a});}),this['_changes']['push'](_0x2ce57a),_0x210bed['push'](_0x2ce57a);}),this['fire']('reviewCheckResultReady',{'changes':_0x210bed,'result':_0x19f4f4,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x4199c7){const _0x44a90c=this['_changes']['find'](_0x176667=>_0x176667['id']===_0x4199c7);return!(!_0x44a90c||'pending'!==_0x44a90c['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x34c3ca=>!0x0===_0x34c3ca['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x5b833d=>'pending'===_0x5b833d['status']);}['getChangeById'](_0x6f621d){return this['_changes']['find'](_0x33f241=>_0x33f241['id']===_0x6f621d);}['markAllChangesAsAccepted'](){for(const _0x22fb8c of this['_changes'])'pending'===_0x22fb8c['status']&&(_0x22fb8c['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x1c026e){const _0x6295f0=this['_changes']['find'](_0x1a1506=>_0x1a1506['id']===_0x1c026e);_0x6295f0&&'pending'===_0x6295f0['status']&&(_0x6295f0['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x14fc5c){const _0x24e60e=this['_changes']['find'](_0x18d768=>_0x18d768['id']===_0x14fc5c);_0x24e60e&&'pending'===_0x24e60e['status']&&(_0x24e60e['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x531ba1){const _0x516c5e=this['_changes']['find'](_0x4dfdd8=>_0x4dfdd8['id']===_0x531ba1);_0x516c5e&&'pending'===_0x516c5e['status']&&(_0x516c5e['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x3321ed){const _0x56f3c4=this['_changes']['find'](_0x672916=>_0x672916['id']===_0x3321ed);_0x56f3c4&&'outdated'===_0x56f3c4['status']&&(_0x56f3c4['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x54ad29){this['_changes']['filter'](_0x53f833=>_0x53f833['isActivated']&&_0x53f833['id']!==_0x54ad29)['forEach'](_0x57a416=>{_0x57a416['isActivated']=!0x1;});const _0x3b06ba=this['_changes']['find'](_0x567142=>_0x567142['id']===_0x54ad29);_0x3b06ba&&'pending'===_0x3b06ba['status']&&(_0x3b06ba['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x3306aa=>_0x3306aa['isActivated'])['forEach'](_0x12ea29=>{_0x12ea29['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x4fbb1f){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x43c8c8;if(_0x4fbb1f){const _0x5c5cf4=this['_changes']['find'](_0x5af56e=>_0x5af56e['id']===_0x4fbb1f);if(_0x5c5cf4&&_0x5c5cf4['isRated'])return;_0x5c5cf4&&(_0x43c8c8=_0x5c5cf4['parent']['id'],_0x5c5cf4['isRated']=!0x0);}const _0x21942d={'positiveCount':this['_changes']['filter'](_0x6839f2=>'accepted'===_0x6839f2['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x21942d,this['callId'],_0x43c8c8);}['_addReviewCheckResult'](_0x447289,_0x18fa74){const _0x28249a=this['_documentData']['elements']['get'](_0x447289);if(!_0x28249a)return;const _0x47bd6e=_0x28249a['getContent']();if(_0x47bd6e===_0x18fa74)return;const _0x4212ad=new Os({'id':_0x447289,'contentInitial':_0x47bd6e,'contentNew':_0x18fa74,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x4212ad['id'],_0x4212ad),this['fire']('reviewCheckResultAdded',{'result':_0x4212ad,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x1ed451=>'pending'===_0x1ed451['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x337aeb=>'pending'===_0x337aeb['status'])['length']&&(this['status']='finished'));}}class si extends Hs{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x47761a=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x56ae34=0x0;_0x56ae34<this['_reviewParams']['length'];_0x56ae34++){if(!this['_reviewParams'][_0x56ae34]||!this['_sourceCheck']['options'][_0x56ae34])continue;const _0x1099fb=this['_sourceCheck']['options'][_0x56ae34],_0x150961=_0x1099fb['data']?.['find'](_0x4db18b=>_0x4db18b['id']===this['_reviewParams'][_0x56ae34]);_0x150961&&_0x47761a['push'](_0x150961['label']);}return _0x47761a['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x26c06f,_0x482973,_0x4dbd42){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x482973,_0x26c06f,_0x4dbd42);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ve extends _0x5aeef2{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[q];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0x2fd495,_0xf8ef6f)=>{const _0x2135ad=this['_aiReviewCheckList']['getCheckById'](_0xf8ef6f['id']);if(_0x2135ad){this['_onReviewCheckRun'](_0xf8ef6f),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0xf8ef6f,_0x2135ad),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x38fda4,_0x401428)=>{switch(_0x401428['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x401428);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new _0x5a06e8('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x5a06e8('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x401428['status']&&'error-chunk'!==_0x401428['status']&&'error-general'!==_0x401428['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x3b337c,_0x319a17)=>{if(!this['_currentReviewCheckRun'])throw new _0x5a06e8('ai-review-mode-no-current-check-run',this);const _0x5e3664=this['_diffContent'](_0x319a17['result']['contentInitial'],_0x319a17['result']['contentNew']);_0x319a17['source']['addResultChanges'](_0x319a17['result']['id'],_0x5e3664);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x5150d5,_0x4409b3)=>{for(const _0x2d4f65 of _0x4409b3['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x2d4f65);this['_markChangePositionInEditorContent'](_0x4409b3['changes'],_0x4409b3['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x55ffec,_0x347aab)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x347aab['change']['id'],_0x347aab['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x500c8c,_0x770c75)=>{this['_onReviewCheckResultActivated'](_0x770c75);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x4d93ae){_0x4d93ae instanceof Error&&_0x4d93ae['message']['includes']('ai-request-aborted')||(_0x4d93ae instanceof _0x5a06e8?this['_logError'](_0x4d93ae):this['_logError'](new _0x5a06e8('ai-review-mode-check-run-failed',this,void 0x0,_0x4d93ae)));}}else this['_logError'](new _0x5a06e8('ai-review-mode-source-check-not-found',this,{'checkId':_0xf8ef6f['id']}));}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0xba9a42=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0xba9a42['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0xba9a42['map'](_0x6c74d9=>_0x6c74d9['id']));const _0x478423=this['_currentReviewCheckRun'];_0x478423['markAllChangesAsAccepted'](),_0x478423['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x3aeeab,_0x492b0c)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x492b0c['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x492b0c['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x492b0c['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x492b0c['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x170ebf,_0x166a01)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x166a01['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x166a01['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x166a01['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x166a01['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x3e5b35,_0x28d21c)=>{this['_onActivateChange'](_0x28d21c);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x404177,_0x2c83d0)=>{this['_onDeactivateChange'](_0x2c83d0);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x332db3,_0x231879)=>{this['_onChangeMarkerClicked'](_0x332db3,_0x231879);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x28975c,_0x1ea21f)=>{this['_onChangeMarkerHovered'](_0x28975c,_0x1ea21f);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x32bdc1,_0x6fc81b)=>{this['_onChangeMarkerRemoved'](_0x32bdc1,_0x6fc81b);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0xe5d3e4,_0x5516c0)=>{this['_onChangeMarkerRestored'](_0xe5d3e4,_0x5516c0);});}['_createReviewCheckRun'](_0x4033d1,_0x3862a1){return new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3862a1,this['_aiConnector'],_0x4033d1['params'],_0x4033d1['args']);}['_onChangeMarkerRemoved'](_0x43823b,_0x282f74){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x282f74['changeId']);}['_onChangeMarkerRestored'](_0x3b864b,_0x110da7){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x110da7['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x15bb6c=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x15bb6c&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x221a1d=this['_aiReviewCoreEditing']['getEditor']();_0x221a1d&&_0x221a1d['editing']['view']['change'](_0xdb84b3=>{const _0x1e2389=_0x221a1d['editing']['view']['document']['getRoot']();_0xdb84b3['removeClass']('ck-ai_review-diff',_0x1e2389),_0xdb84b3['removeClass']('ck-ai_review-highlights',_0x1e2389),_0xdb84b3['removeClass']('ck-ai-translate-mode-content',_0x1e2389);});}['_getTranslationWithDefault'](_0x1b1d7d,_0x2476ea){const _0x14af53=i(this['context']['locale'],_0x1b1d7d);return _0x14af53===_0x1b1d7d?_0x2476ea:_0x14af53;}['_logError'](_0x33cf56,_0x546572=!0x1){pt(_0x33cf56['message']),_0x546572||(_0x33cf56['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0xff2f06){if('content'===this['_changeActivationSource']){const _0x407952=this['_aiReviewCoreUi']['getChangeElement'](_0xff2f06);_0x407952&&_0x2da007(_0x407952['closest']('.ck-ai_review__check-run-result')||_0x407952);}else{if('panel'===this['_changeActivationSource']){const _0x34d872=this['_getChangeContentElement'](_0xff2f06);if(!_0x34d872)return;_0x3f0a76({'target':_0x34d872,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const we=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}];class Ds{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x41ccab){this['id']=_0x41ccab['id'],this['commandId']=_0x41ccab['commandId'],this['title']=_0x41ccab['title'],this['description']=_0x41ccab['description'],this['isParameterized']=_0x41ccab['isParameterized'],this['useArgs']=_0x41ccab['useArgs'],this['options']=_0x41ccab['options'],this['args']=_0x41ccab['args'];}}class vo extends ts(){['_checks']=[];['setupChecks'](_0x3d92da){this['_checks']=_0x3d92da['map'](_0x2ec00d=>new Ds(_0x2ec00d));}get['checks'](){return this['_checks'];}['getCheckById'](_0x45fc2d){return this['checks']['find'](_0x1c0554=>_0x1c0554['id']===_0x45fc2d);}['removeCheckById'](_0xf49cc6){this['_checks']=this['_checks']['filter'](_0x3c7932=>_0x3c7932['id']!==_0xf49cc6);}}class ke extends Ds{['_models']=[];['_defaultModel']=null;constructor(_0x99a41e,_0x3ade25,_0x47127c){super(_0x99a41e),this['_models']=_0x3ade25,this['_defaultModel']=_0x47127c;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Ie extends Ds{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0xf0831d,_0x203eaa,_0x313fe7){super(_0xf0831d),this['prompt']=_0xf0831d['prompt'],this['model']=_0xf0831d['model'],this['model']?this['_defaultModel']=_0x203eaa['find'](_0x2aeb49=>_0x2aeb49['id']===this['model'])||null:this['_defaultModel']=_0x313fe7;}get['defaultModel'](){return this['_defaultModel'];}}class _e extends vo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x4d3a2d,_0x51d4c7,_0x3986f5){super(),this['_allModels']=_0x4d3a2d,this['_recommendedModels']=_0x51d4c7,this['_defaultModel']=_0x3986f5;}['setupChecks'](_0x5b3517){this['_checks']=_0x5b3517['map'](_0x3aa808=>!0x0===_0x3aa808['isExtra']?new Ie(_0x3aa808,this['_allModels'],this['_defaultModel']):'custom'===_0x3aa808['id']?new ke(_0x3aa808,this['_recommendedModels'],this['_defaultModel']):new Ds(_0x3aa808));}}class Ce extends Hs{['_prompt'];['_model'];constructor(_0x173995,_0x4ffd85,_0x2a1478,_0x58ac99,_0x302862){super(_0x2a1478,_0x58ac99,_0x302862),this['_prompt']=_0x173995,this['_model']=_0x4ffd85;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x347346,_0x2736bd,_0x5ce6c8){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x2736bd,_0x347346,_0x5ce6c8);}}class Re extends Ce{get['subTitle'](){return'';}set['prompt'](_0x376026){this['_prompt']=_0x376026;}set['model'](_0x41ca30){this['_model']=_0x41ca30;}}class pe extends ve{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x47c458){super(_0x47c458),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',we['map'](_0x5f0afb=>_0x5f0afb['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x462b64,_0x2a6bc1)=>{this['_isDiffOn']=_0x2a6bc1['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x42f62f,_0x4f87ca){return _0x42f62f['isCustom']?new Ce(_0x42f62f['args']['prompt'],_0x42f62f['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x4f87ca,this['_aiConnector']):_0x4f87ca['isExtra']?new Re(_0x4f87ca['prompt'],_0x4f87ca['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x4f87ca,this['_aiConnector']):new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x4f87ca,this['_aiConnector'],_0x42f62f['params'],_0x42f62f['args']);}['_onReviewCheckResultActivated'](_0x15bb07){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x15bb07['change']['id']),this['_scrollToChange'](_0x15bb07['change']['id']);const _0x559ba9=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x15bb07['change']['id']);if(!_0x559ba9)return;const _0x27f68a=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x15bb07['change'],()=>_0x559ba9['getElement'](),void 0x0,'click',_0x27f68a?.['editing']?.['view']?.['getDomRoot'](),_0x27f68a?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x15bb07['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x46f9d8){this['_currentReviewCheckRun']&&'click'===_0x46f9d8['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x46f9d8['id']));}['_onDeactivateChange'](_0x1d9abb){this['_currentReviewCheckRun']&&'balloon'===_0x1d9abb['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x1c46cd,_0x303030){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x303030['changeId']);const _0x2413c6=this['_currentReviewCheckRun']['getChangeById'](_0x303030['changeId']);if(!_0x2413c6)return;const _0x268201=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2413c6,_0x303030['markerElement'],_0x303030['domEvent'],'click',_0x268201?.['editing']?.['view']?.['getDomRoot'](),_0x268201?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x31460f,_0x15994d){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x6b7884=this['_currentReviewCheckRun']['getChangeById'](_0x15994d['changeId']);if(!_0x6b7884)return;const _0x4515b4=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x6b7884,_0x15994d['markerElement'],_0x15994d['domEvent'],'hover',_0x4515b4?.['editing']?.['view']?.['getDomRoot'](),_0x4515b4?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x8ea218){const _0x41f914=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x8ea218);return _0x41f914?_0x41f914['getElement']():null;}['_markChangePositionInEditorContent'](_0x155803,_0x1d23e6){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x155803,_0x1d23e6);}['_diffContent'](_0x253eb1,_0x5c2c27){return this['_aiReviewCoreEditing']['diffContent'](_0x253eb1,_0x5c2c27);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x4f3f5e){const _0x2d7a4b=this['_aiReviewCoreEditing']['getEditor']();_0x4f3f5e?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x2d7a4b&&_0x2d7a4b['editing']['view']['change'](_0xb449e5=>{const _0x2f534c=_0x2d7a4b['editing']['view']['document']['getRoot']();for(const _0x38fdc4 of _0x2f534c['getClassNames']())_0x38fdc4['startsWith']('ck-ai_review-')&&_0xb449e5['removeClass'](_0x38fdc4,_0x2f534c);_0xb449e5['addClass'](_0x4f3f5e?'ck-ai_review-diff':'ck-ai_review-highlights',_0x2f534c);});}async['_getChecksList'](){const _0x5531c9=[...we,...this['_getExtraChecks']()],_0x14691b=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x14691b,_0x5531c9);let _0x522725=_0x5531c9;this['_hasDefaultAvailableCommands']||(_0x522725=_0x14691b['map'](_0x23a919=>_0x5531c9['find'](_0x2458d6=>_0x2458d6['id']===_0x23a919))['filter'](_0x21edc0=>!!_0x21edc0)),_0x522725=_0x522725['map'](_0x260f94=>_0x260f94['isExtra']?_0x260f94:this['_translateReviewCheck'](_0x260f94));const _0x46eee3=_0x522725['some'](_0x2e4d9a=>_0x2e4d9a['isExtra']||'custom'===_0x2e4d9a['id']);let _0x481e7e=[],_0x5cf0d9=[],_0x2f3629=null;if(_0x46eee3){const _0xda9f61=await this['_getModels']();_0x481e7e=_0xda9f61['all'],_0x5cf0d9=_0xda9f61['recommended'],_0x2f3629=_0xda9f61['default'];}const _0x39aa50=new _e(_0x481e7e,_0x5cf0d9,_0x2f3629);return _0x39aa50['setupChecks'](_0x522725),_0x46eee3&&this['_filterChecksWithMissingModel'](_0x39aa50),_0x39aa50;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x4dab43=>({'id':_0x4dab43['id'],'commandId':_0x4dab43['id'],'title':_0x4dab43['label'],'description':_0x4dab43['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x4dab43['prompt'],'model':_0x4dab43['model']}));}['_logErrorForNonExistentChecks'](_0x281c17,_0x21b047){const _0x5128b8=_0x281c17['filter'](_0x3bf60f=>!_0x21b047['some'](_0x29a2a6=>_0x29a2a6['id']===_0x3bf60f));_0x5128b8['length']&&this['_logError'](new _0x5a06e8('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x5128b8['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x5bf74f=new yt({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x5bf74f['getAll'](),'recommended':await _0x5bf74f['getAvailableModels'](),'default':await _0x5bf74f['getDefault']()};}catch(_0x409069){return this['_logError'](new _0x5a06e8('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x409069)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0xd80487){const _0x42601e='AI_REVIEW_CHECK_'+_0xd80487['id']['toUpperCase']()['replaceAll']('-','_'),_0x4c6613={..._0xd80487,'title':this['_getTranslationWithDefault'](_0x42601e+'_TITLE',_0xd80487['title']),'description':this['_getTranslationWithDefault'](_0x42601e+'_DESCRIPTION',_0xd80487['description'])};return _0xd80487['options']&&(_0x4c6613['options']=_0xd80487['options']['map'](_0x255b90=>({..._0x255b90,'label':this['_getTranslationWithDefault'](_0x42601e+'_OPTIONS_LABEL',_0x255b90['label']||''),'data':_0x255b90['data']?_0x255b90['data']['map'](_0x4599bd=>({..._0x4599bd,'label':this['_getTranslationWithDefault'](_0x42601e+'_OPTIONS_DATA_'+_0x4599bd['id']['toUpperCase'](),_0x4599bd['label'])})):void 0x0}))),_0x4c6613;}['_filterChecksWithMissingModel'](_0x592d84){const _0x373c9=[];_0x592d84['checks']['forEach'](_0x1ff418=>{(_0x1ff418 instanceof Ie&&!_0x1ff418['defaultModel']||_0x1ff418 instanceof ke&&!_0x1ff418['models']['length'])&&_0x373c9['push'](_0x1ff418['id']);}),_0x373c9['length']&&_0x373c9['forEach'](_0x2c61f6=>{_0x592d84['removeCheckById'](_0x2c61f6),this['_logError'](new _0x5a06e8('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x2c61f6}),!0x0);});}}class Qa extends _0x5aeef2{static get['requires'](){return[pe,ge,de];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class jr extends Ds{get['apiId'](){return'translate';}}class Pe extends vo{['setupChecks'](_0x5976f1){this['_checks']=_0x5976f1['map'](_0x25af0c=>new jr(_0x25af0c));}}class Se extends si{['_title'];constructor(_0x3e45f6,_0x7c483,_0x29ae7d,_0x4660c4,_0x1ae9fe,_0x4f9773){super(_0x3e45f6,_0x7c483,_0x29ae7d,_0x1ae9fe,_0x4f9773),this['_title']=_0x4660c4;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ve{static get['pluginName'](){return'AITranslateController';}constructor(_0x31ebfd){super(_0x31ebfd),this['context']['config']['define']('ai.translate.languages',[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]);}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x3f9cde,_0x322926){return new Se(this['_aiReviewCoreEditing']['getDocumentData'](),_0x322926,this['_aiConnector'],i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x3f9cde['params'],_0x3f9cde['args']);}['_onReviewCheckResultActivated'](_0xa7b16a){this['_aiReviewCoreUi']['setActiveStateInResults'](_0xa7b16a['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0xa7b16a['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x1f8ebd){this['_currentReviewCheckRun']&&('hover'===_0x1f8ebd['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x1f8ebd['id'])),'click'===_0x1f8ebd['uiInteraction']&&this['_scrollToChange'](_0x1f8ebd['id']));}['_onDeactivateChange'](_0x5a0ffb){this['_currentReviewCheckRun']&&'panel'===_0x5a0ffb['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x852105,_0x517c0a){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x517c0a['changeId']),this['_scrollToChange'](_0x517c0a['changeId']));}['_onChangeMarkerHovered'](_0x23d2de,_0x53ec25){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x53ec25['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x53ec25['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x25f4e4){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x25f4e4);}['_markChangePositionInEditorContent'](_0x295f53,_0x3aa573){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x295f53,_0x3aa573);}['_diffContent'](_0x215625,_0x585351){return this['_aiReviewCoreEditing']['diffContent'](_0x215625,_0x585351,!0x0);}['_onReviewCheckRun'](){const _0x32f87f=this['_aiReviewCoreEditing']['getEditor']();_0x32f87f&&_0x32f87f['editing']['view']['change'](_0x2e9aff=>{const _0x4b29dc=_0x32f87f['editing']['view']['document']['getRoot']();for(const _0x270344 of _0x4b29dc['getClassNames']())(_0x270344['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x270344)&&_0x2e9aff['removeClass'](_0x270344,_0x4b29dc);_0x2e9aff['addClass']('ck-ai-translate-mode-content',_0x4b29dc);});}async['_getChecksList'](){const _0x1c2ce6=[],_0xbdd655=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x4b8583 of _0xbdd655)_0x1c2ce6['push']({'title':_0x4b8583['label'],'id':_0x4b8583['id'],'commandId':_0x4b8583['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x4b8583['id']}});const _0x4a9235=new Pe();return _0x4a9235['setupChecks'](this['_translateChecks'](_0x1c2ce6)),_0x4a9235;}['_translateChecks'](_0x13165e){return _0x13165e['map'](_0x355984=>{const _0x320fcc='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x355984['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x355984,'title':this['_getTranslationWithDefault'](_0x320fcc,_0x355984['title'])};});}}class Le extends Ve{constructor(_0xafa043,_0x341efc){super(_0xafa043,_0x341efc),this['on']('set:isLoading',(_0x273b7a,_0x3a067e,_0x130aca)=>{_0x130aca&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x2fde4e,_0x4ad54e,_0x4a73da)=>{_0x4a73da&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x18f3be=super['_createAcceptAllButtonView']();return _0x18f3be['set']('label',i(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x18f3be;}['_createExitReviewButtonView'](){const _0x2e961b=super['_createExitReviewButtonView']();return _0x2e961b['set']('label',i(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x2e961b;}}class Ne extends je{['_setupTemplate'](){const _0x4446de=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x4446de['if']('isVisible','ck-hidden',_0x54ad09=>!_0x54ad09)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x4446de['if']('isVisible','ck-hidden',_0x160dba=>!_0x160dba)]},'children':this['_checkViews']}]});}}class tr extends Me{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0xcfb5b8=this['context']['locale'],_0x54a73f=new _0x4631d7(_0xcfb5b8,{'label':i(_0xcfb5b8,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x420b58,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x126477=new Ae(_0xcfb5b8,{'header':_0x54a73f,'list':new Ne(_0xcfb5b8),'results':new Le(_0xcfb5b8,{'generalErrorText':i(_0xcfb5b8,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0xcfb5b8,{'headerText':i(_0xcfb5b8,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':i(_0xcfb5b8,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0xcfb5b8,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x126477['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x126477;}['registerTab'](){const _0x5ee060=this['context']['plugins']['get']('AITabs');_0x5ee060['view']['on']('activateTab',(_0x66224d,_0x42ec05)=>{'translate'===_0x42ec05?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x5ee060['view']['addTab']({'id':'translate','buttonLabel':i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x420b58,'order':0x0,'content':this['_mainView']});}}class Xa extends _0x5aeef2{static get['requires'](){return[rr,tr,de];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ri as AIActions,K as AIAdapter,Xn as AIAssistant,n as AIAssistantUI,Q as AIBalloon,Fa as AIChat,ht as AIChatController,lt as AIChatHistory,at as AIChatHistoryController,ct as AIChatHistoryUI,Wa as AIChatShortcuts,ut as AIChatUI,q as AIConnector,D as AIEditing,Ya as AIEditorIntegration,Lt as AIQuickActionType,qa as AIQuickActions,ii as AIQuickActionsUI,er as AIRequestError,Ds as AIReviewCheck,Os as AIReviewCheckResult,Hs as AIReviewCheckRun,Qa as AIReviewMode,ve as AIReviewModeController,de as AIReviewModeEditing,ge as AIReviewModeUI,_t as AITabs,ar as AITextAdapter,qt as AIToggleButtonUI,Xa as AITranslate,rr as AITranslateController,tr as AITranslateUI,Zn as AWSTextAdapter,Jn as OpenAITextAdapter,E as ShowAIAssistantCommand,io as ToggleAICommand,Ci as createResizeButton,zn as getDefaultAICommands};
23
+ import{Plugin as _0x3340d2,Command as At,ContextPlugin as _0x269016,Editor as _0x5601f8}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x256d74,IconCheck as _0xd070e4,IconError as _0x9f305d,IconSubmit as _0x19f96e,IconAIHistory as It,IconMagicWand as _0x399e7e,IconRobotPencil as ti,IconMaximize as _0x5720fd,IconMinimize as _0x42cf63,IconShowChangesOn as _0x5a1fad,IconShowChangesOff as _0x112fb1,IconDocument as _0x124970,IconBoxWithCross as _0x4e7afc,IconBoxWithCheck as _0x2d7ecc,IconBoxWithMarker as _0x29a8f4,IconInfo as tc,IconLoupe as _0x2e2350,IconCancel as _0x5acc62,IconStop as _0x4ed6ae,IconAIChat as tt,IconPlus as _0x2ad7c2,IconPin as _0x548f7b,IconThreeHorizontalDots as _0x52bfae,IconChevronDown as _0x45a588,IconChevronUp as _0x703697,IconOutdated as _0xb61b01,IconEye as _0x444a30,IconEyeCrossedOut as _0x555d32,IconChevronRight as _0x4d1d5b,IconAIReview as _0x89e5ef,IconAITranslate as _0x22c9e7}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x5ee109,CKEditorError as _0x36ce55,ObservableMixin as Vt,global as _0xbe938c,isVisible as _0x5866ed,Rect as _0x30f41d,Collection as _0x4c2902,FocusTracker as ts,KeystrokeHandler as _0x34d7cc,first as _0x3c4f7b,logWarning as Zt,logError as _0x283c76,toArray as _0x1f83aa,EmitterMixin as Ft,scrollViewportToShowTarget as _0x23d97c,scrollAncestorsToShowTarget as _0x41c02d,ResizeObserver as _0x47e851,_isMotionReduced as _0x288937,getConstrainedViewportRect as _0x50214f,DomEmitterMixin as Rt}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x8fb4e9,ButtonView as _0x494e59,View as _0x13218d,SpinnerView as _0x4667f2,IconView as _0x25fec4,AutocompleteView as _0x1a3dc9,ListView as _0x49b4eb,ListItemGroupView as _0x2f98e5,ListItemView as _0x202f8e,ButtonLabelView as _0x2dac38,FocusCycler as _0x2532de,createLabeledTextarea as _0x13f57e,Dialog as _0x2b3fa6,createDropdown as _0x478151,addMenuToDropdown as _0x36afe0,MenuBarMenuView as _0x5029fd,MenuBarMenuListItemButtonView as _0x555885,DialogViewPosition as _0x363c9f,MenuBarMenuListView as _0x17defc,MenuBarMenuListItemView as _0x4236d1,BodyCollection as _0x5a5912,BalloonPanelView as _0x514db0,clickOutsideHandler as _0x16b45b,addListToDropdown as _0x32894e,UIModel as _0x2b3edb,submitHandler as _0x40733b,LabeledFieldView as _0x557ad5,createLabeledInputText as th,FormHeaderView as _0x33ee7e,HighlightedTextView as _0x461746,ViewCollection as _0x44a9be,FileDialogButtonView as _0x3ddeee,InputTextView as _0x9669fe,SearchTextView as _0x277b9b,ListItemButtonView as _0x4bd109,ButtonLabelWithHighlightView as _0x4ba152,DropdownMenuPanelPositioningFunctions as _0x542982,BalloonToolbar as Ut,FormRowView as _0x3e3237,TextareaView as _0x7a291d}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as nt,ClipboardMarkersUtils as _0x3c026e}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as ot,ViewDataTransfer as rt,ViewUpcastWriter as _0x1182cb,Matcher as _0x37a7bf,_DetachOperation as _0x1f3d0d,_insertIntoModelNodeList as _0x2d5726,_removeFromModelNodeList as to,ModelRange as _0xa8a41e,transformOperationSets as _0x634cdb,ViewDowncastWriter as ft,ModelDocumentFragment as _0xaf169a,ModelPosition as _0x46cc31,ModelTreeWalker as Dt,MarkerOperation as Mt,InsertOperation as $t}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0xbd76f4,escape as Wt,escapeRegExp as _0x52145f,debounce as Gt}from'es-toolkit/compat';import{createParser as lt}from'eventsource-parser';import{parseDocument as _0x4367e1}from'htmlparser2';import{isTag as _0x89e9ec,findOne as _0x1f6293,getParent as _0x432450,findAll as _0x5ad999,removeElement as _0x53f32a,replaceElement as _0x38243b,prepend as _0x538e3b,prependChild as _0x152e2b,appendChild as _0x3fcfc5,append as _0x450256,find as _0x244cf7,isComment as _0x4d6dc4,getChildren as _0x20b3bc,textContent as _0x2a8dd4}from'domutils';import _0x32bc88 from'dom-serializer';import{Document as _0x1ebbd3,Element as _0x143df1,Text as _0x101e1d,cloneNode as _0x441ae5,isDocument as _0x9432b7,isText as _0x19f89b,NodeWithChildren as _0x138369}from'domhandler';import{MarkdownGfmMdToHtml as _0x15a481}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0xd141a6,DocumentCompare as _0x339a14,DATA_ID_MODEL_ATTRIBUTE as _0x4c4c60,ConfirmMixin as _0x5f4c6a,LateFocusDropdownButtonView as _0x2f07ce,getAllMarkersDomElementsSorted as _0x2b7f22,SuggestionsConversion as bt,DATA_ID_VIEW_ATTRIBUTE as jt,getMarkerDomElement as Bt}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x371c18}from'es-toolkit';import _0x2dcc48 from'morphdom';import{IconWeb as _0x2d1b31,IconClose as _0x58d0d9,IconDocument as _0x2d35c5,IconSelection as _0x5e5386,IconFileUpload as _0x306b56,IconLink as _0x3aa8ab,IconBulb as _0x478764,IconAI as _0x2f345e,IconPreviousArrow as _0x18feb2,IconCheck as _0x14bd5e,IconDocumentOutline as _0x23ca4e,IconPaperClip as _0x3f95f6,IconBrowseFiles as _0x464fe9,IconDropdownArrow as _0x4178ba,IconAIChat as _0x198a09,IconAIReview as _0x556d16,IconAITranslate as xt,IconAIAskAI as _0x5f1756,IconThumbUp as _0x33d0de,IconThumbDown as _0xc1eff0,IconCopy as _0x348579,IconShowChangesOff as _0x4f0b2d,IconShowChangesOn as _0x5c2f07,IconAIQuickActions as _0x545218,IconAIChatCommands as kt,IconAIImproveWriting as Qt,IconAIContinueWriting as Nt,IconAIGrammarCheck as Ct,IconAIAdjustLength as yt,IconAIChangeTone as Tt,IconAIOther as St,IconRefresh as _0x12572b,IconNextArrow as _0x592902}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x35aa15}from'diff';const li='_ungrouppedCommands';function ne(_0x232ae6,_0x2e79e6){const _0x58686f=(0x0,_0x2e79e6['t'])('Other');return _0x232ae6['length']?'groupId'in _0x232ae6[0x0]?_0x232ae6:[{'groupId':li,'groupLabel':_0x58686f,'order':0x1/0x0,'commands':_0x232ae6}]:[{'groupId':li,'groupLabel':_0x58686f,'order':0x1/0x0,'commands':[]}];}const Wn=globalThis['DataTransfer'],ct='ai-ui';class te extends _0x3340d2{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x251fa6}=this,_0x2ba8da=['ck-fake-ai-selection'];_0x251fa6['config']['get']('ai.assistant.useTheme')&&_0x2ba8da['push']('ck-ai-assistant-ui_theme'),_0x251fa6['conversion']['for']('editingDowncast')['markerToHighlight']({'model':ct,'view':{'classes':_0x2ba8da,'priority':0xc}}),_0x251fa6['conversion']['for']('editingDowncast')['markerToElement']({'model':ct,'view':(_0x168eb9,{writer:_0x31551e})=>{if(!_0x168eb9['markerRange']['isCollapsed'])return null;const _0x5452b3=_0x31551e['createUIElement']('span');return _0x31551e['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x5452b3),_0x5452b3;}});}['afterInit'](){!async function(_0x8ea3e4){const _0x4a0db5=_0x4952d0([0x6e,0x41,0x37,0x79,0x75,0x72,0x67,0x4f,0x48,0x62,0x5a,0x76,0x44,0x70,0x6c,0x52,0x6b,0x4a,0x73,0x63,0x64,0x49,0x43,0x6d,0x38,0x36,0x6f,0x50,0x57,0x78,0x39,0x32,0x66,0x31,0x71,0x46,0x30,0x4c,0x61,0x53,0x58,0x33,0x4e,0x47,0x77,0x54,0x4d,0x4b,0x34,0x6a,0x56,0x74,0x59,0x55,0x42,0x51,0x69,0x35,0x7a,0x68,0x65,0x45]),_0x4e3699=0x3dffc4e1,_0x5f26ac=0x3df84249^_0x4e3699,_0x6aa24f=window[_0x4952d0([0x44,0x61,0x74,0x65])][_0x4952d0([0x6e,0x6f,0x77])](),_0x389a8c=_0x8ea3e4[_0x4952d0([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x21d790=new window[(_0x4952d0([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x524dbb=>{_0x389a8c[_0x4952d0([0x6f,0x6e,0x63,0x65])](_0x4952d0([0x72,0x65,0x61,0x64,0x79]),_0x524dbb);}),_0x6bf23={[_0x4952d0([0x6b,0x74,0x79])]:_0x4952d0([0x45,0x43]),[_0x4952d0([0x75,0x73,0x65])]:_0x4952d0([0x73,0x69,0x67]),[_0x4952d0([0x63,0x72,0x76])]:_0x4952d0([0x50,0x2d,0x32,0x35,0x36]),[_0x4952d0([0x78])]:_0x4952d0([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0x4952d0([0x79])]:_0x4952d0([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0x4952d0([0x61,0x6c,0x67])]:_0x4952d0([0x45,0x53,0x32,0x35,0x36])},_0x4c3881=_0x389a8c[_0x4952d0([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x4952d0([0x67,0x65,0x74])](_0x4952d0([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x114ed6(){let _0x3cb8be,_0x117e86=null,_0x2e08cd=null;try{if(_0x4c3881==_0x4952d0([0x47,0x50,0x4c]))return _0x4952d0([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x3cb8be=_0x1011ba(),!_0x3cb8be)return _0x4952d0([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x3cb8be[_0x4952d0([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2e08cd=_0x35b4fd(_0x3cb8be[_0x4952d0([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x3cb8be[_0x4952d0([0x6a,0x74,0x69])])),await _0x5e0080()?_0x44d9e4()?_0x63171d()?_0x4952d0([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3bcc79()?(_0x3cb8be[_0x4952d0([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4952d0([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x117e86=_0x4d8cfe(_0x4952d0([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x1812bf()):_0x4952d0([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x4952d0([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x4952d0([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x4952d0([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x63171d(){const _0x3e6bc1=[_0x4952d0([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x4952d0([0x74,0x72,0x69,0x61,0x6c])][_0x4952d0([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3cb8be[_0x4952d0([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x6aa24f/0x3e8:0xe10*_0x5f26ac;return _0x3cb8be[_0x4952d0([0x65,0x78,0x70])]<_0x3e6bc1;}function _0x44d9e4(){const _0xb7cb9d=_0x3cb8be[_0x4952d0([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0xb7cb9d&&(!!_0xb7cb9d[_0x4952d0([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4952d0([0x2a]))||!!_0xb7cb9d[_0x4952d0([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4952d0([0x41,0x49])));}function _0x3bcc79(){const _0x1b17a2=_0x3cb8be[_0x4952d0([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x1b17a2||0x0==_0x1b17a2[_0x4952d0([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x25edf0}=new URL(window[_0x4952d0([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x1b17a2[_0x4952d0([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x25edf0))return!0x0;const _0x2f7816=_0x25edf0[_0x4952d0([0x73,0x70,0x6c,0x69,0x74])](_0x4952d0([0x2e]));return _0x1b17a2[_0x4952d0([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1314e3=>_0x1314e3[_0x4952d0([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4952d0([0x2a])))[_0x4952d0([0x6d,0x61,0x70])](_0x44a64d=>_0x44a64d[_0x4952d0([0x73,0x70,0x6c,0x69,0x74])](_0x4952d0([0x2e])))[_0x4952d0([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x465df4=>_0x465df4[_0x4952d0([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x2f7816[_0x4952d0([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4952d0([0x6d,0x61,0x70])](_0x5adcc9=>Array(_0x2f7816[_0x4952d0([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x5adcc9[_0x4952d0([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4952d0([0x66,0x69,0x6c,0x6c])](_0x5adcc9[0x0]===_0x4952d0([0x2a])?_0x4952d0([0x2a]):'')[_0x4952d0([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x5adcc9))[_0x4952d0([0x73,0x6f,0x6d,0x65])](_0x8026e0=>_0x2f7816[_0x4952d0([0x65,0x76,0x65,0x72,0x79])]((_0x91a028,_0x28e1b0)=>_0x8026e0[_0x28e1b0]===_0x91a028||_0x8026e0[_0x28e1b0]===_0x4952d0([0x2a])));}function _0x1812bf(){return _0x117e86&&_0x2e08cd?new window[(_0x4952d0([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x62e11c,_0x36a785)=>{_0x117e86[_0x4952d0([0x74,0x68,0x65,0x6e])](_0x62e11c,_0x36a785),_0x2e08cd[_0x4952d0([0x74,0x68,0x65,0x6e])](_0x371c49=>{_0x371c49!=_0x4952d0([0x56,0x61,0x6c,0x69,0x64])&&_0x62e11c(_0x371c49);},_0x36a785);}):_0x117e86||_0x2e08cd||_0x4952d0([0x56,0x61,0x6c,0x69,0x64]);}}function _0x35b4fd(_0x46e43e,_0x1688e0){return new window[(_0x4952d0([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x39e301=>{if(_0x1c2f45())return _0x39e301(_0x4952d0([0x56,0x61,0x6c,0x69,0x64]));_0x4fc75c(),_0x389a8c[_0x4952d0([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x4952d0([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x4f7c6a=!0x1;const _0x2ff775=_0x5ee109();function _0x5b819d(_0x377c10){return!!_0x377c10&&(typeof _0x377c10===_0x4952d0([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x377c10===_0x4952d0([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x377c10[_0x4952d0([0x74,0x68,0x65,0x6e])]===_0x4952d0([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x377c10[_0x4952d0([0x63,0x61,0x74,0x63,0x68])]===_0x4952d0([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x5ec6(_0x369097){_0x33b54b(_0x369097)[_0x4952d0([0x74,0x68,0x65,0x6e])](_0x1cdf7e=>{if(!_0x1cdf7e||_0x1cdf7e[_0x4952d0([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x4952d0([0x6f,0x6b]))return _0x4952d0([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x3ba4f4(_0x3d424c(_0x2ff775+_0x1688e0))!=_0x1cdf7e[_0x4952d0([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x4952d0([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x4952d0([0x56,0x61,0x6c,0x69,0x64]);})[_0x4952d0([0x74,0x68,0x65,0x6e])](_0x1b5731=>(_0x5f22ca(),_0x1b5731),()=>{const _0x39fbc4=_0x2af4be();return null==_0x39fbc4?(_0x5f22ca(),_0x4952d0([0x56,0x61,0x6c,0x69,0x64])):_0x4952d0(_0x6aa24f-_0x39fbc4>(0x19f340e1^_0x4e3699)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x4952d0([0x74,0x68,0x65,0x6e])](_0x39e301)[_0x4952d0([0x63,0x61,0x74,0x63,0x68])](()=>{_0x39e301(_0x4952d0([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2f07ec=0x3dc92a61^_0x4e3699;function _0x5f22ca(){const _0x416f8c=_0x4952d0([0x6c,0x6c,0x63,0x74,0x2d])+_0x3ba4f4(_0x3d424c(_0x46e43e)),_0x47bf35=_0x6994c2(_0x3ba4f4(window[_0x4952d0([0x4d,0x61,0x74,0x68])][_0x4952d0([0x63,0x65,0x69,0x6c])](_0x6aa24f/_0x2f07ec)));window[_0x4952d0([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4952d0([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x416f8c,_0x47bf35);}function _0x2af4be(){const _0x371407=_0x4952d0([0x6c,0x6c,0x63,0x74,0x2d])+_0x3ba4f4(_0x3d424c(_0x46e43e)),_0x5eb203=window[_0x4952d0([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4952d0([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x371407);return _0x5eb203?window[_0x4952d0([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x6994c2(_0x5eb203),0x10)*_0x2f07ec:null;}function _0x33b54b(_0x54356f){return new window[(_0x4952d0([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x293d2c,_0x392431)=>{_0x54356f[_0x4952d0([0x74,0x68,0x65,0x6e])](_0x293d2c,_0x392431),window[_0x4952d0([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x392431,0x3dfe1021^_0x4e3699);});}}_0x389a8c[_0x4952d0([0x6f,0x6e])](_0x4952d0([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x28af1f,_0x78282e)=>{if(_0x78282e[0x0]!=_0x46e43e)return _0x39e301(_0x4952d0([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x78282e[0x1]={..._0x78282e[0x1],[_0x4952d0([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x2ff775};},{[_0x4952d0([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4952d0([0x68,0x69,0x67,0x68])}),_0x389a8c[_0x4952d0([0x6f,0x6e])](_0x4952d0([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x560074=>{_0x5b819d(_0x560074[_0x4952d0([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x4f7c6a=!0x0,_0x5ec6(_0x560074[_0x4952d0([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x4952d0([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4952d0([0x6c,0x6f,0x77])}),_0x21d790[_0x4952d0([0x74,0x68,0x65,0x6e])](()=>{_0x4f7c6a||_0x39e301(_0x4952d0([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x1c2f45(){return _0x389a8c[_0x4952d0([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4952d0([0x76,0x69,0x65,0x77])][_0x4952d0([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x4952d0([0x61,0x75,0x74,0x6f]);}function _0x4fc75c(){_0x389a8c[_0x4952d0([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4952d0([0x76,0x69,0x65,0x77])][_0x4952d0([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x4952d0([0x61,0x75,0x74,0x6f]);}}function _0x4d8cfe(_0x145562){const _0x1411db=[new window[(_0x4952d0([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x37db41=>setTimeout(_0x37db41,0x3df6fa2d^_0x4e3699)),_0x21d790[_0x4952d0([0x74,0x68,0x65,0x6e])](()=>new window[(_0x4952d0([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x53c69c=>{let _0x1203a8=0x0;_0x389a8c[_0x4952d0([0x6d,0x6f,0x64,0x65,0x6c])][_0x4952d0([0x6f,0x6e])](_0x4952d0([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3d4f29,_0x577432)=>{_0x577432[0x0][_0x4952d0([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x1203a8++,_0x1203a8==(0x3dffc109^_0x4e3699)&&(_0x53c69c(),_0x3d4f29[_0x4952d0([0x6f,0x66,0x66])]());});}))];return window[_0x4952d0([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x4952d0([0x72,0x61,0x63,0x65])](_0x1411db)[_0x4952d0([0x74,0x68,0x65,0x6e])](()=>_0x145562);}async function _0x49f560(){await _0x21d790,_0x389a8c[_0x4952d0([0x6d,0x6f,0x64,0x65,0x6c])][_0x4952d0([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x1f80db,_0x389a8c[_0x4952d0([0x6d,0x6f,0x64,0x65,0x6c])][_0x4952d0([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x1f80db,_0x389a8c[_0x4952d0([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x4952d0([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x40f049(_0x41e253){const _0x594671=_0x4d02fd();_0x389a8c[_0x594671]=_0x4952d0([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x41e253,_0x41e253!=_0x4952d0([0x56,0x61,0x6c,0x69,0x64])&&_0x49f560();}function _0x4d02fd(){const _0x45fa19=window[_0x4952d0([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x4952d0([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x4952d0([0x6e,0x6f,0x77])]())[_0x4952d0([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x4952d0([0x2e]),'');let _0x333455=_0x4952d0([0x6e]);for(let _0xb3870a=0x0;_0xb3870a<_0x45fa19[_0x4952d0([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xb3870a+=0x2){let _0x1550c3=window[_0x4952d0([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x45fa19[_0x4952d0([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xb3870a,_0xb3870a+0x2));_0x1550c3>=_0x4a0db5[_0x4952d0([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x1550c3-=_0x4a0db5[_0x4952d0([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x333455+=_0x4a0db5[_0x1550c3];}return _0x333455;}function _0x1011ba(){const _0x38a7b3=_0x4c3881[_0x4952d0([0x73,0x70,0x6c,0x69,0x74])](_0x4952d0([0x2e]));if(0x3!=_0x38a7b3[_0x4952d0([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x14fea5(_0x38a7b3[0x1]);function _0x14fea5(_0x8dee13){const _0x2062f1=_0x14ef89(_0x8dee13);return _0x2062f1&&_0x342e8a()?_0x2062f1:null;function _0x342e8a(){const _0x3a339f=_0x2062f1[_0x4952d0([0x6a,0x74,0x69])],_0x4e8590=window[_0x4952d0([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3a339f[_0x4952d0([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3a339f[_0x4952d0([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2dbdd6={..._0x2062f1,[_0x4952d0([0x6a,0x74,0x69])]:_0x3a339f[_0x4952d0([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3a339f[_0x4952d0([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2dbdd6[_0x4952d0([0x76,0x63])],_0x3d424c(_0x2dbdd6)==_0x4e8590;}}}async function _0x5e0080(){let _0x3ee9d8=!0x0;try{const _0x2d09e4=_0x4c3881[_0x4952d0([0x73,0x70,0x6c,0x69,0x74])](_0x4952d0([0x2e])),[_0x3a1df9,_0x4734d5,_0x1e47c4]=_0x2d09e4;return _0x41e70e(_0x3a1df9),await _0x245f90(_0x3a1df9,_0x4734d5,_0x1e47c4),_0x3ee9d8;}catch{return!0x1;}function _0x41e70e(_0x43fa45){const _0x581c64=_0x14ef89(_0x43fa45);_0x581c64&&_0x581c64[_0x4952d0([0x61,0x6c,0x67])]==_0x4952d0([0x45,0x53,0x32,0x35,0x36])||(_0x3ee9d8=!0x1);}async function _0x245f90(_0x18f86c,_0x1b96e4,_0x2a3cc1){const _0x144f46=window[_0x4952d0([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x4952d0([0x66,0x72,0x6f,0x6d])](_0x540463(_0x2a3cc1),_0x4dc151=>_0x4dc151[_0x4952d0([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x297052=new window[(_0x4952d0([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x4952d0([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x18f86c+_0x4952d0([0x2e])+_0x1b96e4),_0x464748=window[_0x4952d0([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x4952d0([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x464748)return;const _0x132a0e=await _0x464748[_0x4952d0([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x4952d0([0x6a,0x77,0x6b]),_0x6bf23,{[_0x4952d0([0x6e,0x61,0x6d,0x65])]:_0x4952d0([0x45,0x43,0x44,0x53,0x41]),[_0x4952d0([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x4952d0([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x4952d0([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x464748[_0x4952d0([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x4952d0([0x6e,0x61,0x6d,0x65])]:_0x4952d0([0x45,0x43,0x44,0x53,0x41]),[_0x4952d0([0x68,0x61,0x73,0x68])]:{[_0x4952d0([0x6e,0x61,0x6d,0x65])]:_0x4952d0([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x132a0e,_0x144f46,_0x297052)||(_0x3ee9d8=!0x1);}}function _0x14ef89(_0x49fbab){return _0x49fbab[_0x4952d0([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x4952d0([0x65,0x79]))?JSON[_0x4952d0([0x70,0x61,0x72,0x73,0x65])](_0x540463(_0x49fbab)):null;}function _0x540463(_0x1a1bb9){return window[_0x4952d0([0x61,0x74,0x6f,0x62])](_0x1a1bb9[_0x4952d0([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x4952d0([0x2b]))[_0x4952d0([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x4952d0([0x2f])));}function _0x3d424c(_0x4ba4e0){let _0x14ff82=0x1505;function _0x27b402(_0x5c3e88){for(let _0x10a5e7=0x0;_0x10a5e7<_0x5c3e88[_0x4952d0([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x10a5e7++){const _0x25fd1a=_0x5c3e88[_0x4952d0([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x10a5e7);_0x14ff82=(_0x14ff82<<0x5)+_0x14ff82+_0x25fd1a,_0x14ff82&=_0x14ff82;}}function _0x1cdaa9(_0x1fb941){Array[_0x4952d0([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x1fb941)?_0x1fb941[_0x4952d0([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x1cdaa9):_0x1fb941&&typeof _0x1fb941==_0x4952d0([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x4952d0([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x1fb941)[_0x4952d0([0x73,0x6f,0x72,0x74])]()[_0x4952d0([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x50b6ae,_0x55d13f])=>{_0x27b402(_0x50b6ae),_0x1cdaa9(_0x55d13f);}):_0x27b402(window[_0x4952d0([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x1fb941));}return _0x1cdaa9(_0x4ba4e0),_0x14ff82>>>0x0;}function _0x3ba4f4(_0x34630f){return _0x34630f[_0x4952d0([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x4952d0([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x4952d0([0x30]));}function _0x6994c2(_0x355d53){return _0x355d53[_0x4952d0([0x73,0x70,0x6c,0x69,0x74])]('')[_0x4952d0([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x4952d0([0x6a,0x6f,0x69,0x6e])]('');}function _0x1f80db(){}function _0x4952d0(_0x56fe5f){return _0x56fe5f['map'](_0x501c41=>String['fromCharCode'](_0x501c41))['join']('');}_0x40f049(await _0x114ed6());}(this);}['showFakeVisualSelection'](){const _0xbae954=this['editor']['model'];_0xbae954['change'](_0x5a0568=>{const _0x2c26f2=_0xbae954['document']['selection']['getRanges']();let _0xdb88db=0x0;for(const _0x383103 of _0x2c26f2){const _0x49c0c7=ct+':'+_0xdb88db;if(_0xbae954['markers']['has'](_0x49c0c7))_0x5a0568['updateMarker'](_0x49c0c7,{'range':_0x383103});else{if(_0x383103['start']['isAtEnd']){const _0x48c41c=_0x383103['start']['getLastMatchingPosition'](({item:_0x34f9da})=>!_0xbae954['schema']['isContent'](_0x34f9da),{'boundaries':_0x383103});_0x5a0568['addMarker'](_0x49c0c7,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5a0568['createRange'](_0x48c41c,_0x383103['end'])});}else _0x5a0568['addMarker'](_0x49c0c7,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x383103});}_0xdb88db++;}});}['hideFakeVisualSelection'](){const _0x2694a9=this['editor']['model'],_0x11c82e=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](ct));_0x11c82e['length']&&_0x2694a9['change'](_0x5dde09=>{_0x11c82e['forEach'](_0x392650=>{_0x5dde09['removeMarker'](_0x392650);});});}['insertContent'](_0x10dcc4,_0x2d2c15){const _0xd87f79=this['_getAISelection'](),_0x5730ab=_0x2d2c15||_0xd87f79['getFirstRange']();this['editor']['model']['canEditAt'](_0x5730ab)&&this['editor']['model']['change'](_0x3d2d47=>{this['hideFakeVisualSelection'](),_0x2d2c15||this['_resetContentOfSelectedTableCells'](_0x3d2d47,_0xd87f79),this['_pasteHTMLUsingClipboard']({'insertAt':_0x5730ab,'writer':_0x3d2d47,'html':_0x10dcc4});});}['insertContentBelow'](_0x320dfd){const {model:_0x36f305}=this['editor'],_0x267d4d=this['_getAISelection']();_0x36f305['change'](()=>{const _0x58cc41=this['_prepareTableInsertBelowPosition'](_0x320dfd,_0x267d4d)||this['_getDefaultInsertBelowPosition'](_0x267d4d);this['insertContent'](_0x320dfd,_0x58cc41);});}['_getAISelection'](){const _0x3537d5=this['editor']['model'],_0x3335ba=Array['from'](_0x3537d5['markers']['getMarkersGroup'](ct))['map'](_0x148dce=>_0x148dce['getRange']());return _0x3537d5['createSelection'](_0x3335ba);}['_pasteHTMLUsingClipboard']({writer:_0x1643be,html:_0x197c1e,insertAt:_0x210f3b}){const {view:_0x1a6f55}=this['editor']['editing'],_0x523eb8=this['editor']['plugins']['get'](nt),_0x5e3c7a=new Wn();_0x5e3c7a['setData']('text/html',_0x197c1e);const _0x1de4f6=new ClipboardEvent('paste',{'clipboardData':_0x5e3c7a}),_0x83fccc=new ot(_0x1a6f55,_0x1de4f6,{'dataTransfer':new rt(_0x5e3c7a)});_0x1643be['setSelection'](_0x210f3b);const _0x2e275d=(_0x3fe349,_0x294172)=>{_0x294172['resultRange']&&_0x1643be['setSelection'](_0x294172['resultRange']);};_0x523eb8['once']('contentInsertion',_0x2e275d,{'priority':'lowest'}),_0x1a6f55['document']['fire']('paste',_0x83fccc),_0x523eb8['off']('contentInsertion',_0x2e275d);}['_getDefaultInsertBelowPosition'](_0x5fb8fd){const {model:_0x91e1ed}=this['editor'],_0x31e9a2=Array['from'](_0x5fb8fd['getSelectedBlocks']());return _0x31e9a2['length']?_0x91e1ed['createPositionAfter'](_0x31e9a2['pop']()):_0x5fb8fd['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x56bc16,_0x2411ca){const {model:_0xe46d8,plugins:_0x4c123f}=this['editor'];if(_0x4c123f['has']('TableUtils')){const _0x139480=_0x4c123f['get']('TableUtils')['getSelectedTableCells'](_0x2411ca);if(_0x139480['length']){const _0x4239b7=this['_getTableRowCountFromContent'](_0x56bc16),_0x24d3e3=this['_createEmptyTableRows'](_0x139480,_0x4239b7);return _0xe46d8['createPositionAt'](_0x24d3e3,0x0);}}return null;}['_getTableRowCountFromContent'](_0x375fd9){const _0x22c86c=this['editor']['plugins']['get']('TableUtils'),_0x4a7ce6=this['editor']['data']['parse'](_0x375fd9),_0x38d8fc=Array['from'](_0x4a7ce6['getChildren']())['filter'](_0x400786=>_0x400786['is']('element','table'));let _0x3e4b36=0x0;return _0x38d8fc['forEach'](_0x206c62=>{_0x3e4b36+=_0x22c86c['getRows'](_0x206c62);}),_0x3e4b36;}['_createEmptyTableRows'](_0x17a932,_0x46ca43){const _0x429e6f=this['editor']['plugins']['get']('TableUtils'),_0x383570=_0x429e6f['getRowIndexes'](_0x17a932),_0x46af4e=_0x429e6f['getColumnIndexes'](_0x17a932),_0x589a6a=_0x383570['last']+0x1,_0x4e1666=_0x46af4e['first'],_0x111f7d=_0x17a932[0x0]['findAncestor']('table');for(let _0x49c431=0x0;_0x49c431<_0x46ca43;_0x49c431++)_0x429e6f['insertRows'](_0x111f7d,{'at':_0x589a6a});return _0x111f7d['getChild'](_0x589a6a)['getChild'](_0x4e1666);}['_resetContentOfSelectedTableCells'](_0x44eb49,_0x165311){const {plugins:_0x36b8a5}=this['editor'],{model:_0x2342d1}=_0x44eb49;if(!_0x36b8a5['has']('TableUtils'))return;_0x36b8a5['get']('TableUtils')['getSelectedTableCells'](_0x165311)['length']&&_0x2342d1['deleteContent'](_0x165311);}}class hi extends _0x3340d2{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x36ce55('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x27f16d){super(_0x27f16d),this['name']='AIRequestError';}}function Yn(_0x2387f6,_0x8cbfd,_0x49bfe8){const t=_0x2387f6['t'];switch(_0x8cbfd){case'Edit\x20or\x20review':return t('Edit\x20or\x20review');case'Improve\x20writing':return t('Improve\x20writing');case'Make\x20shorter':return t('Make\x20shorter');case'Make\x20longer':return t('Make\x20longer');case'Simplify\x20language':return t('Simplify\x20language');case'Generate\x20from\x20selection':return t('Generate\x20from\x20selection');case'Summarize':return t('Summarize');case'Continue':return t('Continue');case'Change\x20tone':return t('Change\x20tone');case'Professional':return t('Professional');case'Casual':return t('Casual');case'Direct':return t('Direct');case'Confident':return t('Confident');case'Friendly':return t('Friendly');case'Change\x20style':return t('Change\x20style');case'Business':return t('Business');case'Legal':return t('Legal');case'Journalism':return t('Journalism');case'Poetic':return t('Poetic');case'Translate':return t('Translate');case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'AI\x20is\x20writing':return t('AI\x20is\x20writing');case'Generated\x20content:\x20%0':return t('Generated\x20content:\x20%0',_0x49bfe8);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x49bfe8);case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_INSERT_CONTENT':return t({'id':'AI_INSERT_CONTENT','string':'Insert'});case'AI_ERROR_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x49bfe8);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x8cbfd;}}class di extends At{['_commandDefinitions'];constructor(_0x557801,_0x1f07fa){super(_0x557801),this['_commandDefinitions']=_0x1f07fa,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x42e81b,_0x365eb6,_0x2021fa)=>{this['isEnabled']&&(this['enabledCommandsIds']=js(this['_commandDefinitions'],_0x2021fa));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x741f16,_0x336a61,_0x3f1d27)=>{this['enabledCommandsIds']=_0x3f1d27?js(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0xb29fdf=this['editor']['model'];this['_hasContext']=function(_0x355d25){const _0x493756=_0x355d25['document']['selection'];return _0x493756['isCollapsed']?0x0!==[..._0x493756['getSelectedBlocks']()]['length']&&![..._0x493756['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x355d25['hasContent'](_0x493756['getFirstRange']());}(_0xb29fdf);const _0xaa728c=_0xb29fdf['document']['selection'],_0x2fed5f=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x40fb40 of _0xaa728c['getRanges']())for(const _0xf98374 of _0x40fb40['getItems']())if(_0xf98374['is']('element')&&_0x2fed5f['includes'](_0xf98374['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x7364b7='',_0x31f825='',_0x3aeab7='custom'){this['editor']['plugins']['get'](ee)['showUI'](_0x7364b7,_0x31f825,_0x3aeab7);}}function js(_0x46a3ea,_0x129fe0){const _0x866c98=new Set();for(const _0x52b6b3 of _0x46a3ea['values']())(_0x129fe0||!0x1===_0x52b6b3['requiresContent'])&&_0x866c98['add'](_0x52b6b3['id']);return Array['from'](_0x866c98);}const vs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class ui extends/* #__PURE__ -- @preserve */
24
+ Vt(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x40f452,_0x12e3f9,_0xba6b01){super(),this['editor']=_0x40f452,this['textAdapter']=_0x12e3f9,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0xba6b01,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x27080f,_0x1451c5,_0x156bd2)=>{this['view']['value']=this['_sanitizeHTML'](_0x156bd2);}),this['listenTo'](this['view'],'submitPrompt',(_0x58e1a6,_0x523688)=>{const _0x51cc54=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x523688,_0x51cc54,'custom');}),this['listenTo'](this['view'],'tryAgainEvent',()=>{this['view']['prompt']=this['previousLabel'],this['_handleQuery'](this['previousQuery'],this['previousContext'],this['previousActionId'],this['previousLabel']);}),this['listenTo'](this['view'],'stopProcessing',()=>{this['stopProcessing']();});}['destroy'](){this['stopListening']();}async['updateView']({actionId:_0x316325,query:_0x10e47e,htmlContent:_0x29520e,label:_0x308e95,mainActionLabel:_0x10a0c3}){this['view']['prompt']=_0x308e95,this['view']['mainAction']=_0x10a0c3,this['initialContext']=_0x29520e,_0x10e47e&&(this['view']['isRendered']?this['_handleQuery'](_0x10e47e,_0x29520e,_0x316325,_0x308e95):this['view']['once']('render',()=>{this['_handleQuery'](_0x10e47e,_0x29520e,_0x316325,_0x308e95);}));}['stopProcessing'](){this['isProcessing']&&(this['isProcessing']=!0x1,this['view']['finishProcessing'](),this['textAdapter']['abort']());}['reset'](){this['initialContext']='',this['currentContext']='',this['currentResponse']='',this['previousContext']='',this['previousQuery']='',this['previousLabel']='',this['previousActionId']=void 0x0,this['view']['reset'](),this['stopProcessing']();}async['_handleQuery'](_0x389cb7,_0x5057b5,_0x33de5f,_0x284158){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x5057b5,this['previousQuery']=_0x389cb7,this['previousLabel']=_0x284158||_0x389cb7,this['previousActionId']=_0x33de5f,new Promise(_0x4c0e66=>{this['textAdapter']['makeRequest']({'query':_0x389cb7,'context':_0x5057b5,'onData':_0x194d4b=>{this['currentResponse']=_0x194d4b,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x33de5f})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x40d3e8=>{_0x40d3e8 instanceof er?this['view']['handleError'](_0x40d3e8['message']):this['view']['handleError'](),_0x4c0e66();})['finally'](()=>{this['stopProcessing'](),_0x4c0e66();});});}['_parseAndNormalizeContent'](_0x360f9d,_0x11e3a5=!0x1){const _0x1779ac=vs['exec'](_0x360f9d);_0x360f9d=_0x1779ac?_0x360f9d['substring'](_0x1779ac[0x1]['length']):_0x360f9d['length']<0x64&&!_0x11e3a5?'':this['_stripMarkdownSyntax'](_0x360f9d);const _0x8ae7d3=this['_domParser']['parseFromString'](_0x360f9d,'text/html');if(_0x1779ac){const _0xb13e2=Array['from'](_0x8ae7d3['body']['childNodes']);_0xb13e2['reverse']();for(const _0x5474f7 of _0xb13e2){if(_0x5474f7['nodeType']==Node['ELEMENT_NODE'])break;_0x5474f7['remove']();}}const _0x266cce=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x8ae7d3['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x266cce);const _0x4c8585=this['editor']['config']['get']('ai.assistant.preserveComments'),_0xdc6042=this['editor']['data']['toModel'](_0x266cce);return _0x4c8585||_0xdc6042['markers']['clear'](),this['editor']['data']['stringify'](_0xdc6042);}['_normalizeResponseHeadings'](_0x2ab42a){const _0xd65724=new _0x1182cb(this['editor']['editing']['view']['document']),_0x21c6f6=new _0x37a7bf({'name':/^h[1-5]$/}),_0x2ee54d=[];let _0x40b7be=!0x1;for(const _0x34ed28 of _0x2ab42a)_0x34ed28['is']('element')&&_0x21c6f6['match'](_0x34ed28)&&(_0x2ee54d['push'](_0x34ed28),'h1'==_0x34ed28['name']&&(_0x40b7be=!0x0));if(_0x40b7be){for(const _0x224c27 of _0x2ee54d)_0xd65724['rename']('h'+(parseInt(_0x224c27['name'][0x1])+0x1),_0x224c27);}}['_isH1TagSupportEnabled'](){const {data:_0x16c81f,editing:_0x36bd64}=this['editor'],_0x120a1b=_0x16c81f['htmlProcessor']['toView']('<h1></h1>'),_0x4952dd=_0x16c81f['toView'](_0x16c81f['toModel'](_0x120a1b));return!!_0x36bd64['view']['domConverter']['viewToDom'](_0x4952dd)['querySelector']('h1');}['_sanitizeHTML'](_0x5234b1){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x5234b1),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x2749c7){const _0x39c9fc=_0x2749c7['trim']();return _0x39c9fc['startsWith']('```html')?_0x39c9fc['endsWith']('```')?_0x39c9fc['substring'](0x7,_0x39c9fc['length']-0x3):_0x39c9fc['substring'](0x7):_0x2749c7;}}const fi={'REPLACE':'replace','INSERT':'insert'};class Pr extends _0x8fb4e9{constructor(_0x487271){super(_0x487271),this['set']('isVisible',!0x1),this['set']('mainAction',fi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x3209ef=>Yn(_0x487271,'AI_'+_0x3209ef['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Yn(_0x487271,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Yn(_0x487271,'Try\x20again')),this['stopButton']=this['_createButton'](Yn(_0x487271,'Stop'));const _0x43f235=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x43f235['if']('isVisible','ck-hidden',_0x1e6233=>!_0x1e6233)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x33839b,_0x5017a9){const _0x3f805a=new _0x494e59(this['locale']);return _0x3f805a['set']({'label':_0x33839b,'class':_0x5017a9||'','isVisible':!0x0,'withText':!0x0}),_0x3f805a;}}class Ir extends _0x13218d{['contentFieldView'];['copyButtonView'];constructor(_0x32b9aa,_0xb936db=''){super(_0x32b9aa),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x49e176=this['bindTemplate'];this['contentFieldView']=new $n(_0x32b9aa,_0xb936db),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x49e176['if']('isVisible','ck-hidden',_0x3e579f=>!_0x3e579f)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x49e176['if']('isProcessing','ck-ai-form__content-area--processing')]},'children':[this['contentFieldView'],{'tag':'div','attributes':{'class':['ck','ck-ai-form__copy-button-wrapper']},'children':[this['copyButtonView']]}]}]});}['render'](){super['render'](),this['value']&&this['contentFieldView']['setContent'](this['value']);let _0x268209=!0x1;this['on']('change:value',(_0x1bce4b,_0x38d59a,_0x25890c)=>{const _0xe0e26b=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x25890c),this['isProcessing']&&_0xe0e26b&&!_0x268209&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x42ba71,_0x39b307,_0xfa864d)=>{_0x268209=!0x1,_0xfa864d?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x268209=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x268209=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x59e4c1=this['locale'],_0x24b084=new _0x494e59(this['locale']),_0x4adf4b='ck-ai-form__copy-button';return _0x24b084['set']({'label':Yn(_0x59e4c1,'Copy'),'icon':_0x256d74,'class':_0x4adf4b,'tooltip':!0x0}),_0x24b084['bind']('isVisible')['to'](this,'value',_0x4cee43=>!!_0x4cee43),_0x24b084['bind']('isEnabled')['to'](this,'isProcessing',_0x3ccb1b=>!_0x3ccb1b),_0x24b084['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x24b084['icon']=_0xd070e4,_0x24b084['class']=_0x4adf4b+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x24b084['icon']=_0x256d74,_0x24b084['class']=_0x4adf4b;},0x3e8);}),_0x24b084;}['_copyHTMLToClipboard'](_0xa11b59){const {window:_0x784df7,document:_0x20b9d1}=_0xbe938c;if(_0x784df7['ClipboardItem']){const {Blob:_0x54fc4d,ClipboardItem:_0x44ee01}=_0x784df7,_0x69c55a=[new _0x44ee01({'text/html':new _0x54fc4d([_0xa11b59['innerHTML']],{'type':'text/html'}),'text/plain':new _0x54fc4d([_0xa11b59['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x69c55a);}else{const _0x2523d4=_0x20b9d1['createElement']('div');_0x2523d4['style']['position']='absolute',_0x2523d4['style']['left']='-9999px',_0x2523d4['innerHTML']='<span>[</span>'+_0xa11b59['innerHTML']+'<span>]</span>',_0x20b9d1['body']['appendChild'](_0x2523d4);const _0x5e6747=_0x20b9d1['createRange']();_0x5e6747['setStartAfter'](_0x2523d4['firstElementChild']),_0x5e6747['setEndBefore'](_0x2523d4['lastElementChild']);const _0x10d380=_0x784df7['getSelection']();_0x10d380['removeAllRanges'](),_0x10d380['addRange'](_0x5e6747),_0x20b9d1['execCommand']('copy'),_0x2523d4['remove']();}}}class $n extends _0x13218d{constructor(_0x1cfa38,_0x4a1bbc=''){super(_0x1cfa38),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x4a1bbc,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x156fef){this['element']['innerHTML']=_0x156fef;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x1b17d9=new _0x13218d(),_0x41e51a=this['locale'],_0x43f675=new _0x4667f2();return _0x43f675['isVisible']=!0x0,_0x1b17d9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x43f675,{'text':Yn(_0x41e51a,'AI\x20is\x20writing...')}]}),_0x1b17d9['render'](),_0x1b17d9;}}class Vr extends _0x13218d{constructor(_0x3b64cf,_0x229bdb=''){super(_0x3b64cf);const _0x2f33e1=new _0x25fec4(),_0x25bb65=this['bindTemplate'];this['set']('text',_0x229bdb),_0x2f33e1['content']=_0x9f305d,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x2f33e1,{'text':_0x25bb65['to']('text')}]});}}class Hr extends _0x1a3dc9{['submitButtonView'];['showHistoryButtonView'];constructor(_0x4fe94b,_0x403a17){super(_0x4fe94b,_0x403a17),this['queryView']['fieldView']['minRows']=0x1,this['queryView']['fieldView']['maxRows']=0x3,this['submitButtonView']=this['_createSubmitButton'](),this['showHistoryButtonView']=this['_createShowHistoryButton'](),this['focusableChildren']['add'](this['showHistoryButtonView'],0x1),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['showHistoryButtonView']),this['children']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x81e9a6,_0x417526)=>{_0x81e9a6['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x417526());});}['_createSubmitButton'](){const _0x51646b=new _0x494e59(this['locale']),_0xa53481=this['locale'];return _0x51646b['set']({'icon':_0x19f96e,'label':Yn(_0xa53481,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x51646b['on']('execute',()=>{this['submit']();}),_0x51646b['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x37d7d1,_0xb2dfa3)=>!_0x37d7d1&&_0xb2dfa3),_0x51646b;}['_createShowHistoryButton'](){const _0x217946=new _0x494e59(this['locale']),_0x53ec6a=this['resultsView'],_0x34d2a3=this['locale'];_0x217946['set']({'label':Yn(_0x34d2a3,'History'),'withText':!0x1,'icon':It,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x217946['bind']('isOn')['to'](_0x53ec6a,'isVisible'),_0x217946['bind']('isEnabled')['to'](this,'isEnabled'),_0x217946['on']('execute',()=>{_0x53ec6a['isVisible']=!_0x53ec6a['isVisible'],_0x53ec6a['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x1edf61=()=>{_0xbe938c['window']['requestAnimationFrame'](()=>{if(_0x5866ed(this['element'])){const _0x28d4cb=new _0x30f41d(this['queryView']['fieldView']['element']),_0x57bdb2=_0x28d4cb['width'],_0x49690d='rtl'===_0x34d2a3['uiLanguageDirection']?'left':'right';_0x28d4cb['excludeScrollbarsAndBorders'](),_0x217946['element']['style'][_0x49690d]=_0x57bdb2-_0x28d4cb['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x1edf61),this['on']('render',_0x1edf61),_0x217946;}['submit'](){const _0x1affe8=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x1affe8);}['focus'](_0x185cf5){-0x1===_0x185cf5?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Rr extends _0x49b4eb{['historyGroupView'];['clearHistoryButton'];constructor(_0x2a08e6){super(_0x2a08e6),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x2f98e5(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Yn(_0x2a08e6,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x517fd0=0x0;for(const _0x228fbf of this['items'])_0x517fd0+=_0x228fbf['items']['length'];return{'resultsCount':_0x517fd0,'totalItemsCount':_0x517fd0};}['_createClearHistoryButton'](){const _0xae3557=this['locale'],_0x1206cf=new _0x494e59(this['locale']);return _0x1206cf['set']({'label':'('+Yn(_0xae3557,'Clear')+')','withText':!0x0}),_0x1206cf['on']('execute',()=>this['fire']('clearHistory')),_0x1206cf;}}class Br extends _0x202f8e{constructor(_0x4a7129){super();const _0x7755af=new _0x2dac38(),_0x1d9ea8=new _0x494e59(this['locale'],_0x7755af);this['children']['add'](_0x1d9ea8),_0x1d9ea8['set']({'label':_0x4a7129['prompt'],'withText':!0x0}),_0x1d9ea8['on']('execute',()=>{this['fire']('execute',{'value':_0xbd76f4(_0x4a7129['prompt'])});});}}const Sr='CKEditor/AIFormView/PromptHistory';class qr extends _0x4c2902{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0xd75a64,_0x234665)=>{const _0x1e00f3=Fr(_0x234665['prompt']);for(const _0x2206af of this)if(_0x2206af!=_0x234665&&Fr(_0x2206af['prompt'])===_0x1e00f3){this['remove'](_0x2206af);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x3dd7e7=sessionStorage['getItem'](Sr)||'[]';this['addMany'](JSON['parse'](_0x3dd7e7));}['_saveToSessionStorage'](){sessionStorage['setItem'](Sr,JSON['stringify'](this['map'](_0x15b6e5=>_0x15b6e5)));}}function Fr(_0x47ed72){return _0x47ed72['toLowerCase']()['trim']();}class pi extends _0x13218d{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1a1eb3,_0x1ee854,_0x48b966=''){super(_0x1a1eb3),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',fi['REPLACE']),this['_promptHistory']=new qr(),this['errorView']=new Vr(_0x1a1eb3),this['contentArea']=new Ir(_0x1a1eb3,_0x48b966),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new ts(),this['keystrokes']=new _0x34d7cc(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x2532de({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x2342f0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x1ee854],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x2342f0['if']('isError','ck-hidden',_0x46829e=>!_0x46829e)]},'children':[this['errorView']]},this['contentArea'],this['toolbar'],this['promptView']]}]});}['render'](){super['render'](),this['focusTracker']['add'](this['contentArea']['element']),this['focusTracker']['add'](this['contentArea']['copyButtonView']['element']),this['focusTracker']['add'](this['toolbar']['element']),this['focusTracker']['add'](this['promptView']['element']),this['keystrokes']['listenTo'](this['element']);}['focus'](_0x53c38f=0x1){-0x1===_0x53c38f?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['reset'](){this['prompt']='',this['value']='',this['isError']=!0x1,this['promptView']['reset'](),this['contentArea']['isVisible']=!0x1,this['toolbar']['isVisible']=!0x1;}['_createPromptView'](){const _0x2ba8cd=this['locale'],_0x5b1cb7=new Hr(_0x2ba8cd,{'queryView':{'label':Yn(_0x2ba8cd,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x13f57e,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Yn(_0x2ba8cd,'Empty\x20history'),'secondary':Yn(_0x2ba8cd,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5b1cb7['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x43b480,_0x5e16e8)=>_0x43b480&&!_0x5e16e8),this['listenTo'](_0x5b1cb7,'submit',(_0x1bb52b,_0x3793a0)=>{this['prompt']=_0x3793a0;const _0x46af9b=Wt(_0x3793a0);this['fire']('submitPrompt',_0x46af9b),_0x3793a0['trim']()&&this['_promptHistory']['add']({'prompt':_0x46af9b},0x0);},{'priority':'high'}),_0x5b1cb7;}['_createHistoryView'](){const _0x2feb72=new Rr(this['locale']);return _0x2feb72['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Br),_0x2feb72['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2feb72;}['_createToolbar'](){const _0x2af4fd=new Pr(this['locale']);return _0x2af4fd['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x49a4fb,_0x42f5d4,_0x4335f2)=>_0x49a4fb&&!_0x42f5d4&&!!_0x4335f2),_0x2af4fd['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x2af4fd['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x34c0b5,_0x20b54b,_0x307fbb)=>_0x34c0b5&&!_0x20b54b&&!!_0x307fbb),_0x2af4fd['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x2af4fd['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3c3703,_0x1b00c6)=>_0x3c3703&&!_0x1b00c6),_0x2af4fd['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x2af4fd['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x2af4fd['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x2af4fd;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x420936=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Yn(_0x420936,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x29df8e){const _0x73b48c=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x29df8e||Yn(_0x73b48c,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const st=globalThis['DataTransfer'];class ee extends _0x3340d2{['licenseKey'];['_licenseKeyCheckInterval'];['_dialog'];['_formView'];['_aiAdapter'];['_aiAssistantController'];['_uiCssClasses']='';static get['pluginName'](){return'AIAssistantUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[_0x3c026e,te,hi,_0x2b3fa6];}constructor(_0x537a75){super(_0x537a75),_0x537a75['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x537a75['config']['define']('ai.assistant.contentAreaCssClass',''),_0x537a75['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x537a75['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x3e1943}=this;this['_aiAdapter']=_0x3e1943['plugins']['get'](hi),this['_dialog']=_0x3e1943['plugins']['get'](_0x2b3fa6),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x11dec5=new di(_0x3e1943,Array['from'](this['_commandDefinitions']['values']()));_0x3e1943['commands']['add']('showAIAssistant',_0x11dec5),_0x3e1943['ui']['componentFactory']['add']('aiCommands',_0x862d0a=>{const _0x5d0575=_0x478151(_0x862d0a);return _0x5d0575['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x5d0575['buttonView']['set']({'label':Yn(_0x862d0a,'AI\x20Commands'),'icon':_0x399e7e,'tooltip':!0x0}),_0x5d0575['on']('execute',_0xc09aad=>this['_onExecute'](_0xc09aad['source']['id'])),_0x36afe0(_0x5d0575,_0x3e1943['ui']['view']['body'],function(_0x24c4ce){const _0x240038=ne(_0x24c4ce['config']['get']('ai.assistant.commands'),_0x24c4ce['locale']),_0x17f5c8=gi(_0x24c4ce,_0x240038)['filter'](_0x7bb51f=>_0x7bb51f['commands']['length']);if(0x1===_0x17f5c8['length'])return gi(_0x24c4ce,_0x17f5c8[0x0]['commands'])['map'](_0x1c7025=>({'id':_0x1c7025['id'],'label':_0x1c7025['label']}));return _0x17f5c8['map'](_0x287c8d=>{const {groupId:_0x495dba,groupLabel:_0x4da19d,commands:_0x47920e}=_0x287c8d,_0x367268=gi(_0x24c4ce,_0x47920e)['map'](_0x4af529=>({'id':_0x4af529['id'],'label':_0x4af529['label']}));return{'id':_0x495dba,'menu':_0x4da19d||_0x495dba,'children':_0x367268};});}(_0x3e1943),{'ariaLabel':Yn(_0x862d0a,'AI\x20Commands')}),_0x5d0575['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x11dec5['on']('change:enabledCommandsIds',_0x2b4024),_0x5d0575['menuView']['once']('render',_0x2b4024),_0x5d0575;function _0x2b4024(){_0x5d0575['isEnabled']=_0x11dec5['enabledCommandsIds']['length']>0x0;for(const _0x26dfba of _0x5d0575['menuView']['buttons'])_0x26dfba['isEnabled']=_0x11dec5['enabledCommandsIds']['includes'](_0x26dfba['id']);}}),_0x3e1943['ui']['componentFactory']['add']('menuBar:aiCommands',_0xd7dc8c=>{const _0x364998=new _0x5029fd(_0xd7dc8c);_0x364998['buttonView']['set']({'label':Yn(_0xd7dc8c,'AI\x20Commands'),'icon':_0x399e7e}),_0x364998['bind']('isEnabled')['to'](_0x11dec5,'enabledCommandsIds',_0x350239=>_0x350239['length']>0x0);const _0x820cc1=ne(_0x3e1943['config']['get']('ai.assistant.commands'),_0xd7dc8c);return this['_populateMenuBarMenu'](_0x11dec5,_0x364998,_0x820cc1,_0x2e4fc6=>this['_onExecute'](_0x2e4fc6)),_0x364998;}),_0x3e1943['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x165fce=this['_createAIAssistantUIButton'](_0x494e59);return _0x165fce['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x165fce;}),_0x3e1943['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x53c13b=this['_createAIAssistantUIButton'](_0x555885);return _0x53c13b['set']({'role':'menuitemcheckbox'}),_0x53c13b;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x1327d3=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x590e20;for(const _0x2dd343 in _0x1327d3){const _0x3f8fd7=_0x2dd343,_0x47c306=_0x1327d3[_0x3f8fd7];if('aiLicenseKeyValid'==_0x47c306||'aiLicenseKeyInvalid'==_0x47c306||'aiLicenseKeyExpired'==_0x47c306||'aiLicenseKeyDomainLimit'==_0x47c306||'aiLicenseKeyNotAllowed'==_0x47c306||'aiLicenseKeyEvaluationLimit'==_0x47c306||'aiLicenseKeyUsageLimit'==_0x47c306){delete _0x1327d3[_0x3f8fd7],_0x590e20=_0x47c306,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x590e20&&_0x1327d3['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x590e20&&_0x1327d3['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x590e20&&_0x1327d3['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x590e20&&_0x1327d3['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x590e20&&_0x1327d3['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x590e20&&_0x1327d3['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x1c6377='',_0x455abf='',_0x519ab2='custom'){const _0x13cb5c=this['editor'],_0x2fde86=_0x13cb5c['editing']['view'],_0x590b97=_0x13cb5c['plugins']['get'](te),_0x3f7495=_0x13cb5c['plugins']['get'](_0x3c026e);_0x590b97['showFakeVisualSelection']();const _0x572993=new st(),_0x3e0bed=new ClipboardEvent('copy',{'clipboardData':_0x572993}),_0x253042=new rt(_0x572993),_0x1449c6=new ot(_0x2fde86,_0x3e0bed,{'dataTransfer':_0x253042});_0x3f7495['_forceMarkersCopy']('comment',()=>{_0x2fde86['document']['fire']('copy',_0x1449c6);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new ui(_0x13cb5c,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x146424=_0x253042['getData']('text/html');const _0xb5e5bf=_0x13cb5c['model']['document']['selection'],_0x123f93=Array['from'](_0xb5e5bf['getRanges']());0x1===_0x123f93['length']&&_0x123f93[0x0]['isFlat']&&!_0xb5e5bf['getSelectedElement']()&&''!==_0x146424['replace'](/&nbsp;/g,'')['trim']()&&(_0x146424='<p>'+_0x146424+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x519ab2,'query':_0x1c6377,'htmlContent':_0x146424,'label':_0x455abf,'mainActionLabel':fi[_0x13cb5c['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ti,'title':Yn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x363c9f['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x590b97['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x5dbf4e=new Map(),_0x4a71e8=ne(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x52d964 of _0x4a71e8)for(const _0x31775a of _0x52d964['commands'])_0x5dbf4e['set'](_0x31775a['id'],{..._0x31775a,'groupId':_0x52d964['groupId'],'groupLabel':_0x52d964['groupLabel']||_0x52d964['groupId']});return _0x5dbf4e;}['_createAIAssistantUIButton'](_0x4bcf9e){const _0x376445=this['editor'],_0x1d89f3=_0x376445['commands']['get']('showAIAssistant'),_0x425fca=new _0x4bcf9e(_0x376445['locale']);return _0x425fca['set']({'label':Yn(_0x376445['locale'],'AI\x20Assistant'),'icon':ti,'isToggleable':!0x0}),_0x425fca['bind']('isEnabled')['to'](_0x1d89f3),_0x425fca['bind']('isOn')['to'](this['_dialog'],'id',_0x45d124=>'aiAssistant'===_0x45d124),this['listenTo'](_0x425fca,'execute',()=>{_0x425fca['isOn']?this['hideUI']():_0x1d89f3['execute']();}),_0x425fca;}['_initView'](){const _0x3a1429=this['editor']['plugins']['get'](te);this['_formView']=new pi(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.assistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x3a1429['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x3a1429['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x494887,ui:{ariaLiveAnnouncer:_0x28f60a}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x19f5ee,_0x5483de,_0x3800c2)=>{const _0x31ff4c=this['_aiAssistantController']['currentContext'];_0x3800c2?_0x28f60a['announce'](Yn(_0x494887,'AI\x20is\x20writing')):_0x31ff4c&&_0x28f60a['announce'](Yn(_0x494887,'Generated\x20content:\x20%0',_0x31ff4c),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x2ae7e2,_0x40c33b,_0x116695)=>{if(_0x116695){const _0x121e4c=this['_formView']['errorView']['text'];_0x28f60a['announce'](Yn(_0x494887,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x121e4c));}});}['_onExecute'](_0x19cc6d){const _0x390c92=this['_commandDefinitions']['get'](_0x19cc6d),_0x47591b=this['editor'],_0x586c9c=_0x47591b['model']['document']['selection'],_0xaab6c4=_0x47591b['commands']['get']('showAIAssistant'),_0x4fc8a1=_0x47591b['plugins']['get'](te),_0x4aa2fb=''+(_0x390c92['groupId']!==li?_0x390c92['groupLabel']+':\x20':'')+_0x390c92['label'];if(!0x1!==_0x390c92['requiresContent']&&_0x586c9c['isCollapsed']){const _0x5c60e9=_0x3c4f7b(_0x586c9c['getSelectedBlocks']())||_0x47591b['model']['schema']['getLimitElement'](_0x586c9c);_0x47591b['model']['change'](_0x2a77d8=>{_0x2a77d8['setSelection'](_0x5c60e9,'in');});}_0x4fc8a1['showFakeVisualSelection'](),_0xaab6c4['execute'](_0x390c92['prompt'],_0x4aa2fb,'command:'+_0x19cc6d);}['_populateMenuBarMenu'](_0x31840c,_0xc3144e,_0x19b492,_0x494bb2){const _0x26f763=this['editor'],_0x43309f=_0x26f763['locale'],_0x283903=new _0x17defc(_0x43309f),_0x34899b=gi(_0x26f763,_0x19b492)['filter'](_0xb84ee0=>_0xb84ee0['commands']['length']);0x1===_0x34899b['length']?this['_getMenuBarGroupButtons']({'command':_0x31840c,'commands':_0x34899b[0x0]['commands'],'parentMenuView':_0xc3144e,'onExecute':_0x494bb2})['forEach'](_0x14eae1=>_0x283903['items']['add'](_0x14eae1)):_0x34899b['forEach'](({groupId:_0x5a8875,groupLabel:_0x5adf09,commands:_0x346805})=>{const _0xd0a9=new _0x4236d1(_0x43309f,_0xc3144e),_0x10d819=new _0x5029fd(_0x43309f),_0x1bdda4=new _0x17defc(_0x43309f),_0x2962db=this['_getMenuBarGroupButtons']({'command':_0x31840c,'commands':_0x346805,'parentMenuView':_0x10d819,'onExecute':_0x494bb2});_0x10d819['buttonView']['set']({'label':_0x5adf09||_0x5a8875}),_0x10d819['delegate']('execute')['to'](_0xc3144e),_0x1bdda4['items']['addMany'](_0x2962db),_0x10d819['panelView']['children']['add'](_0x1bdda4),_0xd0a9['children']['add'](_0x10d819),_0x283903['items']['add'](_0xd0a9);}),_0xc3144e['panelView']['children']['add'](_0x283903);}['_getMenuBarGroupButtons']({command:_0x392104,commands:_0x18c83d,parentMenuView:_0x4e2e09,onExecute:_0x26701b}){const _0x522295=this['editor'],_0x529c69=_0x522295['locale'];return gi(_0x522295,_0x18c83d)['map'](_0xad9a2e=>{const _0x2bd126=new _0x4236d1(_0x529c69,_0x4e2e09),_0x30a1ba=new _0x555885(_0x529c69);return _0x30a1ba['set']({'label':_0xad9a2e['label']}),_0x30a1ba['delegate']('execute')['to'](_0x4e2e09),_0x30a1ba['on']('execute',()=>_0x26701b(_0xad9a2e['id'])),_0x30a1ba['bind']('isEnabled')['to'](_0x392104,'enabledCommandsIds',_0x439bb7=>_0x439bb7['includes'](_0xad9a2e['id'])),_0x2bd126['children']['add'](_0x30a1ba),_0x2bd126;});}}function wi(_0x390175,_0x2597b2){return void 0x0!==_0x390175['order']&&void 0x0===_0x2597b2['order']?0x1:void 0x0===_0x390175['order']&&void 0x0!==_0x2597b2['order']?-0x1:void 0x0!==_0x390175['order']&&void 0x0!==_0x2597b2['order']?_0x390175['order']-_0x2597b2['order']:0x0;}function gi(_0x5d7343,_0xeb117f){_0xeb117f['sort'](wi);const _0x3b1fbf={},_0xb16bd7=[];for(const _0x242ac9 of _0xeb117f)if(void 0x0!==_0x242ac9['order']){if(_0x242ac9['order']in _0x3b1fbf)throw new _0x36ce55('ai-commands-config-order-collision',_0x5d7343,{'conflictingDefinitions':[_0x242ac9,_0x3b1fbf[_0x242ac9['order']]]});_0x3b1fbf[_0x242ac9['order']]=_0x242ac9,_0xb16bd7['splice'](_0x242ac9['order'],0x0,_0x242ac9);}else _0xb16bd7['push'](_0x242ac9);return _0xb16bd7;}class qn extends _0x3340d2{static get['requires'](){return[ee,te];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4319c9){super(_0x4319c9);const _0x2bf362=_0x4319c9['config'],_0x1b700b=_0x4319c9['locale'];_0x2bf362['define']('ai.assistant.preserveComments',!0x0),_0x2bf362['define']('ai.assistant.commands',Qn(_0x1b700b)),_0x2bf362['define']('ai.assistant.extraCommandGroups',[]),_0x2bf362['define']('ai.assistant.removeCommands',[]);let _0xcfc207=ne(_0x2bf362['get']('ai.assistant.commands'),_0x1b700b);const _0x43dcab=_0x2bf362['get']('ai.assistant.extraCommandGroups'),_0x4ee79c=_0x2bf362['get']('ai.assistant.removeCommands');_0x43dcab['forEach'](_0x32beb9=>{const _0x4b0fb4=_0xcfc207['find'](_0x439909=>_0x439909['groupId']===_0x32beb9['groupId']);_0x4b0fb4?_0x4b0fb4['commands']=_0x4b0fb4['commands']['concat'](_0x32beb9['commands']):_0xcfc207['push'](_0x32beb9);}),_0xcfc207=_0xcfc207['filter'](_0x21dc75=>!_0x4ee79c['includes'](_0x21dc75['groupId'])),_0xcfc207['forEach'](_0x4e222d=>{_0x4e222d['commands']=_0x4e222d['commands']['filter'](_0x35c050=>!_0x4ee79c['includes'](_0x35c050['id']));}),_0x2bf362['set']('ai.assistant.commands',_0xcfc207);}}function Qn(_0x5b8c73){return[{'groupId':'editOrReview','groupLabel':Yn(_0x5b8c73,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Yn(_0x5b8c73,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Yn(_0x5b8c73,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':Yn(_0x5b8c73,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Yn(_0x5b8c73,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':Yn(_0x5b8c73,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Yn(_0x5b8c73,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':Yn(_0x5b8c73,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':Yn(_0x5b8c73,'Change\x20tone'),'commands':[{'id':'professional','label':Yn(_0x5b8c73,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Yn(_0x5b8c73,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Yn(_0x5b8c73,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Yn(_0x5b8c73,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Yn(_0x5b8c73,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Yn(_0x5b8c73,'Change\x20style'),'commands':[{'id':'business','label':Yn(_0x5b8c73,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Yn(_0x5b8c73,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Yn(_0x5b8c73,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Yn(_0x5b8c73,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Yn(_0x5b8c73,'Translate'),'commands':[{'id':'translateEnglish','label':Yn(_0x5b8c73,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Yn(_0x5b8c73,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Yn(_0x5b8c73,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Yn(_0x5b8c73,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Yn(_0x5b8c73,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Yn(_0x5b8c73,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Yn(_0x5b8c73,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Yn(_0x5b8c73,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ar extends _0x3340d2{['abortController'];static get['requires'](){return[hi];}constructor(_0x1ebb7a){super(_0x1ebb7a),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](hi)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x294532){return this['sendRequest'](_0x294532)['catch'](_0x2d7a12=>{if(_0x2d7a12 instanceof er)return Promise['reject'](_0x2d7a12);if('AbortError'==_0x2d7a12['name'])return Promise['resolve']();throw console['error'](_0x2d7a12),new _0x36ce55('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x3317d3,_0x28cf97){const _0x29f722=this['editor']['locale'],_0x1d5a67={'Content-Type':'application/json'};if('object'==typeof _0x3317d3)Object['assign'](_0x1d5a67,_0x3317d3);else{if(_0x3317d3)try{const _0x8457b0=await _0x3317d3(_0x28cf97);Object['assign'](_0x1d5a67,_0x8457b0);}catch{return Promise['reject'](new er(Yn(_0x29f722,'AI_ERROR_GET_HEADERS')));}}return _0x1d5a67;}async['_prepareRequestParameters'](_0x36a833,_0x3eabc3){const _0x5f0478=this['editor']['locale'];if('object'==typeof _0x36a833)return _0x36a833;try{return await _0x36a833(_0x3eabc3);}catch{return Promise['reject'](new er(Yn(_0x5f0478,'AI_ERROR_GET_PARAMETERS')));}}}class Xn extends ar{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x263100){super(_0x263100),_0x263100['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x263100['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x263100['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x263100['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x263100['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x263100['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x40985d,context:_0x56eb2c,onData:_0x47f0f0,actionId:_0xdc060}){const _0x4cc644=this['editor']['locale'],_0xdcfc36=await this['prepareMessages'](_0x40985d,_0x56eb2c,_0xdc060),_0x428889=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xdc060),_0x42b0fe=await this['_prepareRequestParameters'](this['_requestParameters'],_0xdc060),_0x125703={'messages':_0xdcfc36,..._0x42b0fe},_0x39656c={'method':'POST','headers':_0x428889,'body':JSON['stringify'](_0x125703),'signal':this['abortController']['signal']},_0x50ac27=await fetch(this['_apiUrl'],_0x39656c);if(_0x50ac27['ok'])return _0x42b0fe['stream']?await this['_readStreamableResponse'](_0x50ac27,_0x47f0f0):await this['_readStaticResponse'](_0x50ac27,_0x47f0f0),Promise['resolve']();{const _0x499cba=await _0x50ac27['text']();return _0x499cba['includes']('context_length_exceeded')?Promise['reject'](new er(Yn(_0x4cc644,'AI_ERROR_CONTEXT_LENGTH'))):_0x499cba['includes']('Moderation')?Promise['reject'](new er(Yn(_0x4cc644,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x499cba));}}async['prepareMessages'](_0xfaa92c,_0x23cfdb,_0xc37006){let _0x1ac3f8,_0x88d656;return _0x23cfdb?(_0x1ac3f8='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x88d656='Instruction:\x0a'+_0xfaa92c+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x23cfdb):(_0x1ac3f8='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x88d656=_0xfaa92c),[{'role':'system','content':_0x1ac3f8},{'role':'user','content':_0x88d656}];}async['_readStreamableResponse'](_0x1e631f,_0x4b18e9){const _0x44265b=_0x1e631f['body']['getReader'](),_0x30d957=new TextDecoder();let _0x316403='',_0xa72c8c='',_0x5980bb='',_0x4e495c=!0x1;for(;!_0x4e495c;){const {done:_0x599c81,value:_0x2d4d04}=await _0x44265b['read'](),_0x19d293=_0x316403+_0x30d957['decode'](_0x2d4d04);let _0x4c3183='';_0x4e495c=_0x599c81;try{_0x4c3183=this['_cleanUpData'](_0x19d293),_0x316403='';}catch{_0x316403=_0x19d293;continue;}_0xa72c8c+=_0x4c3183,!_0x4e495c&&this['_isBufferIncomplete'](_0xa72c8c)||_0xa72c8c&&(_0x5980bb+=_0xa72c8c,_0xa72c8c='',_0x4b18e9(_0x5980bb));}return Promise['resolve']();}async['_readStaticResponse'](_0x104abf,_0x4a1ad7){return _0x4a1ad7((await _0x104abf['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x3d13c6){const _0x21d11c=_0x3d13c6['split']('<')['length']!==_0x3d13c6['split']('>')['length'],_0x39a946=_0x3d13c6['length']<0x1e;return _0x21d11c&&_0x39a946;}['_cleanUpData'](_0x390f99){return _0x390f99['split'](/\n(?![^{]*\})/g)['map'](_0x12a5ba=>_0x12a5ba['replace']('data:\x20',''))['filter'](_0x27b013=>_0x27b013&&_0x27b013['length']>0x0&&'[DONE]'!==_0x27b013)['map'](_0xb40ec4=>{const {choices:_0x27e489}=JSON['parse'](_0xb40ec4);if(_0x27e489[0x0]?.['delta']?.['content'])return _0x27e489[0x0]['delta']['content'];})['filter'](_0x592bd7=>_0x592bd7)['join']('');}}class zn extends ar{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),Zt('ai-aws-adapter-not-supported');}async['sendRequest'](_0x189c49){throw _0x283c76('ai-aws-adapter-not-supported'),new er(Yn(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ia extends _0x494e59{constructor(_0x520bec,_0x24c316={}){super(_0x520bec),this['isToggleable']=!0x0,this['set']('side',_0x24c316['side']||'top');const _0x523cbc=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x1f83aa(_0x24c316['class']||[]),_0x523cbc['to']('side',_0x3278bc=>'ck-tab-button_'+_0x3278bc),_0x523cbc['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x13218d{['children'];constructor(_0x3c1057,_0x489a92={}){super(_0x3c1057);const _0x14733a=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x1f83aa(_0x489a92['class']||[]),_0x14733a['to']('class'),_0x14733a['if']('isVisible','ck-hidden',_0x140c45=>!_0x140c45)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x13218d{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x2a8b31,_0x4097f9={}){super(_0x2a8b31),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x4097f9['side']||'top'),this['set']('isMaximized',!0x1);const _0x265f33=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x1f83aa(_0x4097f9['class']||[]),_0x265f33['to']('side',_0x243a3d=>'ck-tabs_'+_0x243a3d),_0x265f33['to']('class'),_0x265f33['to']('isMaximized',_0x484c46=>_0x484c46?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x265f33['to']('side',_0x565f0f=>'ck-tabs__buttons-container_'+_0x565f0f)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x265f33['to']('side',_0x30157b=>'ck-tabs__panels-container_'+_0x30157b)]},'children':this['panelViews']},..._0x1f83aa(_0x4097f9['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x495ad1){const _0x43fec2=this['_tabs']['get'](_0x495ad1);return _0x43fec2||null;}['addTab'](_0x349e4f){const _0x24b5cb=this['_setupButton']({'id':_0x349e4f['id'],'label':_0x349e4f['buttonLabel'],'icon':_0x349e4f['buttonIcon'],'order':_0x349e4f['order']}),_0x4143b8=new ea(this['locale']);return _0x4143b8['render'](),_0x349e4f['content']&&_0x4143b8['children']['add'](_0x349e4f['content']),this['panelViews']['add'](_0x4143b8),this['_tabs']['set'](_0x349e4f['id'],{'button':_0x24b5cb,'panel':_0x4143b8,'order':void 0x0!==_0x349e4f['order']?_0x349e4f['order']:null}),this['fire']('addTab:'+_0x349e4f['id'],{'id':_0x349e4f['id'],'button':_0x24b5cb,'panel':_0x4143b8}),null===this['activeTab']?this['activateTab'](_0x349e4f['id']):this['_hidePanel'](_0x349e4f['id']),{'button':_0x24b5cb,'panel':_0x4143b8};}['activateTab'](_0x3a1cdc){if(null!==_0x3a1cdc&&!this['getTab'](_0x3a1cdc))throw new _0x36ce55('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3a1cdc});this['activeTab']!==_0x3a1cdc&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x3a1cdc,_0x3a1cdc&&this['_showPanel'](_0x3a1cdc),this['fire']('activateTab:'+_0x3a1cdc,_0x3a1cdc));}['showTab'](_0x20c354){if(!this['getTab'](_0x20c354))throw new _0x36ce55('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x20c354});this['_showPanel'](_0x20c354),this['_showButton'](_0x20c354),this['fire']('show:'+_0x20c354,_0x20c354);}['hideTab'](_0xd147e0){if(!this['getTab'](_0xd147e0))throw new _0x36ce55('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xd147e0});const _0x2167c5=this['activeTab'];this['_hidePanel'](_0xd147e0),this['_hideButton'](_0xd147e0);const _0x51d5af=this['getTabIds']();_0x2167c5===_0xd147e0&&_0x51d5af['length']>0x1&&this['activateTab'](_0x51d5af['find'](_0x1a03eb=>_0x1a03eb!==_0xd147e0)),this['fire']('hide:'+_0xd147e0,_0xd147e0);}['_getPanel'](_0x3d0b41){const _0x308bc1=this['_tabs']['get'](_0x3d0b41);return _0x308bc1?_0x308bc1['panel']:null;}['_showPanel'](_0x36a250){null!==this['activeTab']&&this['activeTab']!==_0x36a250||this['_getPanel'](_0x36a250)['show']();}['_hidePanel'](_0x1c71b6){const _0x48c7ee=this['_getPanel'](_0x1c71b6);_0x48c7ee['isVisible']&&(this['activeTab']===_0x1c71b6&&(this['activeTab']=null),_0x48c7ee['hide']());}['_getButton'](_0x36a612){const _0x2ceab2=this['_tabs']['get'](_0x36a612);return _0x2ceab2?_0x2ceab2['button']:null;}['_showButton'](_0x57700b){this['_getButton'](_0x57700b)['show']();}['_hideButton'](_0x4fe1c3){this['_getButton'](_0x4fe1c3)['hide']();}['_setupButton'](_0x5c8d26){const _0x3b1452=new ia(this['locale'],{'side':this['side']}),_0x176070=this['buttonViews'];if(_0x3b1452['set']({'label':_0x5c8d26['label'],'icon':_0x5c8d26['icon'],'tooltip':!0x0,'withText':!0x0}),_0x3b1452['bind']('isOn')['to'](this,'activeTab',_0x7d30c4=>_0x7d30c4===_0x5c8d26['id']),_0x3b1452['bind']('side')['to'](this,'side'),_0x5c8d26['order']){const _0x1f3dba=[...this['_tabs']]['reduce']((_0x5d6b3b,_0x2d3cab)=>{const _0x1266fc=_0x2d3cab[0x0],{order:_0x12322c}=_0x2d3cab[0x1];return!_0x12322c||_0x12322c>_0x5c8d26['order']?_0x5d6b3b:_0x12322c>=_0x5d6b3b['order']?{'id':_0x1266fc,'order':_0x12322c}:_0x5d6b3b;},{'id':'','order':0x0}),_0x31121e=_0x176070['getIndex'](this['_getButton'](_0x1f3dba['id']));_0x176070['add'](_0x3b1452,_0x31121e+0x1);}else _0x176070['add'](_0x3b1452);return _0x3b1452['on']('execute',()=>{this['activateTab'](_0x5c8d26['id']);}),_0x3b1452;}}const Ti=['overlay','sidebar','custom'],yi=['left','right'];class bi extends ss{constructor(_0x4275cf,_0xdaaf91={}){super(_0x4275cf,_0xdaaf91),this['set']('type',_0xdaaf91['type']||'sidebar'),this['set']('side',_0xdaaf91['side']||'right'),this['set']('isVisible',_0xdaaf91['visibleByDefault']??!0x0);const _0x501027=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x501027['if']('type','ck-ai-tabs__overlay',_0x111e55=>'overlay'===_0x111e55),_0x501027['if']('type','ck-ai-tabs__sidebar',_0x525257=>'sidebar'===_0x525257),_0x501027['if']('isVisible','ck-hidden',_0x30b0f4=>!_0x30b0f4)]}}),this['buttonViews']['on']('add',(_0x1f9668,_0x52b3aa)=>{_0x52b3aa['set']('withText',!0x1);});}}class H extends _0x269016{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x518cea){super(_0x518cea);const _0x3f43fb=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x3f43fb)throw new _0x36ce55('ai-tabs-configuration-not-found');if(void 0x0!==_0x3f43fb['showResizeButton']&&(this['showResizeButton']=_0x3f43fb['showResizeButton']),'sidebar'!==_0x3f43fb['type']&&'overlay'!==_0x3f43fb['type']||_0x3f43fb['side']&&(this['side']=_0x3f43fb['side']),'sidebar'===_0x3f43fb['type']){if(this['container']=_0x3f43fb['element'],this['set']('type','sidebar'),!this['container'])throw new _0x36ce55('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x3f43fb['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new bi(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x3f43fb['visibleByDefault']||_0x3f43fb['visibleByDefault']}),this['view']['render'](),this['view']['bind']('side')['to'](this,'side'),this['view']['bind']('type')['to'](this,'type'),this['container']&&this['container']['appendChild'](this['view']['element']),this['context']instanceof _0x5601f8&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x7b4b85){if(_0x7b4b85&&this['type']!==_0x7b4b85){if(!Ti['includes'](_0x7b4b85))throw new _0x36ce55('ai-tabs-unsupported-ui-type');this['type']=_0x7b4b85;}}['switchSide'](_0x57d53e){if(_0x57d53e&&this['side']!==_0x57d53e){if(!yi['includes'](_0x57d53e))throw new _0x36ce55('ai-tabs-unsupported-ui-side');this['side']=_0x57d53e;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class s extends _0x269016{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x41b04d){super(_0x41b04d),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl'),this['_token']=null,this['_decoder']=new TextDecoder();}['init'](){const _0x4959ac=this['context']['plugins']['get']('CloudServices');if(!_0x4959ac['token'])throw new _0x36ce55('ai-missing-token',this);this['_token']=_0x4959ac['token'];}['startConversation'](_0x31a8a1,_0x469876){const _0x344562=this['_sendApiRequest']('/conversations','POST',{'id':_0x31a8a1,'group':_0x469876});return{'getConversation':async()=>(await _0x344562['request'])['json'](),'abortController':_0x344562['abortController']};}['queryAssistant']({message:_0x55ddc2,conversationId:_0x14dc87,parts:_0x122d48,capabilities:_0x516d2c,model:_0x437107,attributes:_0x49600c}){const _0x586611={'prompt':_0x55ddc2,'content':_0x122d48,'model':_0x437107,..._0x516d2c&&{'capabilities':_0x516d2c},..._0x49600c&&{'attributes':_0x49600c}},_0x5c6a8b=this['_sendApiRequest']('/conversations/'+_0x14dc87+'/messages','POST',_0x586611);return{'getStream':async()=>{const _0x5b428e=(await _0x5c6a8b['request'])['body'];return this['_getStreamReader'](_0x5b428e);},'abortController':_0x5c6a8b['abortController']};}['executeCustomAction']({content:_0xc6f0fb,message:_0x34cb4c,model:_0x4405e9,outputFormat:_0x2ed8f4}){const _0xcd60f1={'content':[{'type':'text','content':_0xc6f0fb}],'prompt':_0x34cb4c,'model':_0x4405e9,'outputFormat':_0x2ed8f4},_0x1f550f=this['_sendApiRequest']('/actions/custom/calls','POST',_0xcd60f1);return{'getStream':async()=>{const _0x3946ea=(await _0x1f550f['request'])['body'];return this['_getStreamReader'](_0x3946ea);},'abortController':_0x1f550f['abortController']};}['executeAction']({actionName:_0x575c6d,content:_0x3500ad,args:_0x1fea10}){const _0x4d4b39={'content':[{'type':'text','content':_0x3500ad}],'args':_0x1fea10},_0x3c780f=this['_sendApiRequest']('/actions/system/'+_0x575c6d+'/calls','POST',_0x4d4b39);return{'getStream':async()=>{const _0x168b64=(await _0x3c780f['request'])['body'];return this['_getStreamReader'](_0x168b64);},'abortController':_0x3c780f['abortController']};}['uploadFile'](_0x3ca699,_0x119c8d,_0x31fa32){const _0x1710f5=new FormData();_0x1710f5['append']('file',_0x119c8d,_0x119c8d['name']),_0x31fa32&&_0x1710f5['append']('attributes',JSON['stringify'](_0x31fa32));const _0x3cd565=this['_sendApiRequest']('/conversations/'+_0x3ca699+'/files','POST',_0x1710f5);return{'getId':async()=>(await _0x3cd565['request'])['json'](),'abortController':_0x3cd565['abortController']};}['fetchDocument'](_0x15eb0e,_0x3a9599){const _0x3bb5c4=this['_sendApiRequest']('/conversations/'+_0x15eb0e+'/documents/'+_0x3a9599,'GET');return{'getDocument':async()=>(await _0x3bb5c4['request'])['json'](),'abortController':_0x3bb5c4['abortController']};}['uploadDocument'](_0x3e623d,_0x54c3b5,_0x541997){const _0x3d9548={'content':_0x54c3b5};_0x541997&&(_0x3d9548['attributes']=_0x541997);const _0x421745=this['_sendApiRequest']('/conversations/'+_0x3e623d+'/documents','POST',_0x3d9548);return{'getId':async()=>(await _0x421745['request'])['json'](),'abortController':_0x421745['abortController']};}['fetchConversations'](_0x146797,_0x309c7f={}){const _0x2d634d=new URLSearchParams();_0x2d634d['append']('group',_0x146797),_0x2d634d['append']('excludeEmpty',!0x1!==_0x309c7f['excludeEmpty']?'true':'false'),_0x2d634d['append']('limit',_0x309c7f['limit']?_0x309c7f['limit']['toString']():'100'),_0x2d634d['append']('sortBy',_0x309c7f['sortBy']?_0x309c7f['sortBy']:'createdAt'),_0x2d634d['append']('order',_0x309c7f['order']?_0x309c7f['order']:'desc');const _0x514d34=this['_sendApiRequest']('/conversations?'+_0x2d634d['toString'](),'GET');return{'getConversations':async()=>{const _0x8d2104=await _0x514d34['request'];return(await _0x8d2104['json']())['items'];},'abortController':_0x514d34['abortController']};}['deleteConversation'](_0x148401){const _0x3b3e87=this['_sendApiRequest']('/conversations/'+_0x148401,'DELETE');return{'execute':async()=>{await _0x3b3e87['request'];},'abortController':_0x3b3e87['abortController']};}['updateConversation'](_0x155fcc,_0x55aa8f){const _0x5cc898=this['_sendApiRequest']('/conversations/'+_0x155fcc,'PATCH',_0x55aa8f);return{'getResult':async()=>(await _0x5cc898['request'],_0x55aa8f),'abortController':_0x5cc898['abortController']};}['fetchConversation'](_0xa85ea2){const _0x20648c=this['_sendApiRequest']('/conversations/'+_0xa85ea2,'GET');return{'getConversation':async()=>(await _0x20648c['request'])['json'](),'abortController':_0x20648c['abortController']};}['fetchConversationMessages'](_0x5b64b0){const _0x277eb4=this['_sendApiRequest']('/conversations/'+_0x5b64b0+'/messages','GET');return{'getMessages':async()=>{const _0x435b0b=await _0x277eb4['request'];return(await _0x435b0b['json']())['items'];},'abortController':_0x277eb4['abortController']};}['uploadUrl'](_0x31b64e,_0x56dde1,_0x2e81f8){const _0x22584c=this['_sendApiRequest']('/conversations/'+_0x31b64e+'/web-resources','POST',{'url':_0x56dde1,'attributes':_0x2e81f8});return{'getId':async()=>(await _0x22584c['request'])['json'](),'abortController':_0x22584c['abortController']};}['getModels'](_0x4444bd='en'){const _0x37b173=new URLSearchParams();_0x37b173['append']('language',_0x4444bd);const _0x57b3ed='/models/1?'+_0x37b173['toString'](),_0x2afcb7=this['_sendApiRequest'](_0x57b3ed,'GET');return{'list':async()=>await(await _0x2afcb7['request'])['json'](),'abortController':_0x2afcb7['abortController']};}['deleteFile'](_0x52e5ef,_0x293ef8){const _0x349861=this['_sendApiRequest']('/conversations/'+_0x52e5ef+'/files/'+_0x293ef8,'DELETE');return{'execute':async()=>{await _0x349861['request'];},'abortController':_0x349861['abortController']};}['deleteDocument'](_0x17867d,_0x37447d){const _0x2a73f3=this['_sendApiRequest']('/conversations/'+_0x17867d+'/documents/'+_0x37447d,'DELETE');return{'execute':async()=>{await _0x2a73f3['request'];},'abortController':_0x2a73f3['abortController']};}['deleteWebResource'](_0x2d66c0,_0x1680cb){const _0x4ceaa9=this['_sendApiRequest']('/conversations/'+_0x2d66c0+'/web-resources/'+_0x1680cb,'DELETE');return{'execute':async()=>{await _0x4ceaa9['request'];},'abortController':_0x4ceaa9['abortController']};}['callSystemReview']({reviewName:_0x5b2a5c,content:_0xcf862b,args:_0x33508a}){const _0x7b4fe9=this['_sendApiRequest']('/reviews/system/'+_0x5b2a5c+'/calls','POST',{'content':[{'type':'text','content':_0xcf862b}],'args':_0x33508a});return{'getStream':async()=>{const _0x4b186b=(await _0x7b4fe9['request'])['body'];return this['_getStreamReader'](_0x4b186b);},'abortController':_0x7b4fe9['abortController']};}['callCustomReview']({content:_0x1fd185,prompt:_0xf43d59,model:_0x9fc2f8}){const _0x59b342=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x1fd185}],'prompt':_0xf43d59,'model':_0x9fc2f8});return{'getStream':async()=>{const _0xfcae7=(await _0x59b342['request'])['body'];return this['_getStreamReader'](_0xfcae7);},'abortController':_0x59b342['abortController']};}['upsertAIChatRating'](_0x4a4743,_0x186622,_0x3d04cb){const _0x4f6d8c=this['_sendApiRequest']('/conversations/'+_0x4a4743+'/messages/'+_0x186622+'/ratings','PUT',{'positiveCount':_0x3d04cb['positiveCount'],'totalCount':_0x3d04cb['totalCount'],'modificationId':_0x3d04cb['modificationId']});return{'execute':async()=>{await _0x4f6d8c['request'];},'abortController':_0x4f6d8c['abortController']};}['upsertAIActionRating'](_0x51e2e9,_0x2572cb,_0x699aba){const _0x2fbcc0=this['_sendApiRequest']('/actions/system/'+_0x51e2e9+'/calls/'+_0x2572cb+'/ratings','PUT',{'positiveCount':_0x699aba['positiveCount'],'totalCount':_0x699aba['totalCount']});return{'execute':async()=>{await _0x2fbcc0['request'];},'abortController':_0x2fbcc0['abortController']};}['upsertCustomAIActionRating'](_0x2e690f,_0x1b7f18){const _0x5bb78b=this['_sendApiRequest']('/actions/custom/calls/'+_0x2e690f+'/ratings','PUT',{'positiveCount':_0x1b7f18['positiveCount'],'totalCount':_0x1b7f18['totalCount']});return{'execute':async()=>{await _0x5bb78b['request'];},'abortController':_0x5bb78b['abortController']};}['upsertAIReviewRating'](_0x6fdab6,_0x411f19,_0x2fae51,_0x4440c7){const _0x241a72=this['_sendApiRequest']('/reviews/system/'+_0x6fdab6+'/calls/'+_0x411f19+'/ratings','PUT',{'positiveCount':_0x2fae51['positiveCount'],'totalCount':_0x2fae51['totalCount'],'dataId':_0x4440c7});return{'execute':async()=>{await _0x241a72['request'];},'abortController':_0x241a72['abortController']};}['upsertCustomAIReviewRating'](_0x182ddd,_0x52bf6a,_0x2d0b09){const _0x4a7705=this['_sendApiRequest']('/reviews/custom/calls/'+_0x182ddd+'/ratings','PUT',{'positiveCount':_0x52bf6a['positiveCount'],'totalCount':_0x52bf6a['totalCount'],'dataId':_0x2d0b09});return{'execute':async()=>{await _0x4a7705['request'];},'abortController':_0x4a7705['abortController']};}['_sendApiRequest'](_0xba8730,_0xa21dda,_0x20a984){const _0x5f27ab=new AbortController(),_0x2a4eae=_0x20a984 instanceof FormData,_0x5b11e1={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x20a984&&!_0x2a4eae&&(_0x5b11e1['Content-Type']='application/json');const _0x50c934={'method':_0xa21dda,'headers':_0x5b11e1,'signal':_0x5f27ab['signal']};return _0x20a984&&(_0x50c934['body']=_0x2a4eae?_0x20a984:JSON['stringify'](_0x20a984)),{'request':fetch(''+this['_apiUrl']+_0xba8730,_0x50c934)['catch'](_0xb3d74=>{this['_handleError'](_0xb3d74);})['then'](_0x36015d=>_0x36015d['ok']?_0x36015d:_0x36015d['json']()['then'](_0x5b56b4=>{throw{'url':this['_apiUrl'],'path':_0xba8730,'method':_0xa21dda,'body':_0x20a984,'status':(_0x36015d||{})['status'],'statusText':(_0x36015d||{})['statusText'],'code':_0x5b56b4['code'],'message':_0x5b56b4['message'],'traceId':_0x5b56b4['traceId']};})),'abortController':_0x5f27ab};}async*['_getStreamReader'](_0x18fad4){const _0xe95cc6=[],_0x2c0d06=_0x18fad4['getReader'](),_0x4163f7=lt({'onError':_0x45d73a=>{this['_handleError'](_0x45d73a);},'onEvent':_0x53b023=>{_0x53b023['data']=JSON['parse'](_0x53b023['data']),_0xe95cc6['push'](_0x53b023);}});try{let _0x339be3=!0x1;for(;!_0x339be3;){const {done:_0x24558c,value:_0x517fc8}=await _0x2c0d06['read']();_0x24558c&&(_0x339be3=!0x0),_0x4163f7['feed'](this['_decoder']['decode'](_0x517fc8,{'stream':!0x0})),yield*_0xe95cc6,_0xe95cc6['length']=0x0;}}catch(_0x3bc947){this['_handleError'](_0x3bc947);}finally{_0x2c0d06['releaseLock'](),_0x4163f7['reset']();}}['_handleError'](_0x1063f8){if(_0x1063f8 instanceof _0x36ce55)throw _0x1063f8;if(_0x1063f8 instanceof Error&&'AbortError'===_0x1063f8['name'])throw new _0x36ce55('ai-request-aborted',this,{'originalError':_0x1063f8});throw new _0x36ce55('ai-request-failed',this,{'originalError':_0x1063f8});}}function m(_0x246496,_0x5fe68b,_0x3fd127){const t=_0x246496['t'];switch(_0x5fe68b){case'AI_SUGGESTION_HEADER_TITLE':return t({'id':'AI_SUGGESTION_HEADER_TITLE','string':'Proposed\x20changes'});case'AI_SUGGESTION_BUTTON_SHOW_CHANGES':return t({'id':'AI_SUGGESTION_BUTTON_SHOW_CHANGES','string':'Show\x20details'});case'AI_MINI_TOOLBAR_LIKE':return t({'id':'AI_MINI_TOOLBAR_LIKE','string':'I\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_DISLIKE':return t({'id':'AI_MINI_TOOLBAR_DISLIKE','string':'I\x20don\x27t\x20like\x20this\x20response'});case'AI_MINI_TOOLBAR_COPY':return t({'id':'AI_MINI_TOOLBAR_COPY','string':'Copy\x20to\x20clipboard'});case'AI_SUGGESTION_CONTENT_PART_TITLE':return t({'id':'AI_SUGGESTION_CONTENT_PART_TITLE','string':'Change\x20%0'},_0x3fd127);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi!\x20I\x20can\x20help\x20you\x20draft,\x20rewrite,\x20and\x20improve\x20your\x20text,\x20explore\x20ideas,\x20research\x20topics,\x20and\x20solve\x20problems.\x20How\x20can\x20I\x20help\x20right\x20now?'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x3fd127);case'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES','string':'Unable\x20to\x20load\x20resources\x20from\x20%0.\x20Please\x20try\x20again.'},_0x3fd127);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x3fd127);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0x3fd127);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x3fd127);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x3fd127);case'AI_CHAT_MODEL_SELECTOR_GROUP':return t({'id':'AI_CHAT_MODEL_SELECTOR_GROUP','string':'Models'});case'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP','string':'Select\x20a\x20model'});case'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP','string':'Start\x20a\x20new\x20conversation\x20to\x20change\x20the\x20model'});case'AI_CHAT_CAPABILITIES_YES':return t({'id':'AI_CHAT_CAPABILITIES_YES','string':'Yes'});case'AI_CHAT_CAPABILITIES_NO':return t({'id':'AI_CHAT_CAPABILITIES_NO','string':'No'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT','string':'The\x20selected\x20model\x20is\x20no\x20longer\x20available,\x20so\x20you\x20cannot\x20continue\x20this\x20conversation.\x20Please\x20'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON','string':'start\x20a\x20new\x20one.'});case'AI_CHAT_CONTEXT_SOURCES_LABEL':return t({'id':'AI_CHAT_CONTEXT_SOURCES_LABEL','string':'Sources'});case'AI_CHAT_HISTORY_HEADING':return t({'id':'AI_CHAT_HISTORY_HEADING','string':'Chat\x20History'});case'AI_CHAT_HISTORY_SEARCH_LABEL':return t({'id':'AI_CHAT_HISTORY_SEARCH_LABEL','string':'Search\x20history'});case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY','string':'No\x20chats\x20were\x20found\x20matching\x20\x22%0\x22.'},_0x3fd127);case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY','string':'Please\x20try\x20a\x20different\x20phrase\x20or\x20check\x20the\x20spelling.'});case'AI_CHAT_HISTORY_EMPTY_MESSAGE':return t({'id':'AI_CHAT_HISTORY_EMPTY_MESSAGE','string':'Your\x20chat\x20history\x20for\x20current\x20document\x20will\x20appear\x20here.'});case'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON':return t({'id':'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON','string':'Go\x20to\x20chat'});case'AI_CHAT_HISTORY_PIN_BUTTON':return t({'id':'AI_CHAT_HISTORY_PIN_BUTTON','string':'Pin'});case'AI_CHAT_HISTORY_SHOW_MORE_ITEMS':return t({'id':'AI_CHAT_HISTORY_SHOW_MORE_ITEMS','string':'Show\x20more\x20items'});case'AI_CHAT_HISTORY_EDIT_NAME':return t({'id':'AI_CHAT_HISTORY_EDIT_NAME','string':'Edit\x20name'});case'AI_CHAT_HISTORY_REMOVE':return t({'id':'AI_CHAT_HISTORY_REMOVE','string':'Remove'});case'AI_CHAT_HISTORY_REMOVE_CONFIRM':return t({'id':'AI_CHAT_HISTORY_REMOVE_CONFIRM','string':'Do\x20you\x20want\x20to\x20remove\x20this\x20chat?'});case'AI_CHAT_HISTORY_ACCEPT':return t({'id':'AI_CHAT_HISTORY_ACCEPT','string':'Accept'});case'AI_CHAT_HISTORY_CANCEL':return t({'id':'AI_CHAT_HISTORY_CANCEL','string':'Cancel'});case'AI_CHAT_HISTORY_LOADING_REMOVING':return t({'id':'AI_CHAT_HISTORY_LOADING_REMOVING','string':'Removing\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_RENAMING':return t({'id':'AI_CHAT_HISTORY_LOADING_RENAMING','string':'Renaming\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_PINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_PINNING','string':'Pinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_LOADING_UNPINNING':return t({'id':'AI_CHAT_HISTORY_LOADING_UNPINNING','string':'Unpinning\x20the\x20chat...'});case'AI_CHAT_HISTORY_CATEGORY_PINNED':return t({'id':'AI_CHAT_HISTORY_CATEGORY_PINNED','string':'Pinned'});case'AI_CHAT_HISTORY_CATEGORY_TODAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_TODAY','string':'Today'});case'AI_CHAT_HISTORY_CATEGORY_YESTERDAY':return t({'id':'AI_CHAT_HISTORY_CATEGORY_YESTERDAY','string':'Yesterday'});case'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS','string':'Last\x2014\x20days'});case'AI_CHAT_HISTORY_CATEGORY_LATER':return t({'id':'AI_CHAT_HISTORY_CATEGORY_LATER','string':'Later'});case'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE','string':'Failed\x20to\x20change\x20the\x20\x22%0\x22\x20chat\x20name.\x20Please\x20try\x20again\x20later.'},_0x3fd127);case'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED','string':'Failed\x20to\x20%0\x20the\x20\x22%1\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0x3fd127);case'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM':return t({'id':'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM','string':'Failed\x20to\x20delete\x20the\x20\x22%0\x22\x20chat.\x20Please\x20try\x20again\x20later.'},_0x3fd127);case'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS':return t({'id':'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS','string':'Failed\x20to\x20load\x20the\x20chat\x20history.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_ERROR_GENERIC':return t({'id':'AI_CHAT_HISTORY_ERROR_GENERIC','string':'Something\x20went\x20wrong.\x20Please\x20try\x20again\x20later.'});case'AI_CHAT_HISTORY_PIN_ACTION':return t({'id':'AI_CHAT_HISTORY_PIN_ACTION','string':'pin'});case'AI_CHAT_HISTORY_UNPIN_ACTION':return t({'id':'AI_CHAT_HISTORY_UNPIN_ACTION','string':'unpin'});case'AI_BALLOON_HEADER_TITLE':return t({'id':'AI_BALLOON_HEADER_TITLE','string':'Change\x20%0'},_0x3fd127);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x3fd127);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE','string':'This\x20conversation\x20is\x20loaded\x20from\x20chat\x20history\x20from\x20a\x20previous\x20session,\x20so\x20you\x20can’t\x20apply,\x20reject,\x20or\x20suggest\x20changes.'});case'AI_SUGGESTION_DISABLED_FEED_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_FEED_MESSAGE','string':'Actions\x20aren’t\x20available\x20for\x20changes\x20from\x20a\x20previous\x20session.'});default:return _0x5fe68b;}}function Cs(_0x5a1ff8,_0x175717){const _0x4639e6=new _0x494e59(_0x5a1ff8),_0x246a90=m(_0x5a1ff8,'AI_TABS_LABEL_MINIMIZE'),_0x490810=m(_0x5a1ff8,'AI_TABS_LABEL_MAXIMIZE');return _0x4639e6['set']({'withText':!0x1,'icon':_0x5720fd,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0x4639e6['bind']('label')['to'](_0x175717,'isMaximized',_0x5ae413=>_0x5ae413?_0x246a90:_0x490810),_0x4639e6['bind']('icon')['to'](_0x175717,'isMaximized',_0x36a442=>_0x36a442?_0x42cf63:_0x5720fd),_0x4639e6['bind']('isOn')['to'](_0x175717,'isMaximized'),_0x4639e6['on']('execute',()=>{_0x175717['fire']('resizeTabs');}),_0x4639e6;}function He(_0x3cd8d5){return _0x4367e1(_0x3cd8d5);}function Y(_0x3c35fe){return _0x32bc88(_0x3c35fe);}function Z(_0x1ba6a6,_0x108af8,_0x121763){const _0x520837=null!==_0x108af8?_0x346c38=>_0x346c38['attribs'][_0x1ba6a6]===_0x108af8:_0x223cf4=>Boolean(_0x223cf4['attribs'][_0x1ba6a6]);return _0x1f6293(_0x579e48=>_0x89e9ec(_0x579e48)&&_0x520837(_0x579e48),_0x121763);}function Ye(_0x270884,_0x51b930,_0x200e1e){const _0x102f99=null!==_0x51b930?_0x4ffb70=>_0x4ffb70['attribs'][_0x270884]===_0x51b930:_0x4df5c7=>Boolean(_0x4df5c7['attribs'][_0x270884]);return _0x5ad999(_0x4c5884=>_0x89e9ec(_0x4c5884)&&_0x102f99(_0x4c5884),_0x200e1e);}function q(_0x42f81c,_0x31062b){return _0x42f81c&&_0x89e9ec(_0x42f81c)?_0x42f81c['attribs'][_0x31062b]:null;}function Qi(_0x4b2983,_0x11353e,_0x4aa750){_0x89e9ec(_0x4b2983)&&(null===_0x4aa750?delete _0x4b2983['attribs'][_0x11353e]:_0x4b2983['attribs'][_0x11353e]=_0x4aa750);}function Ui(_0x271a57,_0x1fa124,_0x2cc157){const _0x10e865=_0x1fa124['cloneNode'](!0x0);'beforebegin'===_0x2cc157?_0x538e3b(_0x271a57,_0x10e865):'afterbegin'===_0x2cc157?_0x152e2b(_0x271a57,_0x10e865):'beforeend'===_0x2cc157?_0x3fcfc5(_0x271a57,_0x10e865):'afterend'===_0x2cc157&&_0x450256(_0x271a57,_0x10e865);}function qe(_0x4118b3){const _0x5c45df=[];let _0x3a99a4=_0x4118b3;for(;_0x3a99a4;)_0x3a99a4=_0x432450(_0x3a99a4),_0x3a99a4&&_0x5c45df['push'](_0x3a99a4);return _0x5c45df;}function Jn(_0x114b5a){return _0x114b5a['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function $i(_0x58dc2e){let _0x2e6d6a=0x0;for(;_0x58dc2e['parentNode'];)_0x58dc2e=_0x58dc2e['parentNode'],_0x2e6d6a++;return _0x2e6d6a;}function Es(_0x4f8231){const _0x415e62=[];let _0x38d5ea=_0x4f8231['nextSibling'];for(;_0x38d5ea;)_0x415e62['push'](_0x38d5ea),_0x38d5ea=_0x38d5ea['nextSibling'];_0x415e62['forEach'](_0x54ddb7=>{_0x53f32a(_0x54ddb7);});}class Ke extends/* #__PURE__ -- @preserve */
25
+ Vt(){['_m2html'];constructor(){super(),this['_m2html']=new _0x15a481();}['convertMarkdownToHTML'](_0x4a6223){const _0x821a1f=this['_m2html']['parse'](_0x4a6223);return this['parseAndNormalizeHTML'](_0x821a1f);}['parseAndNormalizeHTML'](_0x35fa75){return this['_parseHTML'](_0x35fa75);}['_parseHTML'](_0x535091){const _0x28fee8=He('<dummy>'+_0x535091['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x28fee8['children']=_0x28fee8['children'][0x0]['children'],_0x28fee8;}}class Qe extends/* #__PURE__ -- @preserve */
26
+ Vt(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x3aeedf){super(),this['_generateUid']=_0x3aeedf||_0x5ee109;}['merge'](_0x1465c4,_0x35860e,_0x13369b){const _0x3226d9=_0x1465c4['cloneNode'](!0x0);if(0x0===_0x35860e['childNodes']['length']){const _0x19eb5f=[];return Ye('data-id','new-element',_0x3226d9)['forEach'](_0x2b3975=>{const _0x3397cb=this['_generateUid']();Qi(_0x2b3975,'data-id',_0x3397cb),_0x19eb5f['push'](_0x3397cb);}),this['_removeSpecialComments'](_0x3226d9),{'parsedContent':_0x3226d9,'newNodeIds':_0x19eb5f,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x13369b&&_0x13369b['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x3226d9),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ye('data-id',null,_0x35860e)['map'](_0x23a69c=>q(_0x23a69c,'data-id'))['filter'](_0x5ead62=>!!_0x5ead62));let _0x8fdd52=-0x1,_0x2026a0=!0x1;const _0x347605=_0x3226d9['childNodes'],_0x5ac590=Array['from'](_0x347605)['filter'](_0x2a63df=>!(0x3===_0x2a63df['nodeType']&&''===Y(_0x2a63df)['trim']())),_0x28eca0=_0x5ac590['length'];for(let _0x674fb1=0x0;_0x674fb1<_0x28eca0;_0x674fb1++){const _0x58d1a2=_0x5ac590[_0x674fb1],_0x1309e7=_0x5ac590[_0x674fb1+0x1];if(this['_isNewNode'](_0x58d1a2)){if(-0x1===_0x8fdd52&&(_0x8fdd52=_0x674fb1),this['_markWrappedElements'](_0x58d1a2),!this['_isNewNode'](_0x1309e7)){const [_0x131191,_0x28880b]=this['_findReferenceNode'](_0x58d1a2,_0x2026a0,_0x35860e);if(_0x131191){const _0x1cfee3=Array['from'](_0x5ac590)['slice'](_0x8fdd52,_0x674fb1+0x1);this['_insertNodes'](_0x131191,_0x1cfee3,_0x28880b),_0x8fdd52=-0x1;}}}else{if(this['_isExistingContentComment'](_0x58d1a2))_0x2026a0=!0x0;else{if(this['_isExistingNode'](_0x58d1a2)){const _0x528b64=q(_0x58d1a2,'data-id');if(_0x528b64&&this['_existingDataIds']['has'](_0x528b64)){const _0x3ea4a7=Z('data-id',_0x528b64,_0x35860e);this['_replaceNode'](_0x3ea4a7,_0x58d1a2);}if(this['_touchedNodesState']['removedIds']['includes'](_0x528b64)){const _0x1ebf5d=this['_touchedNodesState']['removedIds']['indexOf'](_0x528b64);this['_touchedNodesState']['removedIds']['splice'](_0x1ebf5d,0x1);}}else{if(this['_isDelNode'](_0x58d1a2)){const _0x10aeb3=q(_0x58d1a2,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x10aeb3)||this['_storeDeletedElementIds'](_0x58d1a2);}}}}}for(const _0x416c38 of this['_touchedNodesState']['removedIds']){const _0x4137ce=Z('data-id',_0x416c38,_0x35860e);if(_0x4137ce){if(_0x13369b&&_0x13369b['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x416c38;const _0xc14944=_0x13369b['replaceRemovedWith']['cloneNode'](!0x0);Qi(_0xc14944,'data-id',_0x416c38),Qi(_0xc14944,'data-removed','true'),_0x38243b(_0x4137ce,_0xc14944);}else _0x53f32a(_0x4137ce);}}if(Ye('data-wrapped-id',null,_0x35860e)['forEach'](_0x24b5f0=>{const _0x304078=Z('data-id',q(_0x24b5f0,'data-wrapped-id'),_0x35860e);var _0x80b018,_0x3f20ad;_0x304078&&(_0x3f20ad=_0x24b5f0,_0x53f32a(_0x80b018=_0x304078),_0x38243b(_0x3f20ad,_0x80b018));}),Ye('data-id','new-element',_0x35860e)['forEach'](_0x1fc30d=>{const _0x3ca0cb=this['_getUid'](_0x1fc30d);Qi(_0x1fc30d,'data-id',_0x3ca0cb),this['_touchedNodesState']['newIds']['push'](_0x3ca0cb);}),this['_removeSpecialComments'](_0x35860e),_0x13369b&&_0x13369b['markUnstableElements']&&this['_markUnstableElements'](_0x35860e,_0x13369b['markUnstableElementsDepth']||0x0),_0x13369b&&_0x13369b['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x251db8=Z('data-id',this['_touchedNodesState']['lastTouchedId'],_0x35860e);for(;_0x251db8;)Es(_0x251db8),_0x251db8=_0x251db8['parentNode'];}return{'parsedContent':_0x35860e,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x4f7ce4,_0x1e3c9a,_0x19f7a3){for(const _0x2a3d66 of _0x1e3c9a){const _0x462937=this['_getUid'](_0x2a3d66);Qi(_0x2a3d66,'data-id',_0x462937),this['_touchedNodesState']['newIds']['push'](_0x462937),this['_touchedNodesState']['lastTouchedId']=_0x462937;}const _0x1b7f38='afterbegin'===_0x19f7a3||'afterend'===_0x19f7a3?_0x1e3c9a['reverse']():_0x1e3c9a;for(const _0x2082f0 of _0x1b7f38)Ui(_0x4f7ce4,_0x2082f0,_0x19f7a3);}['_replaceNode'](_0x197906,_0x219037){if(!_0x197906)return;if(_0x3beafb=_0x219037,Jn(Y(_0x197906))===Jn(Y(_0x3beafb)))return;var _0x3beafb;const _0x485dc8=this['_getUid'](_0x197906);Qi(_0x219037,'data-id',_0x485dc8),this['_touchedNodesState']['modifiedIds']['push'](_0x485dc8),this['_touchedNodesState']['lastTouchedId']=_0x485dc8,_0x38243b(_0x197906,_0x219037['cloneNode'](!0x0));}['_findReferenceNode'](_0x1a474,_0x7aad92,_0x589215){const _0x723be1=this['_findPrevElementWithDataId'](_0x1a474,!0x1);if(_0x723be1){const _0x2ed67a=this['_getNodeDataId'](_0x723be1),_0x47ce11=Z('data-id',_0x2ed67a,_0x589215);if(_0x47ce11)return[_0x47ce11,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x2ed67a);}const _0x2b19a7=this['_findNextElementWithDataId'](_0x1a474,!0x1);if(_0x2b19a7){const _0xb0a420=this['_getNodeDataId'](_0x2b19a7),_0x52819b=Z('data-id',_0xb0a420,_0x589215);if(_0x52819b)return[_0x52819b,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0xb0a420);}return _0x7aad92?_0x1a474['nextSibling']?this['_findFallbackReferenceNode'](_0x1a474,_0x589215):[_0x589215['childNodes'][_0x589215['childNodes']['length']-0x1],'afterend']:[_0x589215['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x17ac22,_0x19b9a5){const _0x154225=[],_0x484336=this['_findPrevElementWithDataId'](_0x17ac22,!0x0);if(_0x484336){const _0xefe3a4=Z('data-id',this['_getNodeDataId'](_0x484336),_0x19b9a5);_0xefe3a4&&_0x154225['push']([_0xefe3a4,'afterend']);}const _0x4c7240=this['_findNextElementWithDataId'](_0x17ac22,!0x0);if(_0x4c7240){const _0x3fd09f=Z('data-id',this['_getNodeDataId'](_0x4c7240),_0x19b9a5);_0x3fd09f&&_0x154225['push']([_0x3fd09f,'beforebegin']);}if(_0x154225['length']>0x1)return $i(_0x154225[0x0][0x0])<=$i(_0x154225[0x1][0x0])?_0x154225[0x0]:_0x154225[0x1];return 0x1===_0x154225['length']?_0x154225[0x0]:[_0x19b9a5['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x53e6e9,_0x9d787c){let _0x22c2e5=_0x53e6e9['nextSibling'],_0x586f3=null,_0x3fe252=!0x1;for(;_0x22c2e5;){if(_0x4d6dc4(_0x22c2e5)){if(this['_isDelNode'](_0x22c2e5)&&(_0x586f3=_0x22c2e5),this['_isExistingContentComment'](_0x22c2e5)&&_0x9d787c&&!_0x3fe252){_0x3fe252=!0x0,_0x22c2e5=_0x22c2e5['nextSibling'];continue;}break;}const _0x5c2ad6=q(_0x22c2e5,'data-id');if(_0x5c2ad6&&'new-element'!==_0x5c2ad6&&this['_existingDataIds']['has'](_0x5c2ad6)){_0x586f3=_0x22c2e5;break;}_0x22c2e5=_0x22c2e5['nextSibling'];}return _0x586f3;}['_findPrevElementWithDataId'](_0x3d912e,_0x20e01f){let _0x482955=_0x3d912e['previousSibling'],_0x4d2b55=null,_0x4fbfcf=!0x1;for(;_0x482955;){if(_0x4d6dc4(_0x482955)){if(this['_isDelNode'](_0x482955)&&(_0x4d2b55=_0x482955),this['_isExistingContentComment'](_0x482955)&&_0x20e01f&&!_0x4fbfcf){_0x4fbfcf=!0x0,_0x482955=_0x482955['previousSibling'];continue;}break;}const _0x943ae=q(_0x482955,'data-id');if(_0x943ae&&'new-element'!==_0x943ae&&this['_existingDataIds']['has'](_0x943ae)){_0x4d2b55=_0x482955;break;}_0x482955=_0x482955['previousSibling'];}return _0x4d2b55;}['_markWrappedElements'](_0x2602de){_0x89e9ec(_0x2602de)&&Ye('data-id',null,_0x2602de)['forEach'](_0x5835db=>{this['_isExistingNode'](_0x5835db)&&!this['_hasWrappedParent'](_0x5835db)&&(Qi(_0x5835db,'data-wrapped-id',q(_0x5835db,'data-id')),Qi(_0x5835db,'data-id',null));});}['_getNodeDataId'](_0x2d3b71){if(!_0x2d3b71)return null;if(_0x89e9ec(_0x2d3b71))return q(_0x2d3b71,'data-id');if(_0x4d6dc4(_0x2d3b71)){const _0x172478=Y(_0x2d3b71)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x172478&&_0x172478[0x1])return _0x172478[0x1];}return null;}['_storeDeletedElementIds'](_0x25988b){if(_0x4d6dc4(_0x25988b)){const _0x2fe371=Y(_0x25988b)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x2fe371&&_0x2fe371[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x2fe371[0x1]);}}['_getUid'](_0x44bda3){return this['_isExistingNode'](_0x44bda3)?q(_0x44bda3,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x461035){(function(_0x2066fd){return _0x244cf7(_0x23b21d=>_0x4d6dc4(_0x23b21d),_0x2066fd,!0x0,0x1/0x0);}(_0x461035)['filter'](_0x5ede7f=>this['_isDelNode'](_0x5ede7f)||this['_isExistingContentComment'](_0x5ede7f))['forEach'](_0x54b3a0=>{_0x53f32a(_0x54b3a0);}));}['_markLastTagElementUnstable'](_0x400d03){const _0x332f28=_0x400d03['childNodes'],_0x420232=_0x332f28[_0x332f28['length']-0x1];_0x420232&&_0x89e9ec(_0x420232)&&Qi(_0x420232,'data-unstable','true');}['_markUnstableElements'](_0x15536a,_0x121d6d){const _0x35f7e2=Z('data-unstable','true',_0x15536a);if(!_0x35f7e2)return;const _0x34b89c=qe(_0x35f7e2)['slice'](0x0,-0x1),_0x16e641=_0x34b89c['length'];let _0x14ee17=_0x35f7e2;if(_0x16e641>_0x121d6d){let _0x57ce93=_0x16e641,_0x4f5814=null;for(;_0x57ce93>_0x121d6d&&_0x57ce93>=0x0;)_0x57ce93--,_0x4f5814=_0x34b89c[_0x57ce93];_0x4f5814&&(_0x14ee17=_0x4f5814,Qi(_0x35f7e2,'data-unstable',null),Qi(_0x4f5814,'data-unstable','true'));}else{if(_0x16e641<_0x121d6d){let _0xaf6ab3=_0x16e641,_0x24307e=_0x35f7e2;for(;_0xaf6ab3<_0x121d6d;){const _0x5995f6=_0x24307e['childNodes']['filter'](_0x181fbb=>_0x89e9ec(_0x181fbb));if(0x0===_0x5995f6['length'])break;_0xaf6ab3++,_0x24307e=_0x5995f6[_0x5995f6['length']-0x1];}_0x24307e&&(_0x14ee17=_0x24307e,Qi(_0x35f7e2,'data-unstable',null),Qi(_0x24307e,'data-unstable','true'));}}let _0x21804f=_0x14ee17;for(;_0x21804f;){for(;_0x21804f['nextSibling'];)_0x21804f=_0x21804f['nextSibling'],_0x89e9ec(_0x21804f)&&Qi(_0x21804f,'data-unstable','true');_0x21804f=_0x21804f['parentNode'];}}['_isNewNode'](_0x26aadc){return Boolean('new-element'===q(_0x26aadc,'data-id'));}['_isExistingNode'](_0x427bc4){return Boolean((q(_0x427bc4,'data-id')||'')['length']>0x0&&'new-element'!==q(_0x427bc4,'data-id'));}['_isDelNode'](_0x370971){return!!_0x370971&&Boolean(_0x4d6dc4(_0x370971)&&Y(_0x370971)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x5d86ca){let _0x520f0a=_0x5d86ca['parentNode'];for(;_0x520f0a;){if(q(_0x520f0a,'data-wrapped-id'))return!0x0;_0x520f0a=_0x520f0a['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x54773b){return Boolean(_0x4d6dc4(_0x54773b)&&Y(_0x54773b)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function f({editor:_0x572959,changeGroups:_0x247c28,documentContextContent:_0x20a9c5,showDiff:_0x1604f7,trimUnchanged:_0x4f5479=!0x0}){return _0x247c28['map'](_0x1736e7=>{const _0x5e22f4=new _0x1ebbd3([]),_0x46135c=new _0x1ebbd3([]);for(const _0x59b112 of _0x1736e7['changes'])if(_0x1604f7&&'removed'==_0x59b112['type']||_0x46135c['children']['push'](_0x59b112['node']['cloneNode'](!0x0)),'new'!=_0x59b112['type']&&(_0x1604f7||'removed'!=_0x59b112['type'])){const _0x35e097=_0x1f6293(_0xda27f4=>q(_0xda27f4,'data-id')==_0x59b112['id'],_0x20a9c5,!0x0);_0x35e097&&_0x5e22f4['children']['push'](_0x35e097['cloneNode'](!0x0));}const {content:_0xbc61f2,hasChanges:_0x91f425}=function(_0x5b2592,_0x440da3,_0x28eeb9,_0x532366,_0x5e95ed=!0x0){const _0x2285a3=_0x5b2592['plugins']['get']('DocumentCompare'),_0x347b16=Y(_0x440da3),_0x131af7=Y(_0x28eeb9),_0x3d06cd=_0x5b2592['data']['parse'](_0x347b16,'$root'),_0x10d73e=_0x5b2592['model']['createPositionAt'](_0x3d06cd,0x0),_0x5bcc50=_0x2285a3['getDiff'](_0x347b16,_0x131af7,{'anchor':_0x10d73e,'markDeletions':_0x532366}),_0x407421=_0x5bcc50['getOperations']();if(0x0==_0x407421['length'])return{'content':_0x440da3['cloneNode'](!0x0),'hasChanges':!0x1};_0x532366?function(_0x1e162c,_0x2613a7,_0x189ea6){if(0x0==_0x1e162c['length'])return;const _0x1bca4c=_0x189ea6['plugins']['get']('DocumentCompare'),_0x259c81=_0x189ea6['plugins']['get']('SuggestionsConversion');_0x189ea6['model']['change'](_0x202fec=>{const _0x39780e=new Set();for(let _0x1243ca=0x0;_0x1243ca<_0x1e162c['length'];_0x1243ca++){const _0x42db1b=_0x1e162c[_0x1243ca];if(_0x42db1b['baseVersion']=null,_0x42db1b['isDocumentOperation']=!0x1,_0x1bca4c['isMarkedRemoveOperation'](_0x42db1b)){const _0x3aef38=_0xd141a6(_0x42db1b['newRange'],_0x189ea6['model']),_0x4de8b7='suggestion:deletion:'+_0x5ee109()+':$aiSuggestion';_0x2613a7['markers']['set'](_0x4de8b7,_0x3aef38);}else switch(_0x42db1b['type']){case'rename':{if(_0x42db1b['oldName']==_0x42db1b['newName'])break;_0x202fec['batch']['addOperation'](_0x42db1b),_0x189ea6['model']['applyOperation'](_0x42db1b);const _0x3b6cd3='$elementName',_0x3a018d=_0x42db1b['position'],_0x51a13f=_0x189ea6['model']['createRange'](_0x3a018d,_0x189ea6['model']['createPositionAt'](_0x3a018d['nodeAfter'],'end')),_0x53230b='suggestion:attribute:'+_0x3b6cd3+':'+_0x5ee109()+':$aiSuggestion';_0x2613a7['markers']['set'](_0x53230b,_0x51a13f);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x42db1b['oldValue']==_0x42db1b['newValue'])break;_0x202fec['batch']['addOperation'](_0x42db1b),_0x189ea6['model']['applyOperation'](_0x42db1b);const _0x592d9f=_0x42db1b['key'];if(!_0x259c81['isRegisteredAttribute'](_0x592d9f))break;const _0x117ed0=_0xd141a6(_0x42db1b['range'],_0x189ea6['model']),_0x479d61='suggestion:attribute:'+_0x592d9f+':'+_0x5ee109()+':$aiSuggestion';_0x2613a7['markers']['set'](_0x479d61,_0x117ed0);break;}case'insert':{_0x202fec['batch']['addOperation'](_0x42db1b),_0x189ea6['model']['applyOperation'](_0x42db1b);if(_0x1e162c[_0x1243ca+0x1]&&'move'==_0x1e162c[_0x1243ca+0x1]['type']){no(_0x2613a7,_0x42db1b);break;}const _0x319dbd=_0x42db1b['position'],_0x19bdcc=_0x42db1b['howMany'],_0x356b7d=_0xd141a6(_0x189ea6['model']['createRange'](_0x319dbd,_0x319dbd['getShiftedBy'](_0x19bdcc)),_0x189ea6['model']),_0x138542='suggestion:insertion:'+_0x5ee109()+':$aiSuggestion';_0x2613a7['markers']['set'](_0x138542,_0x356b7d);break;}case'split':{_0x202fec['batch']['addOperation'](_0x42db1b),_0x189ea6['model']['applyOperation'](_0x42db1b);const _0xab8eb8=_0x42db1b['splitPosition'],_0x583045=_0x42db1b['moveTargetPosition'],_0x100118=_0x189ea6['model']['createRange'](_0xab8eb8,_0x583045),_0xdbe5a3='suggestion:insertion:'+_0x5ee109()+':$aiSuggestion';_0x2613a7['markers']['set'](_0xdbe5a3,_0x100118);break;}case'move':{_0x202fec['batch']['addOperation'](_0x42db1b),_0x189ea6['model']['applyOperation'](_0x42db1b),_0x1e162c[_0x1243ca-0x1]&&'insert'==_0x1e162c[_0x1243ca-0x1]['type']&&no(_0x2613a7,_0x42db1b);const _0x2cd499=_0x42db1b['getMovedRangeStart'](),_0x23d7cb=_0x42db1b['howMany'];for(let _0x5d82b2=0x0;_0x5d82b2<_0x23d7cb;_0x5d82b2++){const _0x499b00=_0x2cd499['getShiftedBy'](_0x5d82b2)['nodeAfter'];_0x39780e['add'](_0x499b00);}break;}case'remove':{const _0x34e428=_0x42db1b['sourcePosition'],_0x1a91b6=_0x42db1b['howMany'],_0x1739c4=new _0x1f3d0d(_0x34e428,_0x1a91b6);_0x202fec['batch']['addOperation'](_0x1739c4),_0x189ea6['model']['applyOperation'](_0x1739c4);break;}}}for(const _0x45c5dd of _0x39780e){const _0x5a5f95=_0x189ea6['model']['createRangeOn'](_0x45c5dd),_0x3060aa='suggestion:formatBlock:$fakeWrap:'+_0x5ee109()+':$aiSuggestion';_0x2613a7['markers']['set'](_0x3060aa,_0xd141a6(_0x5a5f95,_0x189ea6['model']));}});}(_0x407421,_0x3d06cd,_0x5b2592):_0x5b2592['model']['change'](_0x1a11f7=>{for(const _0x3df065 of _0x407421)if('remove'==_0x3df065['type']){const _0x5441a6=_0x3df065['sourcePosition'],_0x1e04ff=_0x3df065['howMany'],_0x5822b9=new _0x1f3d0d(_0x5441a6,_0x1e04ff);_0x1a11f7['batch']['addOperation'](_0x5822b9),_0x5b2592['model']['applyOperation'](_0x5822b9);}else{if('marker'==_0x3df065['type']){const _0x185ec0=_0x3df065['name'],_0x40d23c=_0x3df065['newRange'];null!==_0x40d23c?_0x3d06cd['markers']['set'](_0x185ec0,_0x40d23c):_0x3d06cd['markers']['delete'](_0x185ec0);}else _0x3df065['baseVersion']=null,_0x3df065['isDocumentOperation']=!0x1,_0x1a11f7['batch']['addOperation'](_0x3df065),_0x5b2592['model']['applyOperation'](_0x3df065);}});if(_0x5e95ed){const _0x62790e=W(_0x5b2592,_0x407421,_0x3d06cd);G(_0x5b2592['model'],_0x62790e),function(_0xc6e9b0,_0x37603f){const _0x212e37=_0x37603f['getFirstRange']()['start'];let _0x426bd7=_0x37603f['getFirstRange']()['end'];const _0x24addc=_0x212e37['root'];(_0x426bd7['textNode']||_0x426bd7['nodeAfter']&&_0x426bd7['nodeAfter']['is']('$text'))&&(_0x2d5726(_0x426bd7,'...'),_0x426bd7=_0x426bd7['getShiftedBy'](0x3)),(_0x212e37['textNode']||_0x212e37['nodeBefore']&&_0x212e37['nodeBefore']['is']('$text'))&&(_0x2d5726(_0x212e37,'...'),function(_0x493dcb,_0x3de78b,_0x73deeb){for(let [_0x3f519a,_0x466e5f]of _0x493dcb['markers']){const _0xdfed10=_0x466e5f['_getTransformedByInsertion'](_0x3de78b,_0x73deeb,!0x1);_0x466e5f=_0xdfed10[0x0],_0x493dcb['markers']['set'](_0x3f519a,_0x466e5f);}}(_0x24addc,_0x212e37,0x3),_0x212e37['parent']==_0x426bd7['parent']&&(_0x426bd7=_0x426bd7['getShiftedBy'](0x3)));const _0x513a2d=_0xc6e9b0['createRange'](_0xc6e9b0['createPositionAt'](_0x24addc,0x0),_0x212e37),_0x1d4625=_0xc6e9b0['createRange'](_0x426bd7,_0xc6e9b0['createPositionAt'](_0x24addc,'end')),_0x184351=[..._0x513a2d['getMinimalFlatRanges'](),..._0x1d4625['getMinimalFlatRanges']()];_0x184351['reverse']();for(const _0x3628c1 of _0x184351)to(_0x3628c1),Zn(_0x24addc,_0x3628c1);}(_0x5b2592['model'],_0x62790e);}const _0x2d709b=_0x5b2592['data']['stringify'](_0x3d06cd,{'showSuggestionHighlights':!0x0});return{'content':He(_0x2d709b),'hasChanges':!0x0};}(_0x572959,_0x5e22f4,_0x46135c,_0x1604f7,_0x4f5479);return{'type':_0x1736e7['changes'][0x0]['type'],'index':_0x1736e7['index'],'content':_0xbc61f2,'hasChanges':_0x91f425};});}function no(_0x3b0462,_0x197b18){for(const [_0x3e11de,_0x31924e]of _0x3b0462['markers']){const _0x328265=_0xa8a41e['_createFromRanges'](_0x31924e['getTransformedByOperation'](_0x197b18));_0x3b0462['markers']['set'](_0x3e11de,_0x328265);}}function W(_0x3d5da7,_0x26d810,_0x5089c8){const _0x4b4c4e=_0x3d5da7['plugins']['get']('DocumentCompare');let _0x4e6086=_0x3d5da7['model']['createPositionAt'](_0x5089c8,Number['POSITIVE_INFINITY']),_0x3e4e58=_0x3d5da7['model']['createPositionAt'](_0x5089c8,0x0);for(const _0x4522b4 of _0x26d810){let _0x2be324,_0x11aa7d;if(_0x4b4c4e['isMarkedRemoveOperation'](_0x4522b4))_0x2be324=_0x4522b4['newRange']['start'],_0x11aa7d=_0x4522b4['newRange']['end'];else switch(_0x4e6086=_0x4e6086['getTransformedByOperation'](_0x4522b4),_0x3e4e58=_0x3e4e58['getTransformedByOperation'](_0x4522b4),_0x4522b4['type']){case'rename':_0x2be324=_0x4522b4['position'],_0x11aa7d=_0x2be324['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x2be324=_0x4522b4['range']['start'],_0x11aa7d=_0x4522b4['range']['end'];break;case'insert':_0x2be324=_0x4522b4['position'],_0x11aa7d=_0x2be324['getShiftedBy'](_0x4522b4['howMany']);break;case'split':_0x2be324=_0x4522b4['splitPosition'],_0x11aa7d=_0x4522b4['moveTargetPosition'];break;case'merge':{const _0x502007=_0x4522b4['targetPosition']['path']['slice'](0x0,-0x1);_0x2be324=_0x3d5da7['model']['createPositionFromPath'](_0x5089c8,_0x502007),_0x11aa7d=_0x2be324['getShiftedBy'](0x1);break;}case'remove':{const _0x26ce97=_0x4522b4['howMany'],_0x52398d=_0x4522b4['sourcePosition']['_getTransformedByInsertion'](_0x4522b4['targetPosition'],_0x26ce97),_0x34a7ad=_0x4522b4['getMovedRangeStart']();'remove'==_0x4522b4['type']?(_0x2be324=_0x52398d,_0x11aa7d=_0x52398d):(_0x2be324=_0x34a7ad,_0x11aa7d=_0x34a7ad['getShiftedBy'](_0x26ce97));break;}}_0x2be324&&_0x2be324['isBefore'](_0x4e6086)&&(_0x4e6086=_0x2be324['clone'](),_0x4e6086['stickiness']='toNone'),_0x11aa7d&&_0x11aa7d['isAfter'](_0x3e4e58)&&(_0x3e4e58=_0x11aa7d['clone'](),_0x3e4e58['stickiness']='toNone');}return _0x3d5da7['model']['createSelection'](_0x3d5da7['model']['createRange'](_0x4e6086,_0x3e4e58));}function G(_0x51bc05,_0x3ed120){ro(_0x51bc05,_0x3ed120,'forward');const _0xaf1b3e=_0x3ed120['getFirstRange']();_0x3ed120['setTo']([]),_0x3ed120['setTo'](_0xaf1b3e,{'backward':!0x0}),ro(_0x51bc05,_0x3ed120,'backward');}function ro(_0x220419,_0x1741dc,_0x1f42fb){let _0x5d7dcb=0x14;for(;_0x5d7dcb;){_0x220419['modifySelection'](_0x1741dc,{'unit':'word','direction':_0x1f42fb}),_0x5d7dcb--;const _0x364d32=_0x1741dc['focus']['forward'==_0x1f42fb?'nodeBefore':'nodeAfter'];if(_0x364d32&&_0x364d32['is']('element')&&_0x220419['schema']['isBlock'](_0x364d32)&&_0x220419['schema']['isObject'](_0x364d32))break;}}function Zn(_0x35ed21,_0x2b4a37){for(const [_0x392e53,_0x38efb5]of _0x35ed21['markers']){const _0x27704d=_0x38efb5['_getTransformedByDeletion'](_0x2b4a37['start'],_0x2b4a37['end']['offset']-_0x2b4a37['start']['offset']);null!=_0x27704d?_0x35ed21['markers']['set'](_0x392e53,_0x27704d):_0x35ed21['markers']['delete'](_0x392e53);}}class pe extends Vt(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x1ebbd3([]);['parsedMergedContent']=new _0x1ebbd3([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x1b7a5b,content:_0x218636='',isDone:_0x228e72=!0x1,interactionId:_0x22d823,areActionsDisabled:_0x5d0023,documentContextContent:_0x45e725,editor:_0x20ed4c,id:_0x1cf49d}){super(),this['id']=_0x1cf49d||_0x5ee109(),this['interactionId']=_0x22d823,this['type']=_0x1b7a5b,this['areActionsDisabled']=!!_0x5d0023,this['editor']=_0x20ed4c,this['aiResponseParser']=new Ke(),this['aiResponseApplier']=new Qe(),this['documentContextContent']=He(_0x45e725||''),this['set']('isDone',_0x228e72),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x218636);}['appendContent'](_0xe76172){this['set']('content',this['content']+_0xe76172);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x1f55ba,_0x53dd12){this['changeGroups'][_0x1f55ba]['state']=_0x53dd12,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x1f55ba,'state':_0x53dd12});}['getContentParts']({showDiff:_0x3f38d8,groupIndex:_0x1d676c}){if(!this['editor'])throw new _0x36ce55('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x147bd0=this['_getCachedContentParts'](_0x3f38d8,_0x1d676c);if(_0x147bd0)return _0x147bd0;let _0x1802e4=[];if(void 0x0===_0x1d676c)_0x1802e4=this['changeGroups'];else{const _0x12f97e=this['changeGroups']['find'](({index:_0x12a5b9})=>_0x12a5b9===_0x1d676c);if(!_0x12f97e)throw new _0x36ce55('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x1d676c});_0x1802e4=[_0x12f97e];}const _0x58e9c0=f({'editor':this['editor'],'showDiff':_0x3f38d8,'changeGroups':_0x1802e4,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x3f38d8,_0x58e9c0),_0x58e9c0;}['_getCachedContentParts'](_0x4dc41e,_0x384e5e){const _0x83c913=_0x4dc41e?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x83c913]['length'])return null;const _0x168346=this['cachedSuggestionContentParts'][_0x83c913];if(void 0x0===_0x384e5e)return _0x168346['length']>0x0&&_0x168346['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x4dc41e,null),null):_0x371c18(_0x168346);{const _0x57315c=_0x168346['find'](({index:_0x40ac07})=>_0x40ac07===_0x384e5e);if(_0x57315c)return[_0x371c18(_0x57315c)];}return null;}['_setCachedContentParts'](_0x2613d6,_0x45940){const _0x45d61a=_0x2613d6?'withDiff':'withoutDiff';_0x45940?_0x45940['forEach'](_0x3bfee8=>{const _0x541452=this['cachedSuggestionContentParts'][_0x45d61a],_0x1dcae1=_0x541452['find'](({index:_0xb079e4})=>_0xb079e4===_0x3bfee8['index']);if(_0x1dcae1){const _0x2c07cd=_0x541452['indexOf'](_0x1dcae1);_0x541452['splice'](_0x2c07cd,0x1,_0x3bfee8);}else _0x541452['push'](_0x3bfee8);}):this['cachedSuggestionContentParts'][_0x45d61a]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x294c9c=this['changeGroups'];this['updateChangeGroups']();const _0x485e01=this['_getDifferentChangeGroups'](_0x294c9c,this['changeGroups']);(_0x485e01['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x485e01),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x2b0a1a,_0x5482e2){const _0x5212c5=[];for(const _0x1a4663 of _0x5482e2){const _0x9cc4f8=_0x2b0a1a[_0x1a4663['index']];_0x9cc4f8?_0x9cc4f8['changes']['length']!==_0x1a4663['changes']['length']?_0x5212c5['push'](_0x1a4663):_0x9cc4f8['changes']['forEach']((_0x5a544a,_0x4bb901)=>{const _0x447829=_0x1a4663['changes'][_0x4bb901];_0x5a544a['id']!==_0x447829['id']&&_0x5212c5['push'](_0x1a4663);}):_0x5212c5['push'](_0x1a4663);}return _0x5212c5;}['updateChangeGroups'](){const _0xb6c7e=new _0x143df1('p',{},[new _0x143df1('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x101e1d(m(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x2f441e=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0xb6c7e,'cutAfterLastChange':!this['isDone']});if(!_0x2f441e['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x2f441e['parsedContent'];let _0x199940=[];if(_0x5ad999(_0x2bd4d8=>{const _0x31bae4=q(_0x2bd4d8,'data-id');if(!_0x31bae4||!_0x2b077d(_0x31bae4))return!0x1;const _0x23027d=[_0x2bd4d8,...qe(_0x2bd4d8)]['at'](-0x2);if(_0x2bd4d8!=_0x23027d){const _0x4a1ea0=q(_0x23027d,'data-id');_0x2b077d(_0x4a1ea0)||(_0x199940['push']({'node':_0x23027d,'id':_0x4a1ea0,'type':'modified'}),_0x2f441e['modifiedNodeIds']['push'](_0x4a1ea0));}else _0x2f441e['modifiedNodeIds']['includes'](_0x31bae4)?_0x199940['push']({'node':_0x2bd4d8,'type':'modified','id':_0x31bae4}):_0x2f441e['newNodeIds']['includes'](_0x31bae4)?_0x199940['push']({'node':_0x2bd4d8,'type':'new','id':_0x31bae4,'anchorId':q(_0x2bd4d8['previousSibling'],'data-id')}):_0x199940['push']({'node':_0x2bd4d8,'type':'removed','id':_0x31bae4});return!0x0;},this['parsedMergedContent']),_0x199940=_0x199940['filter'](({node:_0x3a53ee})=>[...qe(_0x3a53ee),_0x3a53ee]['every'](_0x471247=>!q(_0x471247,'data-unstable'))),0x0==_0x199940['length'])return;const _0x6ae648=[[_0x199940[0x0]]];for(let _0x563ad3=0x1;_0x563ad3<_0x199940['length'];_0x563ad3++){const _0x229244=_0x6ae648[_0x6ae648['length']-0x1],_0x3a6e47=_0x229244[_0x229244['length']-0x1];_0x199940[_0x563ad3]['node']['previousSibling']==_0x3a6e47['node']&&'modified'!=_0x199940[_0x563ad3]['type']&&'modified'!=_0x3a6e47['type']?_0x229244['push'](_0x199940[_0x563ad3]):_0x6ae648['push']([_0x199940[_0x563ad3]]);}for(const _0x1851bf of _0x6ae648){const _0x5a088f=_0x1851bf[0x0],_0x125998=_0x1851bf[_0x1851bf['length']-0x1],_0x19bba6=_0x1a20e4(_0x5a088f['node']['previousSibling']);_0x19bba6&&_0x1851bf['unshift'](_0x19bba6);const _0x50f365=_0x1a20e4(_0x125998['node']['nextSibling']);_0x50f365&&_0x1851bf['push'](_0x50f365);}function _0x2b077d(_0x2016ba){return _0x2f441e['modifiedNodeIds']['includes'](_0x2016ba)||_0x2f441e['newNodeIds']['includes'](_0x2016ba)||_0x2f441e['removedNodeIds']['includes'](_0x2016ba);}function _0x1a20e4(_0x30e5f1){if(_0x30e5f1&&q(_0x30e5f1,'data-id')&&!q(_0x30e5f1,'data-unstable')){const _0x1ebad9=q(_0x30e5f1,'data-id');if(!_0x2b077d(_0x1ebad9))return{'node':_0x30e5f1,'type':'context','id':_0x1ebad9};}return null;}this['changeGroups']=_0x6ae648['map']((_0x4f7e95,_0x51d096)=>({'changes':_0x4f7e95,'state':'pending','index':_0x51d096}));}}const zt=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class qt extends Ft(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x4801cf,editor:_0x24aa07}){super(),this['id']=_0x5ee109(),this['connector']=_0x4801cf,this['isStopped']=!0x0,this['editor']=_0x24aa07;}async['start'](){const _0x33c1be=[];let _0x2e888f,_0x3fd9d2,_0x594b93;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0xda268f=await this['currentRequest']['getStream']();for await(const _0x77aa08 of _0xda268f){if(this['isStopped'])return;if('error'==_0x77aa08['event'])return void this['fire']('error',{'error':new _0x36ce55('ai-chat-interaction-error',this)});switch(_0x77aa08['event']){case'message-metadata':this['messageId']=_0x77aa08['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x77aa08['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x77aa08['data']['conversationTitle'],!0x0);break;case'source':_0x33c1be['push'](_0x77aa08['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x2e888f='modification-delta'==_0x77aa08['event']?'modification':'text',_0x3fd9d2='modification-delta'==_0x77aa08['event']?_0x77aa08['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x2e888f&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x2e888f,'interactionId':this['id'],'id':_0x3fd9d2}),'modification'==_0x2e888f&&(this['currentReply']['sources']=_0x33c1be['splice'](0x0))),this['currentReply']['appendContent'](_0x77aa08['data']['textDelta']);break;case'mcp-tool-result':_0x594b93=JSON['parse'](_0x77aa08['data']['result']),this['_handleToolResultData']({'toolName':_0x77aa08['data']['toolName'],'data':_0x594b93['data'],'attributes':_0x594b93['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x77aa08['data']['toolName'],'data':_0x77aa08['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x33c1be['length']>0x0&&(this['currentReply']['sources']=_0x33c1be['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x5b8ded){return this['replies']['find'](_0x3c4fd9=>_0x3c4fd9['id']===_0x5b8ded);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x2fcf13=>_0x2fcf13['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x356991){const _0x1a1118=new pe({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x356991});return this['replies']['push'](_0x1a1118),_0x1a1118['delegate'](...zt)['to'](this),this['fire']('replyCreated',_0x1a1118),_0x1a1118;}['setConversationTitle'](_0x4c4bda,_0x52d2e8=!0x1){this['fire']('setConversationTitle',_0x4c4bda,_0x52d2e8);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x264c51){this['fire']('toolDataReceived',{'type':'result','toolName':_0x264c51['toolName'],'data':structuredClone(_0x264c51['data']||{}),'attributes':structuredClone(_0x264c51['attributes']||{})},this);}['_handleToolNotificationData'](_0x3973b2){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x3973b2['toolName'],'data':structuredClone(_0x3973b2['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Jt=function(_0x19abc2){return _0x19abc2['TOOL']='mcp-tool-context',_0x19abc2['FILE']='file',_0x19abc2['DOCUMENT']='document',_0x19abc2['URL']='web-resource',_0x19abc2['TEXT']='text',_0x19abc2['SELECTION']='selection',_0x19abc2;}({}),Xt=function(_0x7f9138){return _0x7f9138['TEXT']='text',_0x7f9138['MARKDOWN']='markdown',_0x7f9138['HTML']='html',_0x7f9138;}({});const Yt=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),xe=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class be extends Vt(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x201871,config:_0x50ea6c,ownerId:_0x43823c}){super(),this['_connector']=_0x201871,this['_config']=_0x50ea6c,this['_ownerId']=_0x43823c;}['init'](){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_setAddContextOptionsDefaultState']();}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x43a8fa){const _0x5c12ee=await this['_createContextItemFromContent'](_0x43a8fa);return this['_addToConversationContextItem'](_0x5c12ee),'current-document'===_0x5c12ee['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x5c12ee;}async['_createContextItemFromContent'](_0x49d46b){if(_0x49d46b['type']===Jt['DOCUMENT']){const _0x15d786=await this['_connector']['fetchDocument'](this['_ownerId'],_0x49d46b['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x49d46b['type'],'content':_0x15d786['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x15d786['attributes']?.['version'],'sessionId':_0x15d786['attributes']?.['sessionId']};}if(_0x49d46b['type']===Jt['TOOL'])return{'id':_0x49d46b['id'],'uiId':_0x49d46b['id'],'label':_0x49d46b['data']?.['label']||_0x49d46b['id'],'type':Jt['TOOL'],'mcpServerName':_0x49d46b['mcpServerName'],'toolName':_0x49d46b['toolName'],'data':_0x49d46b['data']||{}};return{'id':_0x49d46b['id'],'uiId':_0x49d46b['id'],'label':_0x49d46b['attributes']?.['label']||_0x49d46b['name']||_0x49d46b['url']||_0x49d46b['id'],'type':_0x49d46b['type'],..._0x49d46b?.['attributes']?.['resourceId']?{'resourceId':_0x49d46b['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x323426){const _0xbabbf3=this['_pendingContextItems']['get'](_0x323426);_0xbabbf3?.['isReadOnly']||this['_removeContextItem'](_0x323426);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x32a54b of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x32a54b['uiId']);const _0x19532e=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x19532e&&this['_addContextItem']({..._0x19532e,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x13e2bc){for(const _0x293565 of _0x13e2bc['values']())this['_addToConversationContextItem'](_0x293565);this['clearPendingContextItems'](),this['fire']('contextSent',{'contextItems':Array['from'](this['getSentContextItems']()['values']())});}['isCurrentDocumentInContext'](){return this['_pendingContextItems']['has']('current-document');}['isSelectionInContext'](){return this['_pendingContextItems']['has']('selection');}['isCurrentDocumentInConversation'](){return this['_conversationContextItems']['has']('current-document');}static['mapContextItemsToRequestData'](_0x5ee6d3){return Array['from'](_0x5ee6d3['values']())['map'](_0x12bbae=>this['_mapContextItemToRequestData'](_0x12bbae))['filter'](_0x195421=>null!==_0x195421);}async['addFilesToContext'](_0x64e032,_0x4e4238,_0x4269ff=Jt['FILE']){const _0x419301='files-'+_0x5ee109();this['_startUploadOperation'](_0x419301);try{await Promise['all'](_0x64e032['map'](async _0x4db49a=>{const _0x2dbc12='file-'+_0x5ee109(),_0x5d1555=Wt(_0x4db49a['name']);try{this['_addContextItem']({'type':_0x4269ff,'label':_0x4e4238?.['label']||_0x5d1555,'uiId':_0x2dbc12,'resourceId':_0x4e4238?.['resourceId']},!0x0);const _0x4993a8=this['_connector']['uploadFile'](this['_ownerId'],_0x4db49a,_0x4e4238);this['_ongoingUploads']['set'](_0x2dbc12,_0x4993a8['abortController']);const {id:_0x47d65b}=await _0x4993a8['getId']();this['_ongoingUploads']['delete'](_0x2dbc12),this['_finishContextItemLoading']({'type':_0x4269ff,'id':_0x47d65b,'label':_0x4e4238?.['label']||_0x5d1555,'uiId':_0x2dbc12,'resourceId':_0x4e4238?.['resourceId']},!0x1);}catch(_0x3d80ae){this['_ongoingUploads']['delete'](_0x2dbc12);if(!(_0x3d80ae instanceof _0x36ce55&&_0x3d80ae['message']['startsWith']('ai-request-aborted'))){const _0x436829=Yt['get'](_0x3d80ae['code'])||'ai-chat-file-upload-failed',_0x3afc43=new _0x36ce55(_0x436829,null,{'fileName':_0x5d1555,..._0x3d80ae});_0x3afc43['stack']=_0x3d80ae['stack'],this['fire']('error',{'error':_0x3afc43});}this['_removeContextItem'](_0x2dbc12);}}));}finally{this['_finishUploadOperation'](_0x419301);}}['addCurrentDocumentToContext'](_0x2d93f2){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x10f53c={'type':Jt['DOCUMENT'],'uiId':'current-document','label':_0x2d93f2,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x10f53c);}async['updateCurrentDocument'](_0x2e0833,_0x17dbd3,_0x514f86,_0x5cc2ce){const _0x2dda56=this['_pendingContextItems']['get']('current-document');if(_0x2dda56&&_0x2e0833){_0x2dda56['selection']=_0x5cc2ce?_0x5cc2ce['map'](_0x1af376=>({'start':_0x1af376['start'],'end':_0x1af376['end']})):[];try{if(_0x2dda56['version']===_0x17dbd3)return;const {id:_0x2b8bfa}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x2e0833,{'version':_0x17dbd3,'sessionId':_0x514f86})['getId']();_0x2dda56['id']=_0x2b8bfa,_0x2dda56['content']=_0x2e0833,_0x2dda56['version']=_0x17dbd3,_0x2dda56['sessionId']=_0x514f86;}catch(_0x49f0eb){const _0x268264=new _0x36ce55('ai-chat-document-upload-failed',null);_0x268264['stack']=_0x49f0eb['stack'],this['fire']('error',{'error':_0x268264});}}}['addSelectionToContext'](_0x42d1a4){this['_addContextItem']({'type':Jt['SELECTION'],'label':_0x42d1a4,'uiId':'selection','content':_0x42d1a4});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x1b9699,_0x5baabc){const _0x810097='url-'+_0x5ee109();this['_startUploadOperation'](_0x810097);const _0x24add6='url-'+_0x5ee109();try{this['_addContextItem']({'type':Jt['URL'],'label':_0x5baabc?.['label']||_0x1b9699,'uiId':_0x24add6,'resourceId':_0x5baabc?.['resourceId']},!0x0);const _0x177cc5=this['_connector']['uploadUrl'](this['_ownerId'],_0x1b9699,_0x5baabc);this['_ongoingUploads']['set'](_0x24add6,_0x177cc5['abortController']);const {id:_0x4035a1}=await _0x177cc5['getId']();this['_ongoingUploads']['delete'](_0x24add6),this['_finishContextItemLoading']({'type':Jt['URL'],'id':_0x4035a1,'label':_0x5baabc?.['label']||_0x1b9699,'uiId':_0x24add6,'resourceId':_0x5baabc?.['resourceId']},!0x1);}catch(_0x13d7e5){this['_ongoingUploads']['delete'](_0x24add6),(_0x13d7e5['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x36ce55('ai-chat-url-upload-failed',this,{'url':_0x1b9699,'originalError':_0x13d7e5}),'url':_0x1b9699}),this['_removeContextItem'](_0x24add6));}finally{this['_finishUploadOperation'](_0x810097);}}['addToolItemToContext'](_0x27d5ea){_0x27d5ea['id']=_0x27d5ea['id']??_0x5ee109()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x27d5ea['uiId'],_0x27d5ea),this['fire']('contextItemAdded',{'contextItem':_0x27d5ea,'isLoading':!0x1});}async['loadSourceResources'](_0x169488,_0x63feaa,_0x19c24e){const _0x25abae=this['_addContextOptionsState']['sources']['find'](_0x320861=>_0x320861['id']===_0x169488);if(!_0x25abae)return this['fire']('error',{'error':new _0x36ce55('ai-chat-source-not-found',this,{'sourceId':_0x169488}),'sourceId':_0x169488}),[];try{const _0x44c6ec=(await _0x25abae['getResources'](_0x63feaa))['map'](_0x3f948a=>{const _0x2ac687=this['_isResourceInContext'](_0x3f948a['id']);return{..._0x3f948a,'isInContext':_0x2ac687};});return _0x25abae['resources']=_0x44c6ec,this['fire']('sourceResourcesLoaded',{'sourceId':_0x169488,'source':_0x25abae,'resources':_0x44c6ec,'uid':_0x19c24e}),_0x44c6ec;}catch(_0x568e57){return this['fire']('error',{'error':new _0x36ce55('ai-chat-source-resources-load-failed',this,{'sourceId':_0x169488,'originalError':_0x568e57}),'sourceId':_0x169488,'sourceLabel':_0x25abae['label']}),[];}}async['addResourceToContext'](_0x23f4f3,_0x54015f){if(this['_isResourceInContext'](_0x54015f['id']))return;let _0x514d59=_0x54015f['data'];if(!_0x514d59&&_0x23f4f3['getData'])try{_0x514d59=await _0x23f4f3['getData'](_0x54015f['id']);}catch(_0x12286d){return void this['fire']('error',{'error':new _0x36ce55('ai-chat-resource-load-failed',this,{'resourceId':_0x54015f['id'],'sourceId':_0x23f4f3['id'],'originalError':_0x12286d}),'resourceId':_0x54015f['id'],'sourceId':_0x23f4f3['id']});}if(_0x514d59)switch(_0x54015f['type']){case Jt['URL']:if('string'!=typeof _0x514d59)return void this['fire']('error',{'error':new _0x36ce55('ai-chat-context-invalid-data',this,{'resourceId':_0x54015f['id'],'sourceId':_0x23f4f3['id'],'expectedType':'string','actualType':typeof _0x514d59}),'resourceId':_0x54015f['id'],'sourceId':_0x23f4f3['id']});await this['addUrlToContext'](_0x514d59,{'label':_0x54015f['label'],'resourceId':_0x54015f['id']});break;case Jt['FILE']:if(!(_0x514d59 instanceof File))return void this['fire']('error',{'error':new _0x36ce55('ai-chat-context-invalid-data',this,{'resourceId':_0x54015f['id'],'sourceId':_0x23f4f3['id'],'expectedType':'File','actualType':typeof _0x514d59}),'resourceId':_0x54015f['id'],'sourceId':_0x23f4f3['id']});await this['addFilesToContext']([_0x514d59],{'label':_0x54015f['label'],'resourceId':_0x54015f['id']});break;case Jt['TEXT']:if('object'!=typeof _0x514d59||!('content'in _0x514d59)||!('type'in _0x514d59))return void this['fire']('error',{'error':new _0x36ce55('ai-chat-context-invalid-data',this,{'resourceId':_0x54015f['id'],'sourceId':_0x23f4f3['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x514d59}),'resourceId':_0x54015f['id'],'sourceId':_0x23f4f3['id']});_0x514d59=be['_convertTextResourceToFile'](_0x514d59,_0x54015f['label']),await this['addFilesToContext']([_0x514d59],{'label':_0x54015f['label'],'resourceId':_0x54015f['id']},Jt['TEXT']);break;case Jt['TOOL']:break;default:this['fire']('error',{'error':new _0x36ce55('ai-chat-context-unsupported-type',this,{'resourceId':_0x54015f['id'],'sourceId':_0x23f4f3['id'],'resourceType':_0x54015f['type']}),'resourceId':_0x54015f['id'],'sourceId':_0x23f4f3['id']});}else this['fire']('error',{'error':new _0x36ce55('ai-chat-resource-no-data',this,{'resourceId':_0x54015f['id'],'sourceId':_0x23f4f3['id']}),'resourceId':_0x54015f['id'],'sourceId':_0x23f4f3['id']});}static['_convertTextResourceToFile'](_0x4fdcd0,_0x4ca29e){switch(_0x4fdcd0['type']){case Xt['MARKDOWN']:return new File([_0x4fdcd0['content']],_0x4ca29e,{'type':'text/markdown'});case Xt['HTML']:return new File([_0x4fdcd0['content']],_0x4ca29e,{'type':'text/html'});default:return new File([_0x4fdcd0['content']],_0x4ca29e,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x307062){switch(_0x307062['type']){case Jt['FILE']:return{'type':Jt['FILE'],'id':_0x307062['id']};case Jt['URL']:return{'type':Jt['URL'],'id':_0x307062['id']};case Jt['DOCUMENT']:return{'type':Jt['DOCUMENT'],'id':_0x307062['id'],..._0x307062['selection']?.['length']&&{'selection':_0x307062['selection']}};case Jt['TEXT']:return{'type':Jt['FILE'],'id':_0x307062['id']};case Jt['TOOL']:{const _0xa0ed33=_0x307062;return{'type':Jt['TOOL'],'mcpServerName':_0xa0ed33['mcpServerName'],'toolName':_0xa0ed33['toolName'],'data':_0xa0ed33['data'],'id':_0xa0ed33['id']};}default:return null;}}['_addContextItem'](_0x324edb,_0x4d5d2b=!0x1){if(this['_pendingContextItems']['set'](_0x324edb['uiId'],_0x324edb),_0x324edb['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x324edb,'isLoading':_0x4d5d2b}),'current-document'===_0x324edb['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x324edb['resourceId']){const _0x1d3800=this['_findSourceIdsByResourceId'](_0x324edb['resourceId']);_0x1d3800&&_0x1d3800['forEach'](_0x1cb777=>{this['_updateResourceInContextState'](_0x1cb777,_0x324edb['resourceId'],!0x0);});}}['_removeContextItem'](_0x222d84){const _0x5662cd=this['_pendingContextItems']['get'](_0x222d84),_0xe04764=this['_ongoingUploads']['get'](_0x222d84);if(_0xe04764&&(_0xe04764['abort'](),this['_ongoingUploads']['delete'](_0x222d84)),_0x5662cd?.['resourceId']){const _0x5dd6ed=this['_findSourceIdsByResourceId'](_0x5662cd['resourceId']);_0x5dd6ed&&_0x5dd6ed['forEach'](_0x38b52d=>{this['_updateResourceInContextState'](_0x38b52d,_0x5662cd['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x222d84),this['fire']('contextItemRemoved',{'uiId':_0x222d84,'type':_0x5662cd?.['type']}),'current-document'===_0x222d84&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0xe0c332,_0x225ae8){if(this['_pendingContextItems']['has'](_0xe0c332['uiId'])&&(this['_pendingContextItems']['set'](_0xe0c332['uiId'],_0xe0c332),this['fire']('contextItemLoadingEnded',{'contextItem':_0xe0c332,'isLoading':_0x225ae8}),_0xe0c332['resourceId'])){const _0x537ac3=this['_findSourceIdsByResourceId'](_0xe0c332['resourceId']);_0x537ac3&&_0x537ac3['forEach'](_0x3de5a6=>{this['_updateResourceInContextState'](_0x3de5a6,_0xe0c332['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x2fd9f4){this['_conversationContextItems']['set'](_0x2fd9f4['uiId'],_0x2fd9f4);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState'](),'customItems':this['_config']?.['customItems']?.['map'](_0x4f9aa3=>({..._0x4f9aa3,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x2728cb=>({..._0x2728cb,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x248cd5=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x248cd5,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x702969){for(const _0x17049e of this['_pendingContextItems']['values']())if(_0x17049e['resourceId']===_0x702969)return!0x0;for(const _0x3f3d7e of this['_conversationContextItems']['values']())if(_0x3f3d7e['resourceId']===_0x702969)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x1bd262){const _0x420fe1=[];for(const _0x3b889f of this['_addContextOptionsState']['sources']){_0x3b889f['resources']['find'](_0x40380c=>_0x40380c['id']===_0x1bd262)&&_0x420fe1['push'](_0x3b889f['id']);}return 0x0===_0x420fe1['length']?null:_0x420fe1;}['_updateResourceInContextState'](_0x5bff90,_0x5ddf0c,_0x3a7663){const _0x4fc54c=this['_addContextOptionsState']['sources']['find'](_0x5ad5d1=>_0x5ad5d1['id']===_0x5bff90);if(!_0x4fc54c)return;const _0x20bc3b=_0x4fc54c['resources']['find'](_0x3c94ab=>_0x3c94ab['id']===_0x5ddf0c);_0x20bc3b&&(_0x20bc3b['isInContext']=_0x3a7663,this['fire']('resourceStateChanged',{'sourceId':_0x5bff90,'resourceId':_0x5ddf0c,'isInContext':_0x3a7663}));}['_startUploadOperation'](_0x45a69b){this['_ongoingUploadOperations']['set'](_0x45a69b,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x64ee60){this['_ongoingUploadOperations']['delete'](_0x64ee60),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Me=['capabilitiesUpdated'];class ye extends Ft(){['_isWebSearchEnabled'];['_isReasoningEnabled'];constructor(){super(),this['_isWebSearchEnabled']=!0x1,this['_isReasoningEnabled']=!0x1;}['init'](){this['reset']();}['reset'](){this['setWebSearch'](!0x1),this['setReasoning'](!0x1);}['getCapabilitiesConfig'](){return{'isWebSearchEnabled':this['_isWebSearchEnabled'],'isReasoningEnabled':this['_isReasoningEnabled']};}static['getCapabilitiesRequestData'](_0x51211c){const _0x1dac6c={};return _0x51211c&&_0x51211c['isWebSearchEnabled']&&(_0x1dac6c['webSearch']={}),_0x51211c&&_0x51211c['isReasoningEnabled']&&(_0x1dac6c['reasoning']={}),_0x1dac6c;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x4fd6fc){_0x4fd6fc!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x4fd6fc,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x3fd939){_0x3fd939!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x3fd939,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Se extends qt{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x11189d){super(_0x11189d),this['conversationId']=_0x11189d['conversationId'],this['contextItems']=_0x11189d['contextItems'],this['capabilities']=_0x11189d['capabilities'],this['userMessage']=_0x11189d['userMessage'],this['model']=_0x11189d['model'],this['attributes']=_0x11189d['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':be['mapContextItemsToRequestData'](this['contextItems']),'capabilities':ye['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class F extends Ft(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x67e66c){super(),this['options']=_0x67e66c,this['connector']=_0x67e66c['connector'],this['chatModels']=_0x67e66c['chatModels'],this['id']=_0x67e66c['conversationId'],this['isFromHistory']=_0x67e66c['isFromHistory'];}async['init'](_0xd70a31){try{this['chatContext']=new be({'connector':this['connector'],'config':_0xd70a31,'ownerId':this['id']}),this['chatContext']['delegate'](...xe)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new ye(),this['chatCapabilities']['delegate'](...Me)['to'](this),this['chatCapabilities']['init']();const _0x4a9331=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x4a9331});const _0x4ea5c7=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x4ea5c7&&await this['setModel'](_0x4ea5c7);}catch(_0x283f33){const _0xf9ba9=new _0x36ce55('ai-chat-conversation-init-failed',null,{'message':_0x283f33['message']||_0x283f33});_0xf9ba9['stack']=_0x283f33['stack'],this['fire']('error',{'error':_0xf9ba9});}}async['start'](){if(this['isStarted'])throw new _0x36ce55('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x36ce55('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x11657d}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x11657d,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x302495){const _0x2cdc09=new _0x36ce55('ai-chat-conversation-start-failed',null,{'message':_0x302495['message'],'conversationId':this['id']});throw _0x2cdc09['stack']=_0x302495['stack'],this['fire']('error',{'error':_0x2cdc09}),_0x2cdc09;}}async['load'](_0x31728c,_0x330539){try{const _0x4435ef=await this['connector']['fetchConversation'](_0x31728c)['getConversation'](),_0x38c7e9=await this['connector']['fetchConversationMessages'](_0x31728c)['getMessages'](),_0x4b716e=_0x38c7e9[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x4435ef['id'],'title'in _0x4435ef?this['fire']('setConversationTitle',_0x4435ef['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x421c09=(await this['chatModels']['getAll']())['find'](_0x37fe3d=>_0x37fe3d['id']['toLowerCase']()===_0x4b716e['toLowerCase']());return this['selectedModel']=_0x421c09,this['fire']('modelSelected',{'selectedModel':_0x421c09,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x38c7e9,_0x330539,_0x4b716e),this['currentInteraction']=void 0x0,this;}catch(_0x1ce1a8){const _0x5a74b6=new _0x36ce55('ai-chat-conversation-init-from-id-failed',null,{'message':_0x1ce1a8['message'],'conversationId':_0x31728c});throw _0x5a74b6['stack']=_0x1ce1a8['stack'],this['fire']('error',{'error':_0x5a74b6}),_0x5a74b6;}}async['_processMessagesToInteractions'](_0x32aa23,_0x191622,_0x5e2f9c){let _0x1fd795;for(const _0x7f9aa8 of _0x32aa23)if('user'===_0x7f9aa8['role']){const _0x458bd6=await this['_extractContextItems'](_0x7f9aa8),_0x200a47={'isReasoningEnabled':Object['hasOwn'](_0x7f9aa8['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x7f9aa8['capabilities'],'webSearch')};_0x1fd795=this['createInteraction']({'userMessage':_0x7f9aa8['prompt'],'contextItems':_0x458bd6,'capabilities':_0x200a47,'modelId':_0x5e2f9c,'attributes':_0x7f9aa8['attributes']}),this['currentInteraction']=_0x1fd795,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x7f9aa8['role']&&_0x1fd795){const _0x4bffea=[];for(const _0x109d1b of _0x7f9aa8['content'])switch(_0x109d1b['type']){case'text':case'modification':{const _0xb0e26c=_0x1fd795['getDocumentContext']()?.['sessionId']!==_0x191622;_0x1fd795['currentReply']=_0x1fd795['createReply']({'type':_0x109d1b['type'],'isDone':!0x0,'interactionId':_0x1fd795['id'],'areActionsDisabled':_0xb0e26c}),_0x1fd795['currentReply']['appendContent'](_0x109d1b['content']),_0x4bffea['length']>0x0&&(_0x1fd795['currentReply']['sources']=_0x4bffea['splice'](0x0));break;}case'url':_0x4bffea['push'](_0x109d1b);break;case'mcp-tool-result':{const {data:_0x14f344,attributes:_0x46f6ff}=JSON['parse'](_0x109d1b['content']);_0x1fd795['_handleToolResultData']({'toolName':_0x109d1b['toolName'],'data':_0x14f344,'attributes':_0x46f6ff});break;}}}}}async['_extractContextItems'](_0x4600c7){const _0x5f2eef=new Map();if(!_0x4600c7['content'])return _0x5f2eef;for(const _0x2dfc8d of _0x4600c7['content']){const _0x5ce8cc=await this['chatContext']['populateFromMessage'](_0x2dfc8d);_0x5ce8cc&&_0x5f2eef['set'](_0x5ce8cc['id'],_0x5ce8cc);}return _0x5f2eef;}async['handleUserInteraction']({userMessage:_0xff61a3,attributes:_0x5127a9}){if(!this['isStarted'])throw new _0x36ce55('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x36ce55('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x477494=this['chatContext']['getPendingContextItems'](),_0x477926=this['chatCapabilities']['getCapabilitiesConfig'](),_0x1336ba=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0xff61a3,'contextItems':_0x477494,'capabilities':_0x477926,'modelId':_0x1336ba,'attributes':_0x5127a9}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x295578){if(_0x295578 instanceof _0x36ce55)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x295578});else{const _0x354756=Yt['get'](_0x295578['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x36ce55(_0x354756,null,{'error':_0x295578})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x1af731,contextItems:_0x2ac600,capabilities:_0x2e6e62,modelId:_0x55b39d,attributes:_0x2b4a16}){const _0x46feaf=new Se({'userMessage':_0x1af731,'contextItems':_0x2ac600,'capabilities':_0x2e6e62,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x55b39d,'attributes':_0x2b4a16});return _0x46feaf['delegate'](...zt)['to'](this),this['interactions']['push'](_0x46feaf),this['fire']('interactionCreated',_0x46feaf),_0x46feaf;}['getInteraction'](_0x4721db){return this['interactions']['find'](_0x56a7b2=>_0x56a7b2['id']===_0x4721db);}['removeInteraction'](_0x517d3c){const _0x69e9f2=this['getInteraction'](_0x517d3c);_0x69e9f2&&(_0x69e9f2['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x69e9f2),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x4ecfae){this['chatContext']['addCurrentDocumentToContext'](_0x4ecfae);}async['updateCurrentDocumentInContext']({content:_0x393d5d,version:_0x431055,sessionId:_0x2e4236,selections:_0x30668b}){await this['chatContext']['updateCurrentDocument'](_0x393d5d,_0x431055,_0x2e4236,_0x30668b);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x4b37eb){this['chatContext']['addSelectionToContext'](_0x4b37eb);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x2ec07c){this['chatContext']['addFilesToContext'](_0x2ec07c);}['addUrlToContext'](_0x1d492a){this['chatContext']['addUrlToContext'](_0x1d492a);}['addToolItemToContext'](_0x75194d){this['chatContext']['addToolItemToContext'](_0x75194d);}['addResourceToContext'](_0x10fcd7,_0x16aa47){this['chatContext']['addResourceToContext'](_0x10fcd7,_0x16aa47);}['loadSourceResources'](_0x1c72c9,_0x53b8a5,_0x527eaa){return this['chatContext']['loadSourceResources'](_0x1c72c9,_0x53b8a5,_0x527eaa);}['removeFromContext'](_0x4c7807){this['chatContext']['removeFromContext'](_0x4c7807);}['setWebSearch'](_0x5648a2){this['chatCapabilities']['setWebSearch'](_0x5648a2);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x770a5b){this['chatCapabilities']['setReasoning'](_0x770a5b);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x3a0341){_0x3a0341?!0x1===await this['chatModels']['isAvailable'](_0x3a0341)&&(Zt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x3a0341}),_0x3a0341=(await this['chatModels']['getAvailableModels']())[0x0]):(Zt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x3a0341=(await this['chatModels']['getAvailableModels']())[0x0]),_0x3a0341['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x3a0341,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x3a0341}));}}class X extends Ft(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x101168,config:_0x49a2b5,locale:_0x32908e}){super(),this['_connector']=_0x101168,this['_config']=_0x49a2b5,this['_locale']=_0x32908e;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get['_defaultModelId'](){return this['_config']?.['defaultModelId'];}async['getAll'](){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()),this['_modelsRequest'];}async['getAvailableModels'](){const _0x13f68e=await this['getAll']();let _0x2c0e5d;return _0x2c0e5d=this['_availableModels']?this['_filterModels'](_0x13f68e,this['_availableModels']):_0x13f68e['filter'](_0x32b0cf=>_0x32b0cf['recommended']),_0x2c0e5d;}async['getModel'](_0x3578d5){const _0x2e5e96=await this['getAll']();if(!_0x2e5e96['length'])return null;if(_0x3578d5){const _0x3233ee=this['_getModelById'](_0x2e5e96,_0x3578d5);if(_0x3233ee)return _0x3233ee;Zt('ai-chat-model-id-unrecognized',{'modelId':_0x3578d5,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x5c5e0c=await this['getAvailableModels']();if(!_0x5c5e0c['length'])return null;if(this['_defaultModelId']){const _0x42df30=this['_getModelById'](_0x5c5e0c,this['_defaultModelId']);if(_0x42df30)return _0x42df30;Zt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x5c5e0c[0x0]['id']});}return _0x5c5e0c[0x0];}async['isAvailable'](_0x2db95e){return(await this['getAvailableModels']())['some'](_0xcb5de=>_0xcb5de['name']===_0x2db95e['name']&&_0xcb5de['provider']===_0x2db95e['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x4bd7af=this['_locale']['uiLanguage']||'en',_0x157587=this['_connector']['getModels'](_0x4bd7af),_0x5aac0a=await _0x157587['list']();this['_modelList']=_0x5aac0a['items']['map'](_0x40d560=>ze(_0x40d560)?{..._0x40d560,'name':m(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x40d560);}catch(_0x4b4780){throw _0x283c76('ai-models-unable-to-retrieve',{'error':_0x4b4780}),_0x4b4780;}return[...this['_modelList']];}['_filterModels'](_0x4cd730,_0x566dd9){let _0x5e4175;if(_0x566dd9){_0x5e4175=[];const _0x34381c=new Set(),_0x124f8f='string'==typeof _0x566dd9?[_0x566dd9['toLocaleLowerCase']()]:_0x566dd9['map'](_0x4b65cc=>_0x4b65cc['toLocaleLowerCase']());for(const _0x50654e of _0x124f8f)for(const _0x32c7f6 of _0x4cd730)!_0x34381c['has'](_0x32c7f6['id'])&&this['_isMatchingFilter'](_0x32c7f6,_0x50654e)&&(_0x5e4175['push'](_0x32c7f6),_0x34381c['add'](_0x32c7f6['id']));}else _0x5e4175=_0x4cd730;return _0x5e4175;}['_isMatchingFilter'](_0x2fdfe2,_0x50a9b4){const _0x531d57=_0x2fdfe2['id']['toLocaleLowerCase'](),_0x161507=_0x2fdfe2['name']['toLocaleLowerCase'](),_0x2a1d09=_0x2fdfe2['provider']['toLocaleLowerCase']();return _0x531d57===_0x50a9b4||_0x161507===_0x50a9b4||ze(_0x2fdfe2)&&'auto'===_0x50a9b4||_0x2a1d09===_0x50a9b4||_0x531d57['startsWith'](_0x50a9b4);}['_getModelById'](_0x2ee1d9,_0x55b6d8){return _0x2ee1d9['find'](_0x2694f7=>ze(_0x2694f7)&&'auto'===_0x55b6d8?_0x2694f7:_0x2694f7['id']===_0x55b6d8)||null;}}function ze(_0x2fa25f){return _0x2fa25f['id']['startsWith']('agent');}function D(_0xa8160b){if(_0xa8160b instanceof _0x5601f8)return _0xa8160b;if(_0xa8160b?.['editors']&&_0xa8160b['editors']['get'](0x0))return _0xa8160b['editors']['length']>0x1&&console['warn']('AIChat:\x20Multiple\x20editor\x20instances\x20detected.\x20Only\x20the\x20first\x20editor\x20instance\x20will\x20be\x20used\x20for\x20AI\x20operations.\x20This\x20configuration\x20is\x20not\x20fully\x20supported\x20and\x20may\x20lead\x20to\x20unexpected\x20behavior.'),_0xa8160b['editors']['get'](0x0);throw new _0x36ce55('ai-get-editor-from-context-no-editor');}function y({editor:_0x58c2e9,interaction:_0x69dcee,reply:_0xba5fa3,groups:_0x109557,transform:_0x243f4c,documentCompare:_0x547eef,documentCompareOptions:_0x549396}){const _0x18c274=_0x69dcee['getDocumentContext']();if(!_0x18c274)return[];const _0x1fc8b0=_0x18c274['content'],_0x51c000=_0x18c274['version'],_0x4549fd=_0xba5fa3['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x358cc1}of _0x109557){const _0x445d8f=_0x358cc1['filter'](_0x2ca510=>'new'!=_0x2ca510['type'])['map'](_0x4cf3a8=>Z('data-id',_0x4cf3a8['id'],_0x4549fd)),_0x41538a=_0x358cc1['filter'](_0x433925=>'removed'!=_0x433925['type'])['map'](_0x12036a=>_0x12036a['node']['cloneNode'](!0x0));let _0x76d857=null;if(_0x445d8f['length']){_0x76d857=_0x445d8f[0x0]['previousSibling'];for(let _0xd16694=0x0;_0xd16694<_0x445d8f['length'];_0xd16694++)_0x53f32a(_0x445d8f[_0xd16694]);}if(_0x41538a['length']){_0x76d857||(_0x358cc1[0x0]['anchorId']?_0x76d857=Z('data-id',_0x358cc1[0x0]['anchorId'],_0x4549fd):(_0x76d857=_0x41538a['shift'](),_0x152e2b(_0x4549fd,_0x76d857)));for(let _0x2b2648=0x0;_0x2b2648<_0x41538a['length'];_0x2b2648++)_0x450256(_0x76d857,_0x41538a[_0x2b2648]),_0x76d857=_0x41538a[_0x2b2648];}}const _0x2ffe5d=Y(_0x4549fd),_0x225229=_0x547eef['getDiff'](_0x1fc8b0,_0x2ffe5d,_0x549396)['getOperations']();if(_0x243f4c){const _0x291da1=_0x58c2e9['model']['document']['history']['getOperations'](_0x51c000),_0x2b479d={'document':_0x58c2e9['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x634cdb(_0x225229,_0x291da1,_0x2b479d)['operationsA'];}return _0x225229;}function d(_0x4ad2a0,_0x4221f5){if('marker'!=_0x4221f5['type'])return;const _0x303c3c=_0x4ad2a0['model']['markers']['get'](_0x4221f5['name']);_0x303c3c&&(_0x4221f5['oldRange']=_0x303c3c['getRange']());}class x extends _0x269016{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[s,_0x339a14];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x5a5912(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new X({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x11e646=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x24d072,_0x5965c0)=>{this['_handleUIUserMessage']({'userMessage':_0x5965c0});}),this['listenTo'](_0x11e646,'resizedTabs',(_0x39d0bc,_0x51decc)=>{this['_setIsMaximized'](_0x51decc);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x11e646['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x3228ab,_0x55d5d1)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x55d5d1));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x35da6b,_0x4d6941)=>{this['activeConversation']?.['addUrlToContext'](_0x4d6941);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x3e5404,_0x195d5e)=>{_0x195d5e['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x4e2ba3,_0x2c1b9a)=>{this['activeConversation']?.['addResourceToContext'](_0x2c1b9a['source'],_0x2c1b9a['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x2db6a7,_0x13aa49)=>{this['_removeFromContext'](_0x13aa49);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x1f8512,_0x41694e)=>{this['activeConversation']?.['loadSourceResources'](_0x41694e['sourceId'],_0x41694e['query'],_0x41694e['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x40ee12,_0x970d24)=>{this['activeConversation']?.['setModel'](_0x970d24);}),this['listenTo'](this['_aiChatUi'],'like',(_0x32c5d6,{replyId:_0x133a41})=>{console['log']('Liked\x20response',_0x133a41);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x4e71c1,{replyId:_0x5a67ca})=>{console['log']('Disliked\x20response',_0x5a67ca);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x89156,_0x164f1a)=>{this['_insertSuggestion'](_0x164f1a);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x550f1d,{replyId:_0x3ce498,partIndex:_0x5e4bb7})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x3ce498,_0x5e4bb7);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x45352a,{replyId:_0x1101be,partIndex:_0x3d555f})=>{const _0xb6290e=this['_getDocumentRangeForReplyChanges'](_0x1101be,_0x3d555f);_0xb6290e&&'$graveyard'!=_0xb6290e['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0xb6290e['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x3d3a3a,_0x377c2f)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x377c2f);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x2757f3,{replyId:_0x57feec,showDiff:_0x56eeac})=>{const {reply:_0x4d0664}=this['getInteractionAndReplyById'](_0x57feec),_0x253662=_0x4d0664['getContentParts']({'showDiff':_0x56eeac});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x4d0664['id'],'parts':_0x253662,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x9915c,{replyId:_0x33e8cb,partIndex:_0x50642f})=>{this['_rejectSuggestion']({'replyId':_0x33e8cb,'partIndex':_0x50642f}),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon'),this['set']('_aiChatBalloonShowDiff',!0x1),this['_aiChatBalloon']['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](this['_aiChatBalloon'],'toggleSuggestionDisplayMode',()=>{const {replyId:_0x124b7f,partIndex:_0x36bf52}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x420708}=this['getInteractionAndReplyById'](_0x124b7f),_0x258bea=_0x420708['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x36bf52});this['_aiChatBalloon']['updateContent']({'part':_0x258bea[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x1ff36f,partIndex:_0x4f637e}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x1ff36f,'partIndex':_0x4f637e}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x2f301d,partIndex:_0x34f7a2}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x2f301d,'partIndex':_0x34f7a2}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x439abe,partIndex:_0x5cd375}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x439abe,'partIndex':_0x5cd375}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x42beef,partIndex:_0x3ad912}=this['_currentPreviewedChangeGroup'],_0x5e288a=this['_getPresentableSiblingContentPartIndex'](_0x42beef,_0x3ad912,'next');null!==_0x5e288a&&this['_openBalloonFor'](_0x42beef,_0x5e288a);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x2e98a6,partIndex:_0x3b0b82}=this['_currentPreviewedChangeGroup'],_0x367f9b=this['_getPresentableSiblingContentPartIndex'](_0x2e98a6,_0x3b0b82,'previous');null!==_0x367f9b&&this['_openBalloonFor'](_0x2e98a6,_0x367f9b);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x3f3abe,{id:_0x5241cb})=>{if('aiChatBalloon'!==_0x5241cb)return;const {replyId:_0x35834a,partIndex:_0x239159}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x35834a,'index':_0x239159,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof _0x5601f8?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2ca6a0,_0x41ce19)=>{_0x41ce19['on']('ready',()=>{this['_integrateEditor'](_0x41ce19);});});const _0x58c22c=this['context']['config']['get']('ai.chat.initialConversation');let _0x16dd7c=_0x58c22c;if('lastCreated'!=_0x58c22c||(_0x16dd7c=await this['_getLastCreatedConversationId'](),_0x16dd7c))return'new'==_0x16dd7c?this['_startConversationSafely']():this['loadConversation'](_0x16dd7c);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x576f6){const _0x38903f=D(this['context']);if(!_0x38903f['plugins']['has']('TrackChanges'))throw new _0x36ce55('ai-no-track-changes',null);const _0x22ca81=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x5b4587,interaction:_0x4a9f63}=this['getInteractionAndReplyById'](_0x576f6['replyId']),_0x538020=this['_getDocumentRangeForReplyChanges'](_0x576f6['replyId'],_0x576f6['partIndex']),_0x4b11a2=void 0x0!==_0x576f6['partIndex']?[_0x5b4587['changeGroups'][_0x576f6['partIndex']]]:_0x5b4587['changeGroups']['filter'](_0x23cc84=>'pending'==_0x23cc84['state']),_0x448e3b=_0x4b11a2['map'](_0x32629e=>_0x5b4587['changeGroups']['indexOf'](_0x32629e));if(!_0x538020||'$graveyard'==_0x538020['range']['root']['rootName'])return void _0x448e3b['forEach'](_0x5ddba3=>_0x5b4587['setChangeGroupState'](_0x5ddba3,'outdated'));_0x448e3b['forEach'](_0x51bf5e=>_0x5b4587['setChangeGroupState'](_0x51bf5e,'accepted'));const _0x326556=y({'editor':_0x38903f,'reply':_0x5b4587,'interaction':_0x4a9f63,'groups':_0x4b11a2,'transform':!0x0,'documentCompare':_0x22ca81,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x315206;_0x538020&&this['_scrollToSuggestionRange'](_0x538020['range']),_0x38903f['model']['change'](_0x2d717d=>{_0x315206=_0x2d717d['batch'],_0x38903f['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x326556),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x315206,{'interactionId':_0x4a9f63['id'],'replyId':_0x5b4587['id'],'indexes':_0x448e3b['slice']()}),this['_updateRatings'](_0x5b4587);}['_applySuggestion'](_0xeb6221){const _0x325428=D(this['context']),_0x552aa2=this['context']['plugins']['get'](_0x339a14),{reply:_0x55f66f,interaction:_0x117256}=this['getInteractionAndReplyById'](_0xeb6221['replyId']),_0x269611=this['_getDocumentRangeForReplyChanges'](_0xeb6221['replyId'],_0xeb6221['partIndex']),_0x27cd55=void 0x0!==_0xeb6221['partIndex']?[_0x55f66f['changeGroups'][_0xeb6221['partIndex']]]:_0x55f66f['changeGroups']['filter'](_0x4cece1=>'pending'==_0x4cece1['state']),_0x5cca76=_0x27cd55['map'](_0x4f79a1=>_0x55f66f['changeGroups']['indexOf'](_0x4f79a1));if(!_0x269611||'$graveyard'==_0x269611['range']['root']['rootName'])return void _0x5cca76['forEach'](_0x5991a6=>_0x55f66f['setChangeGroupState'](_0x5991a6,'outdated'));_0x5cca76['forEach'](_0x2751ea=>_0x55f66f['setChangeGroupState'](_0x2751ea,'accepted'));const _0x1f7dac=y({'editor':_0x325428,'reply':_0x55f66f,'interaction':_0x117256,'groups':_0x27cd55,'transform':!0x0,'documentCompare':_0x552aa2,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0xe35c84;_0x269611&&this['_scrollToSuggestionRange'](_0x269611['range']),_0x325428['model']['change'](_0x3ab807=>{_0xe35c84=_0x3ab807['batch'];for(const _0x29c9a9 of _0x1f7dac)_0x29c9a9['baseVersion']=_0x325428['model']['document']['version'],d(_0x325428,_0x29c9a9),_0x3ab807['batch']['addOperation'](_0x29c9a9),_0x325428['model']['applyOperation'](_0x29c9a9);}),this['_batchToChanges']['set'](_0xe35c84,{'interactionId':_0x117256['id'],'replyId':_0x55f66f['id'],'indexes':_0x5cca76['slice']()}),this['_updateRatings'](_0x55f66f);}['_rejectSuggestion'](_0x14d216){const {reply:_0x10b699}=this['getInteractionAndReplyById'](_0x14d216['replyId']);_0x10b699['setChangeGroupState'](_0x14d216['partIndex'],'rejected');}['_openBalloonFor'](_0x1b53d2,_0x29503f){if(!this['_aiChatBalloon'])return;const {reply:_0x7e6b82}=this['getInteractionAndReplyById'](_0x1b53d2),_0x233a6f=_0x7e6b82['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x3b12cc,_0x17dd16;if(void 0x0!==_0x29503f?(_0x17dd16=_0x233a6f['find'](_0x36efa6=>_0x36efa6['index']==_0x29503f),_0x3b12cc=_0x17dd16?.['index']):(_0x17dd16=_0x233a6f[0x0],_0x3b12cc=_0x17dd16['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x1b53d2&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x3b12cc)return;const _0x214d70=this['_getUserPresentableContentPartDocumentRange'](_0x1b53d2,_0x7e6b82,_0x17dd16);if(!_0x214d70)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x1b53d2,'partIndex':_0x3b12cc},this['_scrollToSuggestionRange'](_0x214d70,!0x0);const _0x1399e7=this['_getPresentableSiblingContentPartIndex'](_0x1b53d2,_0x3b12cc,'next');this['_aiChatBalloon']['updateContent']({'part':_0x17dd16,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x3b12cc,'title':m(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x3b12cc+0x1)['toString']()),'showRotator':null!==_0x1399e7,'ranges':[_0x214d70],'areActionsDisabled':_0x7e6b82['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x1b53d2,_0x3b12cc),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x1b53d2,'index':_0x3b12cc,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x2316fd,_0x28f14a,_0x19d148){const {reply:_0x4f2d6d}=this['getInteractionAndReplyById'](_0x2316fd),_0x5407a9=_0x4f2d6d['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x5407a9['length'])return null;const _0x59f2ad=_0x5407a9['findIndex'](_0x5758cd=>_0x5758cd['index']==_0x28f14a),_0x272026='next'==_0x19d148?0x1:-0x1;let _0x33e802=_0x5407a9['at']((_0x59f2ad+_0x272026)%_0x5407a9['length'])['index'],_0x2605cb=_0x5407a9[_0x33e802];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x2316fd,_0x4f2d6d,_0x2605cb);){if(_0x33e802=_0x5407a9['at']((_0x33e802+_0x272026)%_0x5407a9['length'])['index'],_0x33e802===_0x59f2ad)return null;_0x2605cb=_0x5407a9[_0x33e802];}return _0x33e802;}['_getUserPresentableContentPartDocumentRange'](_0x1a8b74,_0x1a2c65,_0x5d7386){const _0x2fcf76=_0x1a2c65['changeGroups'];if(!_0x5d7386['hasChanges'])return null;const _0xf626fa=_0x2fcf76['find'](_0x49cf7d=>_0x49cf7d['index']==_0x5d7386['index']);if('pending'!==_0xf626fa?.['state'])return null;const _0x288916=this['_getDocumentRangeForReplyChanges'](_0x1a8b74,_0x5d7386['index']);if(!_0x288916)return null;const {range:_0x2b11fb,currentIndex:_0x17dc79}=_0x288916;return'$graveyard'==_0x2b11fb['root']['rootName']?(_0x1a2c65['setChangeGroupState'](_0x17dc79,'outdated'),null):_0x288916['range'];}['_getDocumentRangeForReplyChanges'](_0x1b1467,_0x5ce49e){const _0x61d79d=D(this['context']),{reply:_0x31a248,interaction:_0x3597a0}=this['getInteractionAndReplyById'](_0x1b1467),_0x5e0af1=_0x31a248['changeGroups']['filter'](_0x402888=>'pending'==_0x402888['state']),_0x8586c1=_0x5e0af1['map'](_0x513a0f=>_0x31a248['changeGroups']['indexOf'](_0x513a0f));void 0x0===_0x5ce49e&&(_0x5ce49e=_0x8586c1[0x0]);const _0x4f6609=_0x8586c1['indexOf'](_0x5ce49e);if(-0x1==_0x4f6609)return null;const _0xaf2457=_0x5e0af1[_0x4f6609],_0x37233a=new _0x1ebbd3([]),_0x3d83e0=new _0x1ebbd3([]);for(const _0x4ab8de of _0xaf2457['changes'])if('removed'!=_0x4ab8de['type']&&_0x3d83e0['children']['push'](_0x4ab8de['node']['cloneNode'](!0x0)),'new'!=_0x4ab8de['type']){const _0x1a92b4=_0x1f6293(_0x12bed5=>q(_0x12bed5,'data-id')==_0x4ab8de['id'],_0x31a248['documentContextContent'],!0x0);_0x37233a['children']['push'](_0x1a92b4['cloneNode'](!0x0));}if(0x0==_0x37233a['children']['length']){if(_0xaf2457['changes'][0x0]['anchorId']){const _0x2358fe=Z('data-id',_0xaf2457['changes'][0x0]['anchorId'],_0x31a248['documentContextContent']);_0x37233a['children']['unshift'](_0x2358fe['cloneNode'](!0x0)),_0x3d83e0['children']['unshift'](_0x2358fe['cloneNode'](!0x0)),_0x2358fe['nextSibling']&&(_0x37233a['children']['push'](_0x2358fe['nextSibling']['cloneNode'](!0x0)),_0x3d83e0['children']['push'](_0x2358fe['nextSibling']['cloneNode'](!0x0)));}else{const _0x58edd9=_0x31a248['documentContextContent']['children'][0x0];if(!_0x58edd9)return null;_0x37233a['children']['push'](_0x58edd9['cloneNode'](!0x0)),_0x3d83e0['children']['push'](_0x58edd9['cloneNode'](!0x0));}}const _0x109e1e=_0x3597a0['getDocumentContext'](),_0x4d8b79=_0x61d79d['data']['parse'](_0x109e1e['content']),_0x462875=Y(_0x37233a),_0x4fe106=_0x61d79d['data']['parse'](_0x462875),_0x294331=_0x61d79d['data']['parse'](_0x462875),_0x555fb0=_0x61d79d['model']['createPositionAt'](_0x4fe106,0x0),_0x344120=Y(_0x3d83e0),_0x23e321={'anchor':_0x555fb0,'markDeletions':!0x1},_0x953c08=_0x61d79d['plugins']['get'](_0x339a14)['getDiff'](_0x462875,_0x344120,_0x23e321)['getOperations']();if(!_0x953c08['length'])return null;_0x61d79d['model']['change'](_0x3dd93c=>{for(const _0x45c5bb of _0x953c08)if('remove'==_0x45c5bb['type']){const _0x9cffba=_0x45c5bb['sourcePosition'],_0xae6043=_0x45c5bb['howMany'],_0x3292d7=new _0x1f3d0d(_0x9cffba,_0xae6043);_0x3dd93c['batch']['addOperation'](_0x3292d7),_0x61d79d['model']['applyOperation'](_0x3292d7);}else'marker'!==_0x45c5bb['type']&&(_0x45c5bb['baseVersion']=null,_0x45c5bb['isDocumentOperation']=!0x1,_0x3dd93c['batch']['addOperation'](_0x45c5bb),_0x61d79d['model']['applyOperation'](_0x45c5bb));});const _0x4340ae=W(_0x61d79d,_0x953c08,_0x4fe106);G(_0x61d79d['model'],_0x4340ae);const _0x4509d6=_0x4340ae['getFirstRange']()['start']['path']['slice'](),_0x97e2ef=_0x4340ae['getFirstRange']()['end']['path']['slice'](),_0x470f77=[];let _0xe619ef=_0x4fe106,_0x3a2ea4=_0x294331;for(let _0x47f4a5=0x0;_0x47f4a5<_0x97e2ef['length'];_0x47f4a5++){const _0x180330=_0xe619ef['maxOffset']-_0x97e2ef[_0x47f4a5];_0x470f77[_0x47f4a5]=_0x3a2ea4['maxOffset']-_0x180330,_0xe619ef=_0xe619ef['getChildAtOffset'](_0x97e2ef[_0x47f4a5]),_0x3a2ea4=_0x3a2ea4['getChildAtOffset'](_0x470f77[_0x47f4a5]);}const _0x3ed1a0=_0x61d79d['model']['createRange'](_0x61d79d['model']['createPositionFromPath'](_0x294331,_0x4509d6),_0x61d79d['model']['createPositionFromPath'](_0x294331,_0x470f77)),_0x31907a=_0x294331['getChild'](0x0)['getAttribute'](_0x4c4c60),_0xe570d5=Array['from'](_0x4d8b79['getChildren']())['find'](_0x390640=>_0x390640['getAttribute'](_0x4c4c60)==_0x31907a)['getPath'](),_0x5dea58=_0x3ed1a0['start']['path']['slice'](),_0x556e38=_0x3ed1a0['end']['path']['slice']();_0x5dea58[0x0]=_0xe570d5[0x0]+_0x5dea58[0x0],_0x556e38[0x0]=_0xe570d5[0x0]+_0x556e38[0x0];let _0x420183=_0x61d79d['model']['createRange'](_0x61d79d['model']['createPositionFromPath'](_0x61d79d['model']['document']['getRoot'](),_0x5dea58),_0x61d79d['model']['createPositionFromPath'](_0x61d79d['model']['document']['getRoot'](),_0x556e38));const _0x169561=_0x61d79d['model']['document']['history']['getOperations'](_0x109e1e['version']);for(const _0x324656 of _0x169561)_0x420183=_0xa8a41e['_createFromRanges'](_0x420183['getTransformedByOperation'](_0x324656));return{'range':_0x420183,'currentIndex':_0x5ce49e};}['_integrateEditor'](_0x226160){if(!_0x226160['plugins']['has']('Undo'))return;const _0x38f07f=_0x226160['commands']['get']('undo'),_0x1871f0=_0x226160['commands']['get']('redo');this['listenTo'](_0x38f07f,'revert',(_0x27c433,_0x1fb50b,_0x117671)=>{const _0x541c58=this['_batchToChanges']['get'](_0x1fb50b);if(!_0x541c58)return;const _0x4bfeab=this['activeConversation']['getInteraction'](_0x541c58['interactionId'])['getReply'](_0x541c58['replyId']);_0x541c58['indexes']['forEach'](_0x1de4f8=>_0x4bfeab['setChangeGroupState'](_0x1de4f8,'pending')),this['_batchToChanges']['delete'](_0x1fb50b),this['_batchToChanges']['set'](_0x117671,_0x541c58);}),this['listenTo'](_0x1871f0,'revert',(_0x400197,_0x155891,_0x17f9ae)=>{const _0x303fca=this['_batchToChanges']['get'](_0x155891);if(!_0x303fca)return;const _0x20f9dc=this['activeConversation']['getInteraction'](_0x303fca['interactionId'])['getReply'](_0x303fca['replyId']);_0x303fca['indexes']['forEach'](_0x4be2df=>_0x20f9dc['setChangeGroupState'](_0x4be2df,'accepted')),this['_batchToChanges']['delete'](_0x155891),this['_batchToChanges']['set'](_0x17f9ae,_0x303fca);});}async['loadConversation'](_0x5f18a6){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](H)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x5f18a6)['getConversation'](),await this['_startConversationSafely'](_0x5f18a6),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x5f18a6,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x3c852f){this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x5f18a6}),this['_logError'](new _0x36ce55('ai-chat-conversation-not-found',this,{'error':_0x3c852f}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0x139028=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x151f26=await _0x139028['getConversations']();return _0x151f26['length']?_0x151f26[0x0]['id']:'new';}catch(_0x4eb4e9){return this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x5ee109()}),this['_logError'](new _0x36ce55('ai-chat-conversation-init-failed',this,{'error':_0x4eb4e9})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x1dc65f){this['activeConversation']['id']===_0x1dc65f&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](m(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x525b6a=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x525b6a),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x24efb8,attributes:_0x5b1811}){await this['_handleUIUserMessage']({'userMessage':_0x24efb8,'attributes':_0x5b1811});}['getGroupId'](){const _0x30454f=this['context']['config']['get']('collaboration.channelId');if(!_0x30454f)throw new _0x36ce55('ai-chat-missing-channel-id',this);return _0x30454f;}async['_startConversationSafely'](_0xae7bb6){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0xae7bb6);}catch(_0xac7098){this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0xae7bb6||_0x5ee109()}),console['error'](_0xac7098),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x381766){let _0x2fef8c;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x381766||!this['activeConversation']?_0x2fef8c=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x2fef8c=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x2fe0a2=this['getGroupId'](),_0x2dc1c1=_0x381766||_0x5ee109();this['activeConversation']=new F({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x2fef8c,'conversationId':_0x2dc1c1,'group':_0x2fe0a2,'getEditor':()=>D(this['context']),'isFromHistory':!!_0x381766}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x4f517d,_0x9d9dc8)=>{this['_aiChatUi']['createConversation'](_0x9d9dc8),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x381766||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x61f2d5,_0x5d2566)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x5d2566['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x3d7e7a,_0x1fcedd)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x1fcedd);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x19cc7a=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x19cc7a);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x5891e4=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x5891e4);}),this['activeConversation']['on']('webSearchFinished',(_0x277a42,_0x4659ab)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x4659ab,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x2d8c84,_0x337f59)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x337f59,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x22e05e,_0x1a1d01)=>{this['_aiChatUi']['removeFeedInteraction'](_0x1a1d01['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x30c477,_0x1ac45f,_0x55cbf1)=>{this['updateConversationTitle'](_0x1ac45f,_0x55cbf1);}),this['activeConversation']['on']('replyCreated',(_0x2ea387,_0x4e3ce7)=>{'text'===_0x4e3ce7['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x4e3ce7):this['_aiChatUi']['addFeedItemAISuggestion'](_0x4e3ce7);}),this['activeConversation']['on']('replyContentUpdated',async(_0x17a61c,_0x46a8ce)=>{await this['_updateReplyContent']({'reply':_0x46a8ce});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x5e4066,{reply:_0x46aaed,index:_0x59b1f1,state:_0x537e30})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x46aaed['id'],'index':_0x59b1f1,'state':_0x537e30}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x46aaed['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x59b1f1&&this['_aiChatBalloon']?.['setState'](_0x537e30);}),this['activeConversation']['on']('contextItemAdded',(_0x3f28c2,_0x5b2792)=>{if(this['_aiChatUi']['addContextItem'](_0x5b2792['contextItem'],_0x5b2792['isLoading']),'selection'===_0x5b2792['contextItem']['type']){const _0x477aaa=[...D(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x477aaa,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x373b70,_0x43bbc9)=>{this['_aiChatUi']['removeContextItem'](_0x43bbc9['uiId']),'current-document'==_0x43bbc9['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x43bbc9['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x1bef62,_0x45009c)=>{this['_aiChatUi']['setContextItemLoading'](_0x45009c['contextItem']['uiId'],_0x45009c['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x5e34df,_0x30e2c6)=>{this['_aiChatUi']['setConversationContext'](_0x30e2c6['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x2792dd,_0x5cf58b)=>{this['_aiChatUi']['setAddContextOptions'](_0x5cf58b['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x276975,_0xbdd1a7)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0xbdd1a7['sourceId'],_0xbdd1a7['source'],_0xbdd1a7['resources'],_0xbdd1a7['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x404e95,_0x5e2a0f)=>{this['_aiChatUi']['updateResourceState'](_0x5e2a0f['sourceId'],_0x5e2a0f['resourceId'],_0x5e2a0f['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x22aa29,_0x2d2e32)=>{this['_aiChatUi']['updateCapabilities'](_0x2d2e32);}),this['activeConversation']['on']('modelSelected',async(_0x2fc2e8,_0x467397)=>{const _0x32dd28=(await this['_aiChatModels']['getAll']())['find'](_0x5d38ae=>_0x5d38ae['id']===_0x467397['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x32dd28,_0x467397['isDisabled']);}),this['activeConversation']['on']('error',(_0x59af2d,{error:_0x34c7e0,interactionId:_0x758afe,fileName:_0x1daf58,url:_0x11abe0,sourceId:_0xaf05a,sourceLabel:_0x4baa9c})=>{const _0x38bc95=_0x758afe?_0x758afe+':'+_0x5ee109():_0x5ee109();_0x34c7e0['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':m(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x38bc95}):_0x34c7e0['message']['startsWith']('ai-chat-conversation-init-failed')||_0x34c7e0['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x38bc95}),this['_logError'](_0x34c7e0)):_0x34c7e0['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x1daf58),'id':_0x38bc95}):_0x34c7e0['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x11abe0),'id':_0x38bc95}):_0x34c7e0['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x38bc95}):_0x34c7e0['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x38bc95}):_0x34c7e0['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0xaf05a&&this['_aiChatUi']['closeSourceResourceBalloon'](_0xaf05a),this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x4baa9c||'source'),'id':_0x38bc95}),this['_logError'](_0x34c7e0)):_0x34c7e0['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x38bc95}),this['_logError'](_0x34c7e0)):_0x34c7e0['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x38bc95}),this['_logError'](_0x34c7e0)):_0x34c7e0['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x38bc95}),this['_logError'](_0x34c7e0)):_0x34c7e0['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x38bc95}),this['_logError'](_0x34c7e0)):_0x34c7e0['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x38bc95}),this['_logError'](_0x34c7e0)):_0x34c7e0['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x38bc95}),this['_logError'](_0x34c7e0)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':m(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x38bc95}),this['_logError'](_0x34c7e0));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x381766||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x45746c,attributes:_0x2f33ca}){if(!this['activeConversation'])throw new _0x36ce55('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x21250a=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x21250a);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x45746c,'attributes':_0x2f33ca});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x46cae7){this['_aiChatUi']['setIsMaximized'](_0x46cae7);}['_logError'](_0x4f615f){_0x283c76(_0x4f615f['message']);}['_removeFromContext'](_0x31356d){this['activeConversation']?.['removeFromContext'](_0x31356d);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x335750){const [_0x3899a4,_0x5d0113]=_0x335750['split'](':'),_0x140074=this['activeConversation']['getInteraction'](_0x3899a4),_0x27b6ef=_0x140074['getReply'](_0x5d0113);return{'interaction':_0x140074,'reply':_0x27b6ef};}['_scrollToSuggestionRange'](_0x40a51f,_0x578c49=!0x1){const _0x18db53=D(this['context']),_0x4871bb={'target':_0x18db53['editing']['view']['domConverter']['viewRangeToDom'](_0x18db53['editing']['mapper']['toViewRange'](_0x40a51f)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x578c49};_0x578c49&&(_0x4871bb['alignToTop']=!0x0),_0x23d97c(_0x4871bb);}['updateConversationTitle'](_0xff22,_0xa2931c=!0x1){this['_aiChatUi']['setConversationTitle'](_0xff22||m(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0xa2931c);}async['_updateReplyContent']({reply:_0x57031a,renderingStrategy:_0x13b39}){const {id:_0x1e3c31,interactionId:_0x551f72,isDone:_0x2eb281,type:_0x2a0b3b,parsedContent:_0x4cf321}=_0x57031a,_0x2d73f4=_0x551f72+':'+_0x1e3c31;if('modification'===_0x2a0b3b){const _0x5d6da4=_0x57031a['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x2d73f4,'parts':_0x5d6da4,'renderingStrategy':_0x13b39,'isDone':_0x2eb281});}else'text'===_0x2a0b3b&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x2d73f4,'parsedContent':_0x4cf321,'renderingStrategy':_0x13b39,'isDone':_0x2eb281});_0x2eb281&&_0x57031a['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x2d73f4,_0x57031a['sources']);}async['_stopLastInteraction'](){const _0x35a235=this['activeConversation']?.['lastInteraction'];_0x35a235&&(_0x35a235['stop'](),this['_aiChatUi']['stopInteraction'](_0x35a235));}async['_flushLastInteractionUI'](){const _0x4dcf8=this['activeConversation']?.['lastInteraction'];if(_0x4dcf8){for await(const _0x1a1d43 of _0x4dcf8['replies'])await this['_updateReplyContent']({'reply':_0x1a1d43,'renderingStrategy':'static'});}}['_updateRatings'](_0x40051c){const _0x442ede={'positiveCount':_0x40051c['changeGroups']['filter'](_0x46257d=>'accepted'===_0x46257d['state'])['length'],'totalCount':_0x40051c['changeGroups']['length'],'modificationId':_0x40051c['id']},_0x2ccea9=this['activeConversation']['getInteraction'](_0x40051c['interactionId'])['messageId'];_0x2ccea9&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x2ccea9,_0x442ede);}['_registerToolDataCallback'](_0x3d3809){let _0x499ee5=null,_0x4a08e0=null;this['on']('toolDataReceived',(_0x28d08d,_0x59d0d9,_0x1541fe)=>{_0x1541fe['id']!==_0x499ee5&&(_0x499ee5=_0x1541fe['id'],_0x4a08e0=this['_getAIChatInteractionAPI'](_0x1541fe)),_0x3d3809(_0x59d0d9,_0x4a08e0);});}['_getAIChatInteractionAPI'](_0x336c23){const _0x2a04af=this['_aiChatUi'],_0x470a06=()=>{_0x336c23['resetWebSearchState'](),_0x336c23['resetReasoningState'](),_0x2a04af['clearLoadingMessage']();},_0x404c1c=()=>{_0x336c23['currentReply']&&(_0x336c23['currentReply']['done'](),_0x336c23['currentReply']=void 0x0);};return{'insertTextReply':(_0x519c76,_0x1007c1)=>{_0x404c1c(),_0x470a06();const _0x5625af=_0x336c23['currentReply']=_0x336c23['createReply']({'type':'text','interactionId':_0x336c23['id'],'content':_0x519c76,'id':_0x1007c1||_0x5ee109()});return _0x404c1c(),_0x5625af;},'insertCustomElement':async(_0x474f43,_0x585931)=>(_0x404c1c(),_0x470a06(),_0x2a04af['addFeedItemCustomElement'](_0x474f43,_0x585931||_0x5ee109())),'setLoadingMessage':_0x2d513e=>{_0x2a04af['setLoadingMessage'](_0x2d513e);},'clearLoadingMessage':()=>{_0x2a04af['clearLoadingMessage']();}};}}const a='ai-selection';class o extends _0x269016{constructor(_0x1e4aa0){super(_0x1e4aa0),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_displayedFakeSelectionId']=null;['_displayedFakeSelectionLocked']=!0x1;['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x386399=D(this['context']),_0x44e220=_0x386399['plugins']['has']('RealTimeCollaborationClient')&&_0x386399['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x44e220||_0x5ee109();}return this['_sessionId'];}async['getDocumentData'](){const _0x1631c3=D(this['context']),_0x2b44e8=_0x1631c3['model'],_0x520e41=_0x1631c3['data']['toView'](_0x2b44e8['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x31a212=new ft(_0x1631c3['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x520e41,_0x31a212);let _0x344e96=await this['_getDocumentDataStringFromView'](_0x520e41);const _0x47f02a=this['_getMarkersInDocumentOrder'](),_0x45d87e=[];for(const _0x5e7de0 of _0x47f02a){const _0x4bf3b5='<'+_0x5e7de0['name']+':start></'+_0x5e7de0['name']+':start>',_0x247675=_0x344e96['indexOf'](_0x4bf3b5);_0x344e96=_0x344e96['substring'](0x0,_0x247675)+_0x344e96['substring'](_0x247675+_0x4bf3b5['length']);const _0x1365fc='<'+_0x5e7de0['name']+':end></'+_0x5e7de0['name']+':end>',_0x16df99=_0x344e96['indexOf'](_0x1365fc);_0x344e96=_0x344e96['substring'](0x0,_0x16df99)+_0x344e96['substring'](_0x16df99+_0x1365fc['length']),_0x45d87e['push']({'markerName':_0x5e7de0['name'],'start':_0x247675,'end':_0x16df99,'htmlFragment':_0x344e96['substring'](_0x247675,_0x16df99)});}return{'content':_0x344e96,'version':_0x1631c3['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x45d87e};}async['afterInit'](){this['context']instanceof _0x5601f8?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x43f923,_0x4e67c2)=>{_0x4e67c2['on']('ready',()=>{this['_integrateEditor'](_0x4e67c2);});});}['_setOutputDataProcessor'](_0x44f1fc){this['_outputDataProcessor']=_0x44f1fc;}async['_getDocumentDataStringFromView'](_0x3b84b1){let _0x1e31eb;const _0x10220e=D(this['context']);if(this['_outputDataProcessor']){const _0x4bd3d8=_0x10220e['data']['processor']['domConverter']['viewToDom'](_0x3b84b1),_0x269196=await this['_outputDataProcessor'](_0x4bd3d8);_0x1e31eb=_0x10220e['data']['processor']['htmlWriter']['getHtml'](_0x269196);}else _0x1e31eb=_0x10220e['data']['processor']['toData'](_0x3b84b1);return _0x1e31eb;}['_integrateEditor'](_0x3a9f42){_0x3a9f42['conversion']['for']('editingDowncast')['markerToHighlight']({'model':a,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x3a9f42['conversion']['for']('dataDowncast')['markerToElement']({'model':a,'view':(_0x7c2317,{writer:_0x3f2c7a,options:_0x6e432c})=>_0x6e432c['convertAiChatSelectionMarker']?_0x3f2c7a['createUIElement'](_0x7c2317['markerName']+':'+(_0x7c2317['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x20301b,_0x801fc3,_0x4bda50=!0x1,_0x33c604=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x33c604)return!0x1;const _0x17f20d=D(this['context'])['model'];return _0x17f20d['change'](_0x4619fa=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x801fc3,this['_displayedFakeSelectionLocked']=_0x4bda50;let _0x4de16a=0x0;for(let _0x5c473a of _0x20301b){const _0x130bd4=a+':'+_0x4de16a;if(_0x5c473a['start']['isAtEnd']){const _0x5ab0e2=_0x5c473a['start']['getLastMatchingPosition'](({item:_0x3d97a6})=>!_0x17f20d['schema']['isContent'](_0x3d97a6),{'boundaries':_0x5c473a});_0x5c473a=_0x4619fa['createRange'](_0x5ab0e2,_0x5c473a['end']);}_0x4619fa['addMarker'](_0x130bd4,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5c473a}),_0x4de16a++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x1a56fe){if(this['_displayedFakeSelectionId']!=_0x1a56fe)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x358897=D(this['context']),_0xacaeca=_0x358897['model']['markers']['getMarkersGroup'](a);return _0x358897['model']['change'](_0x44d037=>{for(const _0xd669d7 of _0xacaeca)_0x44d037['removeMarker'](_0xd669d7);}),!0x0;}async['modelToDataWithIds'](_0x45cc2d){const _0x3cb768=D(this['context']),_0x13638d=_0x3cb768['data']['toView'](_0x45cc2d),_0x1f3d65=new ft(_0x3cb768['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x13638d,_0x1f3d65),this['_getDocumentDataStringFromView'](_0x13638d);}['_setDataIdsOnChildren'](_0x18d5a3,_0x1e2972){let _0x27bd46=!0x1;const _0x3b46d5=new Set();for(const _0x1b6830 of _0x18d5a3['getChildren']()){const _0x8c3de=_0x1b6830['is']('emptyElement')||_0x1b6830['is']('containerElement');if(!_0x1b6830['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x1b6830,_0x1e2972)||_0x8c3de)&&(_0x1e2972['setAttribute']('data-id',this['_nextDataId'](_0x3b46d5),_0x1b6830),_0x27bd46=!0x0);}return _0x27bd46;}['_nextDataId'](_0xa816b0){let _0x10fc91;do{_0x10fc91='';for(let _0x4cd2f0=0x0;_0x4cd2f0<0x4;_0x4cd2f0++)_0x10fc91+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0xa816b0['has'](_0x10fc91));return _0xa816b0['add'](_0x10fc91),_0x10fc91;}['getSelectionText'](){const {model:_0x474fe1}=D(this['context']),_0x578426=_0x474fe1['document']['selection'],_0x4d5d0e=[];for(const _0x11b3b1 of _0x578426['getRanges']())for(const _0x529105 of _0x11b3b1['getItems']())_0x529105['is']('$textProxy')?_0x4d5d0e['push'](_0x529105['data']):_0x529105['is']('element')&&_0x4d5d0e['length']>0x0&&'\x20'!==_0x4d5d0e[_0x4d5d0e['length']-0x1]&&_0x4d5d0e['push']('\x20');return _0x4d5d0e['length']?'\x22'+_0x4d5d0e['join']('')['trim']()+'\x22':m(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0x5ed36d=D(this['context'])['model'];return Array['from'](_0x5ed36d['markers']['getMarkersGroup'](a))['sort']((_0x533403,_0x54e794)=>_0x533403['getStart']()['isBefore'](_0x54e794['getStart']())?-0x1:_0x533403['getStart']()['isAfter'](_0x54e794['getStart']())?0x1:0x0);}}const V=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],it=[...V,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x4cfed3){this['options']={'delay':_0x4cfed3['delay']??0x14,'textNodeStyle':_0x4cfed3['textNodeStyle'],'onStreamUpdate':_0x4cfed3['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x945d9a,targetElement:_0x437b8e,abortSignal:_0x8f25cc}){this['isStreaming']&&this['stop'](),_0x8f25cc?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x441ae5(_0x945d9a,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x55f5dd=0x0;_0x55f5dd<this['currentIndex'];_0x55f5dd++)this['nodesList'][_0x55f5dd]['shouldBeStreamed']=!0x0;do{const _0x59323e=Date['now'](),_0x1a167d=this['nodesList'][this['currentIndex']],_0x35f337=_0x59323e-this['lastUpdateTime'];if(_0x1a167d){_0x1a167d['shouldBeStreamed']=!0x0;let _0x4c2a36=_0x1a167d['parent'];for(;_0x4c2a36;)_0x4c2a36['shouldBeStreamed']=!0x0,_0x4c2a36=_0x4c2a36['parent'];}if(_0x35f337<this['options']['delay'])try{const {promise:_0x423069,abortController:_0xa2c3d7}=Ls(this['options']['delay']-_0x35f337);this['timeoutAbortController']=_0xa2c3d7,await _0x423069;}catch(_0x4d717c){return;}_0x2dcc48(_0x437b8e,'<'+_0x437b8e['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x437b8e['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}['reset'](){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}['cleanUpAnimations']({targetElement:_0x16748a}){Array['from'](_0x16748a['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x50e657=>{_0x50e657['replaceWith'](_0x50e657['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x3c7212){let _0x2231cc='';if(function(_0x177ffb){return _0x9432b7(_0x177ffb);}(_0x3c7212)){for(const _0x7c1339 of _0x3c7212['children'])_0x2231cc+=this['renderNode'](_0x7c1339);}else{if(Ds(_0x3c7212)){if(!_0x3c7212['shouldBeStreamed'])return'';const _0x1b349a=_0x3c7212,_0x1e9a47=Object['entries'](_0x1b349a['attribs'])['map'](([_0x597a5e,_0x28a710])=>_0x597a5e+'=\x22'+_0x28a710+'\x22')['join']('\x20');_0x2231cc+='<'+_0x1b349a['tagName']+(_0x1e9a47?'\x20'+_0x1e9a47:'')+'>';for(const _0x9d9c36 of _0x20b3bc(_0x1b349a))_0x2231cc+=this['renderNode'](_0x9d9c36);_0x2231cc+='</'+_0x1b349a['tagName']+'>';}else{if(!Ts(_0x3c7212))return'';if(!_0x3c7212['shouldBeStreamed'])return'';!function(_0x3055d4){if(!_0x3055d4['parent']||!Ds(_0x3055d4['parent']))return!0x1;if(!ys['includes'](_0x3055d4['parent']['tagName']))return!0x1;return!_0x2a8dd4(_0x3055d4)['match'](/^\s*[<>]\s*$/);}(_0x3c7212)?_0x2231cc+=_0x32bc88(_0x3c7212):_0x2231cc+=_0x32bc88(new _0x143df1('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x3c7212]));}}return _0x2231cc;}['getParsedDocumentNodeList'](){const _0x20fef9=[];return function(_0x2e236d,_0x14834e){const _0x5c08cd=_0x4f12ae=>{if(_0x14834e(_0x4f12ae),_0x4f12ae instanceof _0x138369)for(let _0xc3cad1=0x0;_0xc3cad1<_0x4f12ae['children']['length'];_0xc3cad1++){const _0x23fb7b=_0x4f12ae['children'][_0xc3cad1];_0x5c08cd(_0x23fb7b);}};for(let _0x5b498b=0x0;_0x5b498b<_0x2e236d['children']['length'];_0x5b498b++)_0x5c08cd(_0x2e236d['children'][_0x5b498b]);}(this['document'],_0x45b4c7=>{if(Ts(_0x45b4c7)){const _0x847022=this['splitTextNodeIntoWordNodes'](_0x45b4c7);_0x847022['length']&&_0x20fef9['push'](..._0x847022);}_0x45b4c7['isWordSplitSource']||_0x45b4c7['isWordSplitResult']||_0x20fef9['push'](_0x45b4c7);}),_0x20fef9;}['splitTextNodeIntoWordNodes'](_0x43c08b){if(_0x43c08b['isWordSplitSource']||_0x43c08b['isWordSplitResult'])return[];const _0x3d217b=_0x2a8dd4(_0x43c08b)['match'](/(?:\s*\S+\s*)/g),_0x132f4e=[];if(_0x3d217b&&_0x3d217b['length']>0x1){for(const _0x3a2552 of _0x3d217b){const _0x3a7d1b=new _0x101e1d(_0x3a2552);_0x3a7d1b['isWordSplitResult']=!0x0,_0x538e3b(_0x43c08b,_0x3a7d1b),_0x132f4e['push'](_0x3a7d1b);}_0x43c08b['isWordSplitSource']=!0x0,_0x53f32a(_0x43c08b);}return _0x132f4e;}}const ys=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Ts(_0x477136){return _0x19f89b(_0x477136);}function Ds(_0x3a9ea4){return _0x89e9ec(_0x3a9ea4);}function Ls(_0x3ee0a4){const _0x1dad8c=new AbortController();return{'promise':new Promise((_0x8736e5,_0x1810d7)=>{const _0x389991=setTimeout(_0x8736e5,_0x3ee0a4);_0x1dad8c['signal']['addEventListener']('abort',()=>{clearTimeout(_0x389991),_0x1810d7();});}),'abortController':_0x1dad8c};}class yr extends _0x13218d{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x257d9f){super();const _0x2a11f8=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x257d9f,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x2a11f8['if']('isDone','ck-ai-chat__feed__item_done'),_0x2a11f8['if']('isVisible','ck-hidden',_0x11fb12=>!_0x11fb12),'ck-ai-chat__feed__text-item'],'data-cke-ai-id':this['options']['id']},'children':this['children']});}['markAsDone'](){this['htmlStreamer']['cleanUpAnimations']({'targetElement':this['element']}),this['element']['querySelectorAll']('[data-id]')['forEach'](_0x27c2ba=>{_0x27c2ba['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x3154a7,_0x4e1c03,_0x2487be){await this['htmlStreamer']['stream']({'document':_0x3154a7,'targetElement':_0x4e1c03,'abortSignal':_0x2487be});}}class oa extends _0x13218d{['showChangesToggleView'];constructor(_0x505c09,_0xa75193){super(_0x505c09),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Or(_0x505c09),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':m(_0x505c09,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0xa75193['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x5982cc=>_0x5982cc?_0x5a1fad:_0x112fb1),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x4e75c9=new _0x25fec4();_0x4e75c9['content']=_0x124970,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0xa75193['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x4e75c9,{'tag':'span','children':[m(_0x505c09,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Or extends _0x494e59{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const Wr={'accepted':_0x2d7ecc,'rejected':_0x4e7afc,'outdated':_0x4e7afc};class as extends _0x13218d{['stateIconView'];constructor(_0x3925ba){super(_0x3925ba);const _0xc0a68f=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new Yr(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0xc0a68f['to']('state',_0x240eea=>'ck-ai-suggestion__content-part-state_'+_0x240eea),_0xc0a68f['if']('isVisible','ck-hidden',_0x796bd0=>!_0x796bd0)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0xc0a68f['to']('state',_0x259c06=>{switch(_0x259c06){case'accepted':return m(_0x3925ba,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return m(_0x3925ba,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return m(_0x3925ba,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x17b71b){this['state']=_0x17b71b;}}class Yr extends _0x25fec4{constructor(){super(),this['set']('state','accepted'),this['content']=Wr[this['state']],this['on']('change:state',()=>{this['content']=Wr[this['state']];});}}class os extends _0x8fb4e9{['_applyButton'];['_suggestButton'];constructor(_0x369327,_0x492e31,_0x4ff4a1){super(_0x369327);const _0xea0f24=Boolean(_0x4ff4a1);this['set']('isEnabled',!_0xea0f24),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x12cc10=[];if(_0xea0f24){const _0x26cd3b=new _0x494e59(_0x369327);_0x26cd3b['set']({'label':m(_0x369327,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc}),_0x12cc10['push'](_0x26cd3b);}else{_0x492e31['includes']('applySuggestion')&&(this['_applyButton']=new _0x494e59(_0x369327),this['_applyButton']['set']({'label':m(_0x369327,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x2d7ecc}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x12cc10['push'](this['_applyButton'])),_0x492e31['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x494e59(_0x369327),this['_suggestButton']['set']({'label':m(_0x369327,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x29a8f4}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x12cc10['push'](this['_suggestButton']));const _0x3ef52a=new _0x494e59(_0x369327);_0x3ef52a['set']({'label':m(_0x369327,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x4e7afc}),_0x3ef52a['bind']('isEnabled')['to'](this),_0x3ef52a['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x12cc10['push'](_0x3ef52a);}this['items']['addMany'](_0x12cc10);const _0x546bb5=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x546bb5['if']('isVisible','ck-hidden',_0x56021b=>!_0x56021b)]}});}['setButtonsVisibility']({showApplyButton:_0x4e22d0,showSuggestButton:_0x363915}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x4e22d0),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x363915);}}class yn extends _0x13218d{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x462e9d,{part:_0x455264,uiIndex:_0x480fac,availableActions:_0x48af5f,areActionsDisabled:_0x476a70}){super(_0x462e9d),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new os(_0x462e9d,_0x48af5f,_0x476a70),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x455264['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x455264['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x455264['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new as(_0x462e9d),this['titleLabelView']=new Sn(_0x462e9d,_0x480fac),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],this['toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x4d5bf8,_0xf1c876,_0x41b829,_0xa9d9df)=>{'pending'===_0xa9d9df?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x41b829?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x41b829),this['children']['add'](this['stateView']));});}}class Sn extends _0x13218d{constructor(_0x27c075,_0x48dc89){super(_0x27c075),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[m(_0x27c075,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x48dc89['toString']())]});}}class es extends _0x13218d{['htmlStreamer'];constructor(_0x4990a0){super(_0x4990a0),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x17d8bb,renderingStrategy:_0xaf325,abortSignal:_0x2ec3cf}){'streaming'===_0xaf325?await this['htmlStreamer']['stream']({'document':_0x17d8bb['content'],'targetElement':this['element'],'abortSignal':_0x2ec3cf}):this['element']['innerHTML']=Y(_0x17d8bb['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0x13218d{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x3d2ec8,{part:_0x446e0e,uiIndex:_0x3f8942,areActionsDisabled:_0x5ab3c6,availableActions:_0xd76c7e}){super(_0x3d2ec8);const _0x4e615d=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0xa1656c=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x5ab3c6;};this['on']('change:state',_0xa1656c),this['on']('change:isDone',_0xa1656c),_0xa1656c(),this['_children']=this['createCollection'](),this['_headerView']=new yn(_0x3d2ec8,{'part':_0x446e0e,'uiIndex':_0x3f8942,'availableActions':_0xd76c7e,'areActionsDisabled':_0x5ab3c6}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...V)['to'](this),this['_streamableContentView']=new es(_0x3d2ec8),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x4e615d['to']('state',_0x2a15d4=>'ck-ai-suggestion__body__content-part_'+_0x2a15d4),_0x4e615d['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x4e615d['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x4e615d['if']('isVisible','ck-hidden',_0x5c3aa6=>!_0x5c3aa6)]},'children':this['_children'],'on':{'mouseenter':_0x4e615d['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x446e0e['index']});}),'mouseleave':_0x4e615d['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x446e0e['index']});}),'click':_0x4e615d['to'](_0x2a0fa5=>{const _0xf4f90e=_0x2a0fa5['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0xf4f90e)&&this['fire']('showChangeInText',{'index':_0x446e0e['index']});})}});}async['updateContent']({part:_0x39ce8f,renderingStrategy:_0x48f900,showUnchangedParts:_0x529537=!0x1,abortSignal:_0x14955c}){this['partDefinition']=_0x39ce8f,this['isVisible']=this['partDefinition']['hasChanges']||_0x529537,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x39ce8f,'renderingStrategy':_0x48f900,'abortSignal':_0x14955c});}['markAsDone'](){this['isDone']=!0x0;}}class g extends Ft(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x427a38){const _0x3c5338=this['createTask'](_0x427a38);return this['queue']['push'](_0x3c5338),this['_processQueue'](),_0x3c5338['completePromise'];}['abort'](){this['isProcessing']&&(this['_abortController']['abort'](),this['_abortController']=void 0x0,this['queue']=[],this['fire']('_queueEmpty'),this['isProcessing']=!0x1);}get['queueEmptyPromise'](){return this['queue']['length']||this['isProcessing']?new Promise(_0x1e4ac6=>{this['once']('_queueEmpty',()=>{_0x1e4ac6();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0xf8df73=this['queue']['shift']();try{await _0xf8df73['callback'](this['_abortController']['signal']),_0xf8df73['resolve']();}catch(_0x525268){_0xf8df73['reject'](_0x525268);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x3c262d){let _0x2e545e,_0x3ddb07;const _0x295295=new Promise((_0x53b83b,_0x2a3aaf)=>{_0x2e545e=_0x53b83b,_0x3ddb07=_0x2a3aaf;});return{'callback':_0x3c262d,'resolve':_0x2e545e,'reject':_0x3ddb07,'completePromise':_0x295295};}}class Pe extends yr{constructor(_0x4ca070){super(_0x4ca070),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x4ca070['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x22084b){this['element']['innerHTML']=_0x22084b;}}const S=['applySuggestion','insertSuggestion'];class ra extends _0x13218d{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x37b677,_0x1ade62=[...S],_0x230b90){super(_0x37b677);const _0x432c01=this['bindTemplate'],_0x534577=Boolean(_0x230b90);if(this['set']('isEnabled',!_0x534577),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x534577){const _0x487dc2=new _0x494e59(_0x37b677);_0x487dc2['set']({'label':m(_0x37b677,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc});const _0x3c6e78=new _0x13218d(_0x37b677);_0x3c6e78['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[m(_0x37b677,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x487dc2]}]}),this['children']['add'](_0x3c6e78);}else this['_applyChangesButton']=new _0x494e59(_0x37b677),this['_applyChangesButton']['set']({'label':m(_0x37b677,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x1ade62['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x494e59(_0x37b677),this['_insertSuggestionsButton']['set']({'label':m(_0x37b677,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x1ade62['includes']('insertSuggestion'),'class':'ck-ai-button-secondary'}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x1287cb=>{_0x1287cb['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']]);this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x432c01['if']('isVisible','ck-hidden',_0x141720=>!_0x141720)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x1e5e68){this['isVisible']=_0x1e5e68;}['_switchButtonLabelsPlurality'](_0x21c397){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x21c397?(this['_applyChangesButton']['label']=m(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=m(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=m(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=m(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class Cr extends _0x13218d{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x14990b,_0x41b0f7){super(_0x14990b),this['bodyCollection']=_0x41b0f7,this['children']=this['createCollection'](),this['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources',this['bindTemplate']['if']('isVisible','ck-hidden',_0x16e144=>!_0x16e144)]},'children':this['children']});const _0x4dd154=new _0x13218d(this['locale']),_0x41655f=new _0x25fec4();_0x41655f['content']=_0x2d1b31,_0x4dd154['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x41655f,{'tag':'span','children':[{'text':m(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x4dd154),this['_setupBalloonPanel'](_0x14990b);}['addSource'](_0x197237){this['children']['add'](new br(this['locale'],_0x197237,this['balloonPanelView']));}['_setupBalloonPanel'](_0x46459b){this['balloonPanelView']=new _0x514db0(_0x46459b),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class br extends _0x494e59{['balloonPanelView'];['source'];constructor(_0x59104e,_0x507151,_0x1c3ec3){super(_0x59104e),this['source']=_0x507151,this['balloonPanelView']=_0x1c3ec3,this['set']({'label':_0x507151['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x39497b=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x39497b['to'](()=>{window['open'](_0x507151['url'],'_blank');}),'mouseenter':_0x39497b['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x39497b['to'](()=>{this['_hideTooltip']();})}}),_0x507151['favicon']){const _0x21c097=new _0x13218d(_0x59104e);_0x21c097['setTemplate']({'tag':'img','attributes':{'src':_0x507151['favicon']||_0x2d1b31,'alt':_0x507151['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x21c097);}else this['set']('icon',_0x2d1b31);}['_createTooltipContentView'](_0x5db7ff,_0x54394a){const _0x853ef8=new _0x13218d(_0x5db7ff),_0xc4a189=[];let _0x3e2c9a;_0x54394a?.['favicon']?(_0x3e2c9a=new _0x13218d(_0x5db7ff),_0x3e2c9a['setTemplate']({'tag':'img','attributes':{'src':_0x54394a['favicon'],'alt':_0x54394a['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x3e2c9a=new _0x25fec4(),_0x3e2c9a['content']=_0x2d1b31,_0x3e2c9a['extendTemplate']({'attributes':{'alt':_0x54394a['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0xc4a189['push'](_0x3e2c9a);const _0x21534f=new _0x13218d(_0x5db7ff);_0x21534f['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x54394a['url']},'children':[{'text':new URL(_0x54394a['url'])?.['hostname']}]}),_0xc4a189['push'](_0x21534f);const _0x118a65=new _0x13218d(_0x5db7ff);_0x118a65['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0xc4a189});const _0x35be25=new _0x13218d(_0x5db7ff);return _0x35be25['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x54394a['title']['length']>0x190?_0x54394a['title']['substring'](0x0,0x190)+'...':_0x54394a['title']}]}),_0x853ef8['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x118a65,_0x35be25]}),_0x853ef8;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x514db0['defaultPositions']['northArrowSouth'],_0x514db0['defaultPositions']['northArrowSouthWest'],_0x514db0['defaultPositions']['northArrowSouthEast']],'limiter':document['querySelector']('.ck-ai-chat')}),this['balloonPanelView']['show']();}['_hideTooltip'](){this['balloonPanelView']['hide']();}['_updateTooltipContent'](){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0x5660f8=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x5660f8);}}class ca extends _0x13218d{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x19fc78,_0x3af65c){super(_0x19fc78);const {areActionsDisabled:_0x4318b5,showUnchangedParts:_0x53c651,availableActions:_0x1339e1}=_0x3af65c;this['_areActionsDisabled']=_0x4318b5,this['_showUnchangedParts']=_0x53c651,this['_availableActions']=_0x1339e1,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new g(),this['_emptyPartsWarningView']=new Pe({'id':'empty-parts-warning','initialContent':m(_0x19fc78,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x19fc78,_0x3af65c['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Cr(this['locale'],_0x3af65c['bodyCollection']),_0x3af65c['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...V)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x25dfd0,renderingStrategy:_0x4ace04,abortSignal:_0x49beab}){this['_children']['length']?_0x25dfd0['forEach'](_0x4bbba2=>{const _0x5bfb40=this['_cachedContentParts']['findIndex'](_0x3786a6=>_0x3786a6['index']==_0x4bbba2['index']);-0x1===_0x5bfb40?this['_cachedContentParts']['push'](_0x4bbba2):this['_cachedContentParts'][_0x5bfb40]=_0x4bbba2;}):this['_cachedContentParts']=_0x25dfd0;const _0x2c70dd=this['_showUnchangedParts']?_0x25dfd0:_0x25dfd0['filter'](_0x1cdcbc=>_0x1cdcbc['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x2c70dd['length']>0x1);for(const _0x34ad4b of _0x2c70dd)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x1e9b0=>{let _0x3ecb7a=this['getPartView'](_0x34ad4b['index']);_0x3ecb7a||(_0x3ecb7a=new na(this['locale'],{'part':_0x34ad4b,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x3ecb7a['delegate'](...V)['to'](this),this['_children']['add'](_0x3ecb7a),this['hasPendingParts']=!0x0),await _0x3ecb7a['updateContent']({'part':_0x34ad4b,'renderingStrategy':_0x4ace04,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x1e9b0}),_0x3ecb7a['markAsDone']();});return _0x49beab?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x39f523,_0x27e542){const _0x7da351=this['getPartView'](_0x39f523);_0x7da351&&(_0x7da351['state']=_0x27e542),this['hasPendingParts']='pending'==_0x27e542||Array['from'](this['_children'])['some'](_0x54537c=>'pending'==_0x54537c['state']);}['setPartActive'](_0x47da7c,_0x1c0771){if(!0x1===_0x47da7c){for(const _0x36ec3b of this['_children'])_0x36ec3b['isActive']=!0x1;}else{const _0x4f6e87=this['getPartView'](_0x47da7c);_0x4f6e87&&(_0x4f6e87['isActive']=_0x1c0771);}}['updateSources'](_0x2eb6d9){_0x2eb6d9['forEach'](_0x2dd775=>this['_sourcesView']['addSource'](_0x2dd775)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x2d716d){return this['_children']['find'](_0x3c5fe9=>_0x3c5fe9['partDefinition']['index']==_0x2d716d)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x327262=!this['_cachedContentParts']['find'](({hasChanges:_0x1a6798})=>_0x1a6798),_0x26da18=!!this['_cachedContentParts']['find'](({hasChanges:_0x53af44})=>!_0x53af44);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x26da18,_0x327262?this['_emptyPartsWarningView']['setContent'](m(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](m(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x519425=>_0x519425['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x4ff604=>_0x4ff604['partDefinition']['hasChanges'])['length']>0x0;}}class gn extends _0x13218d{['bodyView'];['children'];['headerView'];constructor(_0x1b1cb1,_0x3c00bc,_0x226ca8){super(_0x1b1cb1);const {showDiff:_0xe5b62c,areActionsDisabled:_0x3a594f,showUnchangedParts:_0x1bf823,availableActions:_0xcd5289}=_0x3c00bc;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0x1b1cb1,{'showDiff':_0xe5b62c}),this['headerView']['on']('toggleShowChanges',(_0x14ede7,_0x475ebd)=>{this['areChangesVisible']=_0x475ebd['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x475ebd['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ca(_0x1b1cb1,{'areActionsDisabled':_0x3a594f,'showUnchangedParts':!!_0x1bf823,'availableActions':_0xcd5289,'bodyCollection':_0x226ca8}),this['bodyView']['delegate'](...V)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x49f6e9){await this['bodyView']['updateContentParts'](_0x49f6e9);}['updateSources'](_0x187f3c){this['bodyView']['updateSources'](_0x187f3c);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class ke extends yr{['containerView'];constructor(_0xdf3d69,_0x540a60,_0x20de26){super(_0x540a60),this['set']('isTrackChangesOn',!0x1),this['containerView']=new gn(_0xdf3d69,{'showDiff':_0x540a60['showDiff'],'areActionsDisabled':_0x540a60['areActionsDisabled'],'availableActions':_0x540a60['availableActions']},_0x20de26),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x20ac63,_0x51c97e)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x51c97e['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x4c4855,{index:_0x1a4075})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x1a4075});}),this['containerView']['on']('applySuggestion',(_0x32ce40,{index:_0x38a340}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x38a340});}),this['containerView']['on']('insertSuggestion',(_0x18f6f0,{index:_0x3e3976}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3e3976});}),this['containerView']['on']('rejectSuggestion',(_0xe0512d,{index:_0x491514})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x491514});}),this['containerView']['on']('mouseOverSuggestion',(_0x1b7268,{index:_0x575459})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x575459});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x343809,{index:_0x3b4903})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3b4903});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x2b4f82){await this['containerView']['updateContent'](_0x2b4f82);}['updatePartState'](_0x2efc35,_0x1fab48){this['containerView']['bodyView']['updatePartState'](_0x2efc35,_0x1fab48);}['setPartActive'](_0x1ad594,_0x58ef2f){!0x1===_0x1ad594?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x1ad594,_0x58ef2f);}['updateSources'](_0x53b416){this['containerView']['updateSources'](_0x53b416);}['getPartView'](_0x4bc720){return this['containerView']['bodyView']['getPartView'](_0x4bc720);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class je extends yr{['replyContainer'];['_bodyCollection'];constructor(_0x31f41a,_0x2e823b,_0x5be6a7){super(_0x2e823b),this['_bodyCollection']=_0x5be6a7,this['locale']=_0x31f41a,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x13218d(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':He(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x422a71,renderingStrategy:_0x5ba242,abortSignal:_0x15df9b}){'streaming'===_0x5ba242?await this['streamIntoElement'](_0x422a71,this['replyContainer']['element'],_0x15df9b):this['replyContainer']['element']['innerHTML']=_0x32bc88(_0x422a71);}['updateSources'](_0x2a5bd0){const _0x5d88c3=new Cr(this['locale'],this['_bodyCollection']);_0x5d88c3['children']['addMany'](_0x2a5bd0['map'](_0x412629=>new br(this['locale'],_0x412629,_0x5d88c3['balloonPanelView']))),_0x5d88c3['isVisible']=!0x0,this['children']['add'](_0x5d88c3);}}class De extends _0x4667f2{constructor(_0xbd13af=void 0x0){super();const _0x461ccc=_0xbd13af?'ck-ai-spinner_'+_0xbd13af:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x461ccc]}});}}const xn={'file':_0x306b56,'document':_0x2d35c5,'web-resource':_0x3aa8ab,'text':_0x306b56,'selection':_0x5e5386,'mcp-tool-context':_0x2d35c5},$r='ck-ai-chat-context-chip',Qr='ck-ai-chat-context-chip_wide',Xr='ck-ai-chat-context-chip_document',Zr='ck-ai-chat-context-chip__label',la='ck-ai-chat-context-chip__type-icon',ua='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class To extends _0x494e59{constructor(_0x12cbe6,_0x219845,_0x43cb4e,_0x2906fe,_0x1274a2=!0x1){super(_0x12cbe6),this['_isAnimationOnEnterEnabled']=_0x2906fe,this['_initializeProperties'](_0x219845,_0x43cb4e,_0x1274a2),this['_setupTemplate']();}['render'](){super['render'](),this['_isAnimationOnEnterEnabled']&&this['element']&&(this['element']['classList']['add']('ck-ai-chat-context-chip_new-chip'),this['_handleAnimationEndOnce'](this['element'],()=>{this['element']&&this['element']['classList']['remove']('ck-ai-chat-context-chip_new-chip');}));}['disableAnimationOnEnter'](){this['_isAnimationOnEnterEnabled']=!0x1,this['element']&&this['element']['classList']['remove']('ck-ai-chat-context-chip_new-chip');}['_initializeProperties'](_0x1b17f0,_0x444d4a,_0x3d8265){this['set']('label',_0x1b17f0['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x1b17f0['type']),this['set']('id',_0x1b17f0['uiId']),this['set']('readonly',_0x444d4a),this['set']('isLoading',_0x3d8265);}['_setupTemplate'](){const _0x1859c3=this['_createIconView'](),_0x45788d=this['_createRemoveButton'](),_0x43ee6c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x43ee6c),'children':this['_createTemplateChildren'](_0x1859c3,_0x45788d,_0x43ee6c)});}['_createTemplateAttributes'](_0x5d7014){return{'class':[$r,_0x5d7014['if']('itemType',Xr,_0x558944=>'document'==_0x558944),_0x5d7014['if']('itemType',Qr,_0x5da535=>'selection'==_0x5da535)],'data-cke-tooltip-text':_0x5d7014['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':ua};}['_createTemplateChildren'](_0x408c30,_0x2e1b05,_0x570f7c){const _0x51998a=this['_createLabelElement'](_0x570f7c),_0x1bd30c=this['_createLoaderIcon']();return this['readonly']?[_0x408c30,_0x51998a]:[_0x408c30,_0x1bd30c,_0x51998a,_0x2e1b05];}['_createLabelElement'](_0x31b40c){return{'tag':'span','attributes':{'class':Zr},'children':[{'text':_0x31b40c['to']('label')}]};}['_createRemoveButton'](){const _0x428724=new _0x494e59(this['locale']);return _0x428724['set']({'label':m(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x58d0d9}),this['_setupRemoveButtonEvent'](_0x428724),_0x428724;}['_setupRemoveButtonEvent'](_0xf3dd9){_0xf3dd9['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x211e07=this['bindTemplate'],_0x4f27f4=new _0x25fec4();return _0x4f27f4['content']=xn[this['itemType']],_0x4f27f4['extendTemplate']({'attributes':{'class':[la,_0x211e07['if']('isLoading','ck-hidden',_0x2a7fce=>_0x2a7fce)]}}),_0x4f27f4;}['_handleAnimationEndOnce'](_0x1d82af,_0x2b1234){if(!_0x1d82af)return;const _0x6bfe78=()=>{_0x2b1234(),_0x1d82af['removeEventListener']('animationend',_0x6bfe78),_0x1d82af['removeEventListener']('webkitAnimationEnd',_0x6bfe78);};_0x1d82af['addEventListener']('animationend',_0x6bfe78),_0x1d82af['addEventListener']('webkitAnimationEnd',_0x6bfe78);}['_createLoaderIcon'](){const _0x1f822b=new De('small');return _0x1f822b['bind']('isVisible')['to'](this,'isLoading',_0x5969a1=>_0x5969a1),_0x1f822b;}}function In(_0x183778){if(!_0x183778)return _0x183778;if(_0x183778['length']<=0x78)return _0x183778;const _0x10978c=_0x183778['slice'](0x0,0x78),_0x59d4a4=_0x10978c['lastIndexOf']('\x20');return(_0x59d4a4>0x0?_0x10978c['slice'](0x0,_0x59d4a4):_0x10978c)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Eo{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x1cb887,_0x32d733,_0x31d3f8,_0x324572,_0x598be6){this['_locale']=_0x1cb887,this['_visibleChips']=_0x32d733,this['_config']={...hn,..._0x31d3f8,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x31d3f8['cssClasses']}},this['_overflowChips']=new _0x4c2902(),this['_bodyCollection']=_0x324572,this['_parentView']=_0x598be6||null;}['setContainerElement'](_0x3845e4){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x3845e4,this['_setupVisibilityObserver']();}get['showMoreButtonView'](){return this['_showMoreButtonView'];}get['overflowChips'](){return this['_overflowChips'];}['reorganizeChips'](){requestAnimationFrame(()=>{this['_checkAndHandleOverflow']();});}['showBalloonPanel'](){this['_showMoreButtonView']&&this['_showMoreBalloonPanelView']&&(this['_updateBalloonContent'](),this['_showMoreButtonView']['isOn']=!0x0,this['_showMoreBalloonPanelView']['show'](),this['_showMoreBalloonPanelView']['pin']({'target':this['_showMoreButtonView']['element'],'limiter':document['querySelector']('.ck-ai-chat')}));}['hideBalloonPanel'](){this['_showMoreButtonView']&&this['_showMoreBalloonPanelView']&&(this['_showMoreButtonView']['isOn']=!0x1,this['_showMoreBalloonPanelView']['hide']());}['clear'](){this['_overflowChips']['clear'](),this['hideBalloonPanel'](),this['_updateShowMoreButtonVisibility'](),this['_showMoreButtonView']&&(this['_showMoreButtonView']['label']=''),this['_showMoreBalloonPanelView']&&this['_showMoreBalloonPanelView']['content']['clear']();}['destroy'](){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_showMoreButtonView']&&(this['_showMoreButtonView']['destroy'](),this['_showMoreButtonView']=null),this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['destroy'](),this['_showMoreBalloonPanelView']=null);}['_checkAndHandleOverflow'](){if(!this['_containerElement'])return;if(!this['_isContainerVisible']())return void(this['_pendingCalculation']=!0x0);this['_pendingCalculation']=!0x1;const _0x5693db=[...this['_visibleChips'],...this['_overflowChips']],_0x3a18fa=this['_createCalculationContainer'](),_0x5c75eb=this['_calculateOverflowInContainer'](_0x3a18fa,_0x5693db),_0x3aaa9d=_0x3a18fa['_ancestorsToRestore'];_0x3aaa9d&&this['_restoreAncestorVisibility'](_0x3aaa9d),_0x3a18fa['remove'](),this['_applyOverflowResults'](_0x5693db,_0x5c75eb);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x16b45b({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x2c7c2=new _0x494e59(this['_locale']);_0x2c7c2['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0xda81fd=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0xda81fd['push'](this['_config']['cssClasses']['controlsButton']),_0x2c7c2['extendTemplate']({'attributes':{'class':_0xda81fd}}),_0x2c7c2;}['_createShowMoreBalloonPanelView'](){const _0x1839ed=new _0x514db0(this['_locale']);return _0x1839ed['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x1839ed),_0x1839ed;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x347c5a=>{_0x347c5a['disableAnimationOnEnter']();});const _0x14dcb3=new _0x13218d(this['_locale']);_0x14dcb3['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x14dcb3);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x3f35bf=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x3f35bf?'':'none');}['_repinBalloonPanel'](){this['_showMoreButtonView']?.['isOn']&&this['_showMoreBalloonPanelView']?.['isVisible']&&this['_showMoreButtonView']['element']&&this['_showMoreBalloonPanelView']['pin']({'target':this['_showMoreButtonView']['element'],'limiter':document['querySelector']('.ck-ai-chat')});}['_findTargetContainer'](_0x41c0fe){const _0xadf12d=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x2b39a4=this['_containerElement']?.['classList'];if(_0x2b39a4){const _0x1693c4=_0x2b39a4[0x0]||'',_0x3fa903=_0x41c0fe['querySelector']('.'+_0x1693c4),_0x35c362=_0x41c0fe['querySelector'](_0xadf12d);return _0x3fa903||_0x35c362||_0x41c0fe;}return _0x41c0fe['querySelector'](_0xadf12d)||_0x41c0fe;}['_calculateContainerWidth'](){const _0xeccad6=this['_parentView']?.['element']||this['_containerElement'];if(!_0xeccad6)return an;const _0x575507=window['getComputedStyle'](_0xeccad6)['width'];if('auto'===_0x575507||'0px'===_0x575507||!_0x575507){const _0x1b04b0=_0xeccad6['parentElement'];if(_0x1b04b0){const _0x6ba465=window['getComputedStyle'](_0x1b04b0);return'auto'!==_0x6ba465['width']?_0x6ba465['width']:an;}return an;}return _0x575507;}['_applyCalculationStyles'](_0x1cb772,_0x1f9cce){this['_config']['cssClasses']['calculationContainer']&&_0x1cb772['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x1cb772['style']['width']=_0x1f9cce,_0x1cb772['style']['position']='absolute',_0x1cb772['style']['top']='-9999px',_0x1cb772['style']['left']='-9999px',_0x1cb772['style']['opacity']='0',_0x1cb772['style']['pointerEvents']='none',_0x1cb772['style']['zIndex']='-1',_0x1cb772['style']['visibility']='visible\x20!important',_0x1cb772['style']['display']='block\x20!important',_0x1cb772['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x3713b0){_0x3713b0['forEach'](({element:_0x4c7c38,originalDisplay:_0x557f91,originalVisibility:_0x29d375})=>{_0x4c7c38['style']['display']=_0x557f91,_0x4c7c38['style']['visibility']=_0x29d375;});}['_makeAncestorsVisible'](_0x42a939){const _0x483dbc=[];let _0x306548=_0x42a939;for(;_0x306548&&_0x306548!==document['body'];){const _0x14c976=window['getComputedStyle'](_0x306548);'none'!==_0x14c976['display']&&'hidden'!==_0x14c976['visibility']||(_0x483dbc['push']({'element':_0x306548,'originalDisplay':_0x306548['style']['display'],'originalVisibility':_0x306548['style']['visibility']}),_0x306548['style']['display']='block',_0x306548['style']['visibility']='visible'),_0x306548=_0x306548['parentElement'];}return _0x483dbc;}['_createContainerElements'](){let _0x38d6c4,_0xab0a0;return this['_parentView']?.['element']?(_0x38d6c4=this['_parentView']['element']['cloneNode'](!0x0),_0xab0a0=this['_findTargetContainer'](_0x38d6c4)):(_0x38d6c4=document['createElement']('div'),_0xab0a0=_0x38d6c4),{'calculationContainer':_0x38d6c4,'targetContainer':_0xab0a0};}['_createCalculationContainer'](){const {calculationContainer:_0x33ecf5,targetContainer:_0x1ea92a}=this['_createContainerElements'](),_0x1945a6=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x33ecf5,_0x1945a6);const _0x44c393=this['_parentView']?.['element']||this['_containerElement'],_0x2c9419=_0x44c393?.['parentElement'];_0x2c9419?_0x2c9419['appendChild'](_0x33ecf5):document['body']['appendChild'](_0x33ecf5),_0x33ecf5['_targetContainer']=_0x1ea92a;const _0x2c4e71=this['_makeAncestorsVisible'](_0x2c9419||null);return _0x33ecf5['offsetWidth'],_0x33ecf5['_ancestorsToRestore']=_0x2c4e71,_0x33ecf5;}['_calculateOverflowInContainer'](_0x1d8a3d,_0x4859eb){const _0x42a8b8=_0x1d8a3d['_targetContainer']||_0x1d8a3d,_0x250233=[],{rowCount:_0x2e2767}=this['_renderChipsAndCountRows'](_0x42a8b8,_0x4859eb);if(_0x2e2767<=this['_config']['maxVisibleRows'])return _0x250233;const _0x51c23f=_0x4859eb['slice']();for(;_0x51c23f['length']>0x0;){if(this['_testButtonFit'](_0x1d8a3d,_0x42a8b8,_0x51c23f)){const _0x57e540=_0x4859eb['filter'](_0x2cc869=>!_0x51c23f['includes'](_0x2cc869));_0x250233['push'](..._0x57e540);break;}if(!_0x51c23f['pop']())break;}return _0x250233;}['_renderChipsAndCountRows'](_0x1348a5,_0x11f35b){_0x1348a5['innerHTML']='',_0x11f35b['forEach'](_0x5d0881=>{if(_0x5d0881['element']){const _0x3d8a21=_0x5d0881['element']['cloneNode'](!0x0);_0x1348a5['appendChild'](_0x3d8a21);}}),_0x1348a5['offsetWidth'];const _0x481cff=_0x1348a5['children'],_0x1236b2=[];return Array['from'](_0x481cff)['forEach'](_0x3bf648=>{const _0x32c910=_0x3bf648['getBoundingClientRect']()['top'];_0x1236b2['some'](_0x23cd5d=>Math['abs'](_0x23cd5d-_0x32c910)<this['_config']['rowDetectionTolerance'])||_0x1236b2['push'](_0x32c910);}),{'rowCount':_0x1236b2['length']};}['_createMockButton'](){const _0x4e8295=document['createElement']('button');return _0x4e8295['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x4e8295['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x4e8295['textContent']='+\x201',_0x4e8295;}['_testButtonFit'](_0xd42b8f,_0x538361,_0x4cb945){this['_renderChipsAndCountRows'](_0x538361,_0x4cb945);const _0x4a9d84=this['_createMockButton']();_0xd42b8f['appendChild'](_0x4a9d84),_0xd42b8f['offsetWidth'];const _0x282d14=[..._0x538361['children'],_0x4a9d84],_0x1fb3e1=[];_0x282d14['forEach'](_0x26f378=>{const _0x4c7d38=_0x26f378['getBoundingClientRect']()['top'];_0x1fb3e1['some'](_0x422f32=>Math['abs'](_0x422f32-_0x4c7d38)<this['_config']['rowDetectionTolerance'])||_0x1fb3e1['push'](_0x4c7d38);});const _0x2b8310=_0x1fb3e1['length'];return _0x4a9d84['remove'](),_0x2b8310<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x2b7fc5,_0x53ce99){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x2b7fc5['forEach'](_0x256e22=>{_0x53ce99['includes'](_0x256e22)?this['_overflowChips']['add'](_0x256e22):this['_visibleChips']['add'](_0x256e22);});}['_updateOverflowUI'](_0x331854){if(_0x331854>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x331854>0x0&&this['_showMoreButtonView']){const _0x4905a4=''+this['_config']['showMoreLabelPrefix']+(_0x331854<0x63?_0x331854:'99');this['_showMoreButtonView']['label']=_0x4905a4;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x4e3b82,_0x379d27){this['_distributeChips'](_0x4e3b82,_0x379d27),this['_updateOverflowUI'](_0x379d27['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x38c9fd=>{_0x38c9fd[0x0]['isIntersecting']&&this['_pendingCalculation']&&requestAnimationFrame(()=>{this['_checkAndHandleOverflow']();});},{'threshold':0.01,'rootMargin':'50px'}),this['_intersectionObserver']['observe'](this['_containerElement']));}['_isContainerVisible'](){if(!this['_containerElement'])return!0x1;if(!this['_containerElement']['isConnected'])return!0x1;const _0x4631c2=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x4631c2['width']||0x0===_0x4631c2['height'])return!0x1;const _0x2f22fd=window['innerHeight']||document['documentElement']['clientHeight'],_0x6ac7eb=window['innerWidth']||document['documentElement']['clientWidth'],_0x1755b5=0xc8;return _0x4631c2['bottom']>=-0xc8&&_0x4631c2['top']<=_0x2f22fd+_0x1755b5&&_0x4631c2['right']>=-0xc8&&_0x4631c2['left']<=_0x6ac7eb+_0x1755b5;}}const da='ck-ai-chat__feed__context-chips',_a='ck-ai-chat-context-chips-wrapper',Aa='ck-ai-chat-context-chips-wrapper-balloon',ga='ck-ai-chat-controls-button',Ia='ck-ai-chat-controls_context_show-more-button',Ea='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0x13218d{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x19ecb2,_0x4ffe84,_0x7decbf){super(_0x19ecb2),this['_bodyCollection']=_0x7decbf,this['_createContextChips'](_0x4ffe84);const _0x1470f3={'cssClasses':{'showMoreButton':Ia,'showMoreBalloon':Ea,'overflowContainer':Aa,'controlsButton':ga}};this['_overflowManager']=new Eo(_0x19ecb2,this['_contextChips'],_0x1470f3,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[da,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':_a},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x2503af=this['element']['querySelector']('.'+_a);_0x2503af&&(this['_overflowManager']['setContainerElement'](_0x2503af),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x4b4606){for(const _0x418bc4 of _0x4b4606){const _0x1ce033=new To(this['locale'],_0x418bc4,!0x0,!0x1);this['_contextChips']['add'](_0x1ce033);}}}class Ve extends yr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x36ba85,_0x46cd47,_0x25824f){super(_0x46cd47),this['_locale']=_0x36ba85,this['_bodyCollection']=_0x25824f,this['_createContextChipsView'](),this['_createMessageContentView'](),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__user-message']}});}['_createContextChipsView'](){this['options']['contextItems']&&this['options']['contextItems']['length']>0x0&&(this['_contextChipsView']=new _h(this['_locale'],this['options']['contextItems']['filter'](_0x5d07e4=>!_0x5d07e4['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x13218d(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class et extends yr{['capabilities'];constructor(_0x3cd23c,_0x5bdfb6){super(_0x5bdfb6);const {isWebSearchEnabled:_0x1ea501,isReasoningEnabled:_0x54bbc4}=_0x5bdfb6['capabilities'],_0x536516=[];let _0x3f4a30='';_0x1ea501&&_0x54bbc4?(_0x3f4a30=m(_0x3cd23c,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x536516['push'](aa(_0x2d1b31)),_0x536516['push'](aa(_0x478764))):_0x1ea501?(_0x3f4a30=m(_0x3cd23c,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x536516['push'](aa(_0x2d1b31))):_0x54bbc4&&(_0x3f4a30=m(_0x3cd23c,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x536516['push'](aa(_0x478764))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x3f4a30?'':'ck-hidden']}});const _0x1161b7=new _0x13218d();_0x1161b7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x536516,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x3f4a30]}]}),this['children']['add'](_0x1161b7),this['capabilities']=_0x5bdfb6['capabilities'];}}function aa(_0x4dfffc){const _0x4d1973=new _0x25fec4();return _0x4d1973['content']=_0x4dfffc,_0x4d1973;}const Fs=['wheel','touchstart','pointerdown','keydown'],Us=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Fe{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x33c64c){this['element']=_0x33c64c,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x3298fb of Fs){const _0x2cf595='keydown'!==_0x3298fb;this['element']['addEventListener'](_0x3298fb,this['_onUserEvent']['bind'](this),{'passive':_0x2cf595,'signal':this['abortController']['signal']});}}['start'](){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}['stop'](){requestAnimationFrame(()=>{this['_stop']();});}['destroy'](){this['_stop'](),this['abortController']['abort']();}['_stop'](){null!==this['animationFrameId']&&(cancelAnimationFrame(this['animationFrameId']),this['animationFrameId']=null),this['isRunning']&&(this['isRunning']=!0x1),this['isUserPaused']=!0x1;}['_onUserEvent'](_0x3d4176){if(this['isRunning']){if('keydown'===_0x3d4176['type']){const _0x536edb=_0x3d4176['key'];if(!Us['includes'](_0x536edb))return;}_0x3d4176 instanceof WheelEvent?_0x3d4176['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x12a1bc,scrollHeight:_0x42f68c,clientHeight:_0x2aedd1}=this['element'];return _0x42f68c-_0x12a1bc-_0x2aedd1<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class Oe extends _0x13218d{constructor(_0x52dc51,_0x5e6269){super(_0x52dc51),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x5e6269)});}['_createSkeletonItems'](_0x21e531){const _0x33fc6e=['ck','ck-ai-skeleton__item'];return _0x21e531['map'](_0x1428b8=>{let _0x1376cb='';switch(_0x1428b8['attributes']['align']){case'right':_0x1376cb='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x1376cb='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x1376cb='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x1428b8['tag'],'attributes':{'class':[..._0x33fc6e,_0x1428b8['attributes']['class']?_0x1428b8['attributes']['class']:''],'style':'width:\x20'+_0x1428b8['attributes']['width']+';\x20height:\x20'+_0x1428b8['attributes']['height']+';'+_0x1376cb}};});}}const Be={'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':ta(0x5,'100%','44px','right'),'aiChatResources':ta(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function ta(_0x2954b7,_0x3bab34,_0x1cd785,_0x2d7f7c){return new Array(_0x2954b7)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x3bab34,'height':_0x1cd785,'align':_0x2d7f7c}}));}class We extends yr{constructor(_0x5c6469){super(_0x5c6469),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class Ci extends _0x13218d{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x55fc20,_0x2d9217){super(_0x55fc20),this['_bodyCollection']=_0x2d9217,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...it)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Fe(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x467ecd,_0x1d8949){let _0x4215e9;return'ai-reply'===_0x467ecd?_0x4215e9=new je(this['locale'],_0x1d8949,this['_bodyCollection']):'ai-suggestion-reply'===_0x467ecd?(_0x4215e9=new ke(this['locale'],_0x1d8949,this['_bodyCollection']),_0x4215e9['bind']('isTrackChangesOn')['to'](this)):_0x4215e9='user-message'===_0x467ecd?new Ve(this['locale'],_0x1d8949,this['_bodyCollection']):'interaction-header'===_0x467ecd?new et(this['locale'],_0x1d8949):'custom-element'===_0x467ecd?new We(_0x1d8949):new Pe(_0x1d8949),this['children']['add'](_0x4215e9),_0x4215e9;}async['updateReplyItem']({id:_0x52666a,parsedContent:_0x246465,renderingStrategy:_0x30ad95,abortSignal:_0x1fc816}){const _0x1c82a6=this['getItemById'](_0x52666a);if(!(_0x1c82a6 instanceof je))throw new _0x36ce55('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x1c82a6,'id':_0x52666a,'parsedContent':_0x246465});await _0x1c82a6['updateContent']({'parsedContent':_0x246465,'renderingStrategy':_0x30ad95,'abortSignal':_0x1fc816});}async['updateWebSources'](_0x323a6d,_0x3f02d7){const _0x3eaf78=this['getItemById'](_0x323a6d);if(_0x3eaf78 instanceof ke)_0x3eaf78['updateSources'](_0x3f02d7);else{if(!(_0x3eaf78 instanceof je))throw new _0x36ce55('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x3eaf78,'id':_0x323a6d,'sources':_0x3f02d7});_0x3eaf78['updateSources'](_0x3f02d7);}}async['updateSuggestionItem']({id:_0x218ee0,parts:_0x3ec33a,renderingStrategy:_0x36f8ff,abortSignal:_0x231964}){const _0x774a91=this['getItemById'](_0x218ee0);if(!(_0x774a91 instanceof ke))throw new _0x36ce55('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x774a91,'id':_0x218ee0,'parts':_0x3ec33a});await _0x774a91['updateContent']({'parts':_0x3ec33a,'renderingStrategy':_0x36f8ff,'abortSignal':_0x231964});}['updateSuggestionPartState']({id:_0x291d7d,index:_0x3890ca,state:_0x4f728a}){const _0x858d9=this['getItemById'](_0x291d7d);if(!(_0x858d9 instanceof ke))throw new _0x36ce55('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x291d7d});_0x858d9['updatePartState'](_0x3890ca,_0x4f728a);}['setSuggestionPartActive']({id:_0x1295cb,index:_0x332bd7,isActive:_0x57d08e}){const _0x2f9f49=this['getItemById'](_0x1295cb);if(!(_0x2f9f49 instanceof ke))throw new _0x36ce55('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x1295cb});this['children']['filter'](_0x563aae=>_0x563aae instanceof ke)['forEach'](_0x2ab967=>{_0x2ab967['setPartActive'](!0x1);}),_0x2f9f49['setPartActive'](_0x332bd7,_0x57d08e);}['markItemAsDone'](_0x2dbee6){this['getItemById'](_0x2dbee6)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0xbe5a9=>_0xbe5a9['options']['id']);}['removeItem'](_0x3fafd0){this['children']['remove'](this['getItemById'](_0x3fafd0));}['hasItem'](_0x462b00){return!!this['children']['find'](_0x2a6986=>_0x2a6986['options']['id']['includes'](_0x462b00));}['scrollToSuggestion'](_0x14d0c3,_0x35f8ab){const _0x47a497=this['getItemById'](_0x14d0c3);if(!(_0x47a497 instanceof ke))return void Zt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x14d0c3,'partIndex':_0x35f8ab});const _0x13b651=_0x47a497['getPartView'](_0x35f8ab);_0x13b651?_0x41c02d(_0x13b651['element'],0x14,this['element']['parentElement'],!0x0,!0x0):Zt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x14d0c3,'partIndex':_0x35f8ab});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x194210=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x194210,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x5cebe5=new Oe(this['locale'],Be['aiFeed']);return _0x5cebe5['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x5568aa=>!_0x5568aa)]}}),_0x5cebe5;}['_createFeedItems'](){const _0x5252b0=new _0x13218d(this['locale']);return _0x5252b0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x5252b0;}['_createFeedLoader'](){const _0x83a6de=new _0x13218d(this['locale']);return _0x83a6de['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x1b5876=>!_0x1b5876)]},'children':this['_createLoaderChildren']()}),_0x83a6de;}['_createLoaderChildren'](){const _0x5d8479=new De();return _0x5d8479['isVisible']=!0x0,[_0x5d8479,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x421823){const _0x25036=this['children']['find'](_0x273c2c=>_0x273c2c['options']['id']['includes'](_0x421823));if(!_0x25036)throw new _0x36ce55('ai-chat-feed-view-item-not-found',this,{'id':_0x421823});return _0x25036;}['setLoadingMessage'](_0x5a3c8f){this['set']('loadingMessage',_0x5a3c8f);}['toggleLoadingSkeleton'](_0x43f581){this['set']('isLoadingSkeletonVisible',_0x43f581);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class ah extends _0x49b4eb{['filter'](){let _0x3bf9c2=0x0;for(const _0x482854 of this['items'])_0x3bf9c2+=_0x482854['items']['length'];return{'resultsCount':_0x3bf9c2,'totalItemsCount':_0x3bf9c2};}}const ph='ck-ai-chat__prompt-input_highlighted';class ms extends _0x1a3dc9{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x358267,_0x2907c6){super(_0x358267,{'queryView':{'label':'','creator':_0x13f57e,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new ah(_0x358267),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x2907c6,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ms['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ms['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x23b6e0,_0xadf016)=>!_0x23b6e0&&!_0xadf016),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x2297c9,_0x75b3ae)=>{this['isUploadInProgress']||this['isEmpty']||_0x2297c9['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x75b3ae());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x4407b4=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x4407b4)return this['queryView']['errorText']=m(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x11b6f9=Wt(_0x4407b4);this['fire']('sendUserMessage',_0x11b6f9),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x3b2dab){this['queryView']['fieldView']['set']('placeholder',_0x3b2dab);}['focus'](_0x3d40e6=!0x1){super['focus'](),_0x3d40e6&&(this['element']['classList']['contains'](ph)||(this['element']['classList']['add'](ph),setTimeout(()=>{this['element']['classList']['remove'](ph);},0x320)));}['_createSubmitButton'](){const _0x332201=new _0x494e59(this['locale']);return _0x332201['set']({'icon':_0x19f96e,'label':m(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x332201['on']('execute',()=>{this['submit']();}),_0x332201;}['setIsUploadInProgress'](_0x352d42){this['isUploadInProgress']=_0x352d42;}['_setUpAddContextButtonPositioning'](){const _0x27011d=this['locale'],_0x4c54a0=()=>{_0xbe938c['window']['requestAnimationFrame'](()=>{if(_0x5866ed(this['element'])){const _0x20f3ef=new _0x30f41d(this['queryView']['fieldView']['element']),_0x232684=new _0x30f41d(this['_addContextButtonView']['element']),_0x2b5298=_0x20f3ef['width'],_0x53f7a4='rtl'===_0x27011d['uiLanguageDirection']?'right':'left';_0x20f3ef['excludeScrollbarsAndBorders']();const _0x29738f=_0x2b5298-_0x20f3ef['width']+0x1;this['_addContextButtonView']['element']['style'][_0x53f7a4]='calc('+(_0x2b5298-_0x232684['width']-_0x29738f)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x4c54a0),this['on']('render',()=>{_0x4c54a0(),this['_queryViewResizeObserver']=new _0x47e851(this['queryView']['fieldView']['element'],()=>{_0x4c54a0();});});}}const Ta='ck-ai-chat__prompt-capabilities',pa='ck-ai-chat-controls-button',ma='ck-ai-chat-controls-button--commands',Ca='ck-ai-button-tertiary',wa='ck-ai-chat-controls__model-selection',fa='ck-ai-chat-controls__model-selection__item-name',Sa='ck-ai-chat-controls__model-selection__item-description',ba='ck-ai-chat-controls__model-selection__item-capabilities',Ra='n';class ds extends _0x13218d{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x159db1){super(_0x159db1),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelDisplayMode','selector'),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x2ca0ff=>'selector'===_0x2ca0ff),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x6e97c8=>_0x6e97c8?this['_modelSelectionDropdown']['buttonView']['label']:m(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x35e07e=>_0x35e07e),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x425f8f=>_0x425f8f),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x582234=>m(this['locale'],_0x582234?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x36724=>_0x36724),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x4568f3=>m(this['locale'],_0x4568f3?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Ta]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x4c2902(),_0x32894e(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x239185,_0x20e33c){if(_0x20e33c)this['set']('modelDisplayMode','hidden');else{const _0x16d833=0x1===_0x239185['length'];this['set']('modelDisplayMode',_0x16d833?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x239185?.['length'])for(const _0x5dd0af of _0x239185){const _0x39845f=new _0x2b3edb({'label':_0x5dd0af['name'],'withText':!0x0,'role':'menuitemradio','id':_0x5dd0af['id'],'model':_0x5dd0af});_0x39845f['bind']('isOn')['to'](this,'activeModelId',_0x2c236e=>_0x2c236e===_0x5dd0af['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x39845f,'labelView':new Oa(this['locale'],_0x5dd0af)});}}['setWebSearch'](_0x343e94){this['set']('webSearchActive',_0x343e94);}['setReasoning'](_0x34e6f4){this['set']('reasoningActive',_0x34e6f4);}['setModel'](_0x13010a){if(!_0x13010a)return;this['activeModelId']=_0x13010a['id'],this['activeModelName']=_0x13010a['name']||_0x13010a['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x13010a['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x13010a['name']);const _0x1a399b=_0x13010a['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x1a399b),this['_webSearchButton']['set']('isVisible',_0x1a399b);const _0x11037b=_0x13010a['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x11037b),this['_reasoningButton']['set']('isVisible',_0x11037b);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x519a7b){this['set']('modelSelectorEnabled',!0x1),_0x519a7b&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x472356=new _0x494e59();return _0x472356['set']({'label':m(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x2d1b31,'class':pa,'isToggleable':!0x0,'tooltipPosition':Ra}),_0x472356['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x472356;}['_createReasoningButton'](){const _0xbe7a8a=new _0x494e59();return _0xbe7a8a['set']({'label':m(this['locale'],'AI_CHAT_REASONING'),'icon':_0x478764,'class':pa,'isToggleable':!0x0,'tooltipPosition':Ra}),_0xbe7a8a['on']('execute',()=>{this['fire']('toggleReasoning');}),_0xbe7a8a;}['_createCommandsButton'](){const _0x194349=new _0x494e59();return _0x194349['set']({'label':m(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x2f345e,'withText':!0x0,'class':pa,'isToggleable':!0x0,'tooltip':m(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ra}),_0x194349['extendTemplate']({'attributes':{'class':[ma]}}),_0x194349['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x194349;}['_createModelSelectionDropdown'](){const _0x5435fa=_0x478151(this['locale']);return _0x5435fa['set']({'panelPosition':'ne','class':[wa]}),_0x5435fa['buttonView']['set']({'label':m(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ra,'class':Ca}),this['listenTo'](_0x5435fa,'execute',_0x3e097e=>{this['fire']('selectModel',_0x3e097e['source']['model']);}),_0x5435fa;}['_createModelNameView'](){const _0x403ac7=new ka(this['locale']);return _0x403ac7['bind']('text')['to'](this,'activeModelName',_0x3dccdd=>_0x3dccdd??''),_0x403ac7['bind']('isVisible')['to'](this,'modelDisplayMode',_0x55d72b=>'name'===_0x55d72b),_0x403ac7;}}let Oa=class extends _0x2dac38{constructor(_0x339486,_0x35270f){super();const _0x45371b=this['bindTemplate'],_0x5104e2=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x45371b['to']('style'),'id':_0x45371b['to']('id')},'children':[{'tag':'div','attributes':{'class':[fa]},'children':[{'text':_0x45371b['to']('text')}]},{'tag':'div','attributes':{'class':[Sa]},'children':[{'tag':'span','children':[{'text':_0x35270f['description']}]}]},{'tag':'div','attributes':{'class':[ba]},'children':_0x5104e2}]}),_0x5104e2['addMany'](this['_getCapabilityParts'](_0x339486,_0x2d1b31,'AI_CHAT_SEARCH_WEB',_0x35270f['capabilities']['webSearch']?.['enabled']??!0x1)),_0x5104e2['addMany'](this['_getCapabilityParts'](_0x339486,_0x478764,'AI_CHAT_REASONING',_0x35270f['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x5c4fb6,_0x4d08cb,_0xf0f2e4,_0x467fdc){const _0x103294=new _0x25fec4();_0x103294['content']=_0x4d08cb;const _0xd9c41=new _0x13218d(_0x5c4fb6);_0xd9c41['setTemplate']({'tag':'span','children':[{'text':m(_0x5c4fb6,_0xf0f2e4)+':\x20'}]});const _0x411ef5=new _0x13218d(_0x5c4fb6);return _0x411ef5['setTemplate']({'tag':'span','children':[{'text':m(_0x5c4fb6,_0x467fdc?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x103294,_0xd9c41,_0x411ef5];}},ka=class extends _0x13218d{constructor(_0x1b7111){super(_0x1b7111),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x45f6aa=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x45f6aa['if']('isVisible','ck-hidden',_0x5249ea=>!_0x5249ea)]},'children':[{'text':_0x45f6aa['to']('text')}]});}};const Na='ck-ai-chat-context-controls__url-form',va='ck-ai-chat-context-controls__url-input-section';class Ao extends _0x13218d{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x47ac2c){super(_0x47ac2c),this['focusTracker']=new ts(),this['keystrokes']=new _0x34d7cc(),this['backButton']=this['_createBackButton'](),this['urlInputField']=this['_createUrlInputField'](),this['confirmButton']=this['_createConfirmButton'](),this['_focusables']=this['createCollection']([this['backButton'],this['urlInputField'],this['confirmButton']]),this['focusCycler']=new _0x2532de({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x23f935=>{this['focusTracker']['add'](_0x23f935['element']),this['keystrokes']['listenTo'](_0x23f935['element']);}),_0x40733b({'view':this}),this['focus']();}['destroy'](){super['destroy'](),this['focusTracker']['destroy'](),this['keystrokes']['destroy']();}['focus'](){this['urlInputField']['focus']();}['getValue'](){return this['urlInputField']['fieldView']['element']?.['value']?.['trim']()||'';}['clear'](){this['urlInputField']['fieldView']['element']['value']='',this['urlInputField']['errorText']=null,this['confirmButton']['isEnabled']=!0x1;}['setError'](_0x4d4056){this['urlInputField']['errorText']=_0x4d4056,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x2e986f=new _0x494e59(this['locale']);return _0x2e986f['set']({'icon':_0x18feb2,'tooltip':m(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x30581d,_0x3761a3,_0x530b80)=>{_0x2e986f['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x530b80?'':'\x20ck-hidden')]});}),_0x2e986f;}['_createUrlInputField'](){const _0x15ef8e=new _0x557ad5(this['locale'],th);return _0x15ef8e['set']({'label':m(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x15ef8e['fieldView']['set']({'placeholder':m(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x15ef8e;}['_createConfirmButton'](){const _0x1634d5=new _0x494e59(this['locale']);return _0x1634d5['set']({'icon':_0x14bd5e,'tooltip':m(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x1634d5;}['_setupTemplate'](){const _0x4bf5b4=new _0x33ee7e(this['locale'],{'label':m(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x4bf5b4['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Na,'tabindex':'-1'},'children':[_0x4bf5b4,{'tag':'div','attributes':{'class':va},'children':[this['urlInputField'],this['confirmButton']]}]});}['_setupEventHandlers'](){this['backButton']['on']('execute',()=>{this['clear'](),this['fire']('cancel');}),this['urlInputField']['fieldView']['on']('input',()=>{this['clearError'](),this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}),this['on']('submit',_0x3c0c11=>{_0x3c0c11['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x2b70be,_0x321f87)=>{this['clear'](),this['fire']('cancel'),_0x321f87();});}['_handleSubmit'](){const _0x218605=this['getValue']()['trim']();_0x218605?this['_isValidUrl'](_0x218605)?(this['clearError'](),this['fire']('submitUrl',_0x218605)):this['setError'](m(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](m(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0xea53cf=this['getValue']()['trim'](),_0x2ea00d=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0xea53cf['length']>0x0&&!_0x2ea00d;}['_isValidUrl'](_0x1543b){try{return!!new URL(_0x1543b);}catch{return!0x1;}}}const ya='ck-ai-chat-resources__item',xa='ck-ai-chat-resources__item--in-context',La='ck-ai-chat-resources__item-title',Da='ck-ai-chat-resources__item__icon';class hc extends _0x202f8e{['resource'];['_titleView'];['_iconView'];constructor(_0x4828f2,_0x25ca52){super(_0x4828f2),this['resource']=_0x25ca52,this['set']('isInContext',!!_0x25ca52['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x3bdd0e){if(_0x3bdd0e['isInContext'])return _0x14bd5e;switch(_0x3bdd0e['type']){case Jt['DOCUMENT']:return _0x2d35c5;case Jt['URL']:return _0x3aa8ab;case Jt['FILE']:case Jt['TEXT']:return _0x306b56;default:return _0x23ca4e;}}['highlightText'](_0x474968){if(!_0x474968||''===_0x474968['trim']())return void this['_titleView']['highlightText'](null);const _0x449fb6=new RegExp(_0x52145f(_0x474968),'gi');this['_titleView']['highlightText'](_0x449fb6);}['updateResourceState'](_0x45e8b1){this['resource']['isInContext']=_0x45e8b1,this['isInContext']=_0x45e8b1,this['_updateIcon']();}['_createTitleView'](){const _0x53cbc0=new _0x461746();return _0x53cbc0['text']=this['resource']['label'],_0x53cbc0['extendTemplate']({'tag':'span','attributes':{'class':[La]}}),_0x53cbc0;}['_createIconView'](){const _0x1a58f0=new _0x25fec4();return _0x1a58f0['content']=this['getResourceIcon'](this['resource']),_0x1a58f0;}['_setupTemplate'](){const _0x2417af=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[ya,_0x2417af['if']('isVisible','ck-hidden',_0xace116=>!_0xace116),_0x2417af['if']('isInContext',xa)]},'children':[{'tag':'div','attributes':{'class':[Da]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x2417af['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const Pa='ck-ai-chat-resources__list';class Ur extends _0x49b4eb{['_source'];constructor(_0x57c52a,_0x49febf){super(_0x57c52a),this['_source']=_0x49febf,this['extendTemplate']({'attributes':{'class':[Pa]}});}['setResources'](_0x46a4a5,_0x2d1975){this['items']['clear']();let _0x8d51=_0x46a4a5;if(this['_source']['useDefaultFiltering']&&_0x2d1975&&''!==_0x2d1975['trim']()){const _0x2495a0=new RegExp(_0x2d1975['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x8d51=_0x46a4a5['filter'](_0x18d466=>_0x2495a0['test'](_0x18d466['label']));}for(const _0x29c38e of _0x8d51){const _0x4f77c5=new hc(this['locale'],_0x29c38e);_0x4f77c5['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x29c38e);}),this['items']['add'](_0x4f77c5);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x2d1975);}['highlightText'](_0xaca920){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x47ec39=>{_0x47ec39['highlightText'](_0xaca920);});}['updateResourceState'](_0x2a931d,_0x42b188){for(const _0x144f20 of this['items']){const _0x1b8acf=_0x144f20;_0x1b8acf['resource']['id']===_0x2a931d&&_0x1b8acf['updateResourceState'](_0x42b188);}}['_handleResourceSelection'](_0x209051,_0x75ca4f){this['fire']('addResourceToContext',{'source':_0x209051,'resource':_0x75ca4f});}}class zr extends _0x557ad5{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x5309c3){const t=_0x5309c3['t'],_0x2af501={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':m(_0x5309c3,'AI_CHAT_SEARCH_RESOURCES')};super(_0x5309c3,_0x2af501['creator']),this['label']=_0x2af501['label'],this['_viewConfig']=_0x2af501,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x5309c3,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x4fd360){this['fire']('search',_0x4fd360);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x25fec4(),this['iconView']['content']=_0x2e2350,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x18922f,t){this['resetButtonView']=new _0x494e59(_0x18922f),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x5acc62,'class':'ck-search__reset','isVisible':!0x1,'tooltip':!0x0}),this['resetButtonView']['on']('execute',()=>{this['reset'](),this['focus'](),this['fire']('reset');}),this['resetButtonView']['bind']('isVisible')['to'](this['fieldView'],'isEmpty',_0x24e334=>!_0x24e334),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class lc extends _0x13218d{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x561d31,_0x41aa36){super(_0x561d31),this['_source']=_0x41aa36['source'],this['_searchInputVisibleFrom']=_0x41aa36['searchInputVisibleFrom']??0x7,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView'](),this['_searchSection']=this['_createSearchSection'](),this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0x44a9be([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new zr(this['locale']);}['_createSearchSection'](){const _0xf005c0=new _0x13218d(this['locale']);return _0xf005c0['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x2f6bbe,_0x4e735b)=>{this['loadResources'](_0x4e735b),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x4e735b);}),_0xf005c0;}['_createResourcesListView'](){const _0x5e0e61=new Ur(this['locale'],this['_source']);return _0x5e0e61['delegate']('addResourceToContext')['to'](this),_0x5e0e61['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x5e0e61;}['_createSkeletonView'](){const _0x559721=new Oe(this['locale'],Be['aiChatResources']);return _0x559721['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x28bdd3=>!_0x28bdd3)]}}),_0x559721;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x28cfc8){const _0xdbe70a=_0x5ee109();this['_latestLoadResourcesUid']=_0xdbe70a,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x28cfc8,'uid':_0xdbe70a}),this['isLoading']=!0x0;}['setResources'](_0x113f46,_0x191fdf){if(_0x191fdf&&_0x191fdf!==this['_latestLoadResourcesUid'])return;const _0xd911e1=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x113f46,_0xd911e1),_0x113f46['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x2aa52b,_0x245312){this['_resourcesListView']['updateResourceState'](_0x2aa52b,_0x245312);}}const Ha='ck-ai-chat-context-controls__source-balloon-panel',Ma='ck-button-icon\x20ck-button-back',Ua='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class fo{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x1113f8,_0x1a784b,_0x492930){this['_locale']=_0x1113f8,this['_bodyCollection']=_0x1a784b,this['_config']=_0x492930;}['showSourceResourcesBalloon']({source:_0x53c98a,withBackButton:_0x1b39d5}){let _0x399971=this['_sourceResourceBalloons']['get'](_0x53c98a['id']);_0x399971||(_0x399971=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x53c98a['id'],_0x399971),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x399971)),this['_addSourceResourceContent']({'balloonPanel':_0x399971,'source':_0x53c98a,'withBackButton':_0x1b39d5}),_0x399971['show']();const _0x595345=this['_config']['getTargetElement']();_0x595345&&_0x399971['pin']({'target':_0x595345,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x3bc21d,_0x374b32,_0x3722d6){const _0x2c1576=this['_sourceResourceBalloons']['get'](_0x3bc21d);if(!_0x2c1576)return;const _0x59d743=this['_getResourcesViewFromBalloon'](_0x2c1576);_0x59d743&&(_0x59d743['setResources'](_0x374b32,_0x3722d6),_0x59d743['once']('change:isLoading',()=>{_0x2c1576['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x43801a){const _0x476724=this['_sourceResourceBalloons']['get'](_0x43801a);_0x476724&&requestAnimationFrame(()=>{_0x476724['hide'](),this['_sourceResourceBalloons']['delete'](_0x43801a),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0xe68f27 of this['_sourceResourceBalloons']['values']())if(_0xe68f27['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x3ed8b0,_0x18189b,_0x40359d){const _0x521394=this['_sourceResourceBalloons']['get'](_0x3ed8b0);if(!_0x521394||!_0x521394['isVisible'])return;const _0x3d1440=this['_config']['getTargetElement']();if(!_0x3d1440)return;_0x521394['pin']({'target':_0x3d1440,'limiter':this['_config']['getLimiterElement']()});const _0x2c854b=this['_getResourcesViewFromBalloon'](_0x521394);_0x2c854b&&_0x2c854b['updateResourceState'](_0x18189b,_0x40359d);}['destroy'](){for(const _0x1e2cd5 of this['_sourceResourceBalloons']['values']())_0x1e2cd5['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x437998=new _0x514db0(this['_locale']);return _0x437998['extendTemplate']({'attributes':{'class':Ha}}),this['_bodyCollection']['add'](_0x437998),_0x437998;}['_addSourceResourceContent']({balloonPanel:_0x31f9d8,source:_0x18acc4,withBackButton:_0x325963}){_0x31f9d8['content']['clear']();const _0x19c9ef=this['_createBalloonHeader']({'balloonPanel':_0x31f9d8,'source':_0x18acc4,'withBackButton':_0x325963});_0x31f9d8['content']['add'](_0x19c9ef);const _0xe0c8cb=this['_createBalloonResourcesView'](_0x18acc4);_0x31f9d8['content']['add'](_0xe0c8cb);}['_createBalloonHeader']({balloonPanel:_0x2f37e4,source:_0xeb1de3,withBackButton:_0x1b34a0}){const _0x1212ac=new _0x33ee7e(this['_locale'],{'label':_0xeb1de3['label'],'class':Ua});return _0x1b34a0&&_0x1212ac['children']['add'](this['_createBackButton'](_0x2f37e4),0x0),_0x1212ac;}['_createBackButton'](_0x480ab3){const _0xf26b56=new _0x494e59(this['_locale']);return _0xf26b56['set']({'icon':_0x18feb2,'tooltip':m(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Ma}),_0xf26b56['on']('execute',()=>{_0x480ab3['hide'](),this['_config']['onBackToContext']();}),_0xf26b56;}['_createBalloonResourcesView'](_0x481748){const _0x28b4ce=new lc(this['_locale'],{'source':_0x481748,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x28b4ce['on']('loadSourceResources',(_0x1bec9f,_0x14f53a)=>{this['_config']['onLoadSourceResources'](_0x14f53a);}),_0x28b4ce['on']('addResourceToContext',(_0x134c9d,_0x37b7e9)=>{this['_config']['onResourceSelected'](_0x37b7e9['source'],_0x37b7e9['resource']),this['closeSourceResourceBalloon'](_0x481748['id']);}),_0x28b4ce;}['_getResourcesViewFromBalloon'](_0x1f6b55){const _0x557784=_0x1f6b55['content']['get'](0x1);return _0x557784 instanceof lc?_0x557784:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x3dced4){_0x16b45b({'emitter':_0x3dced4,'contextElements':[_0x3dced4['element']],'callback':()=>{_0x3dced4['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x3dced4['isVisible']});}}const gs=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Vo='ck-ai-chat-context-controls',go='ck-ai-chat-context-controls__pending-contexts',Io='ck-ai-chat-context-controls__add-context-balloon-panel',Po='ck-ai-chat-context-controls__add-context-button',Ro='ck-ai-chat-context-controls__url-balloon-panel',So='ck-ai-chat-context-controls__balloon-button',Oo='ck-ai-chat-context-controls__balloon-button-source',Uo='ck-ai-chat-controls-button',Lo='ck-ai-chat-context-chips-wrapper-balloon',No='ck-ai-chat-controls_context_show-more-button',Mo='ck-ai-chat-context-controls__show-more-balloon-panel',Ho='ck-ai-chat',jo=[_0x514db0['defaultPositions']['northArrowSouthWest'],_0x514db0['defaultPositions']['northArrowSouth'],_0x514db0['defaultPositions']['northArrowSouthEast'],_0x514db0['defaultPositions']['southArrowNorthWest'],_0x514db0['defaultPositions']['southArrowNorth'],_0x514db0['defaultPositions']['southArrowNorthEast']];class bs extends _0x13218d{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x1834b4,_0x2ac624){super(_0x1834b4),this['bodyCollection']=_0x2ac624['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x1834b4),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x1834b4),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x1834b4),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x1834b4,_0x2ac624);const _0x5f3067={'cssClasses':{'showMoreButton':No,'showMoreBalloon':Mo,'overflowContainer':Lo,'controlsButton':Uo}};this['_overflowManager']=new Eo(_0x1834b4,this['_currentContextsChips'],_0x5f3067,this['bodyCollection'],this),this['_addContextBalloonConfig']={'buttonView':this['addContextButtonView'],'balloonView':this['_addContextBalloonPanelView'],'hideMethod':this['hideAddContextBalloonPanel']['bind'](this),'showMethod':this['showAddContextBalloonPanel']['bind'](this)},this['_setupTemplate'](),this['_bindEventHandlers']();}['render'](){super['render'](),this['_setupAllBalloonClickOutsideHandlers'](),this['_overflowManager']['setContainerElement'](this['element']),this['_overflowManager']['reorganizeChips']();}['destroy'](){super['destroy'](),this['_overflowManager']['destroy'](),this['_resourcesBalloonView']['destroy']();}['addContextItem'](_0x1a21f7,_0x484609){const _0x360477=this['_createContextButton'](_0x1a21f7,'current',!0x0,_0x484609);this['_addContextToCollection'](_0x360477,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0xc686ad){this['_removeContextFromCollection'](_0xc686ad,this['_currentContextsChips']),this['_removeContextFromCollection'](_0xc686ad,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x59f671,_0x2d94cf){let _0x5e3235=this['_currentContextsChips']['find'](_0x4522d2=>_0x4522d2['id']===_0x59f671);_0x5e3235||(_0x5e3235=this['_overflowManager']['overflowChips']['find'](_0x1ef37a=>_0x1ef37a['id']===_0x59f671)),_0x5e3235&&(_0x5e3235['isLoading']=_0x2d94cf);}['setConversationContext'](_0x25ee5c){this['_conversationContextsChips']['clear']();for(const _0xd6c266 of _0x25ee5c){const _0x368092=this['_createContextButton'](_0xd6c266,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x368092,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x2d817d,_0x288779,_0x3612e0){this['_resourcesBalloonView']['updateResourceState'](_0x2d817d,_0x288779,_0x3612e0);}['hideAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x1);}['showAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x0);}['hideUrlBalloonPanel'](){this['_urlBalloonPanelView']['hide'](),this['addContextButtonView']['isOn']=!0x1,this['_urlInputView']&&this['_urlInputView']['clear']();}['showUrlBalloonPanel'](){this['_urlBalloonPanelView']['show'](),this['addContextButtonView']['isOn']=!0x0;}['_showSourceResourcesBalloon']({source:_0x5b6ac4,withBackButton:_0x12391c}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x5b6ac4,'withBackButton':_0x12391c}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x563f7a,_0x3941c9,_0x39fd5e,_0x3a2006){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x563f7a,_0x39fd5e,_0x3a2006);}['closeSourceResourceBalloon'](_0x19ba56){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x19ba56),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0xddb473){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0xddb473),this['_setAddContextButtonEnabled'](_0xddb473);}['_setAddContextButtonEnabled'](_0x589adf){const _0x4bfc79=!_0x589adf['document']['isHidden']&&_0x589adf['document']['enabled'],_0x8a6bab=_0x589adf['urls']['enabled'],_0x2a04ce=_0x589adf['files']['enabled'],_0x3e77fa=_0x589adf['sources']['length']>0x0,_0x3f8331=_0x589adf['customItems']&&_0x589adf['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x4bfc79||_0x8a6bab||_0x2a04ce||_0x3e77fa||_0x3f8331;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Vo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':go},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x38866a){const _0x287f75=new _0x494e59(_0x38866a);return _0x287f75['set']({'label':m(_0x38866a,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Uo+'\x20'+Po,'icon':_0x3f95f6,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x287f75;}['_createAddContextBalloonPanelView'](_0x47ba20){return this['_createBaseBalloonPanel'](_0x47ba20,Io);}['_createUrlBalloonPanelView'](_0x1703d2){const _0x5e8f41=this['_createBaseBalloonPanel'](_0x1703d2,Ro);return this['_addUrlContent'](_0x5e8f41,_0x1703d2),_0x5e8f41;}['_createResourcesBalloonView'](_0x3fed24,_0x2906f2){const _0x51a680={'searchInputVisibleFrom':_0x2906f2['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});},'onResourceSelected':(_0x51e6e3,_0x60600b)=>{this['fire']('addResourceToContext',{'source':_0x51e6e3,'resource':_0x60600b});},'onLoadSourceResources':_0x2b0135=>{this['fire']('loadSourceResources',_0x2b0135);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new fo(_0x3fed24,_0x2906f2['bodyCollection'],_0x51a680);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Ho)||document['body'];}['_createBaseBalloonPanel'](_0x4a28b1,_0x46562f){const _0x121722=new _0x514db0(_0x4a28b1);return _0x121722['extendTemplate']({'attributes':{'class':_0x46562f}}),this['bodyCollection']['add'](_0x121722),_0x121722;}['_setBalloonPanelContent'](_0x59c61a,_0x2189af,_0x511463){if(_0x59c61a['content']['clear'](),!_0x511463['document']['isHidden']&&_0x511463['document']['enabled']){const _0x79b279=this['_createBalloonButton'](_0x2189af,{'label':m(_0x2189af,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x2d35c5});_0x79b279['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x59c61a['content']['add'](_0x79b279);}if(_0x511463['urls']['enabled']){const _0x5cab7d=this['_createBalloonButton'](_0x2189af,{'label':m(_0x2189af,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x3aa8ab});_0x5cab7d['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo}),this['_urlInputView']['focus']();}),_0x59c61a['content']['add'](_0x5cab7d);}if(_0x511463['files']['enabled']){const _0x52c4c0=new _0x3ddeee(_0x2189af);_0x52c4c0['set']({'label':m(_0x2189af,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x464fe9,'withText':!0x0,'tooltip':!0x0,'class':So,'allowMultipleFiles':!0x0}),_0x52c4c0['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x52c4c0['on']('done',(_0x1a794a,_0x27b088)=>{this['fire']('addFileToContext',_0x27b088);}),_0x52c4c0['tooltip']=!0x0,_0x59c61a['content']['add'](_0x52c4c0);}for(const _0x5b93a0 of _0x511463['sources']){const _0x465134=this['_createBalloonButton'](_0x2189af,{'label':_0x5b93a0['label'],'icon':_0x5b93a0['icon']||_0x23ca4e,'type':'source'});_0x59c61a['content']['add'](_0x465134),_0x465134['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x5b93a0,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x4d845c of _0x511463['customItems']||[]){const _0x3fb482=this['_createBalloonButton'](_0x2189af,{'label':_0x4d845c['label'],'icon':_0x4d845c['icon']||_0x23ca4e,'type':'customItem'});_0x59c61a['content']['add'](_0x3fb482),_0x3fb482['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x4d845c);});}this['_hasExactlyOneSource']=0x1===_0x59c61a['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x2fba4c,_0xde947){this['_urlInputView']=new Ao(_0xde947),this['_urlInputView']['on']('submitUrl',(_0x3ee8cc,_0x1f48c8)=>{this['_handleUrlSubmit'](_0x1f48c8);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});}),_0x2fba4c['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x520353,_0x3dba18){const _0x41cc5b='source'===_0x3dba18['type']?new Va(_0x520353):new _0x494e59(_0x520353);return _0x41cc5b['set']({'label':_0x3dba18['label'],'icon':_0x3dba18['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':So}),_0x41cc5b;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x16b45b({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x505329){const _0xc5f4ab=this['_addContextBalloonConfig'];_0xc5f4ab['buttonView']['isOn']=_0x505329,_0x505329?_0xc5f4ab['balloonView']['show']():_0xc5f4ab['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x4ad147,buttonView:_0x38ce39,hideMethod:_0x23f7eb}=this['_addContextBalloonConfig'];_0x16b45b({'emitter':_0x4ad147,'contextElements':[_0x4ad147['element'],_0x38ce39['element']],'callback':()=>{_0x23f7eb();},'activator':()=>_0x38ce39['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x4ef020,_0x349458,_0x46c6dd=!0x1,_0x205923=!0x1){const _0x58d309='conversation'===_0x349458||!0x0===_0x4ef020['isReadOnly'],_0x4e0df9=new To(this['locale'],_0x4ef020,_0x58d309,_0x46c6dd,_0x205923);return _0x58d309||_0x4e0df9['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x4e0df9['id']);}),_0x4e0df9;}['_addContextToCollection'](_0x24d327,_0x586570){_0x586570['add'](_0x24d327,0x0);}['_removeContextFromCollection'](_0x2f6aa0,_0x13c5aa){const _0x91b3d1=_0x13c5aa['find'](_0xbe163d=>_0xbe163d['id']===_0x2f6aa0);_0x91b3d1&&_0x13c5aa['remove'](_0x91b3d1);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x50888f){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x50888f);}}class Va extends _0x494e59{['arrowView'];constructor(_0x2273a3){super(_0x2273a3),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Oo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x1a0abf=new _0x25fec4();return _0x1a0abf['content']=_0x4178ba,_0x1a0abf['extendTemplate']({'attributes':{'class':Oo+'__arrow'}}),_0x1a0abf;}}class ws extends _0x13218d{['_cancelButtonView'];['_loaderView'];constructor(_0x19590e){super(_0x19590e),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_loaderView']=this['_createLoaderView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-loader-wrapper','ck-reset_all']},'children':[this['_loaderView'],this['_cancelButtonView']]});}['_createCancelButtonView'](){const _0x21b3fa=new _0x494e59(this['locale']);return _0x21b3fa['set']({'label':m(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x4ed6ae}),_0x21b3fa['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x21b3fa;}['_createLoaderView'](){const _0x5951ba=new _0x13218d(this['locale']);return _0x5951ba['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}}]},{'text':m(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x5951ba;}}class xi extends _0x13218d{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x3654e3,_0x38ad0d){super(_0x3654e3),this['_contextPanelView']=this['_createContextPanelView'](_0x3654e3,{'bodyCollection':_0x38ad0d['bodyCollection'],'searchInputVisibleFrom':_0x38ad0d['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x3654e3),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x3654e3),this['_loaderView']=this['_createLoaderView'](_0x3654e3),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x3654e3),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...gs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x28b9c0=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x28b9c0['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x28b9c0['if']('isLoading','ck-hidden',_0x1b5523=>_0x1b5523||!this['isModelAvailable']),_0x28b9c0['if']('isModelAvailable','ck-hidden',_0x8b1d9a=>!_0x8b1d9a||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x28b9c0['if']('isLoading','ck-hidden',_0x5b57a5=>!_0x5b57a5)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x28b9c0['if']('isModelAvailable','ck-hidden',_0x9695d3=>_0x9695d3)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x16b45b({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x12a18f,_0x43d8f2){return new bs(_0x12a18f,_0x43d8f2);}['_createPromptInputView'](_0x4bc024){return new ms(_0x4bc024,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0xf0c9c7){return new ds(_0xf0c9c7);}['_createLoaderView'](_0x4085f8){return new ws(_0x4085f8);}['_createModelUnavailableMessageView'](_0x11cd40){const _0x5d5a89=new _s(_0x11cd40);return _0x5d5a89['delegate']('startConversation')['to'](this),_0x5d5a89;}['_handlePromptInputFocus'](_0x4ff73b,_0x493a69,_0xd73ebf){_0xd73ebf?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x228e9e,_0x16084c){this['_contextPanelView']['addContextItem'](_0x228e9e,_0x16084c);}['removeContextItem'](_0x53ccda){this['_contextPanelView']['removeContextItem'](_0x53ccda);}['setContextItemLoading'](_0x38ffa8,_0x14d777){this['_contextPanelView']['setContextItemLoading'](_0x38ffa8,_0x14d777);}['setIsUploadInProgress'](_0x4be6ce){this['_promptInputView']['setIsUploadInProgress'](_0x4be6ce);}['setConversationContext'](_0x44ddae){this['_contextPanelView']['setConversationContext'](_0x44ddae);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x534a29,_0x5db66b,_0x549c17){this['_contextPanelView']['updateResourceState'](_0x534a29,_0x5db66b,_0x549c17);}['setWebSearch'](_0x653ea5){this['_promptCapabilitiesView']['setWebSearch'](_0x653ea5);}['setReasoning'](_0x38c45c){this['_promptCapabilitiesView']['setReasoning'](_0x38c45c);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x344ad4){this['_contextPanelView']['setAddContextOptions'](_0x344ad4);}['setInputPlaceholder'](_0x588384){this['_promptInputView']['setPlaceholderText'](_0x588384);}['setModelList'](_0x3c6311,_0x5b8b6e){this['_promptCapabilitiesView']['setModelList'](_0x3c6311,_0x5b8b6e);}['setModel'](_0x1ea5dc){_0x1ea5dc?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x1ea5dc)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x216e64){this['_promptCapabilitiesView']['disableModelSelector'](_0x216e64);}['populateSourceResourceBalloon'](_0x56c94b,_0x275c2e,_0x5be4d3,_0x200bc4){this['_contextPanelView']['populateSourceResourceBalloon'](_0x56c94b,_0x275c2e,_0x5be4d3,_0x200bc4);}['closeSourceResourceBalloon'](_0x3f8bfa){this['_contextPanelView']['closeSourceResourceBalloon'](_0x3f8bfa);}['focusPromptInput'](_0xcb72d3=!0x1){this['_promptInputView']['focus'](_0xcb72d3);}['setPromptInputValue'](_0x25df64){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x25df64;}}class _s extends _0x13218d{constructor(_0xc41b5e){super(_0xc41b5e);const _0x2481a2=new _0x494e59(_0xc41b5e);_0x2481a2['set']({'label':m(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x2481a2['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':m(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x2481a2]}]});}}class Si extends _0x33ee7e{['conversationStartButton'];['resizeButton'];constructor(_0x14a00a,_0x42218e){super(_0x14a00a,{'label':m(_0x14a00a,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':tt}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x14a00a),this['children']['add'](this['conversationStartButton']),_0x42218e&&(this['resizeButton']=Cs(_0x14a00a,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x1579d8){const _0x4de94e=new _0x494e59(_0x1579d8);return _0x4de94e['set']({'label':m(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x2ad7c2,'class':'ck-ai-chat__start-conversation'}),_0x4de94e['on']('execute',()=>{this['fire']('startConversation');}),_0x4de94e;}}class Bi extends _0x13218d{constructor(_0x492916){super(_0x492916),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':m(_0x492916,'AI_DISCLAIMER_TEXT')}]}]});}}class K extends _0x13218d{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x459e40,_0x513442){super(_0x459e40),this['_bodyCollection']=new _0x5a5912(_0x459e40),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Si(_0x459e40,_0x513442['showResizeButton']),this['chatHeader']['delegate'](...it)['to'](this),this['chatFeed']=new Ci(_0x459e40,this['_bodyCollection']),this['chatFeed']['delegate'](...it)['to'](this),this['chatControls']=new xi(_0x459e40,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x513442['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...it)['to'](this),this['chatDisclaimer']=new Bi(_0x459e40),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x459e40['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x3a0a3c,_0x3614dc,_0x194434,_0x187437){this['chatControls']['populateSourceResourceBalloon'](_0x3a0a3c,_0x3614dc,_0x194434,_0x187437);}['closeSourceResourceBalloon'](_0x27e8fd){this['chatControls']['closeSourceResourceBalloon'](_0x27e8fd);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class P extends _0x269016{static get['requires'](){return[H];}['_view'];static get['pluginName'](){return'AIChatUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['feedItemRenderingStrategy']='streaming';['showDiff']=!0x0;['_promiseQueue'];['_interactionPromiseResolver'];['_titleAnimationInterval']=void 0x0;['_isTrackChangesCommandValueBound']=!0x1;constructor(_0x3946b9){super(_0x3946b9);const _0x40b21d=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new g(),this['_view']=new K(this['context']['locale'],{'showResizeButton':_0x40b21d['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...it)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x3faf2c,{showDiff:_0x54febc})=>{this['showDiff']=_0x54febc;}),_0x40b21d['view']['addTab']({'id':'chat','buttonLabel':m(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':tt,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x44ebb6=>_0x44ebb6),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x1791e2=>_0x1791e2),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x334e69){const _0x1bca6f=this['context']['config']['get']('ai.chat.welcomeMessage')??m(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x334e69['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x1bca6f}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0x37b6f9,staticMessage:_0x41c2fc}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x37b6f9,'initialContent':'<p>'+_0x41c2fc+'</p>'});}['addFeedItemUserMessage'](_0xf05812){const _0x2653c7=_0xf05812['attributes']?.['displayedPrompt']||_0xf05812['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0xf05812['contextItems']['values']()),'initialContent':'<p>'+_0x2653c7+'</p>','id':_0xf05812['id']});}['addFeedItemError']({errorMessage:_0x251b3f,id:_0x3624d7}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x251b3f+'</p>','id':_0x3624d7});}['addFeedItemAIReply'](_0x3c7867){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x3c7867['interactionId']+':'+_0x3c7867['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x50dbef){const _0x427e77=D(this['context']);let _0x415cb9=_0x427e77['config']['get']('ai.availableReplyActions')||[...S];if(_0x427e77['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x2dfbc2=_0x427e77['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x2dfbc2,'value');}}else _0x415cb9=_0x415cb9['filter'](_0x45fcaa=>'insertSuggestion'!=_0x45fcaa);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x50dbef['interactionId']+':'+_0x50dbef['id'],'areActionsDisabled':_0x50dbef['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x415cb9}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x316a16,_0xc36c39){const _0x28165b=this['_view']['chatFeed']['children']['last'];if(_0x28165b instanceof et)return this['_view']['chatFeed']['children']['remove'](_0x28165b),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x316a16['id'],'capabilities':{'isWebSearchEnabled':_0x28165b['capabilities']['isWebSearchEnabled']||_0xc36c39['isWebSearchEnabled'],'isReasoningEnabled':_0x28165b['capabilities']['isReasoningEnabled']||_0xc36c39['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x316a16['id'],'capabilities':_0xc36c39});}async['addFeedItemCustomElement'](_0x41b080,_0x1c6e90){let _0x531f80;return await this['_promiseQueue']['enqueue'](async()=>{_0x531f80=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x41b080,'id':_0x1c6e90});}),_0x531f80;}['removeFeedItem'](_0x3e4338){this['_view']['chatFeed']['removeItem'](_0x3e4338);}['hasFeedItem'](_0x44dd4f){return this['_view']['chatFeed']['hasItem'](_0x44dd4f);}['updateFeedInteractionHeader'](_0x21773b){const _0x4a86a4=this['_view']['chatFeed']['children']['find'](_0x12e378=>_0x12e378['options']['id']==_0x21773b['id']&&_0x12e378 instanceof et);_0x4a86a4&&_0x4a86a4['set']('isVisible',_0x21773b['isVisible']);}async['updateFeedItemAIReplyContent'](_0x9bcbe2){const _0x27f39a=_0x9bcbe2['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x4cfdb5=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x9bcbe2,'abortSignal':_0x4cfdb5,'renderingStrategy':_0x27f39a}),_0x9bcbe2['isDone']&&this['markFeedItemAsDone'](_0x9bcbe2['id']);});}['updateFeedItemAIReplySources'](_0x2f7d70,_0x26c161){this['_view']['chatFeed']['updateWebSources'](_0x2f7d70,_0x26c161);}async['updateFeedItemAIReplySuggestionContent'](_0x4a98c2){const _0x1d343e=_0x4a98c2['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x42ff89=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x4a98c2,'abortSignal':_0x42ff89,'renderingStrategy':_0x1d343e}),_0x4a98c2['isDone']&&this['markFeedItemAsDone'](_0x4a98c2['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x118d0f){this['_view']['chatFeed']['updateSuggestionPartState'](_0x118d0f);}['setFeedItemAIReplySuggestionPartActive'](_0x15ff82){this['_view']['chatFeed']['setSuggestionPartActive'](_0x15ff82);}['markFeedItemAsDone'](_0x3640c7){this['_view']['chatFeed']['markItemAsDone'](_0x3640c7);}['removeFeedInteraction'](_0x5da5da){this['_view']['chatFeed']['getItemIds']()['filter'](_0x3cb7cb=>_0x3cb7cb['startsWith'](_0x5da5da))['forEach'](_0x2fd480=>this['_view']['chatFeed']['removeItem'](_0x2fd480));}['startInteraction'](){const _0xaa9bb4=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0xaa9bb4),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x546bf5){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x2b9acd=>_0x2b9acd['startsWith'](_0x546bf5['id']))['forEach'](_0x5eac3c=>this['markFeedItemAsDone'](_0x5eac3c)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x341b1d,_0x38548f){this['_view']['chatControls']['addContextItem'](_0x341b1d,_0x38548f);}['removeContextItem'](_0x5c85c7){this['_view']['chatControls']['removeContextItem'](_0x5c85c7);}['setContextItemLoading'](_0x5c94cd,_0x2844e6){this['_view']['chatControls']['setContextItemLoading'](_0x5c94cd,_0x2844e6);}['setIsUploadInProgress'](_0x164978){this['_view']['chatControls']['setIsUploadInProgress'](_0x164978);}['setConversationContext'](_0x41e332){this['_view']['chatControls']['setConversationContext'](_0x41e332);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x119c32,_0x49bd06,_0x34cddb){this['_view']['chatControls']['updateResourceState'](_0x119c32,_0x49bd06,_0x34cddb);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x3ab33b){this['_view']['chatControls']['setAddContextOptions'](_0x3ab33b);}['updateCapabilities'](_0xbb4583){this['_view']['chatControls']['setWebSearch'](_0xbb4583['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0xbb4583['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0xbb4583));}['setSelectedModel'](_0x3ae561,_0x4ed334){this['_view']['chatControls']['setModel'](_0x3ae561),_0x4ed334&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x5afbc0){this['feedItemRenderingStrategy']=_0x5afbc0;}['toggleLoadingSkeleton'](_0x1c2359){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x1c2359);}['resetConversationTitle'](){this['setConversationTitle'](m(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x2a5c8c,_0x1e847d=!0x1){if(_0x1e847d&&!_0x288937()&&_0x2a5c8c['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x2a5c8c);this['_view']['chatHeader']['label']=_0x2a5c8c;}['setLoadingMessage'](_0x79c79c){this['_view']['chatFeed']['setLoadingMessage'](_0x79c79c);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x5a1c95){let _0x17746f=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x5a1c95[_0x17746f],_0x17746f++,_0x17746f===_0x5a1c95['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x1017b0){this['_view']['chatHeader']['isMaximized']=_0x1017b0;}['prepareLoadingMessage'](_0x271994){return _0x271994['isWebSearchEnabled']&&_0x271994['isReasoningEnabled']?m(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x271994['isWebSearchEnabled']?m(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x271994['isReasoningEnabled']?m(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):m(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x412cd7){return _0x412cd7?_0x412cd7['isWebSearchEnabled']&&_0x412cd7['isReasoningEnabled']?m(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x412cd7['isWebSearchEnabled']?m(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x412cd7['isReasoningEnabled']?m(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):m(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):m(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x220ef0,_0x104f61,_0x5284f9,_0x4a89d7){this['_view']['populateSourceResourceBalloon'](_0x220ef0,_0x104f61,_0x5284f9,_0x4a89d7);}['closeSourceResourceBalloon'](_0x312b91){this['_view']['closeSourceResourceBalloon'](_0x312b91);}['setPromptInputValue'](_0x53dfa6){this['_view']['chatControls']['setPromptInputValue'](_0x53dfa6);}['focusPromptInput'](_0x8a27e9=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x8a27e9);}['scrollFeedToSuggestion'](_0x3e9303,_0x2c75c4){this['_view']['chatFeed']['scrollToSuggestion'](_0x3e9303,_0x2c75c4);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class zi extends _0x49b4eb{['sections'];constructor(_0x559086,_0x462445){super(_0x559086),this['sections']=_0x462445,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x2a0d5c){let _0xdc52aa=0x0,_0x200952=0x0;for(const _0x91ff67 of this['sections']){const {resultsCount:_0x51d327,totalItemsCount:_0x12b54e}=_0x91ff67['filter'](_0x2a0d5c);_0xdc52aa+=_0x51d327,_0x200952+=_0x12b54e;}return{'resultsCount':_0xdc52aa,'totalItemsCount':_0x200952};}}class Fi extends _0x202f8e{['title'];['itemsViews'];['_itemsListView'];constructor(_0x29af0c,{title:_0xeccc99,items:_0x2dcb5e}){super(_0x29af0c);const _0x47b20a=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0xeccc99,this['itemsViews']=_0x2dcb5e;const _0x146374=new _0x13218d(_0x29af0c);_0x146374['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x49b4eb(_0x29af0c),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x47b20a['if']('isVisible','ck-hidden',_0x3f7003=>!_0x3f7003)]},'children':[_0x146374,this['_itemsListView']]});}['filter'](_0x5a9159){const _0x8dc989=this['itemsViews']['length'];let _0xfe316f=0x0;for(const _0x3af6e4 of this['itemsViews']){if(_0x5a9159){const _0x3ee744=_0x3af6e4['isMatching'](_0x5a9159);_0x3af6e4['isVisible']=!!_0x3ee744,_0x3af6e4['highlightText'](_0x5a9159);}else _0x3af6e4['isVisible']=!0x0,_0x3af6e4['highlightText'](null);_0x3af6e4['isVisible']&&_0xfe316f++;}return this['isVisible']=_0xfe316f>0x0,{'resultsCount':_0xfe316f,'totalItemsCount':_0x8dc989};}['getItem'](_0x13334c){return this['itemsViews']['find'](_0x5d3f00=>_0x5d3f00['id']===_0x13334c);}['removeItem'](_0x3cc332){const _0x31be0e=this['itemsViews']['indexOf'](_0x3cc332);-0x1!==_0x31be0e&&(this['itemsViews']['splice'](_0x31be0e,0x1),this['_itemsListView']['items']['remove'](_0x3cc332));}}class Gi extends/* #__PURE__ -- @preserve */
27
+ _0x5f4c6a(_0x202f8e){['id'];static ['LOADING_LABELS']={'remove':'AI_CHAT_HISTORY_LOADING_REMOVING','rename':'AI_CHAT_HISTORY_LOADING_RENAMING','pin':'AI_CHAT_HISTORY_LOADING_PINNING','unpin':'AI_CHAT_HISTORY_LOADING_UNPINNING'};['actions'];['mainContent'];['_titleView'];constructor(_0xb86aa4,_0x3febff){super(_0xb86aa4);const _0x5d1c27=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x3febff['pinned']),this['set']('loadingState',null),this['id']=_0x3febff['id'];const {title:_0x2dd919,createdAt:_0x12da3b,active:_0xcacd82=!0x1}=_0x3febff;this['_titleView']=new _0x461746(),this['_titleView']['text']=_0x2dd919,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x5d65d1=this['_createCheckView'](),_0x4367ce=this['_createPinButtonView'](_0xb86aa4),_0x1e8cea=this['_createMenuDropdownView'](),_0x381ca7=this['_createEditInputView'](_0xb86aa4,_0x2dd919),_0x38a393=this['_createAcceptEditButtonView'](_0xb86aa4,_0x381ca7),_0x3f0788=this['_createCancelEditButtonView'](_0xb86aa4,_0x381ca7);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x4367ce),this['actions']['add'](_0x1e8cea),this['on']('change:isEdit',(_0x355946,_0x322ffa,_0x2b54c5)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x2b54c5?(this['actions']['add'](_0x38a393),this['actions']['add'](_0x3f0788),this['mainContent']['add'](_0x381ca7),_0x381ca7['element']['focus']()):(this['actions']['add'](_0x4367ce),this['actions']['add'](_0x1e8cea),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0xcacd82?'ck-ai-chat-history__item--active':'',_0x5d1c27['if']('isVisible','ck-hidden',_0x4a2236=>!_0x4a2236),_0x5d1c27['if']('isEdit','ck-ai-chat-history__item--edit')],'role':'listitem'},'children':[{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-check-container']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-check',_0x5d1c27['if']('loadingState','ck-hidden',_0x52617f=>!!_0x52617f)]},'children':_0xcacd82?[_0x5d65d1]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x5d1c27['if']('loadingState','ck-hidden',_0x5dd441=>!_0x5dd441)]},'children':[this['_createSpinnerView']()]}]},{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-row']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-content']},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-title',_0x5d1c27['if']('loadingState','ck-hidden',_0x482ebf=>!!_0x482ebf)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x5d1c27['if']('loadingState','ck-hidden',_0x5a13aa=>!_0x5a13aa)]},'children':[{'text':_0x5d1c27['to']('loadingState',_0x20a59d=>_0x20a59d?m(this['locale'],Gi['LOADING_LABELS'][_0x20a59d]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x12da3b]}]},{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-actions']},'children':this['actions']}]}]}),this['on']('click',()=>{this['isEdit']||this['fire']('selectConversation',{'id':this['id']});});}['updateTitle'](_0x48202a){this['_titleView']['text']=Wt(_0x48202a);}['updateLoadingState'](_0x68c3,_0x1b7525){this['set']('loadingState',_0x1b7525?_0x68c3:null);}['_createCheckView'](){const _0x5ac3b4=new _0x25fec4();return _0x5ac3b4['set']({'content':_0xd070e4}),_0x5ac3b4;}['_createPinButtonView'](_0x142592){const _0x54b824=new _0x494e59(_0x142592);return _0x54b824['set']({'label':m(_0x142592,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x548f7b,'withText':!0x1,'tooltip':!0x0}),_0x54b824['bind']('isOn')['to'](this,'pinned'),_0x54b824['on']('execute',()=>{const _0x3e0c3a=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x3e0c3a});}),_0x54b824;}['_createMenuDropdownView'](){const _0xb917c1=_0x478151(this['locale'],_0x2f07ce),_0x35f5e2=_0xb917c1['panelView']['children'];_0xb917c1['buttonView']['set']({'label':m(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x52bfae}),_0xb917c1['panelPosition']='sw';const _0x1e70d9=new _0x494e59(this['locale']);_0x1e70d9['label']=m(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x1e70d9['withText']=!0x0,_0x1e70d9['on']('execute',()=>{this['isEdit']=!0x0;});const _0x1e3ae4=new _0x494e59(this['locale']);_0x1e3ae4['label']=m(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x1e3ae4['withText']=!0x0,_0x1e3ae4['on']('execute',()=>{this['showConfirm'](m(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x5b3cf9=new _0x49b4eb(this['locale']),_0x58aa21=new _0x202f8e(this['locale']);_0x58aa21['children']['add'](_0x1e70d9);const _0x2defaf=new _0x202f8e(this['locale']);return _0x2defaf['children']['add'](_0x1e3ae4),_0x5b3cf9['items']['addMany']([_0x58aa21,_0x2defaf]),_0x35f5e2['add'](_0x5b3cf9),_0xb917c1;}['_createEditInputView'](_0x5bf8f2,_0x3ef72e){const _0x99e614=new _0x9669fe(_0x5bf8f2),_0x39ef1f=_0x99e614['bindTemplate'];return _0x99e614['value']=_0x3ef72e,_0x99e614['extendTemplate']({'on':{'keydown':_0x39ef1f['to'](_0x209eb8=>{'Enter'==_0x209eb8['key']&&this['_commitEditInputValue'](_0x99e614);})}}),_0x99e614;}['_createAcceptEditButtonView'](_0xb984bf,_0x166f9c){const _0x4e0412=new _0x494e59(_0xb984bf);return _0x4e0412['set']({'icon':_0xd070e4,'withText':!0x1,'tooltip':m(_0xb984bf,'AI_CHAT_HISTORY_ACCEPT')}),_0x4e0412['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x4e0412['on']('execute',()=>{this['_commitEditInputValue'](_0x166f9c);}),_0x4e0412;}['_commitEditInputValue'](_0xc727ef){const _0x369472=_0xc727ef['element']['value']||'';this['_titleView']['text']=_0x369472,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x369472});}['_createCancelEditButtonView'](_0x2c938d,_0x1d2def){const _0x45f1fd=new _0x494e59(_0x2c938d);return _0x45f1fd['set']({'icon':_0x5acc62,'withText':!0x1,'tooltip':m(_0x2c938d,'AI_CHAT_HISTORY_CANCEL')}),_0x45f1fd['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x45f1fd['on']('execute',()=>{this['isEdit']=!0x1,_0x1d2def['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x45f1fd;}['_createSpinnerView'](){const _0x3322ff=new De('tiny');return _0x3322ff['isVisible']=!0x0,_0x3322ff;}['isMatching'](_0x2593a5){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x2593a5)?{'title':!0x0}:null;}['highlightText'](_0x9e8aea){this['_titleView']['highlightText'](_0x9e8aea);}}class dt extends _0x13218d{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x31b245,_0x5da90f){super(_0x31b245),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x536729=new _0x33ee7e(_0x31b245,{'label':m(_0x31b245,'AI_CHAT_HISTORY_HEADING'),'icon':It,'class':'ck-ai-header\x20ck-ai-header_history'});_0x5da90f&&(this['resizeButton']=Cs(_0x31b245,this),_0x536729['children']['add'](this['resizeButton'])),this['sectionsView']=new zi(_0x31b245,[]),this['sectionsView']['delegate'](...Pi)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0x5093e5=>!_0x5093e5)]}}),this['on']('change:isLoading',()=>this['_updateViewVisibility']()),this['on']('change:hasItems',()=>this['_updateViewVisibility']()),this['on']('change:errorMessage',()=>this['_updateViewVisibility']()),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat-history','ck-rounded-corners'],'dir':'ltr'},'children':[_0x536729,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['mainErrorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'],this['isMainErrorViewVisible']=!this['isSearchViewVisible']&&!!this['errorMessage'];}['_createSearchView'](){const _0x3ffcc9=new _0x277b9b(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':m(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0xad5c91=>m(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0xad5c91),'secondary':m(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x32e3eb=this['_createErrorView']();return _0x32e3eb['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x14f1b6=>!_0x14f1b6)]}}),_0x3ffcc9['on']('render',()=>{_0x3ffcc9['children']['add'](_0x32e3eb,0x1);}),_0x3ffcc9['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x3b3370=>!_0x3b3370)]}}),_0x3ffcc9;}['_createSkeletonView'](){const _0x404feb=new Oe(this['locale'],Be['aiHistory']);return _0x404feb['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x1447e7=>!_0x1447e7)]}}),_0x404feb;}['_createErrorView'](){const _0x494bf6=new _0x13218d(this['locale']),_0x4320e0=new _0x494e59(this['locale']);_0x4320e0['set']({'withText':!0x1,'icon':_0x5acc62,'class':'ck-ai-notification_error__dismiss-button'}),_0x4320e0['bind']('isVisible')['to'](this,'hasItems',_0x2f3df2=>!!_0x2f3df2),_0x4320e0['on']('execute',()=>{this['errorMessage']='';});const _0x125c3a=this['bindTemplate'];return _0x494bf6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x125c3a['to']('errorMessage')}]},_0x4320e0]}),_0x494bf6;}['_createEmptyStateView'](){const _0xf45394=new _0x494e59(this['locale']);_0xf45394['set']({'label':m(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x2ad7c2,'class':'ck-ai-chat__start-conversation'}),_0xf45394['on']('execute',()=>{this['fire']('openChat');});const _0x5eda4f=new _0x13218d(this['locale']);return _0x5eda4f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x3812be=>!_0x3812be)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[m(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0xf45394]}),_0x5eda4f;}['_createListItemViews'](_0x33dd26,_0x3f49ca){const _0x1ed970=[];for(const _0xb8461 of _0x33dd26){const _0x5bc79c=new Gi(_0x3f49ca,_0xb8461);_0x5bc79c['delegate'](...Pi)['to'](this),_0x1ed970['push'](_0x5bc79c);}return _0x1ed970;}['updateHistoryItemsWithCategories'](_0x110609){const _0x2279cf=this['locale']||'en',_0x2d0ad1=[];for(const _0x5f49ca of _0x110609){const _0x6fad21=this['_createListItemViews'](_0x5f49ca['items'],_0x2279cf);_0x2d0ad1['push'](new Fi(_0x2279cf,{'title':_0x5f49ca['title'],'items':_0x6fad21}));}this['sectionsView']['sections']=_0x2d0ad1,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x2d0ad1),this['hasItems']=_0x110609['some'](_0x438660=>_0x438660['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x2ca698){for(const _0x3ad7c5 of this['sectionsView']['sections']){const _0x53d128=_0x3ad7c5['getItem'](_0x2ca698);if(_0x53d128){if(_0x3ad7c5['removeItem'](_0x53d128),0x0===_0x3ad7c5['itemsViews']['length']){const _0x4f3d79=this['sectionsView']['sections']['indexOf'](_0x3ad7c5);-0x1!==_0x4f3d79&&(this['sectionsView']['sections']['splice'](_0x4f3d79,0x1),this['sectionsView']['items']['remove'](_0x3ad7c5));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x5df4fa,_0x5edf21){for(const _0x309de7 of this['sectionsView']['sections']){const _0x1ea188=_0x309de7['getItem'](_0x5df4fa);if(_0x1ea188){_0x1ea188['updateTitle'](_0x5edf21);break;}}}['updateItemLoadingState'](_0xaf9e0c,_0x71860,_0x55a2a2){for(const _0x26a2a4 of this['sectionsView']['sections']){const _0x1ed5fd=_0x26a2a4['getItem'](_0xaf9e0c);if(_0x1ed5fd){_0x1ed5fd['updateLoadingState'](_0x71860,_0x55a2a2);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x558db8=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x558db8);}}}const Pi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class ut extends _0x269016{static get['requires'](){return[H];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1b192d){super(_0x1b192d);const _0x43f9b3=this['context']['plugins']['get']('AITabs');this['_historyView']=new dt(this['context']['locale'],_0x43f9b3['showResizeButton']),this['_historyView']['delegate'](...Pi)['to'](this),_0x43f9b3['view']['addTab']({'id':'history','buttonLabel':m(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':It,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x5881da){this['_historyView']['removeHistoryItem'](_0x5881da);}['updateItems'](_0x23e798){this['_historyView']['updateHistoryItemsWithCategories'](_0x23e798);}['updateItemTitle'](_0x4471b0,_0xa8aff6){this['_historyView']['updateItemTitle'](_0x4471b0,_0xa8aff6);}['updateItemLoadingState'](_0x2c13d0,_0x58c59f,_0x3739d4){this['_historyView']['updateItemLoadingState'](_0x2c13d0,_0x58c59f,_0x3739d4);}['setLoadingSkeleton'](_0x117d00){this['_historyView']['isLoading']=_0x117d00;}['showError'](_0x3bcd4d){this['_historyView']['errorMessage']=_0x3bcd4d;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x1c45c7){this['_historyView']['isMaximized']=_0x1c45c7;}}class Ue extends Vt(){['id'];['createdAt'];constructor({id:_0x15dead,title:_0x1812c3,createdAt:_0x2aa5ff,updatedAt:_0x26a694,pinned:_0x4dd301}){super(),this['id']=_0x15dead,this['createdAt']=new Date(_0x2aa5ff),this['set']('title',_0x1812c3),this['set']('updatedAt',_0x26a694?new Date(_0x26a694):null),this['set']('pinned',_0x4dd301||!0x1);}['updateTitle'](_0x5159ef){this['set']('title',Wt(_0x5159ef)),this['updatedAt']=new Date();}['updatePinned'](_0x1d4f13){this['set']('pinned',_0x1d4f13),this['updatedAt']=new Date();}}class _t extends Ft(){['items']=[];['connector'];['group'];constructor({connector:_0x42702c,group:_0x43349a}){super(),this['connector']=_0x42702c,this['group']=_0x43349a;}async['init'](){try{const _0x31bca2=this['connector']['fetchConversations'](this['group']),_0x2532f1=await _0x31bca2['getConversations']();this['loadItems'](_0x2532f1);}catch(_0x503600){this['fire']('error',{'error':_0x503600,'operation':'init'});}}['addItem'](_0x54a82b){this['items']['push'](_0x54a82b);}async['removeItem'](_0x1eeec8){const _0x484c71=this['items']['findIndex'](_0x364f20=>_0x364f20['id']===_0x1eeec8);if(-0x1===_0x484c71)return!0x1;try{return await this['connector']['deleteConversation'](_0x1eeec8)['execute'](),this['items']['splice'](_0x484c71,0x1),this['fire']('itemRemoved',{'itemId':_0x1eeec8}),!0x0;}catch(_0x121bc6){return this['fire']('error',{'error':_0x121bc6,'operation':'removeItem','itemId':_0x1eeec8}),!0x1;}}['getItem'](_0x2f2424){return this['items']['find'](_0xb31033=>_0xb31033['id']===_0x2f2424);}async['updateItemTitle'](_0x17a3bf,_0x2e3fa4){const _0x139085=this['getItem'](_0x17a3bf);if(!_0x139085)return!0x1;try{return await this['connector']['updateConversation'](_0x17a3bf,{'title':_0x2e3fa4})['getResult'](),_0x139085['updateTitle'](_0x2e3fa4),this['fire']('itemUpdated',{'itemId':_0x17a3bf,'updates':{'title':_0x2e3fa4}}),!0x0;}catch(_0x414c78){return this['fire']('error',{'error':_0x414c78,'operation':'updateItemTitle','itemId':_0x17a3bf}),!0x1;}}async['updateItemPinned'](_0x30f8ed,_0x263e63){const _0x368834=this['getItem'](_0x30f8ed);if(!_0x368834)return!0x1;try{return await this['connector']['updateConversation'](_0x30f8ed,{'pinned':_0x263e63})['getResult'](),_0x368834['updatePinned'](_0x263e63),this['fire']('itemUpdated',{'itemId':_0x30f8ed,'updates':{'pinned':_0x263e63}}),!0x0;}catch(_0x5c36c6){return this['fire']('error',{'error':_0x5c36c6,'operation':'updateItemPinned','itemId':_0x30f8ed}),!0x1;}}['loadItems'](_0x3f8c0d){try{this['items']=[],_0x3f8c0d['map'](_0x2556dd=>{this['addItem'](new Ue(_0x2556dd));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x1b7f7e){this['fire']('error',{'error':_0x1b7f7e,'operation':'loadItems'});}}['getItems'](_0x3b9c9f={}){const _0x1e3cb0=void 0x0!==_0x3b9c9f['pinned']&&_0x3b9c9f['pinned'],_0x4ec053=_0x3b9c9f['from']?new Date(_0x3b9c9f['from']['getFullYear'](),_0x3b9c9f['from']['getMonth'](),_0x3b9c9f['from']['getDate']()):null,_0x44385f=_0x3b9c9f['to']?new Date(_0x3b9c9f['to']['getFullYear'](),_0x3b9c9f['to']['getMonth'](),_0x3b9c9f['to']['getDate']()):null;return this['items']['filter'](_0x292065=>{if(_0x292065['pinned']!==_0x1e3cb0)return!0x1;if(_0x44385f){const _0x284561=new Date(_0x292065['createdAt']['getFullYear'](),_0x292065['createdAt']['getMonth'](),_0x292065['createdAt']['getDate']());return _0x4ec053?_0x4ec053['getTime']()===_0x44385f['getTime']()?_0x284561['getTime']()===_0x4ec053['getTime']():_0x284561<_0x44385f&&_0x284561>=_0x4ec053:_0x284561<_0x44385f;}return!0x0;});}}class mt extends _0x269016{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[s,x,ut,H];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](s),this['_aiChatHistoryUi']=this['context']['plugins']['get'](ut),this['_aiChatController']=this['context']['plugins']['get'](x);const _0x3a342c=this['context']['plugins']['get'](H);try{const _0x3fa3f1=this['_aiChatController']['getGroupId']();this['history']=new _t({'connector':this['_aiConnector'],'group':_0x3fa3f1}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x3952fe,_0x5392da)=>{this['_setItemLoading'](_0x5392da['id'],'remove'),this['_handleRemove'](_0x5392da['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x737bf2,_0xfab8f9)=>{this['_setItemLoading'](_0xfab8f9['id'],'rename'),this['_handleEditTitle'](_0xfab8f9['id'],_0xfab8f9['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0xda75f5,_0x1d9e30)=>{void 0x0!==_0x1d9e30['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x1d9e30['itemId'],_0x1d9e30['updates']['title']),void 0x0!==_0x1d9e30['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x1d9e30['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x115cbf,_0x3cb984)=>{this['_aiChatController']['handleRemovedConversation'](_0x3cb984['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x3cb984['itemId']),this['_clearItemLoading'](_0x3cb984['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x48872b,_0x3f5bbb)=>{this['_handleHistoryErrorUI'](_0x3f5bbb['error'],_0x3f5bbb['operation'],_0x3f5bbb['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x4c4580,_0x6bb10f)=>{this['_handleSelectConversation'](_0x6bb10f['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x158f7e,_0x358385)=>{const _0x350d1b=_0x358385['pinned']?'pin':'unpin';this['_setItemLoading'](_0x358385['id'],_0x350d1b),this['_handleTogglePin'](_0x358385['id'],_0x358385['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x3a342c['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x3a342c['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x3a342c,'resizedTabs',(_0x84cc70,_0x431b1e)=>{this['_setIsMaximized'](_0x431b1e);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x3a342c['resize']();});}catch(_0x128413){this['_handleHistoryErrorUI'](_0x128413,'init');}}async['_handleEditTitle'](_0x4830a8,_0x12f233){await this['history']['updateItemTitle'](_0x4830a8,_0x12f233);}async['_handleTogglePin'](_0x3bd9d0,_0x4192cc){await this['history']['updateItemPinned'](_0x3bd9d0,_0x4192cc);}async['_handleRemove'](_0x24730c){await this['history']['removeItem'](_0x24730c);}async['_handleSelectConversation'](_0xfb28ac){await this['_aiChatController']['loadConversation'](_0xfb28ac);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x5eb3c3=this['_aiChatController']['activeConversation']?.['id'],_0x458a2d=this['_getCategorizedItems']()['map'](_0x25f62c=>({'title':_0x25f62c['title'],'items':_0x25f62c['items']['map'](_0x38b68b=>({'id':_0x38b68b['id'],'title':_0x38b68b['title']||m(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x38b68b['createdAt'])['toLocaleDateString'](),'active':_0x38b68b['id']===_0x5eb3c3,'pinned':_0x38b68b['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x458a2d);}['_setItemLoading'](_0x1e1f0a,_0x1e7ec9){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x1e1f0a,_0x1e7ec9,!0x0);}['_clearItemLoading'](_0x4085b8){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x4085b8,null,!0x1);}['_handleHistoryErrorUI'](_0x3aceec,_0x59a373,_0x5e65a7){const _0x51f95b=this['_generateErrorMessage'](_0x59a373,_0x5e65a7);this['_aiChatHistoryUi']['showError'](_0x51f95b),_0x5e65a7&&this['_clearItemLoading'](_0x5e65a7),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x1197d3,_0x3206d9){const _0x4960c1=_0x3206d9?this['history']['getItem'](_0x3206d9):null,_0x351277=_0x4960c1?.['title']||m(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x1197d3){case'updateItemTitle':return m(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x351277);case'updateItemPinned':{const _0x44035e=m(this['context']['locale'],_0x4960c1?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return m(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x44035e,_0x351277]);}case'removeItem':return m(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x351277);case'init':case'loadItems':return m(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return m(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x45d44f=new Date(),_0x2c46f2=new Date(_0x45d44f['getFullYear'](),_0x45d44f['getMonth'](),_0x45d44f['getDate']()),_0x4003c8=new Date(_0x2c46f2);_0x4003c8['setDate'](_0x4003c8['getDate']()-0x1);const _0x166502=new Date(_0x2c46f2);_0x166502['setDate'](_0x166502['getDate']()-0xe);const _0x502db1=this['history']['getItems']({'pinned':!0x0}),_0x48deb7=this['history']['getItems']({'from':_0x2c46f2,'to':_0x2c46f2}),_0x208762=this['history']['getItems']({'from':_0x4003c8,'to':_0x4003c8}),_0x2c05eb=this['history']['getItems']({'from':_0x166502,'to':_0x4003c8}),_0x5eec22=this['history']['getItems']({'to':_0x166502}),_0x5dfab2=[];return _0x502db1['length']>0x0&&_0x5dfab2['push']({'title':m(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x502db1}),_0x48deb7['length']>0x0&&_0x5dfab2['push']({'title':m(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x48deb7}),_0x208762['length']>0x0&&_0x5dfab2['push']({'title':m(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x208762}),_0x2c05eb['length']>0x0&&_0x5dfab2['push']({'title':m(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x2c05eb}),_0x5eec22['length']>0x0&&_0x5dfab2['push']({'title':m(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x5eec22}),_0x5dfab2;}['_setIsMaximized'](_0x1b3b55){this['_aiChatHistoryUi']['setIsMaximized'](_0x1b3b55);}}class I extends _0x269016{static get['requires'](){return[mt,ut];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ba extends _0x269016{static get['requires'](){return[x,o,P,I];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5a85b9){super(_0x5a85b9),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.initialConversation','new');}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](x)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](x)['startConversation']();}async['sendMessage']({message:_0x43dc33,attributes:_0x28de3e}){await this['context']['plugins']['get'](x)['sendMessage']({'message':_0x43dc33,'attributes':_0x28de3e});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](x)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](x)['focusPromptInput']();}['registerToolDataCallback'](_0x27f3c4){this['context']['plugins']['get'](x)['_registerToolDataCallback'](_0x27f3c4);}}class Is extends _0x494e59{['id'];constructor(_0x381108,_0xd46ea3){super(_0x381108);const {id:_0x4634df,type:_0x336eb6,icon:_0x9496b8}=_0xd46ea3;this['id']=_0x4634df,this['set']({'label':_0xd46ea3['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0xd46ea3['id']}}),_0x9496b8?this['icon']=_0x9496b8:'chat'===_0x336eb6?this['icon']=_0x198a09:'review'===_0x336eb6?this['icon']=_0x556d16:'translate'===_0x336eb6&&(this['icon']=xt);}}class ht extends _0x13218d{['listView'];constructor(_0x3dfa30,_0x2fea03){super(_0x3dfa30);const _0x49c71f=_0x2fea03['map'](_0x4b884a=>{const _0x2aff6b=new _0x202f8e(this['locale']),_0x61b53b=new Is(this['locale'],_0x4b884a);return _0x2aff6b['children']['add'](_0x61b53b),_0x61b53b['delegate']('execute')['to'](this),_0x2aff6b;});this['listView']=new _0x49b4eb(this['locale']),this['listView']['items']['addMany'](_0x49c71f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const at='chat-shortcuts';var Ga=function(_0x329f69){return _0x329f69['CHAT']='chat',_0x329f69['REVIEW']='review',_0x329f69['TRANSLATE']='translate',_0x329f69;}({});class Fa extends _0x269016{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[P];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](P),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x1bff05=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x1bff05['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x1bff05,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x18f133=Object['values'](Ga);this['_shortcuts']['forEach'](_0x2fedb7=>{let _0x1f1ced=!0x0;if(_0x2fedb7['id']&&_0x2fedb7['label']&&_0x18f133['includes'](_0x2fedb7['type'])?'chat'===_0x2fedb7['type']&&(_0x1f1ced='string'==typeof _0x2fedb7['prompt']):_0x1f1ced=!0x1,!_0x1f1ced)throw new _0x36ce55('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x2fedb7});});}['_injectShortcuts'](){const _0x163fa7=this['context']['plugins']['get'](P);this['_shortcutsView']=new ht(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x163fa7['addFeedItemCustomElement'](this['_shortcutsView']['element'],at),this['_shortcutsView']['on']('execute',_0x398043=>{const _0x4d83eb=_0x398043['source']['id'];this['_executeShortcut'](_0x4d83eb);});}['_removeShortcuts'](){const _0x16192a=this['context']['plugins']['get'](P);_0x16192a['hasFeedItem'](at)&&_0x16192a['removeFeedItem'](at),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x3f68b1){const _0x427acf=this['_shortcuts']['find'](_0x590453=>_0x590453['id']===_0x3f68b1),_0x24df31=_0x427acf['type'];'chat'===_0x24df31?this['_runChatShortcut'](_0x427acf):'review'===_0x24df31?_0x427acf['check']?this['_runReviewShortcut'](_0x427acf):this['_switchTab']('reviewMode'):'translate'===_0x24df31&&(_0x427acf['language']?this['_runTranslateShortcut'](_0x427acf):this['_switchTab']('translate'));}['_switchTab'](_0x945c51){if(!this['context']['plugins']['has']('AITabs'))throw new _0x36ce55('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x945c51});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x945c51);}async['_runChatShortcut']({prompt:_0x3987d7,draftMode:_0x2907b6,useWebSearch:_0x231990=!0x1,useReasoning:_0xa457e0=!0x1,model:_0x265541}){const _0xaeccd9=this['context']['plugins']['get']('AIChat'),_0x1849ec=this['context']['plugins']['get']('AIChatController'),_0x3688ac=_0x1849ec['activeConversation'];let _0x442c8;_0x442c8=_0x265541?await _0x3688ac['chatModels']['getModel'](_0x265541):await _0x3688ac['chatModels']['getDefault'](),_0x442c8&&await _0x3688ac['setModel'](_0x442c8),_0x3688ac['setWebSearch'](_0x231990),_0x3688ac['setReasoning'](_0xa457e0),_0x1849ec['addCurrentDocumentToChatContext'](),_0x2907b6?(this['_aiChatUI']['setPromptInputValue'](_0x3987d7),this['_aiChatUI']['focusPromptInput'](!0x0)):_0xaeccd9['sendMessage']({'message':_0x3987d7});}['_runReviewShortcut']({check:_0x41b692,model:_0x3cc346,prompt:_0x1be831,params:_0x26ddb0}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0x36ce55('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x986a83={'id':_0x41b692,'isCustom':'custom'===_0x41b692};_0x3cc346&&_0x1be831&&(_0x986a83['args']={'model':_0x3cc346,'prompt':_0x1be831}),_0x26ddb0&&(_0x986a83['params']=_0x26ddb0),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x986a83);}['_runTranslateShortcut']({language:_0x4ba7a8}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0x36ce55('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x4ba7a8,'args':{'language':_0x4ba7a8}});}}class io extends At{constructor(_0x138665){super(_0x138665);const _0xb19847=_0x138665['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0xb19847,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x21dfe2=this['editor']['plugins']['get']('AITabs')['view'];_0x21dfe2['isVisible']=!_0x21dfe2['isVisible'];}}class gt extends _0x3340d2{static get['requires'](){return[H];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x5945e9=this['editor'];_0x5945e9['commands']['add']('toggleAi',new io(_0x5945e9)),_0x5945e9['ui']['componentFactory']['add']('toggleAi',()=>{const _0x32f1b2=this['_createAIUIButton'](_0x494e59);return _0x32f1b2['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x32f1b2;}),_0x5945e9['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x3b6b1c=this['_createAIUIButton'](_0x555885);return _0x3b6b1c['set']({'role':'menuitemcheckbox'}),_0x3b6b1c;});}['_createAIUIButton'](_0x5bf238){const _0x54461b=this['editor'],_0x332553=_0x54461b['commands']['get']('toggleAi'),_0xbf005f=new _0x5bf238(_0x54461b['locale']);return _0xbf005f['set']({'label':m(_0x54461b['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x5f1756,'isToggleable':!0x0}),_0xbf005f['bind']('isEnabled')['to'](_0x332553),_0xbf005f['bind']('isOn')['to'](_0x332553,'value',_0x12ed5d=>!!_0x12ed5d),this['listenTo'](_0xbf005f,'execute',()=>{_0x332553['execute']();}),_0xbf005f;}}const j=['applySuggestion','insertSuggestion','showNext','showPrevious'];class ns extends _0x13218d{['_errorView'];constructor(_0x5141df){super(_0x5141df),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0xa6ed6b){this['showError'](_0xa6ed6b);}['showError'](_0x238550){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x238550,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x4a900d=new _0x13218d(this['locale']),_0x254a86=new _0x13218d(this['locale']);return _0x254a86['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x4a900d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x4ce27c=>!_0x4ce27c)]},'children':[_0x254a86]}),_0x4a900d;}}const L=0xa;class u extends _0x269016{static get['requires'](){return[o];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x64113d){const {id:_0x41b060}=this['_currentConfig']??{};this['_currentConfig']=_0x64113d;const {id:_0x4cf34e}=this['_currentConfig'];this['isOpen']&&_0x41b060===_0x4cf34e?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x509b6f=D(this['context'])['plugins']['get']('Dialog');_0x509b6f['isOpen']&&this['_currentConfig']&&_0x509b6f['id']===this['_currentConfig']['id']&&_0x509b6f['hide']();}['_updateDialog'](){const _0x578fbf=D(this['context'])['plugins']['get']('Dialog'),{icon:_0x411409,title:_0x3b2adb}=this['_currentConfig'];_0x578fbf['view']?.['headerView']&&(_0x578fbf['view']['headerView']['label']=_0x3b2adb,_0x578fbf['view']['headerView']['iconView']&&_0x411409&&(_0x578fbf['view']['headerView']['iconView']['content']=_0x411409)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x578fbf['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](o)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x156797){this['context']['plugins']['get'](o)['hideFakeVisualSelection']('ai-balloon-'+_0x156797);}['_showDialog'](){const _0x5cdc1d=D(this['context'])['plugins']['get']('Dialog'),{id:_0x32a05a,title:_0x8bad13,icon:_0x3f7df6,class:_0x2b835c,mainView:_0x17ae9f}=this['_currentConfig'];_0x17ae9f['delegate'](...j)['to'](this),_0x5cdc1d['show']({'title':_0x8bad13,'icon':_0x3f7df6,'hasCloseButton':!0x0,'id':_0x32a05a,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x2b835c||''),'content':_0x17ae9f,'onShow':_0x40fe0b=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x34dec7=this['_getSelectionElements']();_0x34dec7&&_0x34dec7[0x0]&&_0x23d97c({'target':_0x34dec7[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x40fe0b['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x32a05a});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x32a05a}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x394fcb,_0x54fc10){if(!_0x54fc10)return null;const _0x347887=this['_getSelectionElements']();if(!_0x347887||0x0===_0x347887['length'])return{'left':Math['round'](_0x54fc10['left']+_0x54fc10['width']/0x2-_0x394fcb['width']/0x2),'top':Math['round'](_0x54fc10['top']+_0x54fc10['height']/0x2-_0x394fcb['height']/0x2)};const _0x2b55c2=Math['round'](_0x54fc10['left']+_0x54fc10['width']/0x2-_0x394fcb['width']/0x2),_0x290049=_0x347887['map'](_0x2768ee=>new _0x30f41d(_0x2768ee)),_0x56f2dd=_0x394fcb['height'];return{'left':_0x2b55c2,'top':this['_calculateOptimalTopPosition'](_0x290049,_0x56f2dd,_0x54fc10)};}['_calculateOptimalTopPosition'](_0x9bbd07,_0x11d04b,_0x2d6ba9){const _0x5d07c3=new _0x30f41d(_0xbe938c['window']),_0x1a4066=_0x9bbd07['map'](_0x3e9afc=>_0x3e9afc['getVisible']())['filter'](_0x47d9d9=>_0x47d9d9),_0x4d5511=_0x30f41d['getBoundingRect'](_0x1a4066);if(!_0x4d5511)return Math['round'](_0x2d6ba9['top']+_0x2d6ba9['height']/0x2);const _0x5115b6=_0x5d07c3['getIntersection'](_0x4d5511);if(!_0x5115b6)return Math['round'](_0x2d6ba9['top']+_0x2d6ba9['height']/0x2);const _0x2f8abe=_0x2d6ba9['getVisible'](),_0x5c82f2=_0x2f8abe&&_0x4d5511['height']>_0x2f8abe['height'],_0x5dfe5c=_0x5115b6['top'],_0x4a85a2=_0x5115b6['bottom'];if(_0x5c82f2){const _0x2917c9=(_0x2f8abe||_0x5d07c3)['height']/0x2-_0x11d04b/0x2,_0x5c4b40=_0x5dfe5c-L-_0x2d6ba9['top'],_0x8c9efe=_0x2d6ba9['bottom']-_0x4a85a2-L;return _0x5c4b40>=_0x11d04b?Math['max'](L,_0x5dfe5c-_0x11d04b-L):_0x8c9efe>=_0x11d04b?_0x4a85a2+L:Math['max'](L,_0x2917c9);}const _0x2af792=_0x5dfe5c-_0x11d04b,_0x5e680e=_0x2d6ba9['bottom']-_0x4a85a2-L,_0x5d0102=_0x5dfe5c-L-_0x2d6ba9['top'];let _0x12d060;if(_0x5e680e>=_0x11d04b)_0x12d060=_0x4a85a2+L;else{if(_0x5d0102>=_0x11d04b)_0x12d060=_0x2af792-L;else _0x12d060=_0x5dfe5c+_0x4d5511['height']/0x2-_0x11d04b/0x2;}return _0x12d060;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0xb3d37b=D(this['context']);this['listenTo'](_0xb3d37b['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x200308,data:{newRange:_0x36dfde}}of _0xb3d37b['model']['document']['differ']['getChangedMarkers']())if(_0x200308['startsWith'](a+':')&&(_0x36dfde&&(_0x36dfde['start']['isEqual'](_0x36dfde['end'])||'$graveyard'==_0x36dfde['root']['rootName'])||null==_0x36dfde)){const _0x4c3a9d=m(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x4c3a9d),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x20d129=D(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x20d129['model']['document']);}['_getSelectionElements'](){const _0x27a873=D(this['context']);return _0x2b7f22(_0x27a873['editing'],[..._0x27a873['model']['markers']['getMarkersGroup']('ai-selection'),..._0x27a873['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class hs extends _0x8fb4e9{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x28860d,_0x322802={}){super(_0x28860d),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x322802};const _0x3cf699=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x3cf699?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['toggleShowChangesEnabled'](_0x5ce13e){this['showChangesButton']['isEnabled']=_0x5ce13e;}['_setupRatingButtons'](){this['likeButton']=new _0x494e59(this['locale']),this['likeButton']['set']({'icon':_0x33d0de,'label':m(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x494e59(this['locale']),this['dislikeButton']['set']({'icon':_0xc1eff0,'label':m(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x494e59(this['locale']),this['copyButton']['set']({'icon':_0x348579,'label':m(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x36afec=new _0x25fec4();_0x36afec['set']({'content':_0x14bd5e}),_0x36afec['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20ck-ai-mini-toolbar-copy-button_copied',setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button';},0x7d0);}),this['copyButton']['children']['add'](_0x36afec);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x494e59(this['locale']),this['showChangesButton']['set']({'icon':_0x4f0b2d,'label':m(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':'ck-ai-button-tertiary'}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x58c3e6=>_0x58c3e6?_0x5c2f07:_0x4f0b2d),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class B extends ns{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x30d583,_0x50c8d3){super(_0x30d583);const _0x1d6383=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new ts(),this['_keystrokes']=new _0x34d7cc(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x2532de({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x50c8d3,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new es(_0x30d583),this['_partToolbarView']=new os(_0x30d583,_0x50c8d3['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x50c8d3),this['_stateView']=new as(_0x30d583),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new hs(_0x30d583,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new ls(_0x30d583,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x3f2ade,_0x478da4,_0x272584,_0x4abf7a)=>{let _0x306275,_0x30705b;'pending'===_0x4abf7a?(_0x306275=this['_partToolbarView'],_0x30705b=this['_stateView']):(_0x306275=this['_stateView'],_0x30705b=this['_partToolbarView']),this['_stateView']['setState'](_0x272584),_0x306275['isVisible']=!0x1,_0x30705b['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x1d6383['to']('_state',_0x31fdfa=>'ck-ai-chat-balloon-main_state_'+_0x31fdfa)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x50c8d3);});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_partToolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_partToolbarView'],this['_miniToolbarView']]);}['destroy'](){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}['focusLast'](){this['focusCycler']['focusLast']();}async['updateContent'](_0x37f82d){_0x37f82d?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x37f82d);}['setState'](_0x50bae2){this['_state']=_0x50bae2;}['showError'](_0x27733e){super['showError'](_0x27733e),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x4ee78d){super['showBlockingError'](_0x4ee78d),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x10f12f){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x10f12f;}['togglePartToolbarEnabled'](_0xb2669e){this['_partToolbarView']['isEnabled']=_0xb2669e;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x4f009f,showSuggestButton:_0x5a5b48}){_0x4f009f=_0x4f009f&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x5a5b48=_0x5a5b48&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x4f009f,'showSuggestButton':_0x5a5b48});}['_createNextButtonView'](){const _0x16d5a2=new _0x494e59(this['locale']);return _0x16d5a2['set']({'icon':_0x45a588,'label':m(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x16d5a2['on']('execute',()=>{this['fire']('showNext');}),_0x16d5a2;}['_createPreviousButtonView'](){const _0x4145c9=new _0x494e59(this['locale']);return _0x4145c9['set']({'icon':_0x703697,'label':m(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x4145c9['on']('execute',()=>{this['fire']('showPrevious');}),_0x4145c9;}}class ls extends _0x13218d{constructor(_0xe5648a,_0x2faed4){super(_0xe5648a),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x2faed4});}}class pt extends _0x3340d2{static get['requires'](){return[_0x2b3fa6,u];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x3743cb){super(_0x3743cb),this['set']('showDiff',!0x1);}['open'](_0x42d50e){const _0x29f620=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x29f620['plugins']['get']('AIBalloon')['open']({..._0x42d50e,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x42d50e['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x42d50e['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x1623b3){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x1623b3);}['setState'](_0x294c26){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x294c26);}['_createChatBalloonView'](){const _0x7f564c=this['editor'],_0x58361c=_0x7f564c['plugins']['get']('AIBalloon'),_0x52ec30=_0x7f564c['commands']['get']('trackChanges');let _0x56609a=_0x7f564c['config']['get']('ai.availableReplyActions')||[...S];_0x7f564c['plugins']['has']('TrackChanges')||(_0x56609a=_0x56609a['filter'](_0x35c58b=>'insertSuggestion'!=_0x35c58b));const _0x1265e3=new B(_0x7f564c['locale'],{'availableActions':_0x56609a,'showApplyButton':!0x0,'showSuggestButton':!!_0x52ec30});return _0x1265e3['bind']('showDiff')['to'](this),_0x1265e3['delegate'](...V)['to'](this),_0x1265e3['delegate']('showPrevious','showNext')['to'](this),_0x58361c['delegate']('dialogClosed')['to'](this),_0x1265e3['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x1265e3['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x1265e3['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x52ec30&&_0x1265e3['bind']('isTrackChangesOn')['to'](_0x52ec30,'value'),_0x1265e3['render'](),_0x1265e3;}['_toggleRotatorButtonsInDialogHeader'](_0x3cdd12){const _0x17af89=this['editor'],_0x147360=_0x17af89['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x3cdd12),_0x147360['has'](this['_chatBalloonView']['previousButtonView'])||(_0x147360['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x17af89['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x147360['remove'](this['_chatBalloonView']['previousButtonView']),_0x147360['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class Ka extends _0x3340d2{static get['requires'](){return[gt,pt,bt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Et(_0x387822){const {editor:_0x893920,action:_0x4bd62f,withText:_0x37a05f=!0x1,withIcon:_0x1a5678=!0x0,isInDropdown:_0x3acd41=!0x0,shouldPreventFocus:_0x4a1953=!0x1}=_0x387822;return()=>{const _0x4a29ca=_0x893920['locale'],_0x5737b5=new _0x494e59(_0x4a29ca),_0x173bc1=_0x5737b5['bindTemplate'];_0x3acd41&&_0x5737b5['extendTemplate']({'on':{'mouseenter':_0x173bc1['to'](()=>{_0x4a1953&&_0x4a1953()||_0x5737b5['focus']();})}});const _0x16580c=_0x4bd62f['icon']??_0x4bd62f['parent']?.['icon'];return _0x5737b5['set']({'label':_0x4bd62f['displayedPrompt'],'withText':_0x37a05f,'role':'menuitem','icon':_0x1a5678?_0x16580c??_0x545218:void 0x0,'tooltip':!_0x37a05f,'class':'ck-ai-quick-actions-button','isEnabled':_0x4bd62f['isEnabled']}),_0x5737b5['on']('execute',()=>{_0x893920['editing']['view']['focus'](),_0x893920['commands']['execute']('aiQuickAction',_0x4bd62f);}),_0x5737b5;};}class Qs extends _0x4bd109{['arrowView'];constructor(_0x1ee2c7,_0x34ba06){super(_0x1ee2c7,_0x34ba06);const _0x3fcbca=this['bindTemplate'];this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':['ck-dropdown-menu-list__nested-menu__button'],'aria-haspopup':!0x0,'aria-expanded':this['bindTemplate']['to']('isOn',_0x2a21da=>String(_0x2a21da)),'data-cke-tooltip-disabled':_0x3fcbca['to']('isOn')},'on':{'mouseenter':_0x3fcbca['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x30c469=new _0x25fec4();return _0x30c469['content']=_0x4178ba,_0x30c469['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x30c469;}}class Gs extends _0x49b4eb{['_allListItems'];['_allSearchableItems'];constructor(_0xead331,_0x1da937,_0x55ef18){super(_0xead331),this['_allListItems']=_0x1da937,this['_allSearchableItems']=_0x55ef18;}['filter'](_0x2fb43d){if(!_0x2fb43d)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x5dd908=_0x2fb43d['source']['toLowerCase']()['trim'](),_0x429176=this['_allSearchableItems']['filter'](_0x19d85b=>(_0x19d85b['groupLabel']?_0x19d85b['label']+'\x20('+_0x19d85b['groupLabel']+')':_0x19d85b['label'])['toLowerCase']()['includes'](_0x5dd908));return this['items']['clear'](),this['items']['addMany'](_0x429176['sort']((_0x3f3265,_0x444d5c)=>{const _0x18364b=_0x3f3265['groupLabel'],_0x461f1e=_0x444d5c['groupLabel'];return _0x18364b||_0x461f1e?_0x18364b?0x1:-0x1:0x0;})['map'](_0xc3f498=>_0xc3f498['item'])),this['_highlightQuery'](_0x5dd908,_0x429176),{'resultsCount':_0x429176['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x5b6496,_0x25a539){if(!_0x5b6496)return;const _0x160c09=new RegExp(_0x52145f(_0x5b6496),'gi');_0x25a539['forEach'](_0x1758e0=>{_0x1758e0['highlightViews']&&_0x1758e0['highlightViews']['forEach'](_0x39dcc9=>{'function'==typeof _0x39dcc9['highlightText']&&_0x39dcc9['highlightText'](_0x160c09);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x4bfb14=>{_0x4bfb14['highlightViews']&&_0x4bfb14['highlightViews']['forEach'](_0x263472=>{'function'==typeof _0x263472['highlightText']&&_0x263472['highlightText'](null);});});}}const Ks='menu',Os='menuitem';class co extends _0x13218d{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x206b9e,_0x449ed9,_0x195066,_0x1b142c,_0x1ad344=!0x1){const _0x50c688=_0x206b9e['locale'];super(_0x50c688),this['_bodyCollection']=_0x1b142c,this['_hasSearch']=_0x1ad344;const _0x681327=this['_createListItems'](_0x206b9e,_0x449ed9,_0x195066);this['optionsListView']=new Gs(_0x50c688,_0x681327,this['_allSearchableItems']),this['optionsListView']['role']=Ks,this['optionsListView']['items']['addMany'](_0x681327),this['focusTracker']=new ts(),this['keystrokes']=new _0x34d7cc(),_0x1ad344&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x681327,this['focusCycler']=new _0x2532de({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x1ad344&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x1f094e=_0x1ad344&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x44a9be(_0x1f094e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x50c688['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x277b9b(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':m(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':m(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x409a72=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x409a72);}['_createListItems'](_0x1c111e,_0x223b86,_0x5fb795){const _0xac6158=new _0x44a9be();return _0x223b86['forEach'](_0x108d0a=>{if('actions'in _0x108d0a){const {listItem:_0x2ea22f}=this['_createActionGroupButton'](_0x1c111e,_0x108d0a,_0x5fb795);_0xac6158['add'](_0x2ea22f),_0x108d0a['actions']['forEach'](_0xe762a0=>{this['_createActionButton'](_0x1c111e,_0xe762a0,_0x108d0a['label'],_0x108d0a['icon']);const {listItem:_0x3778bd,highlightViews:_0x4c4c56}=this['_createSearchResultActionButton'](_0x1c111e,_0xe762a0,_0x108d0a['label'],_0x108d0a['icon']);this['_allSearchableItems']['push']({'item':_0x3778bd,'label':_0xe762a0['displayedPrompt'],'groupLabel':_0x108d0a['label'],'highlightViews':_0x4c4c56});});}else{const {listItem:_0x3a1a9a}=this['_createActionButton'](_0x1c111e,_0x108d0a);_0xac6158['add'](_0x3a1a9a);const _0x3e55f8=_0x3a1a9a['children']['first'];if(_0x3e55f8){const {listItem:_0x4d28c5,highlightViews:_0x3c95f7}=this['_createSearchResultActionButton'](_0x1c111e,_0x108d0a);this['_allSearchableItems']['push']({'item':_0x4d28c5,'label':_0x3e55f8['label']||'','highlightViews':_0x3c95f7});}}}),_0xac6158;}['_createActionButton'](_0x15772b,_0x41470c,_0x4f28de,_0xfa255f){const _0x38523a=new _0x202f8e(this['locale']);if(_0x4f28de&&_0xfa255f){const _0x40eb38=new _0x494e59(this['locale']),_0x3b69da=_0x40eb38['bindTemplate'],_0x1b2b9e=new _0x461746();_0x1b2b9e['text']=_0x41470c['displayedPrompt'];const _0x16c1db=new _0x461746();_0x16c1db['text']=_0x4f28de;const _0x5737da=new _0x25fec4();_0x5737da['content']=_0xfa255f,_0x5737da['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x56d9f9=new _0x13218d(this['locale']);_0x56d9f9['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0xd47bfc=new _0x13218d(this['locale']);return _0xd47bfc['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x40eb38['set']({'label':_0x41470c['displayedPrompt']+'\x20('+_0x4f28de+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x40eb38['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x1b2b9e,_0x56d9f9,_0x5737da,_0x16c1db,_0xd47bfc],'on':{'mouseenter':_0x3b69da['to'](()=>{this['_isSearchFocused']()||_0x40eb38['focus']();}),'click':_0x3b69da['to'](()=>{_0x40eb38['fire']('execute');})}}),_0x40eb38['on']('execute',()=>{_0x15772b['editing']['view']['focus'](),_0x15772b['commands']['execute']('aiQuickAction',_0x41470c);}),_0x38523a['children']['add'](_0x40eb38),{'listItem':_0x38523a,'highlightViews':[_0x1b2b9e,_0x16c1db]};}{const _0xc8187b=new _0x4ba152(),_0x28ffe1=new _0x494e59(this['locale'],_0xc8187b),_0x2fce79=_0x28ffe1['bindTemplate'],_0x4f1bf4=_0x41470c['icon']??_0x41470c['parent']?.['icon'],_0x3e168b=void 0x0!==_0x41470c['icon'];return _0x28ffe1['set']({'label':_0x41470c['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x3e168b?_0x4f1bf4??_0x545218:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x28ffe1['extendTemplate']({'on':{'mouseenter':_0x2fce79['to'](()=>{this['_isSearchFocused']()||_0x28ffe1['focus']();})}}),_0x28ffe1['on']('execute',()=>{_0x15772b['editing']['view']['focus'](),_0x15772b['commands']['execute']('aiQuickAction',_0x41470c);}),_0x38523a['children']['add'](_0x28ffe1),{'listItem':_0x38523a,'highlightViews':[_0xc8187b]};}}['_createSearchResultActionButton'](_0x204413,_0x6f3f1e,_0x306c23,_0x5ed52a){return _0x306c23&&_0x5ed52a?this['_createSearchResultGroupedActionButton'](_0x204413,_0x6f3f1e,_0x306c23,_0x5ed52a):this['_createSearchResultIndividualActionButton'](_0x204413,_0x6f3f1e);}['_createSearchResultGroupedActionButton'](_0x38cad0,_0x4f5ad2,_0x174d9c,_0x4e867d){const _0x55aad8=new _0x202f8e(this['locale']),_0x6aa878=new _0x494e59(this['locale']),_0x34f6f1=_0x6aa878['bindTemplate'],{view:_0x440912,highlightView:_0x2fae86}=this['_createSearchResultGroupRow'](_0x174d9c,_0x4e867d),{view:_0x597e25,highlightView:_0x330218}=this['_createSearchResultActionRow'](_0x4f5ad2['displayedPrompt']),_0x5c42d7=this['_createSearchResultContentView'](_0x440912,_0x597e25);return _0x6aa878['set']({'label':_0x4f5ad2['displayedPrompt'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1}),_0x6aa878['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-search-result-button','ck-ai-quick-actions-search-result-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x5c42d7],'on':{'mouseenter':_0x34f6f1['to'](()=>{this['_isSearchFocused']()||_0x6aa878['focus']();}),'click':_0x34f6f1['to'](()=>{this['_handleSearchResultButtonClick'](_0x6aa878);})}}),this['_setupActionButtonExecution'](_0x6aa878,_0x38cad0,_0x4f5ad2),_0x55aad8['children']['add'](_0x6aa878),{'listItem':_0x55aad8,'highlightViews':[_0x2fae86,_0x330218]};}['_createSearchResultIndividualActionButton'](_0x323225,_0x4d0df2){const _0x1d187d=new _0x202f8e(this['locale']),_0x24c624=new _0x4ba152(),_0x3329bd=new _0x494e59(this['locale'],_0x24c624),_0x4ab247=_0x3329bd['bindTemplate'];return _0x3329bd['set']({'label':_0x4d0df2['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x3329bd['extendTemplate']({'on':{'mouseenter':_0x4ab247['to'](()=>{this['_isSearchFocused']()||_0x3329bd['focus']();})}}),this['_setupActionButtonExecution'](_0x3329bd,_0x323225,_0x4d0df2),_0x1d187d['children']['add'](_0x3329bd),{'listItem':_0x1d187d,'highlightViews':[_0x24c624]};}['_createSearchResultGroupRow'](_0x5b14cf,_0x4abb4c){const _0x22f1d9=new _0x13218d(this['locale']),_0x15b1f9=new _0x25fec4();_0x15b1f9['content']=_0x4abb4c,_0x15b1f9['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x25fd82=new _0x461746();return _0x25fd82['text']=_0x5b14cf,_0x22f1d9['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x15b1f9,_0x25fd82]}),{'view':_0x22f1d9,'highlightView':_0x25fd82};}['_createSearchResultActionRow'](_0x21b718){const _0x572a84=new _0x13218d(this['locale']),_0x2fea9b=new _0x461746();return _0x2fea9b['text']=_0x21b718,_0x572a84['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x2fea9b]}),{'view':_0x572a84,'highlightView':_0x2fea9b};}['_createSearchResultContentView'](_0x4b48d3,_0x3075a3){const _0x3663e5=new _0x13218d(this['locale']);return _0x3663e5['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x4b48d3,_0x3075a3]}),_0x3663e5;}['_setupActionButtonExecution'](_0x1c8d2a,_0xfbe7a8,_0xb50bee){_0x1c8d2a['on']('execute',()=>{_0xfbe7a8['editing']['view']['focus'](),_0xfbe7a8['commands']['execute']('aiQuickAction',_0xb50bee);});}['_createActionGroupButton'](_0x90c9b,_0x79c760,_0xb0fc53){const _0x325e3f=new _0x202f8e(this['locale']),_0x554a93=new _0x4ba152(),_0x550ebb=new Qs(this['locale'],_0x554a93),_0x34a7ca=_0x550ebb['bindTemplate'],_0x38354a=this['_getPanelKeystroke'](_0xb0fc53),_0x3a4519=this['_createGroupActionsList'](_0x90c9b,_0x79c760['actions'],_0xb0fc53);_0x550ebb['set']({'label':_0x79c760['label'],'withText':!0x0,'role':Os,'icon':_0x79c760['icon']??_0x545218,'isEnabled':_0x79c760['actions']['some'](_0x3ac50f=>_0x3ac50f['isEnabled'])}),_0x550ebb['extendTemplate']({'on':{'mouseenter':_0x34a7ca['to'](()=>{this['_isSearchFocused']()||_0x550ebb['focus']();})}});const _0x546a9c=new _0x514db0(this['locale']);return _0x546a9c['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x34a7ca['to'](_0x379c10=>{this['_handlePanelKeydown'](_0x379c10,_0x38354a,_0x550ebb,_0x546a9c);})}}),_0x550ebb['bind']('isOn')['to'](_0x546a9c,'isVisible'),this['_bodyCollection']['add'](_0x546a9c),_0x546a9c['content']['add'](_0x3a4519),this['_setupGroupMenuBehavior'](_0x550ebb,_0x546a9c),_0x325e3f['children']['add'](_0x550ebb),{'listItem':_0x325e3f,'highlightView':_0x554a93};}['_createGroupActionsList'](_0x23e325,_0xdb5c69,_0x4b87b0){const _0x1ad137=new _0x49b4eb(this['locale']);return _0x1ad137['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0xdb5c69['forEach'](_0x4f18c7=>{const _0x53c07c=new _0x202f8e(this['locale']),_0x19c958=Et({'editor':_0x23e325,'action':_0x4f18c7,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x53c07c['children']['add'](_0x19c958),_0x4b87b0['focusTracker']['add'](_0x19c958),_0x1ad137['items']['add'](_0x53c07c);}),_0x1ad137;}['_setupGroupMenuBehavior'](_0x470b72,_0x471713){const _0x404572=_0x470b72['bindTemplate'],_0x4972c8=this['_getButtonKeystroke'](_0x470b72);_0x470b72['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x404572['to'](()=>{this['_showNestedPanel'](_0x471713,_0x470b72);}),'mouseleave':_0x404572['to'](_0x1a2ae2=>{const _0x370a34=_0x1a2ae2['relatedTarget'];this['_isMovingToNestedMenu'](_0x370a34,_0x471713)||this['_hideNestedPanel'](_0x471713);}),'keydown':_0x404572['to'](_0x167bf6=>{_0x167bf6['key']==_0x4972c8&&(this['_showNestedPanel'](_0x471713,_0x470b72),_0x471713['content']['get'](0x0)['focus']());})}}),_0x471713['on']('render',()=>{_0x471713['element']?.['addEventListener']('mouseleave',_0x21797f=>{const _0x5b77f8=_0x21797f['relatedTarget'];_0x470b72['element']?.['contains'](_0x5b77f8)||this['_isMovingToNestedMenu'](_0x5b77f8,_0x471713)||this['_hideNestedPanel'](_0x471713);});});}['_showNestedPanel'](_0x353dbb,_0x282fec){this['_openNestedPanels']['forEach'](_0x33cc2f=>{_0x33cc2f!==_0x353dbb&&_0x33cc2f['isVisible']&&_0x33cc2f['hide']();}),_0x353dbb['show'](),_0x353dbb['pin']({'positions':[_0x542982['eastSouth']],'target':_0x282fec['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x353dbb);}['_hideNestedPanel'](_0x276644){_0x276644['hide'](),this['_openNestedPanels']['delete'](_0x276644);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x29f147=>_0x29f147['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x503ee9,_0x48ef20){if(!_0x503ee9)return!0x1;if(_0x48ef20['element']?.['contains'](_0x503ee9))return!0x0;const _0x44f4ed=_0x503ee9;return _0x44f4ed['closest']&&(null!==_0x44f4ed['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x44f4ed['closest']('.ck-ai-quick-actions-group-list')||null!==_0x44f4ed['closest']('.ck-ai-quick-actions-group-button'));}['resetSearch'](){this['_searchTextView']&&this['_searchTextView']['reset']();}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['_searchTextView']?this['_searchTextView']['focus']():this['optionsListView']['focus']();}['_getPanelKeystroke'](_0x2e60c1){return'rtl'===_0x2e60c1['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0xb6726b){return'rtl'===_0xb6726b['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x5a26d7,_0x554daa,_0x584cd8,_0x46e83f){_0x5a26d7['key']==_0x554daa&&(_0x584cd8['focus'](),this['_hideNestedPanel'](_0x46e83f));}['_handleSearchResultButtonClick'](_0x36aeb1){_0x36aeb1['fire']('execute');}}function Ot(_0x32c583){const {editor:_0x5817da,content:_0x25ae4d,buttonDefinition:_0x53ca5e,bodyCollection:_0x4de9b5,hasSearch:_0x2d9acd=!0x1}=_0x32c583;return()=>{const _0xb592b8=_0x5817da['locale'],_0x59bac0=_0x478151(_0xb592b8);_0x59bac0['buttonView']['set']({'icon':_0x53ca5e['icon']??_0x545218,'label':_0x53ca5e['label'],'tooltip':!0x0}),_0x59bac0['set']({'class':'ck-ai-quick-actions-dropdown'});const _0xebe89=new co(_0x5817da,_0x25ae4d,_0x59bac0,_0x4de9b5,_0x2d9acd);if(_0x59bac0['panelView']['children']['add'](_0xebe89),_0x2d9acd){const _0x32df5e='ai-quick-actions-dropdown-selection';_0x59bac0['on']('change:isOpen',(_0x50f87d,_0x4e40c4,_0x39d7d0)=>{if(_0x39d7d0){if(_0x5817da['plugins']['has']('AIEditing')){const _0x1c6cb1=_0x5817da['plugins']['get'](o),_0x5a45a3=_0x5817da['model']['document']['selection'],_0x7148ea=Array['from'](_0x5a45a3['getRanges']());_0x7148ea['length']>0x0&&_0x1c6cb1['showFakeVisualSelection'](_0x7148ea,_0x32df5e,!0x1,!0x0);}}else _0x5817da['plugins']['has']('AIEditing')&&_0x5817da['plugins']['get'](o)['hideFakeVisualSelection'](_0x32df5e),_0xebe89['resetSearch']();});}return _0x59bac0;};}const vt='<task>For\x20given\x20selected\x20part\x20of\x20HTML\x20document\x20you\x20must\x20explain\x20the\x20meaning\x20of\x20it\x27s\x20content\x20clearly\x20and\x20in\x20plain\x20language.</task><rules>1.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is:-\x20If\x20it\x20looks\x20like\x20a\x20definition\x20explain\x20the\x20concept\x20in\x20simple\x20terms.-\x20If\x20it\x20looks\x20like\x20a\x20description\x20clarify\x20what\x20it\x20is\x20describing\x20and\x20why\x20it\x20matters.-\x20If\x20it\x20contains\x20technical\x20terms\x20or\x20jargon\x20break\x20them\x20down\x20into\x20everyday\x20language.-\x20If\x20it\x20looks\x20instructional\x20restate\x20as\x20clear\x20steps\x20someone\x20can\x20follow.-\x20If\x20it\x20provides\x20examples\x20explain\x20what\x20the\x20example\x20shows\x20and\x20why\x20it\x27s\x20relevant.-\x20If\x20it\x20presents\x20an\x20argument\x20or\x20claim\x20restate\x20the\x20claim\x20neutrally\x20and\x20explain\x20its\x20purpose.-\x20If\x20it\x20is\x20narrative/story-like\x20explain\x20what\x20event\x20or\x20situation\x20is\x20being\x20described.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20explain\x20what\x20the\x20data\x20indicates.-\x20If\x20it\x20is\x20a\x20quotation\x20explain\x20the\x20meaning\x20of\x20the\x20quote\x20in\x20context.-\x20If\x20it\x20compares/contrasts\x20things\x20explain\x20the\x20key\x20differences\x20or\x20similarities\x20simply.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20give\x20a\x20clear,\x20plain-language\x20explanation\x20of\x20its\x20meaning,\x20focusing\x20on\x20usefulness.2.\x20Provide\x20context\x20if\x20the\x20meaning\x20could\x20be\x20unclear\x20without\x20it.\x20(e.g.,\x20explain\x20where\x20such\x20a\x20term\x20might\x20be\x20used,\x20or\x20why\x20it\x20is\x20important).3.\x20Keep\x20the\x20explanation\x20short\x20but\x20complete\x20(2–5\x20sentences).Avoid\x20overly\x20technical\x20detail\x20unless\x20it\x20is\x20necessary\x20for\x20understanding.4.\x20Do\x20not\x20simply\x20repeat\x20the\x20original\x20text\x20—\x20restate\x20and\x20expand\x20it\x20in\x20plain\x20words.5.\x20If\x20possible,\x20add\x20a\x20short\x20example\x20or\x20analogy\x20to\x20make\x20it\x20easier\x20to\x20understand.6.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20explanation.7.\x20Your\x20explanation\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20explanation.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Pt='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20summarize\x20its\x20content\x20in\x20a\x20few\x20sentences,\x20keeping\x20only\x20the\x20essential\x20meaning.</task><rules>1.\x20Your\x20summary\x20should\x20be\x20short\x20and\x20clear:-\x20Aim\x20for\x202–4\x20sentences\x20unless\x20the\x20text\x20is\x20extremely\x20short.-\x20Focus\x20on\x20capturing\x20the\x20main\x20idea(s)\x20without\x20unnecessary\x20detail.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20summary\x20style:-\x20If\x20it\x20is\x20descriptive\x20condense\x20the\x20description\x20into\x20its\x20core\x20idea.-\x20If\x20it\x20is\x20argumentative\x20or\x20opinion-based\x20summarize\x20the\x20main\x20claim\x20and\x20reasoning\x20neutrally.-\x20If\x20it\x20is\x20narrative/story-like\x20capture\x20the\x20main\x20event\x20or\x20outcome\x20without\x20side\x20details.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20summarize\x20what\x20the\x20data\x20shows\x20in\x20plain\x20language.-\x20If\x20it\x20is\x20instructional\x20restate\x20the\x20overall\x20purpose\x20of\x20the\x20steps\x20without\x20listing\x20every\x20step.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20provide\x20a\x20general\x20concise\x20summary.3.\x20Provide\x20context\x20if\x20necessary\x20for\x20clarity:-\x20Mention\x20the\x20subject\x20or\x20topic\x20explicitly\x20so\x20the\x20summary\x20can\x20stand\x20alone.4.\x20Do\x20not\x20simply\x20copy\x20sentences\x20from\x20the\x20original\x20text\x20—\x20rephrase\x20in\x20plain\x20language.5.\x20Avoid\x20adding\x20new\x20information\x20or\x20interpretation\x20not\x20present\x20in\x20the\x20text.6.\x20Summarize\x20in\x20a\x20way\x20that\x20would\x20make\x20sense\x20to\x20someone\x20who\x20has\x20not\x20read\x20the\x20original\x20text.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20summary.8.\x20Your\x20summary\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20summary.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Kt='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</task><rules>1.\x20Present\x20the\x20output\x20as\x20a\x20clear,\x20structured\x20list\x20(bullets\x20or\x20numbered).-\x20Each\x20point\x20should\x20be\x20concise\x20(one\x20sentence\x20or\x20less).-\x20Do\x20not\x20merge\x20distinct\x20ideas\x20into\x20one\x20bullet.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20extraction\x20style:-\x20If\x20it\x20is\x20descriptive\x20capture\x20the\x20main\x20attributes\x20or\x20features.-\x20If\x20it\x20is\x20argumentative\x20extract\x20the\x20main\x20claim\x20and\x20supporting\x20reasons\x20separately.-\x20If\x20it\x20is\x20narrative/story-like\x20extract\x20the\x20main\x20events\x20in\x20chronological\x20order.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20highlight\x20the\x20most\x20important\x20facts\x20or\x20numbers.-\x20If\x20it\x20is\x20instructional\x20list\x20the\x20steps\x20or\x20main\x20actions\x20in\x20simplified\x20form.-\x20If\x20it\x20provides\x20comparisons\x20extract\x20the\x20contrasted\x20items\x20and\x20their\x20differences/similarities.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20category\x20above\x20extract\x20the\x20main\x20ideas\x20in\x20plain,\x20short\x20statements.3.\x20Keep\x20the\x20list\x20between\x203–7\x20items\x20where\x20possible.-\x20If\x20the\x20text\x20is\x20very\x20short,\x20fewer\x20items\x20are\x20fine.-\x20If\x20it\x20is\x20very\x20long,\x20focus\x20on\x20the\x20most\x20important\x20ideas\x20only.4.\x20Do\x20not\x20copy\x20long\x20text\x20fragments\x20—\x20restate\x20in\x20simple\x20words.5.\x20Do\x20not\x20add\x20interpretation,\x20evaluation,\x20or\x20commentary\x20beyond\x20the\x20text.6.\x20Ensure\x20the\x20list\x20can\x20stand\x20alone\x20without\x20requiring\x20the\x20reader\x20to\x20see\x20the\x20original\x20document.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20key\x20points.8.\x20Your\x20key\x20points\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>';var wt=function(_0x41904a){return _0x41904a['CHAT']='CHAT',_0x41904a['ACTION']='ACTION',_0x41904a['REVIEW']='REVIEW',_0x41904a;}({}),Wa=function(_0x5433b8){return _0x5433b8['CHAT']='AIChat',_0x5433b8['ACTION']='AIActions',_0x5433b8['REVIEW']='AIReviewMode',_0x5433b8;}({});class ki extends _0x3340d2{static get['requires'](){return[Ut,s];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x14cb48=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x14cb48),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x58058a){return function(_0x32904a){const _0x4f77d6=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x32904a['uiLanguage']),_0x26eb76=_0x4f77d6||'English',_0x10a4cd=[{'id':'ask-ai','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':kt},{'id':'chat-commands','label':m(_0x32904a,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':kt,'actions':[{'id':'explain','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':vt['replace']('%0',_0x26eb76),'type':'CHAT'},{'id':'summarize','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Pt['replace']('%0',_0x26eb76),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Kt['replace']('%0',_0x26eb76),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Qt},{'id':'continue','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Nt},{'id':'fix-grammar','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Ct},{'id':'adjust-length','label':m(_0x32904a,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':yt,'actions':[{'id':'make-shorter','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':m(_0x32904a,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Tt,'actions':[{'id':'make-tone-casual','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':m(_0x32904a,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':xt,'actions':[{'id':'translate-to-english','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':m(_0x32904a,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':m(_0x32904a,'AI_QUICK_ACTIONS_OTHER'),'icon':St,'actions':[]}];return _0x10a4cd;}(_0x58058a);}async['_getDefaultAndCustomActions'](){const _0x34f11e=ki['getDefaultQuickActions'](this['editor']['locale']),_0x45f89f=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x592fe6=[];try{_0x592fe6=await new X({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x494072){const _0x181d5d=new _0x36ce55('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x494072});_0x283c76(_0x181d5d['message']);}finally{const _0x52fbd4=_0x45f89f['map'](_0x5f3b85=>({..._0x5f3b85,'icon':void 0x0}));_0x34f11e['find'](_0x2dd3e3=>'other'===_0x2dd3e3['id'])['actions']['push'](..._0x52fbd4),_0x34f11e['forEach'](_0x757a4a=>{if('actions'in _0x757a4a)_0x757a4a['actions']['forEach'](_0x4232aa=>{if(_0x4232aa['isEnabled']=!!_0x592fe6['find'](_0x1ec679=>_0x1ec679['id']===_0x4232aa['model'])||void 0x0===_0x4232aa['model'],!_0x4232aa['isEnabled']){const _0x417de6=new _0x36ce55('ai-quick-actions-unavailable-model',this,{'actionId':_0x4232aa['id'],'modelId':_0x4232aa['model']});_0x283c76(_0x417de6['message']);}});else{if(_0x757a4a['isEnabled']=!!_0x592fe6['find'](_0x289de7=>_0x289de7['id']===_0x757a4a['model'])||void 0x0===_0x757a4a['model'],!_0x757a4a['isEnabled']){const _0x2f02ce=new _0x36ce55('ai-quick-actions-unavailable-model',this,{'actionId':_0x757a4a['id'],'modelId':_0x757a4a['model']});_0x283c76(_0x2f02ce['message']);}}});}return _0x34f11e;}['_initializeQuickActionsComponentsAndCommands'](){const _0x1af23b=new _0x5a5912(this['editor']['locale']);_0x1af23b['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x1af23b),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x1af23b);}['_initializeQuickActionsDropdown'](_0x5c5f51){const _0x152cc3=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Ot({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x545218,'label':m(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x5c5f51,'hasSearch':_0x152cc3}));}['_prepareQuickActionsDefinition'](_0x457c98){this['_quickActionsDefinition']=_0x457c98['map'](_0x658ff0=>{if('actions'in _0x658ff0){const _0x23dc9f=_0x658ff0;return{..._0x23dc9f,'actions':_0x23dc9f['actions']['map'](_0x325b6f=>{const {actions:_0x20e88e,..._0x29a2b1}=_0x23dc9f;return{..._0x325b6f,'parent':_0x29a2b1};})['filter'](_0x1a6c42=>this['_shouldIncludeAction'](_0x1a6c42))};}return _0x658ff0;})['filter'](_0x4c232c=>'actions'in _0x4c232c?_0x4c232c['actions']['length']>0x0:this['_shouldIncludeAction'](_0x4c232c));}['_shouldIncludeAction'](_0x11e198){const _0x1e0066=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Wa[_0x11e198['type']])&&!_0x1e0066['includes'](_0x11e198['id'])&&!('CHAT'===_0x11e198['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x508ebb){this['_quickActionsDefinition']['forEach'](_0x102f55=>{if('actions'in _0x102f55){const _0x587ab1=Ot({'editor':this['editor'],'content':_0x102f55['actions'],'buttonDefinition':_0x102f55,'bodyCollection':_0x508ebb});this['editor']['ui']['componentFactory']['add'](_0x102f55['id'],_0x587ab1),_0x102f55['actions']['forEach'](_0xbafc65=>{const _0x4044ec=Et({'editor':this['editor'],'action':_0xbafc65});this['editor']['ui']['componentFactory']['add'](_0xbafc65['id'],_0x4044ec);});}else{const _0x3e5128=Et({'editor':this['editor'],'action':_0x102f55,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x102f55['id'],_0x3e5128);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0xec424a=>{const _0x334b9e=new _0x5029fd(_0xec424a),_0xc320c1=m(_0xec424a,'AI_QUICK_ACTIONS_HEADING');_0x334b9e['buttonView']['set']({'label':_0xc320c1,'icon':_0x545218});const _0x42e1e4=new _0x17defc(_0xec424a);_0x42e1e4['set']({'ariaLabel':_0xc320c1,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x42ff1b=>{if('actions'in _0x42ff1b){const _0x49551b=_0x42ff1b,_0x487603=new _0x4236d1(_0xec424a,_0x334b9e),_0xa7f7c3=new _0x5029fd(_0xec424a),_0x4cbc56=new _0x17defc(_0xec424a);_0xa7f7c3['buttonView']['set']({'label':_0x49551b['label'],'icon':_0x49551b['icon']}),_0x49551b['actions']['forEach'](_0x58ca69=>{const _0x3f28ec=new _0x4236d1(_0xec424a,_0xa7f7c3),_0x3ed76d=new _0x555885(_0xec424a);_0x3ed76d['set']({'label':_0x58ca69['displayedPrompt'],'icon':_0x58ca69['icon'],'role':'menuitem','isEnabled':_0x58ca69['isEnabled']}),_0x3ed76d['on']('execute',()=>{this['_executeQuickAction'](_0x58ca69);}),_0x3ed76d['delegate']('execute')['to'](_0xa7f7c3),_0x3f28ec['children']['add'](_0x3ed76d),_0x4cbc56['items']['add'](_0x3f28ec);}),_0xa7f7c3['panelView']['children']['add'](_0x4cbc56),_0x487603['children']['add'](_0xa7f7c3),_0x42e1e4['items']['add'](_0x487603);}else{const _0x461cce=_0x42ff1b,_0x2cd742=new _0x4236d1(_0xec424a,_0x334b9e),_0x553079=new _0x555885(_0xec424a);_0x553079['set']({'label':_0x461cce['displayedPrompt'],'icon':_0x461cce['icon'],'role':'menuitem','isEnabled':_0x461cce['isEnabled']}),_0x553079['on']('execute',()=>{this['_executeQuickAction'](_0x461cce);}),_0x553079['delegate']('execute')['to'](_0x334b9e),_0x2cd742['children']['add'](_0x553079),_0x42e1e4['items']['add'](_0x2cd742);}});const _0x1b6569=Object['values'](Wa)['some'](_0x3e1502=>this['editor']['plugins']['has'](_0x3e1502));return _0x334b9e['set']({'isEnabled':_0x1b6569}),_0x334b9e['panelView']['children']['add'](_0x42e1e4),_0x334b9e;});}['_executeQuickAction'](_0x553258){const _0x211019=this['editor'];_0x211019['editing']['view']['focus'](),_0x211019['commands']['execute']('aiQuickAction',_0x553258);const _0x525689=_0x211019['ui']['view']['menuBarView'];_0x525689&&_0x525689['close']&&_0x525689['close']();}}class Ii extends At{['execute'](_0x30035e){switch(this['_expandSelectionIfCollapsed'](),_0x30035e['type']){case wt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x4ee399=m(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x36ce55('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x4ee399});}this['_handleAIChatAction'](_0x30035e);break;case wt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x248552=m(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x36ce55('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x248552});}this['_handleAIActionsAction'](_0x30035e);break;case wt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x3ac81d=m(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x36ce55('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x3ac81d});}this['_handleAIReviewAction'](_0x30035e);}}async['_handleAIChatAction'](_0x58b3bc){const _0x54b96a=this['editor']['plugins']['get']('AIChat'),_0x51cf31=this['editor']['plugins']['get']('AIChatController'),_0x29f937=this['editor']['plugins']['get']('AITabs')['view'];if(_0x29f937['isVisible']||(_0x29f937['isVisible']=!0x0),'chat'!==_0x29f937['activeTab']&&_0x29f937['activateTab']('chat'),'ask-ai'===_0x58b3bc['id'])_0x51cf31['removeSelectionFromChatContext'](),await _0x54b96a['addSelectionToChatContext'](),_0x54b96a['focusPromptInput']();else await _0x54b96a['startConversation'](),_0x51cf31['removeSelectionFromChatContext'](),await _0x54b96a['addSelectionToChatContext'](),_0x54b96a['focusPromptInput'](),await _0x54b96a['sendMessage']({'message':_0x58b3bc['prompt']||_0x58b3bc['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x58b3bc['id']},'displayedPrompt':_0x58b3bc['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x4d1f95=this['editor'],_0xdca1f1=_0x4d1f95['model']['document']['selection'];if(!_0xdca1f1['isCollapsed'])return;const _0x40ee2b=_0x3c4f7b(_0xdca1f1['getSelectedBlocks']())||_0x4d1f95['model']['schema']['getLimitElement'](_0xdca1f1);_0x4d1f95['model']['change'](_0x14b91f=>{_0x14b91f['setSelection'](_0x40ee2b,'in');});}['_handleAIActionsActionLabel'](_0x2edca2){return _0x2edca2['parent']?.['label']&&'other'!==_0x2edca2['parent']?.['id']?_0x2edca2['parent']['label']+':\x20'+_0x2edca2['displayedPrompt']:_0x2edca2['displayedPrompt'];}async['_handleAIActionsAction'](_0x2a3ebc){const _0x119a50=this['editor']['plugins']['get']('AIActions'),_0x1176d4=_0x2a3ebc['prompt']?{'userMessage':_0x2a3ebc['prompt'],'model':_0x2a3ebc['model']}:{'actionName':_0x2a3ebc['actionName']||_0x2a3ebc['id'],'args':_0x2a3ebc['args']},_0xe84325=this['_handleAIActionsActionLabel'](_0x2a3ebc);await _0x119a50['executeAction'](_0x1176d4,_0xe84325,_0x2a3ebc['icon']);}async['_handleAIReviewAction'](_0xbe36ce){console['log']('handleAIReviewAction',_0xbe36ce);}}class ji extends _0x3340d2{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x289ac5=this['editor'],_0x567d20=new Ii(this['editor']);if(_0x289ac5['commands']['add']('aiQuickAction',_0x567d20),_0x289ac5['plugins']['has']('AIChat')){const _0x1df355=this['editor']['plugins']['get']('AIChat');_0x289ac5['model']['document']['selection']['on']('change:range',(_0x577a3d,_0x283f6f)=>{_0x283f6f['directChange']&&_0x1df355['removeSelectionFromChatContext']();});}}}class Lt extends pe{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x5fd097=this['documentContextContent']['children']['map'](_0x4140e2=>({'node':_0x4140e2,'id':q(_0x4140e2,'data-id')})),_0x2ce8a5=this['parsedMergedContent']['children']['map'](_0x289470=>({'node':_0x289470,'id':q(_0x289470,'data-id')||_0x5ee109()})),_0x25365f=_0x35aa15(_0x5fd097,_0x2ce8a5,{'comparator':(_0x88a078,_0x3fd909)=>_0x88a078['id']==_0x3fd909['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x25365f['length']&&_0x25365f[_0x25365f['length']-0x1]['removed'];)_0x25365f['pop']();}const _0xed828=_0x25365f['map'](_0x2a82c1=>{const _0x25b057=_0x2a82c1['added']?'new':_0x2a82c1['removed']?'removed':'modified';return{'node':_0x2a82c1['value'][0x0]['node'],'type':_0x25b057,'id':_0x2a82c1['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0xed828,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x5765c9,_0xc735d6){return _0xc735d6;}}class h extends qt{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x1bc520){super(_0x1bc520),this['content']=_0x1bc520['content'],this['version']=_0x1bc520['version'],this['actionName']=_0x1bc520['actionName'],this['args']=_0x1bc520['args'],this['userMessage']=_0x1bc520['userMessage'],this['model']=_0x1bc520['model'];}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':Jt['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x2f7968){const _0x1014a2=new Lt({'editor':this['editor'],'documentContextContent':this['content'],..._0x2f7968});return this['replies']['push'](_0x1014a2),_0x1014a2['delegate'](...zt)['to'](this),this['fire']('replyCreated',_0x1014a2),_0x1014a2;}}class Bn extends _0x8fb4e9{constructor(_0x1cc99a,_0x542ff3=!0x0,_0x4f2c87=!0x0){super(_0x1cc99a),this['set']('isEnabled',!0x1),_0x542ff3&&(this['applyButton']=this['_createButton'](m(_0x1cc99a,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x4f2c87&&(this['suggestButton']=this['_createButton'](m(_0x1cc99a,'AI_BALLOON_SUGGEST_BUTTON'),_0x542ff3?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x542ff3,'showSuggestButton':_0x4f2c87}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x849bcc,showSuggestButton:_0xed282b}){this['applyButton']&&(this['applyButton']['isVisible']=_0x849bcc),this['suggestButton']&&(this['suggestButton']['isVisible']=_0xed282b);}['_createButton'](_0x23d1f3,_0x300c9b){const _0x5aaee0=new _0x494e59(this['locale']);return _0x5aaee0['set']({'label':_0x23d1f3,'class':_0x300c9b,'isVisible':!0x0,'withText':!0x0}),_0x5aaee0;}}class Nn extends _0x13218d{constructor(_0x36fffb){super(_0x36fffb),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':m(_0x36fffb,'AI_DISCLAIMER_TEXT')}]}]});}}class Vn extends _0x13218d{constructor(_0x45150c){super(_0x45150c),this['set']('isVisible',!0x0);const _0x522a43=new De('small');_0x522a43['isVisible']=!0x0;const _0x41a677=new _0x13218d(this['locale']);_0x41a677['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[m(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x8acb20=>!_0x8acb20)]},'children':[_0x522a43,_0x41a677]});}}class v extends ns{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x1cc90e,_0x58993c){super(_0x1cc90e),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x58993c,this['_focusTracker']=new ts(),this['_keystrokes']=new _0x34d7cc(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x2532de({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x44a9be(),this['_addContentWrapper'](_0x58993c),this['_addDisclaimerView'](),this['_addToolbar'](_0x58993c),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main']},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x58993c);});}['render'](){super['render']();for(const _0x305808 of this['_focusables'])this['_focusTracker']['add'](_0x305808['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0xea5dc5){-0x1===_0xea5dc5?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x3d3085){this['_isLoading']=_0x3d3085;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x58077a){super['showError'](_0x58077a),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x111bdc){super['showBlockingError'](_0x111bdc),this['setErrorState']();}['addMiniToolbarItem'](_0x1db290){this['_miniToolbarView']['items']['has'](_0x1db290)||this['_miniToolbarView']['items']['add'](_0x1db290);}['removeMiniToolbarItem'](_0x48f887){this['_miniToolbarView']['items']['has'](_0x48f887)&&this['_miniToolbarView']['items']['remove'](_0x48f887);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x5e1765,showSuggestButton:_0x5bc068}){_0x5e1765=_0x5e1765&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x5bc068=_0x5bc068&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x5e1765,'showSuggestButton':_0x5bc068});}async['updateContent'](_0x5e1e29){await this['_streamableContentView']['update'](_0x5e1e29);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x1feb15){this['_contentWrapper']=new _0x13218d(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x1feb15['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new Nn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x4f3512,showSuggestButton:_0x5a0c3a}){this['_toolbarView']=new Bn(this['locale'],_0x4f3512,_0x5a0c3a),this['_toolbarView']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['_toolbarView']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x47725f,_0x3e780a,_0x31c46a)=>!(_0x47725f||_0x3e780a||_0x31c46a)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x4f3512,'showSuggestButton':_0x5a0c3a}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x53ddcf){return this['_miniToolbarView']=new hs(this['locale'],_0x53ddcf),this['_miniToolbarView']['delegate'](...V)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x3afd6a,_0x5bfd5c)=>!(_0x3afd6a||_0x5bfd5c)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Vn(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new es(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x3172e4=new _0x494e59(this['locale']),_0x219cdb=new _0x494e59(this['locale']),_0x22f956=new On(this['locale']),_0xfbfb95=new _0x494e59(this['locale']);_0x3172e4['set']({'icon':_0x12572b,'label':m(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x219cdb['set']({'icon':_0x18feb2,'tooltip':m(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0xfbfb95['set']({'icon':_0x592902,'tooltip':m(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x3172e4['bind']('isEnabled')['to'](this,'isBusy',_0x3d92a5=>!_0x3d92a5),_0x3172e4['on']('execute',()=>{this['fire']('tryAgain');}),_0x219cdb['bind']('isEnabled')['to'](this,'isBusy',_0x353da7=>!_0x353da7),_0x219cdb['on']('execute',()=>{this['fire']('showPrevious');}),_0xfbfb95['bind']('isEnabled')['to'](this,'isBusy',_0x29499e=>!_0x29499e),_0xfbfb95['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x219cdb,this['_navigationCounter']=_0x22f956,this['_navigationNextButton']=_0xfbfb95,this['_navigationTryAgainButton']=_0x3172e4;}['updateMiniToolbarButtons'](_0x533856,_0x581241){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x5315b7=_0x533856>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x5315b7){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x10683e=_0x533856-_0x581241;this['_navigationCounter']['setInteractionCount'](_0x10683e+'/'+_0x533856),this['_navigationPreviousButton']['isEnabled']=_0x581241<_0x533856-0x1,this['_navigationNextButton']['isEnabled']=_0x581241>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}['disableMiniToolbarButtons'](){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}['startAutoScroll'](){this['_initializeScrollManager'](),this['_scrollManager']&&this['_scrollManager']['start']();}['stopAutoScroll'](){this['_scrollManager']&&this['_scrollManager']['stop']();}['toggleIsLoading'](_0x566df2){this['_isLoading']=_0x566df2;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x4fb859=this['_getScrollableElement']();_0x4fb859&&!this['_scrollManager']&&(this['_scrollManager']=new Fe(_0x4fb859));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class On extends _0x13218d{constructor(_0x15120e){super(_0x15120e);const _0x1c3d3f=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x1c3d3f['to']('interactionCount')}]});}['setInteractionCount'](_0x88a776){this['set']('interactionCount',_0x88a776);}}class qi extends _0x3340d2{static get['requires'](){return[s,_0x2b3fa6,o,u,_0x339a14];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];constructor(_0x452f22){super(_0x452f22),this['_bodyCollection']=new _0x5a5912(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new g();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x1f0974,_0xf3338a,_0xd78d0e){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x451d7f,anchorData:_0x5ef5ea}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x1f0974,_0x451d7f,_0x5ef5ea,_0xf3338a,_0xd78d0e);}}const {modelFragment:_0x274395,anchorData:_0x529508}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x1f0974,_0x274395,_0x529508,_0xf3338a,_0xd78d0e);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x20a518=this['editor']['plugins']['has']('TrackChanges');let _0x1ed921=this['editor']['config']['get']('ai.availableReplyActions')||[...S];_0x20a518||(_0x1ed921=_0x1ed921['filter'](_0x3e152a=>'insertSuggestion'!=_0x3e152a));const _0x37685b=this['editor']['commands']['get']('trackChanges'),_0xbd6a26=new v(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x20a518,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x1ed921});return _0xbd6a26['bind']('isBusy')['to'](this),_0x37685b&&_0xbd6a26['bind']('isTrackChangesOn')['to'](_0x37685b,'value'),_0xbd6a26['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0xbd6a26['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0xbd6a26['on']('showNext',()=>{this['_navigateToNext']();}),_0xbd6a26;}['_getExecuteDataRegular'](){const _0xef59e9=this['editor']['model']['document']['selection'];if(_0xef59e9['isCollapsed']){const _0x2fdb35=_0x3c4f7b(_0xef59e9['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0xef59e9);this['editor']['model']['change'](_0x1ccb91=>{_0x1ccb91['setSelection'](_0x2fdb35,'in');});}const _0x33bbe7=_0xef59e9['getFirstRange'](),_0x15eed1=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0xef59e9),_0x33bbe7['start'],_0x33bbe7['end']);this['_copyMarkersToFragment'](_0x15eed1,_0xef59e9,{'isTableSelection':!0x1});const _0x59a0eb=_0xef59e9['getFirstRange']()['start'],_0x1d84d2=new Map();let _0x308d9b=_0x15eed1;for(let _0x4d7e68=0x0;_0x4d7e68<_0x59a0eb['path']['length'];_0x4d7e68++)_0x1d84d2['set'](_0x308d9b,_0x59a0eb['path'][_0x4d7e68]),_0x308d9b=_0x308d9b['getChild'](0x0);return{'modelFragment':_0x15eed1,'anchorData':_0x1d84d2};}['_getExecuteDataInTable'](){const _0x28af5e=this['editor']['model']['document']['selection'],_0x2590cf=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x34799f=_0x28af5e['getFirstRange']()['start']['parent']['parent'],_0x8abaf1=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x34799f),this['editor']['model']['createPositionAfter'](_0x34799f)),_0x19773b=this['_wrapWithCommonAncestors'](_0x2590cf,_0x8abaf1['start'],_0x8abaf1['end']);this['_copyMarkersToFragment'](_0x19773b,_0x28af5e,{'isTableSelection':!0x0});const _0x27893a=_0x28af5e['getFirstRange']()['start'],_0xed6102=new Map();let _0x193cea=_0x19773b;for(let _0x1f1fcb=0x0;_0x1f1fcb<_0x27893a['path']['length'];_0x1f1fcb++)if(_0xed6102['set'](_0x193cea,_0x27893a['path'][_0x1f1fcb]),_0x1f1fcb<_0x27893a['path']['length']-0x1)_0x193cea=_0x193cea['getChild'](0x0);else{let _0x40267e=_0x193cea['nextSibling'];for(;_0x40267e;)_0xed6102['set'](_0x40267e,_0x27893a['path'][_0x1f1fcb]),_0x40267e=_0x40267e['nextSibling'];}return{'modelFragment':_0x19773b,'anchorData':_0xed6102};}async['_executeAction'](_0x5d3f19,_0x56cb72,_0x22d7fa,_0x3b5072,_0x3536e6){const _0x1a9c55=this['editor']['plugins']['get'](o),_0x3ff817=this['editor']['plugins']['get'](u),_0x3224ad=this['editor']['model']['document']['selection'],_0x5daaf1=await _0x1a9c55['modelToDataWithIds'](_0x56cb72),_0xdc94fd=this['editor']['model']['document']['version'],_0x4afe04=[..._0x3224ad['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0x3ff817['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x3b5072,'icon':_0x3536e6||_0x545218,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x4afe04,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x3ff817),this['_interactionParams']={'action':_0x5d3f19,'content':_0x5daaf1,'version':_0xdc94fd,'aiBalloon':_0x3ff817,'modelFragment':_0x56cb72,'anchorData':_0x22d7fa},this['_setupApplyListeners'](),this['listenTo'](_0x3ff817,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x3ff817,'dialogClosed',(_0x1c83f0,{id:_0x418b7d})=>{if('aiActionsBalloon'===_0x418b7d){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x117c03=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x4c8df1=_0x117c03['changeGroups'][0x0];_0x4c8df1&&'pending'===_0x4c8df1['state']&&_0x117c03['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x3ff817);}}),this['_createInteraction'](_0x5daaf1,_0xdc94fd,_0x3ff817,_0x5d3f19);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x5127b9,anchorData:_0x244ddb}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x5127b9,_0x244ddb,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x5127b9,_0x244ddb,!0x0);});}['_wrapWithCommonAncestors'](_0x54ffbe,_0x35f950,_0x4a9c0d){const _0x4eca24=this['editor']['model']['createRange'](_0x35f950,_0x4a9c0d)['getCommonAncestor'](),_0x3ed26c=_0x4eca24['is']('documentFragment')?[]:_0x4eca24['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x3ed26c['length']){const _0x45463b=_0x3ed26c['map'](_0x47efcb=>_0x47efcb['_clone'](!0x1));for(let _0x23d858=0x1;_0x23d858<_0x45463b['length'];_0x23d858++)_0x45463b[_0x23d858-0x1]['_appendChild'](_0x45463b[_0x23d858]);return _0x45463b[_0x45463b['length']-0x1]['_appendChild'](_0x54ffbe),new _0xaf169a(_0x45463b[0x0]);}return _0x54ffbe;}['_copyMarkersToFragment'](_0x1e4141,_0xd2733e,_0x5ec94c={'isTableSelection':!0x1}){const _0x4ffbfb=this['editor']['model'],_0xe4ade3=Array['from'](_0xd2733e['getRanges']()),_0x207465=_0xd2733e['getFirstRange']()['start'];for(const _0xee67aa of _0x4ffbfb['markers']){if(_0xee67aa['name']['startsWith'](a)||!_0xee67aa['affectsData'])continue;const _0x1772da=_0xee67aa['getRange']();if(!_0xe4ade3['some'](_0x410aad=>_0x410aad['containsRange'](_0x1772da,!0x0)))continue;const _0x4566e1=this['_regularCalculateMarkerPath'](_0x1772da['start'],_0x207465,_0x5ec94c['isTableSelection']),_0x3643e9=this['_regularCalculateMarkerPath'](_0x1772da['end'],_0x207465,_0x5ec94c['isTableSelection']),_0x13cbaf=_0x4ffbfb['createPositionFromPath'](_0x1e4141,_0x4566e1),_0x39bbb6=_0x4ffbfb['createPositionFromPath'](_0x1e4141,_0x3643e9);if(!_0x13cbaf['isEqual'](_0x39bbb6)){const _0x29e195=_0x4ffbfb['createRange'](_0x13cbaf,_0x39bbb6);_0x1e4141['markers']['set'](_0xee67aa['name'],_0x29e195);}}}['_regularCalculateMarkerPath'](_0x19ad17,_0x5d200a,_0x374c20=!0x1){const _0x17e3b4=[..._0x19ad17['path']['slice']()];for(let _0x26f597=0x0;_0x26f597<Math['max'](_0x5d200a['path']['length'],_0x19ad17['path']['length']);_0x26f597++){const _0x50c18d=_0x5d200a['path'][_0x26f597]||0x0,_0x20aa2c=(_0x19ad17['path'][_0x26f597]||0x0)-_0x50c18d;if(_0x17e3b4[_0x26f597]=_0x20aa2c,0x0!==_0x20aa2c&&!_0x374c20)break;}return _0x17e3b4;}async['_createInteraction'](_0x376807,_0x1a1abb,_0x1dc48d,_0x37740b){const _0x364926=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x37740b,'content':_0x376807,'version':_0x1a1abb,'aiBalloon':_0x1dc48d,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x1c44f4=new h({'connector':this['_aiConnector'],'editor':_0x364926,'content':_0x376807,'version':_0x1a1abb,..._0x37740b});this['_interactions']['push'](_0x1c44f4);const _0x3fbd61=(_0x32744f,_0x1d8375=!0x1,_0x3e64d8='streaming')=>this['_promiseQueue']['enqueue'](async _0x1bb539=>{try{const _0x328af0=f({'editor':_0x364926,'changeGroups':_0x32744f['changeGroups'],'documentContextContent':_0x32744f['documentContextContent'],'showDiff':_0x1d8375,'trimUnchanged':!0x1});_0x328af0['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x328af0[0x0],'renderingStrategy':_0x3e64d8,'abortSignal':_0x1bb539});}catch(_0x27cb64){if(this['_isAbortError'](_0x27cb64))return;throw _0x27cb64;}});this['_interaction']['on']('replyCreated',(_0x3b3070,_0xa63909)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x3fbd61(_0xa63909)['catch'](_0x372592=>{this['_isAbortError'](_0x372592)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x372592),this['_setErrorState'](_0x1c44f4));});}),this['_interaction']['on']('replyContentUpdated',(_0x1561e6,_0x19aa92)=>{_0x3fbd61(_0x19aa92)['catch'](_0x480224=>{this['_isAbortError'](_0x480224)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x480224),this['_setErrorState'](_0x1c44f4));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x3cac5c){this['_isAbortError'](_0x3cac5c)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x3cac5c),this['_setErrorState'](_0x1c44f4));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x597626,{showDiff:_0x6f91b})=>{try{this['_balloonShowDiff']=_0x6f91b;const _0x29df84=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x29df84&&await _0x3fbd61(_0x29df84,_0x6f91b,'static');}catch(_0x17bb6e){this['_isAbortError'](_0x17bb6e)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x17bb6e),this['_setErrorState'](_0x1c44f4));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x7ef2c,{reply:_0x3f6c75})=>{const _0x572e06={'positiveCount':_0x3f6c75['changeGroups']['filter'](_0x367679=>'accepted'===_0x367679['state'])['length'],'totalCount':_0x3f6c75['changeGroups']['length']},_0x35fc5e=this['_interaction']['actionCallId'],_0x307235=this['_interaction']['actionName'];_0x307235?this['_aiConnector']['upsertAIActionRating'](_0x307235,_0x35fc5e,_0x572e06):this['_aiConnector']['upsertCustomAIActionRating'](_0x35fc5e,_0x572e06);}),this['_setLoadingState']();try{const _0x31d288=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x31d288;}catch(_0x53ffcc){if(this['_isAbortError'](_0x53ffcc))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x1c44f4);}}['_applyChanges'](_0x51cac7,_0x6cbb4e,_0x880b8e){const _0xa5080d=this['editor'];if(_0x880b8e&&!_0xa5080d['plugins']['has']('TrackChanges'))throw new _0x36ce55('ai-no-track-changes',null);const _0x234dec=this['editor']['plugins']['get'](_0x339a14),_0x44de73=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x44de73||!_0x44de73['replies']['length'])return;const _0x17a101=_0x44de73['replies'][_0x44de73['replies']['length']-0x1],_0x4b811e=_0x17a101['changeGroups'];_0x17a101['setChangeGroupState'](0x0,'accepted');let _0xb3d5ee=y({'editor':_0xa5080d,'reply':_0x17a101,'interaction':_0x44de73,'groups':_0x4b811e,'transform':!0x1,'documentCompare':_0x234dec,'documentCompareOptions':{'anchor':_0xa5080d['model']['createPositionAt'](_0x51cac7,0x0),'markDeletions':_0x880b8e}});_0xb3d5ee=this['_filterOperationsOutsideRange'](_0xb3d5ee,_0x6cbb4e);for(const _0x5988f2 of _0xb3d5ee)this['_anchorOperation'](_0x6cbb4e,_0x5988f2,_0xa5080d['model']['document']['getRoot']());const _0x1d0894=_0x44de73['getDocumentContext']()['version'],_0xf96786=_0xa5080d['model']['document']['history']['getOperations'](_0x1d0894),_0x47b27c={'document':_0xa5080d['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0xe671ab=_0x634cdb(_0xb3d5ee,_0xf96786,_0x47b27c)['operationsA'];_0xa5080d['model']['change'](_0x3e1f98=>{if(_0x3e1f98['setSelection'](_0xa5080d['model']['document']['selection']['focus']),_0x880b8e)_0xa5080d['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0xe671ab);else{for(const _0x59a5c5 of _0xe671ab)_0x59a5c5['baseVersion']=_0xa5080d['model']['document']['version'],d(_0xa5080d,_0x59a5c5),_0x3e1f98['batch']['addOperation'](_0x59a5c5),_0xa5080d['model']['applyOperation'](_0x59a5c5);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x8ba4cd,_0x385bd0){return _0x8ba4cd['filter'](_0x1d907a=>{if('rename'==_0x1d907a['type']){const _0x2531fb=_0x1d907a['position']['nodeAfter'];return!_0x385bd0['has'](_0x2531fb);}if(_0x1d907a['type']['indexOf']('Attribute')>-0x1){const _0x2e9bed=_0x1d907a['range']['start']['nodeAfter'];return!_0x385bd0['has'](_0x2e9bed);}return!0x0;});}['_anchorOperation'](_0x5a6e0b,_0x558947,_0x256dc7){const _0x1d11bb=_0x558947['clone']();for(const _0x17a6d9 in _0x558947){const _0x8255a3=_0x558947[_0x17a6d9];_0x8255a3 instanceof _0xa8a41e?_0x558947[_0x17a6d9]=new _0xa8a41e(_0x53e83d(_0x8255a3['start']),_0x53e83d(_0x8255a3['end'])):_0x8255a3 instanceof _0x46cc31&&(_0x558947[_0x17a6d9]=_0x53e83d(_0x8255a3));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x1d11bb['type'])){if(_0x1d11bb['isDocumentOperation']=!0x1,_0x1d11bb['baseVersion']=null,'remove'==_0x1d11bb['type']){const _0x372ee0=_0x1d11bb['sourcePosition'],_0x2f2df5=_0x1d11bb['howMany'];new _0x1f3d0d(_0x372ee0,_0x2f2df5)['_execute']();}else _0x1d11bb['_execute']();}function _0x53e83d(_0x25fbd5){if('$graveyard'==_0x25fbd5['root']['rootName'])return _0x25fbd5;const _0x4e779e=[];let _0x34629f=_0x25fbd5['root'];for(let _0x766b81=0x0;_0x766b81<_0x25fbd5['path']['length'];_0x766b81++){const _0x293cc0=_0x5a6e0b['get'](_0x34629f)||0x0;_0x4e779e[_0x766b81]=_0x25fbd5['path'][_0x766b81]+_0x293cc0,_0x34629f=_0x34629f['getChildAtOffset'](_0x25fbd5['path'][_0x766b81]);}return new _0x46cc31(_0x256dc7,_0x4e779e,_0x25fbd5['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x35ba0d,content:_0x34d99a,version:_0x3269da,aiBalloon:_0x17378c}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['showLoader'](),this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0x34d99a,_0x3269da,_0x17378c,_0x35ba0d)['catch'](_0x203a6e=>{this['_isAbortError'](_0x203a6e)||console['error']('Error\x20refreshing\x20interaction:',_0x203a6e);});}['_isAbortError'](_0x26ef81){return!!_0x26ef81['message']&&_0x26ef81['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x419bcc=this['_interactions']['length'];this['_currentInteractionIndex']<_0x419bcc-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x1d47e1){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x1d47e1;const _0x489c87=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x489c87)return;if(_0x489c87['hasError'])return this['_setErrorState'](_0x489c87),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x489c87['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x2364fc=_0x489c87['replies'][_0x489c87['replies']['length']-0x1];if(_0x2364fc){const _0x3c5327=this['editor'];try{const _0x5e737b=f({'editor':_0x3c5327,'changeGroups':_0x2364fc['changeGroups'],'documentContextContent':_0x2364fc['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x44a9c3=>setTimeout(_0x44a9c3,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x5e737b[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x3367cf){this['_isAbortError'](_0x3367cf)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x3367cf);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x146036){const _0xfdb1fb=m(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0xfdb1fb),_0x146036['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class Ya extends _0x3340d2{static get['requires'](){return[ki,ji,qi];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x12927b){super(_0x12927b),_0x12927b['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class vr extends _0x13218d{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x5f3e3f,_0x43a962){super(_0x5f3e3f),this['id']=_0x43a962,this['set']('status','pending'),this['set']('changeId',_0x43a962),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x143d9a,_0x135460)=>{_0x135460&&_0x135460['target']&&'A'===_0x135460['target']['tagName']&&_0x135460['preventDefault'](),this['fire']('activateChange',{'id':_0x43a962,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x43a962,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x43a962,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x5279cc=new _0x13218d(this['locale']);return _0x5279cc['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x56377a=>!_0x56377a)]}}),_0x5279cc;}['_createAcceptButtonView'](){const _0x1658bf=new _0x494e59(this['locale']);return _0x1658bf['set']({'label':m(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x1658bf['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5c7e01=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x5c7e01['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x53fd43=>'pending'!==_0x53fd43&&'accepted'!==_0x53fd43),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x6f580e=>'pending'===_0x6f580e),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x20cba0=>'accepted'===_0x20cba0)]}}),this['on']('change:status',(_0x48112b,_0x372ea9,_0x18fe85)=>{_0x1658bf['isEnabled']='pending'===_0x18fe85,'accepted'===_0x18fe85&&(_0x1658bf['label']=m(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x1658bf['icon']=_0xd070e4);}),_0x1658bf;}['_createDismissButtonView'](){const _0x34bffd=new _0x494e59(this['locale']);return _0x34bffd['set']({'label':m(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x34bffd['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x46092f=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x46092f['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x4b4102=>'pending'!==_0x4b4102&&'rejected'!==_0x4b4102),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x2cb734=>'pending'===_0x2cb734),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x2ca01d=>'rejected'===_0x2ca01d)]}}),this['on']('change:status',(_0x40979e,_0x3f1785,_0x214a45)=>{_0x34bffd['isEnabled']='pending'===_0x214a45,'rejected'===_0x214a45&&(_0x34bffd['label']=m(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x34bffd['icon']=_0x5acc62);}),_0x34bffd;}['_createInfoButtonView'](){const _0x4a924e=new _0x494e59(this['locale']);return _0x4a924e['set']({'label':m(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':tc,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x4a924e['bind']('isOn')['to'](this,'isInfoToggleOn',_0x4f95a8=>_0x4f95a8),_0x4a924e['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x4a924e;}['_createOutdatedButtonView'](){const _0x1e15d2=new _0x494e59(this['locale']);return _0x1e15d2['set']({'label':m(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0xb61b01,'withText':!0x0,'isEnabled':!0x1}),_0x1e15d2['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x4b2589=>'outdated'!==_0x4b2589)],'disabled':'disabled'}}),_0x1e15d2;}}class ie extends _0x514db0{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x4fa1d9,_0x3cdf57){super(_0x4fa1d9),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['set']('isDiffActive',!0x1),this['content']['add'](this['_createContentView']()),_0x3cdf57['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0xa2487){this['resultItemView']['changeId']=_0xa2487['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0xa2487['contentDiffed'];}['showBalloon'](_0x43bbc0,_0x21f8c6,_0x210597,_0x320aba,_0x21f844,_0x4ac658){const _0x47d835=_0x21f8c6();if(!_0x47d835)return;this['updateContent'](_0x43bbc0),this['show']();const _0x1332bd=Array['from'](_0x47d835['getClientRects']())['reverse'](),_0x2db11d=this['_getPointedRectIndexFromEvent'](_0x210597,_0x1332bd),_0x20823a=_0x1332bd[_0x2db11d??0x0];'click'===_0x320aba?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x21f8c6(),_0x2db11d,_0x43bbc0['id'],_0x21f844,_0x4ac658)||_0x20823a})):'hover'===_0x320aba&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x21f8c6(),_0x2db11d,_0x43bbc0['id'])||_0x20823a}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){_0x16b45b({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x4c958d=[this['element']];return this['_pinnedTargetElement']&&_0x4c958d['push'](this['_pinnedTargetElement']),_0x4c958d;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x2f1fe4=new _0x13218d();return this['resultItemView']=new vr(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x2f1fe4['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai_review-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai_review__suggestion-text']},'children':[this['resultItemView']]}]}),_0x2f1fe4;}['_getBestRectPositionOnClick'](_0x4a7e62,_0x2f5b62,_0xef1e08,_0x3ad775,_0x512823){if(!_0x4a7e62)return null;const _0x37f98f=this['position']['replace']('arrow_',''),_0x4cf4da=Array['from'](_0x4a7e62['getClientRects']());let _0x5371a5,_0x314542=_0x4cf4da['reverse']();return void 0x0!==_0x2f5b62&&this['_isPinnedRectVisible'](_0x314542[_0x2f5b62],_0x3ad775,_0x512823)?(_0x5371a5=_0x314542[_0x2f5b62],this['_pinnedRectIndex']=_0x2f5b62):this['_isPinnedRectVisible'](_0x314542[0x0],_0x3ad775,_0x512823)&&void 0x0===_0x2f5b62?_0x5371a5=_0x314542[0x0]:(_0x314542='s'==_0x37f98f[0x0]?[..._0x4cf4da]['reverse']():_0x4cf4da,_0x314542['forEach'](_0x41ee31=>{this['_isPinnedRectVisible'](_0x41ee31,_0x3ad775,_0x512823)&&(_0x5371a5=_0x41ee31);})),this['_pinnedTargetChangeId']=_0xef1e08,this['_pinnedTargetElement']=_0x4a7e62,_0x5371a5||_0x4a7e62['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x491f6d,_0x156f3a,_0x822ef2){if(!_0x491f6d)return null;const _0x482146=Array['from'](_0x491f6d['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x156f3a&&this['_pinnedTargetChangeId']!==_0x822ef2)return this['_pinnedRectIndex']=_0x156f3a,this['_pinnedTargetElement']=_0x491f6d,this['_pinnedTargetChangeId']=_0x822ef2,_0x482146[_0x156f3a];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x822ef2){if(_0x491f6d!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x482146[this['_pinnedRectIndex']];}return void 0x0!==_0x156f3a&&this['_pinnedTargetChangeId']!==_0x822ef2?(this['_pinnedRectIndex']=_0x156f3a,this['_pinnedTargetElement']=_0x491f6d,this['_pinnedTargetChangeId']=_0x822ef2,_0x482146[_0x156f3a]):_0x491f6d['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x2a1188,_0x29cbdf){if(_0x2a1188)for(let _0x90e4d9=0x0;_0x90e4d9<_0x29cbdf['length'];_0x90e4d9++){const _0x38caad=_0x29cbdf[_0x90e4d9];if(_0x2a1188['clientX']>=_0x38caad['left']-0x3&&_0x2a1188['clientX']<=_0x38caad['right']+0x3&&_0x2a1188['clientY']>=_0x38caad['top']-0x3&&_0x2a1188['clientY']<=_0x38caad['bottom']+0x3)return _0x90e4d9;}}['_isPinnedRectVisible'](_0x5e8456,_0x19421d,_0x40bdf7){const _0x1768b6=new _0x30f41d(_0x5e8456),_0xc2bb50=_0x19421d||document['documentElement'],_0x5aae9e=_0x1768b6['getIntersection'](_0x50214f(_0x40bdf7)),_0x3c9ddb=new _0x30f41d(_0xc2bb50)['getIntersection'](_0x1768b6);return!!(_0x5aae9e&&_0x3c9ddb&&_0x1768b6['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ve extends _0x269016{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[H];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4b6429){super(_0x4b6429),this['_bodyCollection']=new _0x5a5912(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...ih)['to'](this),this['_balloonSuggestionView']=new ie(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x596c9c=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x596c9c);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x14a06e){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x547bae=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x14a06e,_0x547bae);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x517617){_0x517617&&('error-general'!==_0x517617['status']?'error-chunk'!==_0x517617['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x5a39f4){this['_mainView']['addCheckRunResult'](_0x5a39f4);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x5db648){this['_mainView']['showGeneralReviewCoreErrorView'](_0x5db648??m(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x2aaddc,_0x106e61){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x2aaddc,_0x106e61);}['setActiveStateInResults'](_0x1af661){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x52bc51=>{_0x52bc51['id']===_0x1af661&&_0x52bc51['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x46812f=>_0x46812f['setItemAsInactive']());}['updateChangeState'](_0x435d8f,_0x3b4227){'accepted'===_0x3b4227||'rejected'===_0x3b4227||'outdated'===_0x3b4227?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x435d8f,_0x3b4227):this['_mainView']['reviewCheckResultsView']['showResult'](_0x435d8f,_0x3b4227);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x40e2fd,_0x2debb7,_0x4b34f4,_0x47af82,_0x56dba0,_0x18b3f9){this['_balloonSuggestionView']['showBalloon'](_0x40e2fd,_0x2debb7,_0x4b34f4,_0x47af82,_0x56dba0,_0x18b3f9);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x3f19d8){const _0x3c1fec=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x2b6e8d=>_0x2b6e8d['id']===_0x3f19d8);return _0x3c1fec?_0x3c1fec['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0x13218d{constructor(_0xd59c4a){super(_0xd59c4a),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x902dfa=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x902dfa['if']('isVisible','ck-hidden',_0x25a45d=>!_0x25a45d)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x902dfa['to']('errorMessage')}]}]});}}class _e extends _0x13218d{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x18010c,_0x63d76){super(_0x18010c),this['reviewCoreHeader']=_0x63d76['header'],this['generalErrorView']=new sh(_0x18010c),this['reviewCheckListView']=_0x63d76['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0x63d76['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0x63d76['completed'],this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x5a6bb1){this['reviewCheckResultsView']['addResult'](_0x5a6bb1),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewCoreErrorView'](_0xb005e){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0xb005e;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class _r extends _0x494e59{constructor(_0x522949,_0x557fc3){super(_0x557fc3),this['set']({'label':_0x522949,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ie extends _0x202f8e{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x140177,_0x36e5df){super(_0x140177),this['_contents']=_0x36e5df,this['_resultViews']=new _0x44a9be(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['_resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new Bi(_0x140177),this['set']('isLoading',!0x1),this['set']('isToggleDiffOn',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('headerSubtitle',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general'),this['set']('isCompleted',!0x1);const _0x101d9f=this['_createCombinedSkeletonLoader'](),_0x415e15=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x415e15['if']('isLoading','ck-ai_review__check-run_loading',_0x580626=>_0x580626),_0x415e15['if']('isResultReady','ck-ai_review__check-run_ready',_0x31b1d4=>_0x31b1d4),_0x415e15['if']('isVisible','ck-hidden',_0x15c3a6=>!_0x15c3a6)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x5982e6=>_0x5982e6)]},'children':this['_resultViews']},_0x101d9f]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x21a334){const _0x2a9f60=new vr(this['locale'],_0x21a334['id']);_0x2a9f60['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x2a9f60),_0x2a9f60['resultResponseView']['element']['innerHTML']=_0x21a334['contentDiffed'];}['hideResult'](_0x10db20,_0x274cef){if('pending'===_0x274cef)return;const _0x1953bd=this['_resultViews']['find'](_0x6c1213=>_0x6c1213['id']===_0x10db20);_0x1953bd&&(_0x1953bd['status']=_0x274cef,_0x1953bd['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x134655,_0x591314){if('pending'!==_0x591314)return;const _0x2edc85=this['_resultViews']['find'](_0x3bd3a1=>_0x3bd3a1['id']===_0x134655);_0x2edc85&&(_0x2edc85['status']=_0x591314,_0x2edc85['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x5e5820,_0x33987c){this['headerTitle']=_0x5e5820,this['headerSubtitle']=_0x33987c||'';}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}['resetErrorState'](){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}['_createSkeletonLoader'](){return new Oe(this['locale'],Be['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x29f46b=new _0x13218d(this['locale']),_0x33a7cb=[];for(let _0x1888a4=0x0;_0x1888a4<0x10;_0x1888a4++){const _0x104c19=this['_createSkeletonLoader']();_0x104c19['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x33a7cb['push'](_0x104c19);}return _0x29f46b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x103c2f=>!_0x103c2f)]},'children':_0x33a7cb}),_0x29f46b;}['_createErrorView'](){const _0x3fe0f1=new _0x13218d(this['locale']),_0x117957=new _0x494e59(this['locale']),t=this['locale']['t'];return _0x3fe0f1['delegate']('retryReview')['to'](this),_0x117957['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x117957['on']('execute',()=>{this['fire']('retryReview');}),_0x3fe0f1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x46937c=>!_0x46937c),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x1c1f2c=>'chunk'===_0x1c1f2c)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x4e291b=>'chunk'===_0x4e291b)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x1169fb=>'general'!==_0x1169fb)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x672e45=>'chunk'!==_0x672e45)]},'children':[{'text':m(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x117957]}),_0x3fe0f1;}['_createCancelButtonView'](){const _0x5ece38=new _0x494e59(this['locale']);return _0x5ece38['set']({'label':m(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x4ed6ae}),_0x5ece38['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x34f3f2=>_0x34f3f2),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x467590=>_0x467590)]}}),_0x5ece38['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x5ece38;}['_createToggleDiffButtonView'](){const _0x36b9f0=new _0x494e59(this['locale']);_0x36b9f0['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x36b9f0['bind']('isEnabled')['to'](this,'isError',_0x5c8938=>!_0x5c8938),_0x36b9f0['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x13bd5c=>!_0x13bd5c),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x458e2c=>_0x458e2c)]}});const _0x1426ff=m(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x51b0c2=m(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x36b9f0['bind']('isOn')['to'](this,'isToggleDiffOn',_0x25923e=>_0x25923e),_0x36b9f0['bind']('icon')['to'](this,'isToggleDiffOn',_0x123b60=>_0x123b60?_0x444a30:_0x555d32),_0x36b9f0['bind']('label')['to'](this,'isToggleDiffOn',_0x31d7cf=>_0x31d7cf?_0x1426ff:_0x51b0c2),_0x36b9f0['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x36b9f0;}['_createAcceptAllButtonView'](){const _0x4c09cc=new _0x494e59(this['locale']);return _0x4c09cc['set']({'label':m(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x4c09cc['bind']('isEnabled')['to'](this,'isError',_0x1edf46=>!_0x1edf46),_0x4c09cc['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x555dbc=>!_0x555dbc),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x419596=>_0x419596)]}}),_0x4c09cc['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x4c09cc;}['_createExitReviewButtonView'](){const _0x56eb31=new _0x494e59(this['locale']);return _0x56eb31['set']({'label':m(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x56eb31['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x24e9c3=>!_0x24e9c3),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3db0d5=>_0x3db0d5)]}}),_0x56eb31['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x56eb31;}['_createResultHeaderView'](){const _0xfdb879=new _0x13218d(this['locale']),_0xd9dc29=this['_createTitleView']();return _0xfdb879['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x576fc8=>_0x576fc8)]},'children':[_0xd9dc29,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0xfdb879;}['_createTitleView'](){const _0xcdb31b=new _0x13218d(this['locale']),_0x37b911=new De();return _0x37b911['bind']('isVisible')['to'](this,'isResultReady',_0x19b4a0=>!_0x19b4a0),_0xcdb31b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x37b911,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x49ba6b=>_0x49ba6b)]},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x736203=>!_0x736203)]},'children':[{'text':m(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0xcdb31b;}['_createFinishReviewButtonView'](){const _0x1cbb34=new _r(m(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x1cbb34['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x126a96=>!_0x126a96)]}}),_0x1cbb34['delegate']('finishReview')['to'](this),_0x1cbb34;}}class Re extends _0x202f8e{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x2631bb,_0xdca831){super(_0x2631bb),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0xdca831['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0xdca831['headerText']);const _0x3a0213=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x3a0213['if']('isVisible','ck-hidden',_0x3560a8=>!_0x3560a8)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0xdca831['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x6a2e04){const _0x2f7afc=new _r(_0x6a2e04,this['locale']);return _0x2f7afc['delegate']('finishReview')['to'](this),_0x2f7afc;}['_createResultHeaderView'](_0xf93f17){const _0x583ab1=new _0x13218d(this['locale']);return _0x583ab1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title']},'children':[{'text':_0xf93f17}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x583ab1;}}class Dr extends _0x13218d{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x31cd42,_0x347ff6){super(_0x31cd42),this['_defaultValue']=_0x347ff6['default']||(_0x347ff6['data']['length']>0x0?_0x347ff6['data'][0x0]['id']:''),this['_defaultLabel']=_0x347ff6['data']['find'](_0x586e69=>_0x586e69['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x478151(this['locale']);const _0x463aa7=this['_prepareListOptions'](_0x347ff6['data']);_0x32894e(this['_dropdownView'],_0x463aa7,{'role':'menu','ariaLabel':_0x347ff6['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5524a7=>{_0x5524a7['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x1b7b66=>{this['formValue']=_0x1b7b66['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x1b7b66['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x30b8a6=[]){const _0x15a5e8=new _0x4c2902();this['resetToDefault']();for(const _0x21710b of _0x30b8a6){const _0x4b68c6=new _0x2b3edb({'label':_0x21710b['label'],'withText':!0x0,'role':'menuitemradio','id':_0x21710b['id'],'model':_0x21710b});_0x4b68c6['bind']('isOn')['to'](this,'formValue',_0xc96694=>_0xc96694===_0x4b68c6['id']);const _0x114963={'type':'button','model':_0x4b68c6};_0x15a5e8['add'](_0x114963);}return _0x15a5e8;}}class cc extends _0x202f8e{['_formItem']=null;constructor(_0x316c2f,_0x18174d,_0x2b2134){super(_0x316c2f),this['argsKey']=_0x18174d?.['argsKey'];if('dropdown'===_0x18174d['formType'])this['_formItem']=new Dr(this['locale'],_0x18174d);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x4a912a=new _0x3e3237(this['locale'],{'children':[this['_formItem']],'class':[_0x2b2134?'ck-form__row_with-submit':'']});_0x2b2134&&_0x4a912a['children']['add'](_0x2b2134),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x4a912a]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class po extends _0x7a291d{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x1d66e4){super(_0x1d66e4),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x34d7cc(),this['minRows']=po['MIN_ROWS'],this['maxRows']=po['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class rc extends _0x13218d{['focusTracker']=new ts();['keystrokes']=new _0x34d7cc();['focusCycler'];['_focusables']=new _0x44a9be();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x49114b,_0x351e5f,_0x3396a8=!0x1){super(_0x49114b),this['_check']=_0x351e5f,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x351e5f['defaultModel']?_0x351e5f['defaultModel']['id']:'',this['_defaultLabel']=_0x351e5f['defaultModel']?_0x351e5f['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x557ad5(this['locale'],()=>new po(_0x49114b)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _0x4c2902(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x3396a8),_0x32894e(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x3e3237(this['locale'],{'children':[this['promptInputView']]}),new _0x3e3237(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x49d527,_0x20a99c)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x20a99c()):_0x20a99c();}),this['focusCycler']=new _0x2532de({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),([this['promptInputView'],this['_modelSelectionDropdown'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x549f27=>{this['_focusables']['add'](_0x549f27),this['focusTracker']['add'](_0x549f27['element']);}),this['keystrokes']['listenTo'](this['element']));}get['modelDefaultValue'](){return this['_defaultValue'];}get['modelDefaultLabel'](){return this['_defaultLabel'];}['resetToDefault'](){this['prompt']='',this['modelId']=this['modelDefaultValue'],this['_modelSelectionDropdown']['buttonView']['label']=this['modelDefaultLabel'],this['resetFormValidationStatus']();}['resetFormValidationStatus'](){this['promptInputView']['errorText']='';}['_isValid'](){this['resetFormValidationStatus']();for(const _0x3adc1e of this['_getFormValidators']()){const _0x210893=_0x3adc1e();if(_0x210893)return this['promptInputView']['errorText']=_0x210893,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return m(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x3c0771=new _0x494e59(this['locale']),t=this['locale']['t'];return _0x3c0771['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x3c0771['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x3c0771;}['_createCancelButtonView'](){const _0xbe0785=new _0x494e59(this['locale']),t=this['locale']['t'];return _0xbe0785['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0xbe0785['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x732b4e=>{_0x732b4e['stopPropagation']();})}}),_0xbe0785['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0xbe0785;}['_setModelList'](_0x3a60dd){this['_modelSelectionDropdownItems']['clear']();const _0x5afeef=this['_check']['models'];if(_0x3a60dd)this['set']('modelDisplayMode','hidden');else{const _0x40ea02=0x1===_0x5afeef['length'];this['set']('modelDisplayMode',_0x40ea02?'name':'selector');}if(this['resetToDefault'](),_0x5afeef?.['length']){0x1===_0x5afeef['length']&&this['set']('activeModelName',_0x5afeef[0x0]['name']||_0x5afeef[0x0]['id']);for(const _0x56b7b0 of _0x5afeef){const _0x13ebdf=new _0x2b3edb({'label':_0x56b7b0['name'],'withText':!0x0,'role':'menuitemradio','id':_0x56b7b0['id'],'model':_0x56b7b0});_0x13ebdf['bind']('isOn')['to'](this,'modelId',_0x5cd96a=>_0x5cd96a===_0x56b7b0['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x13ebdf,'labelView':new ko(this['locale'],_0x56b7b0)});}}}['_createModelSelectionDropdown'](){const _0x279ca5=_0x478151(this['locale']);return _0x279ca5['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x279ca5['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x279ca5['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x30f352=>'selector'===_0x30f352),this['listenTo'](_0x279ca5,'execute',_0x12a46a=>{this['modelId']=_0x12a46a['source']['model']['id'],_0x279ca5['buttonView']['label']=_0x12a46a['source']['label'];}),_0x279ca5;}['_createModelNameView'](){const _0x302280=new _o(this['locale']);return _0x302280['bind']('text')['to'](this,'activeModelName',_0x51bae5=>_0x51bae5??''),_0x302280['bind']('isVisible')['to'](this,'modelDisplayMode',_0x16fd29=>'name'===_0x16fd29),_0x302280;}['_createActionsFooterView'](){const _0x4e13f7=new _0x13218d(this['locale']);return _0x4e13f7['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x4e13f7;}}class _o extends _0x13218d{constructor(_0x2e55a7){super(_0x2e55a7),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x29caec=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x29caec['if']('isVisible','ck-hidden',_0x3e9965=>!_0x3e9965)]},'children':[{'text':_0x29caec['to']('text')}]});}}class ko extends _0x2dac38{constructor(_0x3e8bf4,_0x5e0524){super();const _0x31125d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x31125d['to']('style'),'id':_0x31125d['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x31125d['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x5e0524['description']||'']}]}]});}}class ic extends _0x202f8e{['_formItemsCollection']=new _0x44a9be();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x25a6da,_0x42ee9e,_0x3b7211,_0xbf34e5=!0x1){super(_0x25a6da),this['_hideModels']=_0xbf34e5,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x42ee9e['isParameterized']);const _0x1d3fe5=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0x1a5266=>_0x1a5266),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x502028=>_0x502028)],'style':{'--ck-ai-review-check-list-item-index':_0x3b7211}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0x42ee9e['title']}]},_0x1d3fe5]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x42ee9e['description']?[{'text':_0x42ee9e['description']}]:[]}]}]},..._0x42ee9e['isParameterized']?[this['_createParameterizedView'](_0x42ee9e)]:[],...'custom'===_0x42ee9e['id']?[this['_createCustomView'](_0x42ee9e,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x42ee9e['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x42ee9e['id'],'args':_0x42ee9e['useArgs']?_0x42ee9e['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x16b45b({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0xe6b844=>{_0xe6b844['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x2f66fe=new _0x25fec4();return _0x2f66fe['content']=_0x4d1d5b,_0x2f66fe['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x2f66fe;}['_createParameterizedView'](_0x296215){const _0x427b9c=new _0x13218d(),_0x5d3f7d=this['_createFormView'](_0x296215);return _0x427b9c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0xd8858=>!_0xd8858)]},'children':[_0x5d3f7d]}),_0x427b9c;}['_createFormView'](_0x2cc1d2){const _0x248834=new _0x13218d(),_0x59eccb=Array['isArray'](_0x2cc1d2['options'])?_0x2cc1d2['options']:[],_0x4a13ec=new _0x494e59(this['locale']),t=this['locale']['t'];_0x4a13ec['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x4a13ec['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1702fb=>{_0x1702fb['stopPropagation']();})}}),_0x4a13ec['on']('execute',()=>{const _0x5127e8=[],_0x30265c={};this['_formItemsCollection']['forEach'](_0x2a758b=>{_0x5127e8['push'](_0x2a758b['value']),_0x2cc1d2['useArgs']&&_0x2cc1d2['options']&&(_0x30265c[_0x2a758b['argsKey']]=_0x2a758b['value']);}),this['fire']('runReviewCheck',{'id':_0x2cc1d2['id'],'params':_0x5127e8['length']?_0x5127e8:void 0x0,'args':Object['keys'](_0x30265c)['length']?_0x30265c:void 0x0});});const _0x52e926=_0x59eccb['length'];return _0x59eccb['forEach']((_0x56c060,_0x5d9580)=>{const _0x474e3f=_0x5d9580===_0x52e926-0x1;this['_formItemsCollection']['add'](new cc(this['locale'],_0x56c060,_0x474e3f?_0x4a13ec:null));}),_0x248834['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x248834;}['_createCustomView'](_0x28c150,_0x5a00aa=!0x1){return this['_customCheckView']=new rc(this['locale'],_0x28c150,_0x5a00aa),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x385a91=>!_0x385a91)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x54b355,_0x1f9064,_0x135e5c)=>{_0x135e5c||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class Te extends _0x202f8e{['_checkViews'];constructor(_0x31b743){super(_0x31b743),this['_checkViews']=new _0x44a9be(),this['_setupTemplate']();}['setChecks'](_0x2b705f,_0x4b4a49=!0x1){this['_checkViews']['clear']();for(const [_0x13eb7a,_0x249d8f]of _0x2b705f['entries']()){const _0x545168=new ic(this['locale'],_0x249d8f,_0x13eb7a,_0x4b4a49);_0x545168['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x545168);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x25c97 of this['_checkViews'])_0x25c97 instanceof ic&&_0x25c97['resetToDefault']();}['_setupTemplate'](){const _0x3634d2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x3634d2['if']('isVisible','ck-hidden',_0x1521cf=>!_0x1521cf)]},'children':this['_checkViews']});}}class re extends ve{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x3a2b1e=this['context']['locale'],_0xb1e344=new _0x33ee7e(_0x3a2b1e,{'label':m(_0x3a2b1e,'AI_REVIEW_MODE'),'icon':_0x89e5ef,'class':'ck-ai-header\x20ck-ai-header_review'});return new _e(this['context']['locale'],{'header':_0xb1e344,'list':new Te(_0x3a2b1e),'results':new Ie(_0x3a2b1e,{'generalErrorText':m(_0x3a2b1e,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new Re(_0x3a2b1e,{'headerText':m(_0x3a2b1e,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':m(_0x3a2b1e,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':m(_0x3a2b1e,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x3e1aab=this['context']['plugins']['get']('AITabs');_0x3e1aab['view']['on']('activateTab',(_0x34fb5d,_0x5951ae)=>{'reviewMode'===_0x5951ae?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x3e1aab['view']['addTab']({'id':'reviewMode','buttonLabel':m(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x89e5ef,'order':0x0,'content':this['_mainView']});}}const Ht='review-';class oe extends _0x269016{static get['requires'](){return[_0x339a14,o];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x9def7a){super(_0x9def7a),this['_domEmitter']=new(Rt())(),this['_eventEmitter']=new(Ft())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x69862=D(this['context']);_0x69862['conversion']['for']('editingDowncast')['markerToElement']({'model':Ht+'insert','view':(_0x42810f,{writer:_0x8d1fa0})=>{const _0x22a8ec=this['_markers']['get'](_0x42810f['markerName']),_0x15147c={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x22a8ec?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x42810f['markerName']};return _0x8d1fa0['createUIElement']('span',_0x15147c,function(_0x25d2e6){const _0x194ddb=this['toDomElement'](_0x25d2e6);return _0x194ddb['innerHTML']=_0x22a8ec?.['content']?.['asString']||'',_0x194ddb;});}}),_0x69862['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ht+'remove-only','view':_0x4483da=>{const _0x46365c=this['_markers']['get'](_0x4483da['markerName']),_0x4669c4=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x46365c?.['id']||'')&&_0x4669c4['push']('ck-ai_review__change_active'),{'classes':_0x4669c4,'attributes':{'data-marker-id':_0x4483da['markerName']}};}}),_0x69862['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ht+'remove-context','view':_0x4cf14c=>{const _0x3f4c42=this['_markers']['get'](_0x4cf14c['markerName']),_0x49fd70=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x3f4c42?.['id']||'')&&_0x49fd70['push']('ck-ai_review__change_active'),{'classes':_0x49fd70,'attributes':{'data-marker-id':_0x4cf14c['markerName']}};}}),_0x69862['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ht+'remove-text','view':_0x46ea88=>{const _0x1f967b=this['_markers']['get'](_0x46ea88['markerName']),_0xfc56d=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x1f967b?.['id']||'')&&_0xfc56d['push']('ck-ai_review__change_active'),{'classes':_0xfc56d,'attributes':{'data-marker-id':_0x46ea88['markerName']}};}}),_0x69862['conversion']['for']('dataDowncast')['markerToElement']({'model':Ht+'suggestion-context','view':(_0x251328,{writer:_0x46c9c7})=>_0x46c9c7['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x251328['isOpening']?'start':'end')})}),_0x69862['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x4c4c60,'view':jt});const _0x3c2bb1=_0x69862['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x3c2bb1,'mouseup',(_0x4e55cf,_0x44729f)=>{const _0x37fa25=_0x44729f['target'],_0x583dae=this['_findMarkerElement'](_0x37fa25);if(!_0x583dae)return;const _0x3a9055=_0x583dae['getAttribute']('data-marker-id'),_0x5c2725=_0x3a9055['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x3a9055,'changeId':_0x5c2725,'markerElement':()=>this['_findMarkerElementById'](_0x3a9055),'domEvent':_0x44729f});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x3c2bb1,'mouseover',(_0x202e10,_0x2c0e61)=>{const _0x44823f=_0x2c0e61['target'],_0x3697d2=_0x2c0e61['relatedTarget'];let _0x4e0462=this['_findMarkerElement'](_0x44823f);if(!_0x4e0462&&_0x3697d2&&(_0x4e0462=this['_findMarkerElement'](_0x3697d2)),!_0x4e0462)return;const _0x5610f2=_0x4e0462['getAttribute']('data-marker-id'),_0x3b9a03=_0x5610f2['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x3b9a03,'markerElement':()=>this['_findMarkerElementById'](_0x5610f2),'domEvent':_0x2c0e61});}),this['_domEmitter']['listenTo'](document,'mouseover',Gt((_0x5b9640,_0x312226)=>{const _0x472008=_0x312226['target'];if(this['_findMarkerElement'](_0x472008))return;_0x472008['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x69862['model']['document']['registerPostFixer'](_0x119e99=>this['_validateMarkers'](_0x69862,_0x119e99)),_0x69862['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x69862));}['getDocumentData'](){const _0x23d3c7=this['context']['plugins']['get']('AIEditing'),_0x54f260=D(this['context']),_0x1ca1de=_0x54f260['model'],_0x5ea693=new _0xaf169a();for(const _0x5470db of _0x1ca1de['document']['getRoot']()['getChildren']()){const _0x3549f3=_0x5470db['_clone'](!0x0);_0x5ea693['_appendChild'](_0x3549f3);}for(const _0x5569d0 of _0x1ca1de['markers'])_0x5ea693['markers']['set'](_0x5569d0['name'],this['_changeRangeOwnerDocument'](_0x5569d0['getRange']()['clone'](),_0x5ea693));const _0x4afde1=new Dt({'ignoreElementEnd':!0x0,'startPosition':_0x1ca1de['createPositionAt'](_0x5ea693,0x0)}),_0xe38d67=new Set(),_0x483da0=new Map();for(const {item:_0x260a1d}of _0x4afde1){if(!_0x260a1d['is']('$textProxy'))continue;const _0x329d6b=_0x260a1d['parent'];if(_0x329d6b&&_0x329d6b['is']('element')){const _0xfe994=this['_upsertDataId'](_0x329d6b,()=>_0x23d3c7['_nextDataId'](_0xe38d67));_0xe38d67['add'](_0xfe994);for(const _0x2cba50 of _0x329d6b['getChildren']())_0x2cba50['is']('element')&&_0xe38d67['add'](this['_upsertDataId'](_0x2cba50,()=>_0x23d3c7['_nextDataId'](_0xe38d67)));let _0x12f0df=_0x329d6b;for(;_0x12f0df['parent']&&!_0x12f0df['parent']['is']('documentFragment');)_0x12f0df=_0x12f0df['parent'],_0x12f0df['hasAttribute'](_0x4c4c60)&&_0x12f0df['_removeAttribute'](_0x4c4c60);_0x483da0['set'](_0xfe994,{'path':_0x329d6b['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x12f0df['_clone'](!0x0),_0xfe994,_0x54f260['data'])}),_0x4afde1['jumpTo'](_0x1ca1de['createPositionAfter'](_0x329d6b));}}return{'content':_0x54f260['data']['processor']['toData'](_0x54f260['data']['toView'](_0x5ea693)),'version':_0x54f260['model']['document']['version'],'elements':_0x483da0};}['diffContent'](_0x7f80e6,_0x3def73,_0x3406ca=!0x1){const _0x2c0647=[],_0x595dac=D(this['context']),_0x4557fb=_0x595dac['data']['parse'](_0x3def73,'$documentFragment'),_0x4ac844=_0x595dac['data']['parse'](_0x7f80e6,'$documentFragment'),_0x2074b4=_0x595dac['model']['createPositionAt'](_0x4ac844,0x0);if(this['_haveSingleTopLevelElement'](_0x4557fb)){if(!this['_hasSameTopLevelElement'](_0x4ac844,_0x4557fb))return _0x2c0647;}else{const _0x368e54=_0x595dac['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x4ac844,_0x368e54)||!this['_haveOnlyInlineContent'](_0x4557fb,_0x368e54))return _0x2c0647;}const _0x5ebdad=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x7f80e6,_0x3def73,{'anchor':_0x2074b4,'markDeletions':!0x0})['getOperations']()['filter'](_0xb0e2d9=>'insert'===_0xb0e2d9['type']||'marker'===_0xb0e2d9['type']&&_0xb0e2d9['name']['startsWith']('$markedRemove')),_0x9a622b=this['_groupAdjacentOperations'](_0x5ebdad),_0xe2a80e=[];if(_0x3406ca){if(_0x9a622b['length']){const _0x4fa5da=_0x9a622b[0x0]['operations'][0x0],_0x2671c7='insert'===_0x4fa5da['type']?_0x4fa5da['position']:_0x4fa5da['newRange']['start'],_0x5cec31=this['_getPositionLimitingRange'](_0x2671c7,_0x595dac,'inside'),_0x556205=_0x5cec31?_0x4557fb['getChild'](0x0)['getChildren']():_0x4557fb['getChildren'](),_0x48646c=_0x5cec31||_0x595dac['model']['createRangeIn'](_0x4ac844),_0x48d945=[new Mt('$markedRemove:synthetic'+_0x5ee109(),null,_0x48646c,_0x595dac['model']['document']['model']['markers'],!0x0,_0x595dac['model']['document']['version']+0x1),new $t(_0x48646c['end'],_0x556205,_0x595dac['model']['document']['version']+0x2)];_0xe2a80e['push']({'operations':_0x48d945,'operationsIsolated':_0x48d945,'groupOffset':0x0});}}else _0xe2a80e['push'](..._0x9a622b);let _0x411297=0x0;return _0x595dac['model']['change'](_0x313d41=>{for(let _0x1a7acc=0x0;_0x1a7acc<_0xe2a80e['length'];_0x1a7acc++){const _0x25e7bb=_0xe2a80e[_0x1a7acc],_0x222f06=_0x313d41['createDocumentFragment']();for(const _0xee97d of _0x4ac844['getChildren']())_0x313d41['append'](_0xee97d['_clone'](!0x0),_0x222f06);for(const _0x1b9a9b of _0x25e7bb['operationsIsolated'])if('insert'===_0x1b9a9b['type']){const _0x4452eb=_0x1b9a9b;_0x4452eb['baseVersion']=null,_0x4452eb['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x4452eb,_0x222f06),_0x313d41['batch']['addOperation'](_0x1b9a9b),_0x595dac['model']['applyOperation'](_0x1b9a9b);const _0x6f726='suggestion:insertion:id:authorId:'+_0x411297++,_0x179cef=_0x595dac['model']['createRange'](_0x4452eb['position'],_0x4452eb['position']['getShiftedBy'](_0x4452eb['howMany']));_0x222f06['markers']['set'](_0x6f726,_0x179cef);}else{if('marker'===_0x1b9a9b['type']&&_0x1b9a9b['name']['startsWith']('$markedRemove')){const _0x337ad1=_0x1b9a9b,_0x1bab58='suggestion:deletion:id:authorId:'+_0x411297++;this['_changeOperationOwnerDocument'](_0x337ad1,_0x222f06),_0x222f06['markers']['set'](_0x1bab58,_0x337ad1['newRange']);}}if(_0x3406ca)_0x2c0647['push']({..._0x25e7bb,'context':this['_createGetContentFn'](_0x4ac844,_0x595dac['data']),'content':this['_createGetContentFn'](_0x4ac844,_0x595dac['data'])});else{const _0x196a18=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x25e7bb['operationsIsolated'][0x0]),_0x222f06),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x25e7bb['operationsIsolated'][_0x25e7bb['operationsIsolated']['length']-0x1]),_0x222f06));_0x222f06['markers']['set'](Ht+'suggestion-context',new _0xa8a41e(_0x196a18['start'],_0x196a18['end'])),_0x2c0647['push']({..._0x25e7bb,'context':this['_createGetContextFn'](_0x222f06,_0x595dac['data'],{'ellipsisBefore':_0x196a18['hasContentBefore'],'ellipsisAfter':_0x196a18['hasContentAfter']}),'content':this['_createGetContentFn'](_0x222f06,_0x595dac['data'])});}}}),_0x2c0647;}['markChangePositionInEditorContent'](_0x4fa6cf,_0x240bce){if(!_0x4fa6cf['length'])return;const _0x14079c=_0x4fa6cf[0x0]['parent']['id'],_0x5643f5=_0x240bce['elements']['get'](_0x14079c);if(!_0x5643f5)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x14079c);const _0x1c3927=_0x5643f5['path'],_0x319970=D(this['context']),_0x38a754=_0x319970['model']['document']['history']['getOperations'](_0x240bce['version']),_0x3a5752=[];for(const _0x1bcb6e of _0x4fa6cf){const _0x365c46=_0x1bcb6e['operationsIsolated']['map'](_0x5dbae6=>this['_translateOperationToEditorContent'](_0x5dbae6,_0x1c3927,_0x319970['model']['document']['getRoots']()[0x0]));if(!_0x365c46||!_0x365c46['length'])continue;const _0x5f1eef=_0x365c46['every'](_0x3ca7cc=>'marker'===_0x3ca7cc['type']&&_0x3ca7cc['name']['startsWith']('$markedRemove')),_0x56abad={'document':_0x319970['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x4da1ef=_0x634cdb(_0x365c46,_0x38a754,_0x56abad)['operationsA'];for(const _0x444225 of _0x4da1ef)if('insert'===_0x444225['type']){const _0x1f7b70=_0x444225,_0x5db12f=_0x1f7b70['nodes'];_0x319970['model']['change'](_0x2a765a=>{const _0x382e60=_0x2a765a['createDocumentFragment']();for(const _0x2e2527 of _0x5db12f)_0x2a765a['append'](_0x2e2527['_clone'](!0x0),_0x382e60);_0x3a5752['push']({'start':_0x1f7b70['position'],'end':_0x1f7b70['position'],'type':'insert','groupId':_0x1bcb6e['id'],'content':{'asString':this['_createGetContentFn'](_0x382e60,_0x319970['data'])(),'asFragment':_0x382e60}});});}else{if('marker'===_0x444225['type']&&_0x444225['name']['startsWith']('$markedRemove')){const _0x5e4530=_0x444225;let _0x54d981='remove-text';if(_0x5f1eef){const _0x2e40dd=this['_findAdjacentContextDistance'](_0x5e4530['newRange']['start'],'backward',_0x319970['model']['schema']),_0x1fd0d9=this['_findAdjacentContextDistance'](_0x5e4530['newRange']['end'],'forward',_0x319970['model']['schema']);if(_0x2e40dd||_0x1fd0d9){const _0x19fd7c=_0x5e4530['newRange']['start']['getShiftedBy'](-_0x2e40dd),_0x184278=_0x5e4530['newRange']['end']['getShiftedBy'](_0x1fd0d9);_0x3a5752['push']({'start':_0x19fd7c,'end':_0x184278,'groupId':_0x1bcb6e['id'],'type':'remove-context'});}else _0x54d981='remove-only';}_0x3a5752['push']({'start':_0x5e4530['newRange']['start'],'end':_0x5e4530['newRange']['end'],'groupId':_0x1bcb6e['id'],'type':_0x54d981});}}}this['_insertMarkers'](_0x3a5752);}['clearAllMarkers'](){const _0x145c68=D(this['context']);_0x145c68['model']['change'](_0x48a286=>{for(const _0x35dc46 of this['_markers']['keys']())_0x145c68['model']['markers']['get'](_0x35dc46)&&_0x48a286['removeMarker'](_0x35dc46);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){D(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){D(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x5b5310){const _0x1a2350=D(this['context']),_0x58807e=_0x1a2350['model'],_0x1f0cf6=_0x5b5310['map'](_0x585541=>this['_getMarkersDataForGroup'](_0x585541))['flat']();_0x58807e['change'](_0x221fa0=>{for(const _0x2e32c4 of _0x1f0cf6){const _0x51c0c1=_0x1a2350['model']['markers']['get'](_0x2e32c4['id']);if(_0x51c0c1){if('insert'===_0x2e32c4['type']){if(!_0x2e32c4['content'])continue;_0x58807e['insertContent'](_0x2e32c4['content']['asFragment']||null,_0x51c0c1['getRange']()['start']);}else'remove-text'!==_0x2e32c4['type']&&'remove-only'!==_0x2e32c4['type']||_0x58807e['deleteContent'](_0x58807e['createSelection'](_0x51c0c1['getRange']()));_0x221fa0['removeMarker'](_0x2e32c4['id']),this['_markers']['delete'](_0x2e32c4['id']);}}});}['rejectChange'](_0x2cf33d){const _0x1ddb85=D(this['context']),_0x2c2fa9=this['_getMarkersDataForGroup'](_0x2cf33d);_0x1ddb85['model']['change'](_0x3f8558=>{for(const _0x44eada of _0x2c2fa9)_0x3f8558['removeMarker'](_0x44eada['id']),this['_markers']['delete'](_0x44eada['id']);});}['getEditor'](){return D(this['context']);}['getMarkerElementForChange'](_0xd645c4){const _0x4a62a2=Array['from'](this['_markers']['values']())['filter'](_0x4b3358=>_0x4b3358['groupId']===_0xd645c4);if(!_0x4a62a2['length'])return null;const _0x5624e5=0x1===_0x4a62a2['length']?_0x4a62a2[0x0]:this['_sortMarkers'](_0x4a62a2)[0x0],_0xa85bd4=D(this['context'])['model']['markers']['get'](_0x5624e5['id']);if(!_0xa85bd4)return null;return{'modelRange':_0xa85bd4['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x5624e5['id'])};}['getContentElementForChange'](_0x4fe754){const _0x8a8ebf=Array['from'](this['_markers']['values']())['filter'](_0x17ec22=>_0x17ec22['groupId']===_0x4fe754);if(!_0x8a8ebf['length'])return null;const _0x33d5a4=0x1===_0x8a8ebf['length']?_0x8a8ebf[0x0]:this['_sortMarkers'](_0x8a8ebf)[0x0],_0x3d4f1d=D(this['context']),_0x132805=_0x3d4f1d['model']['markers']['get'](_0x33d5a4['id']);if(!_0x132805)return null;const _0x578bb6=_0x132805['getRange'](),_0x3ec1d1=_0x3d4f1d['editing']['view']['getDomRoot']();if(!_0x3ec1d1||!_0x578bb6)return null;let _0x1bc47e=_0x578bb6['start']['parent'];for(;_0x1bc47e['parent']&&'$root'!==_0x1bc47e['parent']['name'];)_0x1bc47e=_0x1bc47e['parent'];if(!_0x1bc47e||!_0x1bc47e['name'])return null;const _0x41c871=_0x3ec1d1['querySelector']('[data-marker-id=\x22'+_0x33d5a4['id']+'\x22]');if(!_0x41c871)return null;let _0x3cff35=null;_0x3d4f1d['model']['change'](_0x1b585b=>{_0x3cff35=_0x1b585b['createDocumentFragment'](),_0x1b585b['append'](_0x1bc47e['_clone'](!0x0),_0x3cff35);});const _0x229130=_0x3d4f1d['data']['toView'](_0x3cff35)['getChild'](0x0);return _0x41c871['closest'](_0x229130['name']);}['reactivateMarkers'](_0x5297d1){const _0x1cb995=this['_getMarkersDataForGroup'](_0x5297d1);if(!_0x1cb995['length'])return;const _0x4f2011=Array['from'](this['_activeMarkers'])['sort'](),_0x3c9641=Array['from'](new Set(_0x1cb995['map'](_0x1eb580=>_0x1eb580['id'])))['sort']();_0x4f2011['join']('|')!==_0x3c9641['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x5297d1));}['setMarkersInElementAsActive'](_0x32d80a){const _0x2d80c0=this['_getMarkersDataForGroup'](_0x32d80a);if(!_0x2d80c0['length'])return;const _0x53b087=D(this['context']),_0x5365b2=new Set(_0x2d80c0['map'](_0x447d3e=>_0x447d3e['id'])),_0x36f905=Array['from'](_0x5365b2['values']())['map'](_0x5c37a8=>_0x53b087['model']['markers']['get'](_0x5c37a8))['filter'](_0x2ea155=>!!_0x2ea155);_0x5365b2['forEach'](_0x4a1a81=>{this['_activeMarkers']['add'](_0x4a1a81);}),_0x53b087['model']['change'](()=>{_0x36f905['forEach'](_0x5c2b03=>{_0x53b087['editing']['reconvertMarker'](_0x5c2b03);});});}['setAllMarkersAsInactive'](){const _0x164e34=Array['from'](this['_activeMarkers']);if(!_0x164e34['length'])return;this['_activeMarkers']['clear']();const _0x447fb7=D(this['context']),_0x319d98=_0x164e34['map'](_0x65334c=>_0x447fb7['model']['markers']['get'](_0x65334c))['filter'](_0x200ec9=>!!_0x200ec9);_0x447fb7['model']['change'](()=>{_0x319d98['forEach'](_0x4c7241=>{_0x447fb7['editing']['reconvertMarker'](_0x4c7241);});});}['_getPositionLimitingRange'](_0x21fe4b,_0x23d892,_0x32e9cb='outside'){if(!_0x21fe4b)return null;let _0x283b33=_0x21fe4b['parent'];for(;_0x283b33&&_0x283b33['parent']&&'$root'!==_0x283b33['parent']['name']&&!_0x23d892['model']['schema']['isLimit'](_0x283b33)&&!_0x23d892['model']['schema']['isBlock'](_0x283b33);)_0x283b33=_0x283b33['parent'];if(!_0x283b33||!_0x283b33['name']||'$root'===_0x283b33['name'])return null;let _0x2449b2=null;return _0x23d892['model']['change'](_0x1810a1=>{_0x2449b2='inside'===_0x32e9cb?_0x1810a1['createRangeIn'](_0x283b33):_0x1810a1['createRangeOn'](_0x283b33);}),_0x2449b2;}['_validateMarkers'](_0x2bfdb7,_0x45e36c){const _0x2fe16f=Array['from'](this['_markers']['keys']()),_0x2a0ec4=new Map();for(const _0x25cd11 of _0x2fe16f){const _0x3c2508=_0x2bfdb7['model']['markers']['get'](_0x25cd11);if(!_0x3c2508)continue;const _0x537626=_0x3c2508['getStart']()['path'][0x0];_0x2a0ec4['has'](_0x537626)||_0x2a0ec4['set'](_0x537626,[]),_0x2a0ec4['get'](_0x537626)['push'](_0x3c2508);}const _0x5f42e5=new Set();for(const _0x389c57 of _0x2bfdb7['model']['document']['differ']['getChanges']()){let _0x52f282=-0x1,_0x2edd59=null;if('insert'===_0x389c57['type'])_0x2edd59=new _0xa8a41e(_0x389c57['position'],_0x389c57['position']['getShiftedBy'](_0x389c57['length'])),_0x52f282=_0x389c57['position']['path'][0x0];else{if('remove'!==_0x389c57['type'])continue;_0x2edd59=new _0xa8a41e(_0x389c57['position']),_0x52f282=_0x389c57['position']['path'][0x0];}const _0x2ba56a=_0x2a0ec4['get'](_0x52f282)||[];if(_0x2ba56a['length']){for(const _0x514c54 of _0x2ba56a)if(_0x2edd59['root']['rootName']===_0x514c54['getRange']()['root']['rootName']&&('insert'!==_0x389c57['type']||!_0x2edd59['containsRange'](_0x514c54['getRange']()))&&(_0x2edd59['isIntersecting'](_0x514c54['getRange']())||_0x2edd59['start']['isTouching'](_0x514c54['getRange']()['end'])||_0x2edd59['end']['isTouching'](_0x514c54['getRange']()['start']))){const _0x4139b1=this['_parseMarkerName'](_0x514c54['name']);Array['from'](this['_markers']['values']())['filter'](_0x1e6828=>_0x1e6828['groupId']===_0x4139b1['groupId'])['forEach'](_0x27db76=>_0x5f42e5['add'](_0x27db76['id']));}}}if(_0x5f42e5['size']){for(const _0x54d09b of _0x5f42e5)_0x45e36c['removeMarker'](_0x54d09b);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x234717){for(const {name:_0x4e3829,data:_0x5a6ca0}of _0x234717['model']['document']['differ']['getChangedMarkers']()){if(!_0x4e3829['startsWith'](Ht))continue;const _0x30a733=_0x5a6ca0['oldRange'],_0x3df273=_0x5a6ca0['newRange'],_0x25a600=_0x30a733&&'$graveyard'===_0x30a733['root']['rootName'],_0x2e21bd=_0x3df273&&'$graveyard'===_0x3df273['root']['rootName'];if(_0x25a600&&_0x2e21bd)continue;const _0x295170=this['_parseMarkerName'](_0x4e3829);this['_markers']['get'](_0x4e3829)&&(_0x2e21bd||!_0x3df273?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x4e3829,'changeId':_0x295170['groupId']}):_0x25a600&&_0x3df273&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x4e3829,'changeId':_0x295170['groupId']}));}}['_parseMarkerName'](_0x5b5c85){const _0x48c6ef=_0x5b5c85['split'](':'),_0x162c93=(_0x48c6ef[0x1]||'')['split']('_');return{'prefix':_0x48c6ef[0x0],'groupId':_0x162c93[0x0],'suffix':_0x162c93[0x1]};}['_translateOperationToEditorContent'](_0xf9e00f,_0x4a0ee7,_0x4e6305){if('insert'===_0xf9e00f['type']){const _0x3ce432=_0xf9e00f;return new $t(this['_changePosition'](_0x4a0ee7['concat'](_0x3ce432['position']['offset']),_0x4e6305),_0x3ce432['nodes'],_0x3ce432['baseVersion']);}if('marker'===_0xf9e00f['type']&&_0xf9e00f['name']['startsWith']('$markedRemove')){const _0x44c646=_0xf9e00f;return new Mt(_0x44c646['name'],_0x44c646['oldRange'],this['_changeRange'](_0x44c646['newRange'],_0x4a0ee7['concat'](_0x44c646['newRange']['start']['offset']),_0x4a0ee7['concat'](_0x44c646['newRange']['end']['offset']),_0x4e6305),_0x44c646['_markers'],_0x44c646['affectsData'],_0x44c646['baseVersion']);}return _0xf9e00f;}['_groupAdjacentOperations'](_0x4874f8){if(!_0x4874f8['length'])return[];const _0x103170=[];let _0x34148c=0x0,_0x4cbc9d=0x0,_0x473d28=[];for(let _0x160fdf=0x0;_0x160fdf<=_0x4874f8['length'];_0x160fdf++){const _0x32c0be=_0x4874f8[_0x160fdf],_0x3e8664=_0x4874f8[_0x160fdf-0x1];!_0x32c0be||_0x3e8664&&!this['_getOperationEnd'](_0x3e8664)['isTouching'](this['_getOperationStart'](_0x32c0be))?(_0x103170['push']({'operations':_0x473d28,'operationsIsolated':_0x473d28['map'](_0x52d5f6=>this['_shiftOperation'](_0x52d5f6['clone'](),-_0x4cbc9d)),'groupOffset':_0x34148c}),_0x473d28=_0x32c0be?[_0x32c0be]:[],_0x4cbc9d+=_0x34148c,_0x34148c=0x0):_0x473d28['push'](_0x32c0be),_0x32c0be&&'insert'===_0x32c0be['type']&&(_0x34148c+=_0x32c0be['howMany']);}return _0x103170;}['_findAdjacentContextDistance'](_0x91272f,_0x349ca8,_0x6653cc,_0x24c2a2=0x1){const _0x10bfa7=new Dt({'startPosition':_0x91272f,'direction':_0x349ca8});let _0x331216=0x0;for(let _0x3443d5=0x0;_0x3443d5<_0x24c2a2;_0x3443d5++){let _0x38b2fa=0x0,_0x13d4b4=!0x1,_0x372604='forward'===_0x349ca8?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x1ab1c8}of _0x10bfa7)if(_0x1ab1c8['is']('$textProxy')){const _0x50a2a1=_0x372604['exec'](_0x1ab1c8['data']);if(_0x50a2a1&&_0x50a2a1['length']){if(_0x38b2fa+='forward'===_0x349ca8?_0x50a2a1['index']+_0x50a2a1[0x0]['length']:_0x1ab1c8['data']['length']-_0x50a2a1['index'],_0x50a2a1[0x0]['length']!==_0x1ab1c8['data']['length'])break;_0x13d4b4=!0x0,_0x372604='forward'===_0x349ca8?/^\w+/:/\w+$/;}else{if(_0x13d4b4)break;_0x38b2fa+=_0x1ab1c8['offsetSize'];}}else{if(_0x1ab1c8['is']('element')){_0x6653cc['isInline'](_0x1ab1c8)&&!_0x13d4b4&&(_0x38b2fa+=0x1);break;}}_0x331216+=_0x38b2fa,_0x10bfa7['jumpTo'](_0x91272f['getShiftedBy']('forward'===_0x349ca8?_0x331216:-_0x331216));}return _0x331216;}['_getChangeContext'](_0x4fb05f,_0x4bc85b){const _0x54756b=D(this['context'])['model']['schema'],_0x3276a5=this['_findAdjacentContextDistance'](_0x4fb05f,'backward',_0x54756b,0x6),_0x4e98bd=this['_findAdjacentContextDistance'](_0x4bc85b,'forward',_0x54756b,0x6),_0x110fdc=_0x4fb05f['getShiftedBy'](-_0x3276a5),_0x8368dc=_0x4bc85b['getShiftedBy'](_0x4e98bd);return{'start':_0x110fdc,'end':_0x8368dc,'hasContentBefore':!_0x110fdc['isAtStart'],'hasContentAfter':!_0x8368dc['isAtEnd']};}['_insertMarkers'](_0x586076){const _0x3bcb79=this['context']['plugins']['get']('AIEditing'),_0x6c1d7f=new Set();D(this['context'])['model']['change'](_0x1b37f4=>{for(const _0x5bd7be of _0x586076){const _0x4db0ef=''+Ht+_0x5bd7be['type']+':'+_0x5bd7be['groupId']+'_'+_0x3bcb79['_nextDataId'](_0x6c1d7f);this['_markers']['set'](_0x4db0ef,{'id':_0x4db0ef,'groupId':_0x5bd7be['groupId'],'type':_0x5bd7be['type'],'content':_0x5bd7be['content']}),_0x1b37f4['addMarker'](_0x4db0ef,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1b37f4['createRange'](_0x5bd7be['start'],_0x5bd7be['end'])});}});}['_createGetContextFn'](_0x3ea619,_0x12841c,_0x5ad250){let _0x218459='';return()=>{if(!_0x218459){const _0x10fa9a=_0x12841c['toView'](_0x3ea619,{'showSuggestionHighlights':!0x0});let _0x1f9fc9=_0x10fa9a['getChild'](0x0);if(_0x1f9fc9['is']('containerElement')||(_0x1f9fc9=_0x10fa9a),!_0x1f9fc9)return'';let _0x2dcbba=!0x1;const _0x51c04d=[];for(const _0x2ed818 of _0x1f9fc9['getChildren']())_0x2ed818['is']('element','span')&&_0x2ed818['hasClass']('ck-ai_review-marker_context-end')&&(_0x2dcbba=!0x1),_0x2dcbba&&_0x51c04d['push'](_0x2ed818),_0x2ed818['is']('element','span')&&_0x2ed818['hasClass']('ck-ai_review-marker_context-start')&&(_0x2dcbba=!0x0);_0x1f9fc9['_removeChildren'](0x0,_0x1f9fc9['childCount']),_0x5ad250?.['ellipsisBefore']&&_0x1f9fc9['_appendChild']('…'),_0x1f9fc9['_appendChild'](_0x51c04d),_0x5ad250?.['ellipsisAfter']&&_0x1f9fc9['_appendChild']('…');const _0x4a4453=_0x12841c['htmlProcessor']['domConverter']['viewToDom'](_0x10fa9a),_0x2e3468=_0x12841c['htmlProcessor']['htmlWriter']['getHtml'](_0x4a4453);_0x218459=_0x2e3468;}return _0x218459;};}['_createGetContentFn'](_0x23f1a8,_0x3974e7){let _0x15bd04='';return()=>(_0x15bd04||(_0x15bd04=_0x3974e7['stringify'](_0x23f1a8,{'showSuggestionHighlights':!0x0})),_0x15bd04);}['_createGetContentUsingDataIdFn'](_0x504ab5,_0xdd44c9,_0x3eec1d){let _0x18fad5='';return()=>{if(!_0x18fad5){const _0x516a48=_0x3eec1d['toView'](new _0xaf169a(_0x504ab5)),_0x1ee3f9=_0x3eec1d['htmlProcessor']['domConverter']['viewToDom'](_0x516a48)['querySelector']('[data-id=\x22'+_0xdd44c9+'\x22]');_0x18fad5=_0x1ee3f9?.['outerHTML']||'';}return _0x18fad5;};}['_findMarkerElement'](_0x526344,_0x564b25=0x5){let _0x30678b=_0x526344,_0x56d0c5=null;for(let _0x373bd6=0x0;_0x373bd6<_0x564b25&&_0x30678b;_0x373bd6++){if(!_0x30678b['className']){_0x30678b=_0x30678b['parentElement'];continue;}if(!(''+_0x30678b['className'])['includes']('ck-ai_review-marker_')){_0x30678b=_0x30678b['parentElement'];continue;}if(!_0x30678b['getAttribute']('data-marker-id'))break;_0x56d0c5=_0x30678b;break;}return _0x56d0c5;}['_findMarkerElementById'](_0x137de1){const _0x3c6784=D(this['context']),_0x34abbb=_0x3c6784['model']['markers']['get'](_0x137de1);return _0x34abbb?Bt(_0x3c6784['editing'],_0x34abbb):null;}['_getMarkersDataForGroup'](_0x5bf851){return Array['from'](this['_markers']['values']())['filter'](_0x56723f=>_0x56723f['groupId']===_0x5bf851);}['_getOperationStart'](_0x46c2e4){return'insert'===_0x46c2e4['type']?_0x46c2e4['position']:_0x46c2e4['newRange']['start'];}['_getOperationEnd'](_0x24e85b,_0x44cf30=!0x1){return'insert'===_0x24e85b['type']?_0x44cf30?_0x24e85b['position']:_0x24e85b['position']['getShiftedBy'](_0x24e85b['howMany']):_0x24e85b['newRange']['end'];}['_shiftOperation'](_0x467d69,_0x5b4868){return'insert'===_0x467d69['type']?_0x467d69['position']=_0x467d69['position']['getShiftedBy'](_0x5b4868):'marker'===_0x467d69['type']&&_0x467d69['newRange']&&(_0x467d69['newRange']=new _0xa8a41e(_0x467d69['newRange']['start']['getShiftedBy'](_0x5b4868),_0x467d69['newRange']['end']['getShiftedBy'](_0x5b4868))),_0x467d69;}['_changeOperationOwnerDocument'](_0x4e8198,_0x143144){'insert'===_0x4e8198['type']?_0x4e8198['position']=this['_changePositionOwnerDocument'](_0x4e8198['position'],_0x143144):'marker'===_0x4e8198['type']&&_0x4e8198['newRange']&&(_0x4e8198['newRange']=this['_changeRangeOwnerDocument'](_0x4e8198['newRange'],_0x143144));}['_changePositionOwnerDocument'](_0x48b9d0,_0xd3de74){return new _0x46cc31(_0xd3de74,_0x48b9d0['path']);}['_changeRangeOwnerDocument'](_0x1f94c0,_0x20cf34){return new _0xa8a41e(this['_changePositionOwnerDocument'](_0x1f94c0['start'],_0x20cf34),this['_changePositionOwnerDocument'](_0x1f94c0['end'],_0x20cf34));}['_changePosition'](_0xaab157,_0x1a51be){return new _0x46cc31(_0x1a51be,[..._0xaab157]);}['_changeRange'](_0x42f601,_0x20718d,_0x2bb038,_0x33d1a0){return new _0xa8a41e(this['_changePosition'](_0x20718d,_0x33d1a0),this['_changePosition'](_0x2bb038,_0x33d1a0));}['_sortMarkers'](_0x2548d7){const _0x46ef36=_0x3b5f07=>{switch(_0x3b5f07){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x2548d7['sort']((_0x337390,_0x4b732f)=>_0x46ef36(_0x337390['type'])-_0x46ef36(_0x4b732f['type']));}['_hasSameTopLevelElement'](_0x3dd758,_0x5e9d08){const _0x17a3d6=_0x3dd758['getChild'](0x0),_0x4c8f34=_0x5e9d08['getChild'](0x0);return!(!_0x17a3d6||!_0x4c8f34)&&((!_0x17a3d6['is']('element')||!_0x4c8f34['is']('element')||_0x17a3d6['name']===_0x4c8f34['name'])&&!(_0x17a3d6['is']('element')&&!_0x4c8f34['is']('element')||!_0x17a3d6['is']('element')&&_0x4c8f34['is']('element')));}['_haveSingleTopLevelElement'](_0x4e8ef3){return 0x1===_0x4e8ef3['childCount'];}['_haveOnlyInlineContent'](_0x19c6bc,_0x42c39e){for(const _0x28ab00 of _0x19c6bc['getChildren']())if(_0x28ab00['is']('element')&&!_0x42c39e['isInline'](_0x28ab00))return!0x1;return!0x0;}['_upsertDataId'](_0x4e8769,_0x3a9b19){let _0x393e85=_0x4e8769['getAttribute'](_0x4c4c60);return _0x393e85||(_0x393e85=_0x3a9b19(),_0x4e8769['_setAttribute'](_0x4c4c60,_0x393e85)),_0x393e85;}}class Ws extends Ft(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x47b600,contentNew:_0x568c3e,contentInitial:_0x4074f4,documentVersion:_0x4a4f2f}){super(),this['id']=_0x47b600,this['contentNew']=_0x568c3e,this['contentInitial']=_0x4074f4,this['documentVersion']=_0x4a4f2f;}}class Xs extends Vt(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x2a26ca,_0x5c76d1,_0x59a3fb){super(),this['id']=_0x2a26ca,this['parent']=_0x59a3fb,this['_data']=_0x5c76d1,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class Ys extends Vt(){['id']=_0x5ee109();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x1a7b4d,_0x5965b3,_0x5bbb66,_0x16576c,_0x53c461){super(),this['_sourceCheck']=_0x5965b3,this['_documentData']=_0x1a7b4d,this['_aiConnector']=_0x5bbb66,this['_reviewParams']=_0x16576c,this['_reviewArgs']=_0x53c461,this['on']('change:status',(_0x4b888b,_0x59d498,_0x30f699)=>{'aborted'==_0x30f699&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x30f699,'run':this,'error':this['_currentError']});}),this['set']('status','initialized');}get['documentData'](){return this['_documentData'];}get['processedResultsCount'](){return this['_results']['size'];}get['title'](){return this['_sourceCheck']['title'];}get['subTitle'](){return'';}get['reviewName'](){return this['_sourceCheck']['id'];}get['hasModifications'](){return!this['_changes']['every'](_0x1a12f5=>'pending'===_0x1a12f5['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x57cfd7){this['_documentData']=_0x57cfd7;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x4fb0a0=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x27d2c9 of _0x4fb0a0)'unmodified'!==_0x27d2c9['data']['operation']&&('error'!==_0x27d2c9['data']['operation']?'review-metadata'!==_0x27d2c9['event']?this['_addReviewCheckResult'](_0x27d2c9['data']['dataId'],_0x27d2c9['data']['textDelta']):this['callId']=_0x27d2c9['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']||0x0===this['_changes']['length']?this['status']='unmodified':this['status']='ready');}catch(_0x3d6396){this['_currentError']=_0x3d6396,_0x3d6396 instanceof Error&&_0x3d6396['message']['includes']('ai-request-aborted')?this['status']='aborted':this['status']='error-general';}finally{this['_activeRequest']=null;}}async['restart'](){this['_results']['clear'](),this['_changes']['length']=0x0,this['_currentError']=void 0x0,await this['start']();}['addResultChanges'](_0x1161ea,_0x53850a){const _0x5a7954=this['_results']['get'](_0x1161ea);if(!_0x5a7954)return;if(0x0===_0x53850a['length'])return;const _0x5cfc89=[];_0x53850a['forEach']((_0x591fe1,_0xa6ff15)=>{const _0x1b9f6f=new Xs(_0x5a7954['id']+'-'+_0xa6ff15,_0x591fe1,_0x5a7954);_0x1b9f6f['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x1b9f6f,'status':_0x1b9f6f['status']});}),_0x1b9f6f['on']('change:isActivated',()=>{_0x1b9f6f['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x1b9f6f}):this['fire']('reviewCheckResultDeactivated',{'change':_0x1b9f6f});}),this['_changes']['push'](_0x1b9f6f),_0x5cfc89['push'](_0x1b9f6f);}),this['fire']('reviewCheckResultReady',{'changes':_0x5cfc89,'result':_0x5a7954,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x43c79){const _0x5f0deb=this['_changes']['find'](_0xeb6801=>_0xeb6801['id']===_0x43c79);return!(!_0x5f0deb||'pending'!==_0x5f0deb['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x4b446a=>!0x0===_0x4b446a['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x283e62=>'pending'===_0x283e62['status']);}['getChangeById'](_0x18ed90){return this['_changes']['find'](_0x2b34da=>_0x2b34da['id']===_0x18ed90);}['markAllChangesAsAccepted'](){for(const _0x2c809b of this['_changes'])'pending'===_0x2c809b['status']&&(_0x2c809b['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x2792ca){const _0x2704bf=this['_changes']['find'](_0x180970=>_0x180970['id']===_0x2792ca);_0x2704bf&&'pending'===_0x2704bf['status']&&(_0x2704bf['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x46c4de){const _0x260603=this['_changes']['find'](_0x3c0c93=>_0x3c0c93['id']===_0x46c4de);_0x260603&&'pending'===_0x260603['status']&&(_0x260603['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x37fcd3){const _0x5cfabc=this['_changes']['find'](_0x499c1d=>_0x499c1d['id']===_0x37fcd3);_0x5cfabc&&'pending'===_0x5cfabc['status']&&(_0x5cfabc['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x31c349){const _0x5b63f0=this['_changes']['find'](_0x736fb1=>_0x736fb1['id']===_0x31c349);_0x5b63f0&&'outdated'===_0x5b63f0['status']&&(_0x5b63f0['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x24ea81){this['_changes']['filter'](_0xfbb090=>_0xfbb090['isActivated']&&_0xfbb090['id']!==_0x24ea81)['forEach'](_0x1617ab=>{_0x1617ab['isActivated']=!0x1;});const _0x3381e6=this['_changes']['find'](_0x22eb96=>_0x22eb96['id']===_0x24ea81);_0x3381e6&&'pending'===_0x3381e6['status']&&(_0x3381e6['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x5142db=>_0x5142db['isActivated'])['forEach'](_0x49704f=>{_0x49704f['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x22323e){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x14d4e7;if(_0x22323e){const _0x1b5064=this['_changes']['find'](_0x2732d1=>_0x2732d1['id']===_0x22323e);if(_0x1b5064&&_0x1b5064['isRated'])return;_0x1b5064&&(_0x14d4e7=_0x1b5064['parent']['id'],_0x1b5064['isRated']=!0x0);}const _0xfa1f07={'positiveCount':this['_changes']['filter'](_0x324415=>'accepted'===_0x324415['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0xfa1f07,this['callId'],_0x14d4e7);}['_addReviewCheckResult'](_0x116748,_0x3e30d7){const _0x4f43f1=this['_documentData']['elements']['get'](_0x116748);if(!_0x4f43f1)return;const _0x4b5c9c=_0x4f43f1['getContent']();if(_0x4b5c9c===_0x3e30d7)return;const _0x2de2b5=new Ws({'id':_0x116748,'contentInitial':_0x4b5c9c,'contentNew':_0x3e30d7,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x2de2b5['id'],_0x2de2b5),this['fire']('reviewCheckResultAdded',{'result':_0x2de2b5,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x32cc59=>'pending'===_0x32cc59['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x1fa4bd=>'pending'===_0x1fa4bd['status'])['length']&&(this['status']='finished'));}}class Ri extends Ys{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x26938f=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x58ba3d=0x0;_0x58ba3d<this['_reviewParams']['length'];_0x58ba3d++){if(!this['_reviewParams'][_0x58ba3d]||!this['_sourceCheck']['options'][_0x58ba3d])continue;const _0x448a74=this['_sourceCheck']['options'][_0x58ba3d],_0x314511=_0x448a74['data']?.['find'](_0xae1c10=>_0xae1c10['id']===this['_reviewParams'][_0x58ba3d]);_0x314511&&_0x26938f['push'](_0x314511['label']);}return _0x26938f['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x59c429,_0x24b6ce,_0x49abb7){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x24b6ce,_0x59c429,_0x49abb7);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ae extends _0x269016{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[s];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0x153709,_0x5ad9e8)=>{const _0x5dee07=this['_aiReviewCheckList']['getCheckById'](_0x5ad9e8['id']);if(_0x5dee07){this['_onReviewCheckRun'](_0x5ad9e8),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x5ad9e8,_0x5dee07),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x41646c,_0x38dda1)=>{switch(_0x38dda1['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x38dda1);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new _0x36ce55('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x36ce55('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x38dda1['status']&&'error-chunk'!==_0x38dda1['status']&&'error-general'!==_0x38dda1['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x2cea8c,_0x1baa5a)=>{if(!this['_currentReviewCheckRun'])throw new _0x36ce55('ai-review-mode-no-current-check-run',this);const _0x116c73=this['_diffContent'](_0x1baa5a['result']['contentInitial'],_0x1baa5a['result']['contentNew']);_0x1baa5a['source']['addResultChanges'](_0x1baa5a['result']['id'],_0x116c73);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x239050,_0x4c63d1)=>{for(const _0x5021f1 of _0x4c63d1['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x5021f1);this['_markChangePositionInEditorContent'](_0x4c63d1['changes'],_0x4c63d1['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x2f5c80,_0x10ff84)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x10ff84['change']['id'],_0x10ff84['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x4116f0,_0x45926a)=>{this['_onReviewCheckResultActivated'](_0x45926a);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x4e67fc){_0x4e67fc instanceof Error&&_0x4e67fc['message']['includes']('ai-request-aborted')||(_0x4e67fc instanceof _0x36ce55?this['_logError'](_0x4e67fc):this['_logError'](new _0x36ce55('ai-review-mode-check-run-failed',this,void 0x0,_0x4e67fc)));}}else this['_logError'](new _0x36ce55('ai-review-mode-source-check-not-found',this,{'checkId':_0x5ad9e8['id']}));}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x5cfce7=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x5cfce7['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x5cfce7['map'](_0x84a7eb=>_0x84a7eb['id']));const _0x5cf4d3=this['_currentReviewCheckRun'];_0x5cf4d3['markAllChangesAsAccepted'](),_0x5cf4d3['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x3238cf,_0x4c226f)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4c226f['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x4c226f['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x4c226f['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4c226f['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x59c7fe,_0x2d310b)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x2d310b['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x2d310b['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x2d310b['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x2d310b['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x28ffce,_0x16610b)=>{this['_onActivateChange'](_0x16610b);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0xdae57f,_0x3dfecd)=>{this['_onDeactivateChange'](_0x3dfecd);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x31dbab,_0x56e9e9)=>{this['_onChangeMarkerClicked'](_0x31dbab,_0x56e9e9);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x304c86,_0x1e47e4)=>{this['_onChangeMarkerHovered'](_0x304c86,_0x1e47e4);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x4630d1,_0x4b1cc3)=>{this['_onChangeMarkerRemoved'](_0x4630d1,_0x4b1cc3);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x10793f,_0x4f7dff)=>{this['_onChangeMarkerRestored'](_0x10793f,_0x4f7dff);});}['_createReviewCheckRun'](_0x239ecd,_0x1bf5d4){return new Ri(this['_aiReviewCoreEditing']['getDocumentData'](),_0x1bf5d4,this['_aiConnector'],_0x239ecd['params'],_0x239ecd['args']);}['_onChangeMarkerRemoved'](_0x4a0b96,_0x179efb){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x179efb['changeId']);}['_onChangeMarkerRestored'](_0x86b8fd,_0x580088){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x580088['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x13ad05=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x13ad05&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x6aff09=this['_aiReviewCoreEditing']['getEditor']();_0x6aff09&&_0x6aff09['editing']['view']['change'](_0x14659f=>{const _0x4e6a8a=_0x6aff09['editing']['view']['document']['getRoot']();_0x14659f['removeClass']('ck-ai_review-diff',_0x4e6a8a),_0x14659f['removeClass']('ck-ai_review-highlights',_0x4e6a8a),_0x14659f['removeClass']('ck-ai-translate-mode-content',_0x4e6a8a);});}['_getTranslationWithDefault'](_0x192cd6,_0xaf4482){const _0x727168=m(this['context']['locale'],_0x192cd6);return _0x727168===_0x192cd6?_0xaf4482:_0x727168;}['_logError'](_0x5a69d1,_0x2f89e3=!0x1){_0x283c76(_0x5a69d1['message']),_0x2f89e3||(_0x5a69d1['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x22422a){if('content'===this['_changeActivationSource']){const _0x9c0924=this['_aiReviewCoreUi']['getChangeElement'](_0x22422a);_0x9c0924&&_0x41c02d(_0x9c0924['closest']('.ck-ai_review__check-run-result')||_0x9c0924);}else{if('panel'===this['_changeActivationSource']){const _0x19abb3=this['_getChangeContentElement'](_0x22422a);if(!_0x19abb3)return;_0x23d97c({'target':_0x19abb3,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const he=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}];class Js{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x19b22d){this['id']=_0x19b22d['id'],this['commandId']=_0x19b22d['commandId'],this['title']=_0x19b22d['title'],this['description']=_0x19b22d['description'],this['isParameterized']=_0x19b22d['isParameterized'],this['useArgs']=_0x19b22d['useArgs'],this['options']=_0x19b22d['options'],this['args']=_0x19b22d['args'];}}class vo extends Vt(){['_checks']=[];['setupChecks'](_0x329385){this['_checks']=_0x329385['map'](_0xd8992a=>new Js(_0xd8992a));}get['checks'](){return this['_checks'];}['getCheckById'](_0x46eeea){return this['checks']['find'](_0x304e82=>_0x304e82['id']===_0x46eeea);}['removeCheckById'](_0x13ff60){this['_checks']=this['_checks']['filter'](_0x381519=>_0x381519['id']!==_0x13ff60);}}class me extends Js{['_models']=[];['_defaultModel']=null;constructor(_0x4d94d8,_0x56abb4,_0xf80edf){super(_0x4d94d8),this['_models']=_0x56abb4,this['_defaultModel']=_0xf80edf;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class de extends Js{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x1037b4,_0x3f5096,_0x144910){super(_0x1037b4),this['prompt']=_0x1037b4['prompt'],this['model']=_0x1037b4['model'],this['model']?this['_defaultModel']=_0x3f5096['find'](_0x33da63=>_0x33da63['id']===this['model'])||null:this['_defaultModel']=_0x144910;}get['defaultModel'](){return this['_defaultModel'];}}class ce extends vo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x272e3e,_0x3df066,_0xa7f40d){super(),this['_allModels']=_0x272e3e,this['_recommendedModels']=_0x3df066,this['_defaultModel']=_0xa7f40d;}['setupChecks'](_0x26d451){this['_checks']=_0x26d451['map'](_0xc5176d=>!0x0===_0xc5176d['isExtra']?new de(_0xc5176d,this['_allModels'],this['_defaultModel']):'custom'===_0xc5176d['id']?new me(_0xc5176d,this['_recommendedModels'],this['_defaultModel']):new Js(_0xc5176d));}}class le extends Ys{['_prompt'];['_model'];constructor(_0x4480ee,_0x5a01ac,_0x264bb7,_0x1710ba,_0x5a4227){super(_0x264bb7,_0x1710ba,_0x5a4227),this['_prompt']=_0x4480ee,this['_model']=_0x5a01ac;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x273961,_0x25d3a8,_0x4f008d){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x25d3a8,_0x273961,_0x4f008d);}}class ue extends le{get['subTitle'](){return'';}set['prompt'](_0x1bcd6f){this['_prompt']=_0x1bcd6f;}set['model'](_0x103472){this['_model']=_0x103472;}}class se extends ae{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x302719){super(_0x302719),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',he['map'](_0x41e0f=>_0x41e0f['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x1f685e,_0x215511)=>{this['_isDiffOn']=_0x215511['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x434749,_0xee47a2){return _0x434749['isCustom']?new le(_0x434749['args']['prompt'],_0x434749['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0xee47a2,this['_aiConnector']):_0xee47a2['isExtra']?new ue(_0xee47a2['prompt'],_0xee47a2['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0xee47a2,this['_aiConnector']):new Ri(this['_aiReviewCoreEditing']['getDocumentData'](),_0xee47a2,this['_aiConnector'],_0x434749['params'],_0x434749['args']);}['_onReviewCheckResultActivated'](_0x15430d){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x15430d['change']['id']),this['_scrollToChange'](_0x15430d['change']['id']);const _0x81d16f=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x15430d['change']['id']);if(!_0x81d16f)return;const _0x14ffb4=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x15430d['change'],()=>_0x81d16f['getElement'](),void 0x0,'click',_0x14ffb4?.['editing']?.['view']?.['getDomRoot'](),_0x14ffb4?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x15430d['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x59a55a){this['_currentReviewCheckRun']&&'click'===_0x59a55a['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x59a55a['id']));}['_onDeactivateChange'](_0x246a52){this['_currentReviewCheckRun']&&'balloon'===_0x246a52['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x581603,_0x1ac748){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x1ac748['changeId']);const _0x2b30aa=this['_currentReviewCheckRun']['getChangeById'](_0x1ac748['changeId']);if(!_0x2b30aa)return;const _0x57e5b0=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2b30aa,_0x1ac748['markerElement'],_0x1ac748['domEvent'],'click',_0x57e5b0?.['editing']?.['view']?.['getDomRoot'](),_0x57e5b0?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x2545db,_0x53df07){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x2aab2f=this['_currentReviewCheckRun']['getChangeById'](_0x53df07['changeId']);if(!_0x2aab2f)return;const _0x535d4d=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2aab2f,_0x53df07['markerElement'],_0x53df07['domEvent'],'hover',_0x535d4d?.['editing']?.['view']?.['getDomRoot'](),_0x535d4d?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x21fbb9){const _0xad3c7e=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x21fbb9);return _0xad3c7e?_0xad3c7e['getElement']():null;}['_markChangePositionInEditorContent'](_0x511f42,_0x5bc7e1){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x511f42,_0x5bc7e1);}['_diffContent'](_0x1f4276,_0x4ab08b){return this['_aiReviewCoreEditing']['diffContent'](_0x1f4276,_0x4ab08b);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x399c4a){const _0x5d8a85=this['_aiReviewCoreEditing']['getEditor']();_0x399c4a?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x5d8a85&&_0x5d8a85['editing']['view']['change'](_0x56b2aa=>{const _0x34d78e=_0x5d8a85['editing']['view']['document']['getRoot']();for(const _0x4562e6 of _0x34d78e['getClassNames']())_0x4562e6['startsWith']('ck-ai_review-')&&_0x56b2aa['removeClass'](_0x4562e6,_0x34d78e);_0x56b2aa['addClass'](_0x399c4a?'ck-ai_review-diff':'ck-ai_review-highlights',_0x34d78e);});}async['_getChecksList'](){const _0x5c2a28=[...he,...this['_getExtraChecks']()],_0x53ba79=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x53ba79,_0x5c2a28);let _0x25dc57=_0x5c2a28;this['_hasDefaultAvailableCommands']||(_0x25dc57=_0x53ba79['map'](_0x42999=>_0x5c2a28['find'](_0xf04566=>_0xf04566['id']===_0x42999))['filter'](_0x4ec931=>!!_0x4ec931)),_0x25dc57=_0x25dc57['map'](_0x2fc4e9=>_0x2fc4e9['isExtra']?_0x2fc4e9:this['_translateReviewCheck'](_0x2fc4e9));const _0x1626e1=_0x25dc57['some'](_0xa3492f=>_0xa3492f['isExtra']||'custom'===_0xa3492f['id']);let _0x5cb878=[],_0xec1083=[],_0x41f0ea=null;if(_0x1626e1){const _0x57ab79=await this['_getModels']();_0x5cb878=_0x57ab79['all'],_0xec1083=_0x57ab79['recommended'],_0x41f0ea=_0x57ab79['default'];}const _0x2022e3=new ce(_0x5cb878,_0xec1083,_0x41f0ea);return _0x2022e3['setupChecks'](_0x25dc57),_0x1626e1&&this['_filterChecksWithMissingModel'](_0x2022e3),_0x2022e3;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x11eed6=>({'id':_0x11eed6['id'],'commandId':_0x11eed6['id'],'title':_0x11eed6['label'],'description':_0x11eed6['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x11eed6['prompt'],'model':_0x11eed6['model']}));}['_logErrorForNonExistentChecks'](_0x5c2b9b,_0x148dfb){const _0x4631c1=_0x5c2b9b['filter'](_0x14c677=>!_0x148dfb['some'](_0x89fbc2=>_0x89fbc2['id']===_0x14c677));_0x4631c1['length']&&this['_logError'](new _0x36ce55('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x4631c1['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x28542e=new X({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x28542e['getAll'](),'recommended':await _0x28542e['getAvailableModels'](),'default':await _0x28542e['getDefault']()};}catch(_0x17f99c){return this['_logError'](new _0x36ce55('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x17f99c)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x278cad){const _0x473c10='AI_REVIEW_CHECK_'+_0x278cad['id']['toUpperCase']()['replaceAll']('-','_'),_0x54d677={..._0x278cad,'title':this['_getTranslationWithDefault'](_0x473c10+'_TITLE',_0x278cad['title']),'description':this['_getTranslationWithDefault'](_0x473c10+'_DESCRIPTION',_0x278cad['description'])};return _0x278cad['options']&&(_0x54d677['options']=_0x278cad['options']['map'](_0x28e8b0=>({..._0x28e8b0,'label':this['_getTranslationWithDefault'](_0x473c10+'_OPTIONS_LABEL',_0x28e8b0['label']||''),'data':_0x28e8b0['data']?_0x28e8b0['data']['map'](_0x24ad81=>({..._0x24ad81,'label':this['_getTranslationWithDefault'](_0x473c10+'_OPTIONS_DATA_'+_0x24ad81['id']['toUpperCase'](),_0x24ad81['label'])})):void 0x0}))),_0x54d677;}['_filterChecksWithMissingModel'](_0x4dbf3f){const _0x2abf5d=[];_0x4dbf3f['checks']['forEach'](_0x197ec4=>{(_0x197ec4 instanceof de&&!_0x197ec4['defaultModel']||_0x197ec4 instanceof me&&!_0x197ec4['models']['length'])&&_0x2abf5d['push'](_0x197ec4['id']);}),_0x2abf5d['length']&&_0x2abf5d['forEach'](_0x1bf04b=>{_0x4dbf3f['removeCheckById'](_0x1bf04b),this['_logError'](new _0x36ce55('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x1bf04b}),!0x0);});}}class $a extends _0x269016{static get['requires'](){return[se,re,oe];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class jr extends Js{get['apiId'](){return'translate';}}class ge extends vo{['setupChecks'](_0x3c0525){this['_checks']=_0x3c0525['map'](_0x33f504=>new jr(_0x33f504));}}class Ce extends Ri{['_title'];constructor(_0xb43774,_0x2c798d,_0xfbe041,_0x386ba5,_0x51ef33,_0x504efb){super(_0xb43774,_0x2c798d,_0xfbe041,_0x51ef33,_0x504efb),this['_title']=_0x386ba5;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ae{static get['pluginName'](){return'AITranslateController';}constructor(_0x53e79a){super(_0x53e79a),this['context']['config']['define']('ai.translate.languages',[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]);}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x4270ad,_0x334ff4){return new Ce(this['_aiReviewCoreEditing']['getDocumentData'](),_0x334ff4,this['_aiConnector'],m(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x4270ad['params'],_0x4270ad['args']);}['_onReviewCheckResultActivated'](_0x4f2fa4){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x4f2fa4['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x4f2fa4['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0xf0da39){this['_currentReviewCheckRun']&&('hover'===_0xf0da39['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0xf0da39['id'])),'click'===_0xf0da39['uiInteraction']&&this['_scrollToChange'](_0xf0da39['id']));}['_onDeactivateChange'](_0x42379c){this['_currentReviewCheckRun']&&'panel'===_0x42379c['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x18b84f,_0x3259fd){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x3259fd['changeId']),this['_scrollToChange'](_0x3259fd['changeId']));}['_onChangeMarkerHovered'](_0x2f6397,_0x2417ec){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x2417ec['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x2417ec['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x2fad57){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x2fad57);}['_markChangePositionInEditorContent'](_0x16f706,_0x5d695f){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x16f706,_0x5d695f);}['_diffContent'](_0x5cd39a,_0x1e14b3){return this['_aiReviewCoreEditing']['diffContent'](_0x5cd39a,_0x1e14b3,!0x0);}['_onReviewCheckRun'](){const _0x113076=this['_aiReviewCoreEditing']['getEditor']();_0x113076&&_0x113076['editing']['view']['change'](_0x50b106=>{const _0x2eb0a4=_0x113076['editing']['view']['document']['getRoot']();for(const _0xc6848d of _0x2eb0a4['getClassNames']())(_0xc6848d['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0xc6848d)&&_0x50b106['removeClass'](_0xc6848d,_0x2eb0a4);_0x50b106['addClass']('ck-ai-translate-mode-content',_0x2eb0a4);});}async['_getChecksList'](){const _0x4670a0=[],_0x2056f6=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x5abbff of _0x2056f6)_0x4670a0['push']({'title':_0x5abbff['label'],'id':_0x5abbff['id'],'commandId':_0x5abbff['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x5abbff['id']}});const _0x2ef851=new ge();return _0x2ef851['setupChecks'](this['_translateChecks'](_0x4670a0)),_0x2ef851;}['_translateChecks'](_0xe4f6cc){return _0xe4f6cc['map'](_0x12f97f=>{const _0x3e9570='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x12f97f['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x12f97f,'title':this['_getTranslationWithDefault'](_0x3e9570,_0x12f97f['title'])};});}}class Ae extends Ie{constructor(_0x37274e,_0x49d521){super(_0x37274e,_0x49d521),this['on']('set:isLoading',(_0x520874,_0x4417f4,_0x54b574)=>{_0x54b574&&(this['headerTitle']=m(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x474265,_0x35bade,_0x245cd6)=>{_0x245cd6&&(this['headerTitle']=m(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x234727=super['_createAcceptAllButtonView']();return _0x234727['set']('label',m(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x234727;}['_createExitReviewButtonView'](){const _0x40addf=super['_createExitReviewButtonView']();return _0x40addf['set']('label',m(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x40addf;}}class Le extends Te{['_setupTemplate'](){const _0x943a18=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x943a18['if']('isVisible','ck-hidden',_0x314605=>!_0x314605)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':m(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':m(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x943a18['if']('isVisible','ck-hidden',_0x37cc5b=>!_0x37cc5b)]},'children':this['_checkViews']}]});}}class tr extends ve{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0xed99a7=this['context']['locale'],_0x4d7618=new _0x33ee7e(_0xed99a7,{'label':m(_0xed99a7,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x22c9e7,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x1514e1=new _e(_0xed99a7,{'header':_0x4d7618,'list':new Le(_0xed99a7),'results':new Ae(_0xed99a7,{'generalErrorText':m(_0xed99a7,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new Re(_0xed99a7,{'headerText':m(_0xed99a7,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':m(_0xed99a7,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':m(_0xed99a7,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x1514e1['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x1514e1;}['registerTab'](){const _0x38fc12=this['context']['plugins']['get']('AITabs');_0x38fc12['view']['on']('activateTab',(_0x385190,_0x5ba12d)=>{'translate'===_0x5ba12d?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x38fc12['view']['addTab']({'id':'translate','buttonLabel':m(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x22c9e7,'order':0x0,'content':this['_mainView']});}}class qa extends _0x269016{static get['requires'](){return[rr,tr,oe];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{qi as AIActions,hi as AIAdapter,qn as AIAssistant,ee as AIAssistantUI,u as AIBalloon,Ba as AIChat,x as AIChatController,I as AIChatHistory,mt as AIChatHistoryController,ut as AIChatHistoryUI,Fa as AIChatShortcuts,P as AIChatUI,s as AIConnector,o as AIEditing,Ka as AIEditorIntegration,wt as AIQuickActionType,Ya as AIQuickActions,ki as AIQuickActionsUI,er as AIRequestError,Js as AIReviewCheck,Ws as AIReviewCheckResult,Ys as AIReviewCheckRun,$a as AIReviewMode,ae as AIReviewModeController,oe as AIReviewModeEditing,re as AIReviewModeUI,H as AITabs,ar as AITextAdapter,gt as AIToggleButtonUI,qa as AITranslate,rr as AITranslateController,tr as AITranslateUI,zn as AWSTextAdapter,Xn as OpenAITextAdapter,di as ShowAIAssistantCommand,io as ToggleAICommand,Cs as createResizeButton,Qn as getDefaultAICommands};