@ckeditor/ckeditor5-ai 47.7.2 → 47.7.3

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 _0x361c0d,Command as Lt,ContextPlugin as _0x3a5602,Editor as _0x2cda04}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x41a51c,IconCheck as _0x24d29c,IconError as _0xf1053e,IconSubmit as _0x40c783,IconAIHistory as Nt,IconMagicWand as _0x3699a1,IconRobotPencil as _0x152ed0,IconMaximize as _0x3ff106,IconMinimize as _0x2e4568,IconShowChangesOn as _0x2f2c13,IconShowChangesOff as _0x189462,IconDocument as _0x53a0ad,IconBoxWithCross as _0x1e26a1,IconBoxWithCheck as _0x327ee4,IconBoxWithMarker as _0x40fbce,IconInfo as _0x169d70,IconLoupe as _0x4c94fe,IconCancel as _0x4718d2,IconStop as _0x197784,IconAIChat as Et,IconPlus as _0x1fce8d,IconPin as _0x404f94,IconThreeHorizontalDots as _0x214ca4,IconChevronDown as _0x179898,IconChevronUp as _0x2ca36b,IconOutdated as _0x42666d,IconEye as _0x59f2c5,IconEyeCrossedOut as _0x359228,IconChevronRight as _0x215c94,IconAIReview as _0x4081d8,IconAITranslate as _0x20e0a0}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x48eb5e,CKEditorError as _0x563e6a,ObservableMixin as ts,global as _0x44426a,isVisible as _0x334b9e,Rect as _0x4b725e,Collection as _0x7916ba,FocusTracker as _0x5f2dfb,KeystrokeHandler as _0x15425,first as _0x42aa06,logWarning as _0xa8aac2,logError as _0x4e5dbd,toArray as _0x5f0c81,EmitterMixin as _0x5bd7c6,scrollViewportToShowTarget as _0x1fa956,scrollAncestorsToShowTarget as _0x54a145,ResizeObserver as _0x592694,_isMotionReduced as mt,getConstrainedViewportRect as _0x117236,DomEmitterMixin as _0x3423db}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x14c71e,ButtonView as _0x2cf640,View as _0xc3e5b1,SpinnerView as _0x559c75,IconView as _0x59b3d9,AutocompleteView as _0xf03a68,ListView as _0x163c9e,ListItemGroupView as _0x4cfb21,ListItemView as _0x663ac1,ButtonLabelView as _0x23a78e,FocusCycler as _0x1af4a5,createLabeledTextarea as _0xbfd767,Dialog as _0x3a1450,createDropdown as _0x3e48f8,addMenuToDropdown as _0x4923a2,MenuBarMenuView as _0x580086,MenuBarMenuListItemButtonView as _0x226c2e,DialogViewPosition as _0x1c5421,MenuBarMenuListView as _0x3dd394,MenuBarMenuListItemView as _0x30af6d,BodyCollection as _0x340c25,BalloonPanelView as _0x5442ef,clickOutsideHandler as _0x1d212b,addListToDropdown as _0x5aa31c,UIModel as _0x201273,submitHandler as _0x28e7fc,LabeledFieldView as _0x16298f,createLabeledInputText as th,FormHeaderView as _0x1e299f,HighlightedTextView as _0x19afdf,ViewCollection as _0xf5a45d,FileDialogButtonView as _0x538cbe,InputTextView as _0x4a24d0,SearchTextView as _0x56da7a,ListItemButtonView as _0x4e6947,ButtonLabelWithHighlightView as _0x49352c,DropdownMenuPanelPositioningFunctions as _0x3770f5,BalloonToolbar as te,FormRowView as _0x42755e,TextareaView as _0x2fe62a}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x40b091,ClipboardMarkersUtils as _0x5a0b98}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x2e4e75,ViewDataTransfer as _0x181e06,ViewUpcastWriter as _0x25de84,Matcher as _0x2901ef,_DetachOperation as lt,_insertIntoModelNodeList as _0x296e10,_removeFromModelNodeList as to,ModelRange as dt,transformOperationSets as kt,ViewDowncastWriter as Dt,ModelDocumentFragment as bt,ModelPosition as vt,ModelTreeWalker as _0x1f3d99,MarkerOperation as _0x2a897f,InsertOperation as _0x4675cd}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x4a8a27,escape as _0x528e40,escapeRegExp as _0x15b1ec,debounce as _0x49634e}from'es-toolkit/compat';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x4b17c9}from'htmlparser2';import{isTag as _0x40e032,findOne as gt,getParent as _0x4708b7,findAll as _0x4c7e33,removeElement as _0x12acc3,replaceElement as _0xd8634b,prepend as _0x4856b5,prependChild as _0x8342b6,appendChild as _0xadca60,append as _0x43ba66,find as _0x284730,isComment as _0x38b3c0,getChildren as _0x3a470b,textContent as _0x1099ea}from'domutils';import _0x17e525 from'dom-serializer';import{Document as _t,Element as _0x504ef3,Text as _0x201b94,cloneNode as _0x38bb01,isDocument as _0x82e93c,isText as _0x207546,NodeWithChildren as _0x409cd6}from'domhandler';import{MarkdownGfmMdToHtml as _0x499648}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x5df738,DocumentCompare as ot,DATA_ID_MODEL_ATTRIBUTE as nt,ConfirmMixin as _0x28ab1a,LateFocusDropdownButtonView as _0x3c46f6,getAllMarkersDomElementsSorted as _0x18a8b5,SuggestionsConversion as zt,DATA_ID_VIEW_ATTRIBUTE as _0x5b56f8,getMarkerDomElement as _0xce5e3b}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x4f0e8d}from'es-toolkit';import _0x352e48 from'morphdom';import{IconWeb as _0xd8346c,IconClose as _0x3daaaf,IconDocument as _0x2ff8c2,IconSelection as _0x413c92,IconFileUpload as _0x4d62fe,IconLink as _0xa0ac3e,IconBulb as _0xd8dd72,IconAI as _0x51d4bb,IconPreviousArrow as _0x5d4f8c,IconCheck as _0x2b7211,IconDocumentOutline as _0x5313d0,IconPaperClip as _0x3b2e9c,IconBrowseFiles as _0x3e59fd,IconDropdownArrow as _0x468b06,IconAIChat as _0x382801,IconAIReview as _0x17e3b2,IconAITranslate as Vt,IconAIAskAI as _0x2ab699,IconThumbUp as _0x2ea5c6,IconThumbDown as _0x427eb3,IconCopy as _0x571e92,IconShowChangesOff as _0x1c481d,IconShowChangesOn as _0x339447,IconAIQuickActions as yt,IconAIChatCommands as Gt,IconAIImproveWriting as Bt,IconAIContinueWriting as Ft,IconAIGrammarCheck as Wt,IconAIAdjustLength as Kt,IconAIChangeTone as Yt,IconAIOther as Jt,IconRefresh as _0x42e42d,IconNextArrow as _0x254ba8}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x411a1f}from'diff';const x='_ungrouppedCommands';function o(_0x305070,_0x160d43){const _0x51eecc=(0x0,_0x160d43['t'])('Other');return _0x305070['length']?'groupId'in _0x305070[0x0]?_0x305070:[{'groupId':x,'groupLabel':_0x51eecc,'order':0x1/0x0,'commands':_0x305070}]:[{'groupId':x,'groupLabel':_0x51eecc,'order':0x1/0x0,'commands':[]}];}const Gn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x361c0d{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x36bd6e}=this,_0x5f3143=['ck-fake-ai-selection'];_0x36bd6e['config']['get']('ai.assistant.useTheme')&&_0x5f3143['push']('ck-ai-assistant-ui_theme'),_0x36bd6e['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x5f3143,'priority':0xc}}),_0x36bd6e['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x31d114,{writer:_0x491e8d})=>{if(!_0x31d114['markerRange']['isCollapsed'])return null;const _0x29b214=_0x491e8d['createUIElement']('span');return _0x491e8d['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x29b214),_0x29b214;}});}['afterInit'](){!async function(_0x529653){const _0x3215ef=_0x38b0ea([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]),_0x1aaed3=0x3dffc4e1,_0x496827=0x3df84e89^_0x1aaed3,_0x226b71=window[_0x38b0ea([0x44,0x61,0x74,0x65])][_0x38b0ea([0x6e,0x6f,0x77])](),_0x2d2517=_0x529653[_0x38b0ea([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x58ce3b=new window[(_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3043a0=>{_0x2d2517[_0x38b0ea([0x6f,0x6e,0x63,0x65])](_0x38b0ea([0x72,0x65,0x61,0x64,0x79]),_0x3043a0);}),_0x55126f={[_0x38b0ea([0x6b,0x74,0x79])]:_0x38b0ea([0x45,0x43]),[_0x38b0ea([0x75,0x73,0x65])]:_0x38b0ea([0x73,0x69,0x67]),[_0x38b0ea([0x63,0x72,0x76])]:_0x38b0ea([0x50,0x2d,0x32,0x35,0x36]),[_0x38b0ea([0x78])]:_0x38b0ea([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]),[_0x38b0ea([0x79])]:_0x38b0ea([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]),[_0x38b0ea([0x61,0x6c,0x67])]:_0x38b0ea([0x45,0x53,0x32,0x35,0x36])},_0x2d55bc=_0x2d2517[_0x38b0ea([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x38b0ea([0x67,0x65,0x74])](_0x38b0ea([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0xc2b078(){let _0x395eaf,_0xb19453=null,_0x55399c=null;try{if(_0x2d55bc==_0x38b0ea([0x47,0x50,0x4c]))return _0x38b0ea([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x395eaf=_0x499965(),!_0x395eaf)return _0x38b0ea([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x395eaf[_0x38b0ea([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x55399c=_0x445858(_0x395eaf[_0x38b0ea([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x395eaf[_0x38b0ea([0x6a,0x74,0x69])])),await _0x3c17b9()?_0xb68e14()?_0x379427()?_0x38b0ea([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x5ee40e()?(_0x395eaf[_0x38b0ea([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x38b0ea([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0xb19453=_0x5ade40(_0x38b0ea([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0xd7f128()):_0x38b0ea([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x38b0ea([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x38b0ea([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x38b0ea([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x379427(){const _0x23f30d=[_0x38b0ea([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x38b0ea([0x74,0x72,0x69,0x61,0x6c])][_0x38b0ea([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x395eaf[_0x38b0ea([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x226b71/0x3e8:0xe10*_0x496827;return _0x395eaf[_0x38b0ea([0x65,0x78,0x70])]<_0x23f30d;}function _0xb68e14(){const _0x26734b=_0x395eaf[_0x38b0ea([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x26734b&&(!!_0x26734b[_0x38b0ea([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x38b0ea([0x2a]))||!!_0x26734b[_0x38b0ea([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x38b0ea([0x41,0x49])));}function _0x5ee40e(){const _0x3bf70f=_0x395eaf[_0x38b0ea([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3bf70f||0x0==_0x3bf70f[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x3a5f35}=new URL(window[_0x38b0ea([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3bf70f[_0x38b0ea([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3a5f35))return!0x0;const _0x5ad4b6=_0x3a5f35[_0x38b0ea([0x73,0x70,0x6c,0x69,0x74])](_0x38b0ea([0x2e]));return _0x3bf70f[_0x38b0ea([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x26540a=>_0x26540a[_0x38b0ea([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x38b0ea([0x2a])))[_0x38b0ea([0x6d,0x61,0x70])](_0x39ab84=>_0x39ab84[_0x38b0ea([0x73,0x70,0x6c,0x69,0x74])](_0x38b0ea([0x2e])))[_0x38b0ea([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5b9324=>_0x5b9324[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x5ad4b6[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x38b0ea([0x6d,0x61,0x70])](_0x32d6fe=>Array(_0x5ad4b6[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x32d6fe[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x38b0ea([0x66,0x69,0x6c,0x6c])](_0x32d6fe[0x0]===_0x38b0ea([0x2a])?_0x38b0ea([0x2a]):'')[_0x38b0ea([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x32d6fe))[_0x38b0ea([0x73,0x6f,0x6d,0x65])](_0x1db9da=>_0x5ad4b6[_0x38b0ea([0x65,0x76,0x65,0x72,0x79])]((_0x3b61a7,_0x45ccde)=>_0x1db9da[_0x45ccde]===_0x3b61a7||_0x1db9da[_0x45ccde]===_0x38b0ea([0x2a])));}function _0xd7f128(){return _0xb19453&&_0x55399c?new window[(_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x27465f,_0xc12655)=>{_0xb19453[_0x38b0ea([0x74,0x68,0x65,0x6e])](_0x27465f,_0xc12655),_0x55399c[_0x38b0ea([0x74,0x68,0x65,0x6e])](_0x112ee4=>{_0x112ee4!=_0x38b0ea([0x56,0x61,0x6c,0x69,0x64])&&_0x27465f(_0x112ee4);},_0xc12655);}):_0xb19453||_0x55399c||_0x38b0ea([0x56,0x61,0x6c,0x69,0x64]);}}function _0x445858(_0x118b52,_0x368355){return new window[(_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5c5d0a=>{if(_0x4e7f3f())return _0x5c5d0a(_0x38b0ea([0x56,0x61,0x6c,0x69,0x64]));_0x2e9c1d(),_0x2d2517[_0x38b0ea([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x38b0ea([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x4d475c=!0x1;const _0x3b4f31=_0x48eb5e();function _0x20d468(_0x424ad1){return!!_0x424ad1&&(typeof _0x424ad1===_0x38b0ea([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x424ad1===_0x38b0ea([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x424ad1[_0x38b0ea([0x74,0x68,0x65,0x6e])]===_0x38b0ea([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x424ad1[_0x38b0ea([0x63,0x61,0x74,0x63,0x68])]===_0x38b0ea([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x57667e(_0x4d29af){_0x5af4d1(_0x4d29af)[_0x38b0ea([0x74,0x68,0x65,0x6e])](_0x2cae4b=>{if(!_0x2cae4b||_0x2cae4b[_0x38b0ea([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x38b0ea([0x6f,0x6b]))return _0x38b0ea([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x587310(_0x501f09(_0x3b4f31+_0x368355))!=_0x2cae4b[_0x38b0ea([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x38b0ea([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x38b0ea([0x56,0x61,0x6c,0x69,0x64]);})[_0x38b0ea([0x74,0x68,0x65,0x6e])](_0x2d137f=>(_0x313115(),_0x2d137f),()=>{const _0x19fc6=_0x26d082();return null==_0x19fc6?(_0x313115(),_0x38b0ea([0x56,0x61,0x6c,0x69,0x64])):_0x38b0ea(_0x226b71-_0x19fc6>(0x19f340e1^_0x1aaed3)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x38b0ea([0x74,0x68,0x65,0x6e])](_0x5c5d0a)[_0x38b0ea([0x63,0x61,0x74,0x63,0x68])](()=>{_0x5c5d0a(_0x38b0ea([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x32871a=0x3dc92a61^_0x1aaed3;function _0x313115(){const _0x361bc2=_0x38b0ea([0x6c,0x6c,0x63,0x74,0x2d])+_0x587310(_0x501f09(_0x118b52)),_0x18aa49=_0x42a561(_0x587310(window[_0x38b0ea([0x4d,0x61,0x74,0x68])][_0x38b0ea([0x63,0x65,0x69,0x6c])](_0x226b71/_0x32871a)));window[_0x38b0ea([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x38b0ea([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x361bc2,_0x18aa49);}function _0x26d082(){const _0x4612b2=_0x38b0ea([0x6c,0x6c,0x63,0x74,0x2d])+_0x587310(_0x501f09(_0x118b52)),_0x4a33fe=window[_0x38b0ea([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x38b0ea([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4612b2);return _0x4a33fe?window[_0x38b0ea([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x42a561(_0x4a33fe),0x10)*_0x32871a:null;}function _0x5af4d1(_0xa8beb8){return new window[(_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3cf106,_0x1f94ee)=>{_0xa8beb8[_0x38b0ea([0x74,0x68,0x65,0x6e])](_0x3cf106,_0x1f94ee),window[_0x38b0ea([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x1f94ee,0x3dfe1021^_0x1aaed3);});}}_0x2d2517[_0x38b0ea([0x6f,0x6e])](_0x38b0ea([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x47771f,_0x30901e)=>{if(_0x30901e[0x0]!=_0x118b52)return _0x5c5d0a(_0x38b0ea([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x30901e[0x1]={..._0x30901e[0x1],[_0x38b0ea([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3b4f31};},{[_0x38b0ea([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x38b0ea([0x68,0x69,0x67,0x68])}),_0x2d2517[_0x38b0ea([0x6f,0x6e])](_0x38b0ea([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x83157c=>{_0x20d468(_0x83157c[_0x38b0ea([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x4d475c=!0x0,_0x57667e(_0x83157c[_0x38b0ea([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x38b0ea([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x38b0ea([0x6c,0x6f,0x77])}),_0x58ce3b[_0x38b0ea([0x74,0x68,0x65,0x6e])](()=>{_0x4d475c||_0x5c5d0a(_0x38b0ea([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x4e7f3f(){return _0x2d2517[_0x38b0ea([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x38b0ea([0x76,0x69,0x65,0x77])][_0x38b0ea([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x38b0ea([0x61,0x75,0x74,0x6f]);}function _0x2e9c1d(){_0x2d2517[_0x38b0ea([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x38b0ea([0x76,0x69,0x65,0x77])][_0x38b0ea([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x38b0ea([0x61,0x75,0x74,0x6f]);}}function _0x5ade40(_0x47206a){const _0x5801a7=[new window[(_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x30680e=>setTimeout(_0x30680e,0x3df6fa2d^_0x1aaed3)),_0x58ce3b[_0x38b0ea([0x74,0x68,0x65,0x6e])](()=>new window[(_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x74c70=>{let _0x36de49=0x0;_0x2d2517[_0x38b0ea([0x6d,0x6f,0x64,0x65,0x6c])][_0x38b0ea([0x6f,0x6e])](_0x38b0ea([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x1acab6,_0x4f7e0d)=>{_0x4f7e0d[0x0][_0x38b0ea([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x36de49++,_0x36de49==(0x3dffc109^_0x1aaed3)&&(_0x74c70(),_0x1acab6[_0x38b0ea([0x6f,0x66,0x66])]());});}))];return window[_0x38b0ea([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x38b0ea([0x72,0x61,0x63,0x65])](_0x5801a7)[_0x38b0ea([0x74,0x68,0x65,0x6e])](()=>_0x47206a);}async function _0x27ab30(){await _0x58ce3b,_0x2d2517[_0x38b0ea([0x6d,0x6f,0x64,0x65,0x6c])][_0x38b0ea([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x29a874,_0x2d2517[_0x38b0ea([0x6d,0x6f,0x64,0x65,0x6c])][_0x38b0ea([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x29a874,_0x2d2517[_0x38b0ea([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x38b0ea([0x6d,0x6f,0x64,0x65,0x6c]));}function _0xcdc8b5(_0x116b67){const _0x1239da=_0x287745();_0x2d2517[_0x1239da]=_0x38b0ea([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x116b67,_0x116b67!=_0x38b0ea([0x56,0x61,0x6c,0x69,0x64])&&_0x27ab30();}function _0x287745(){const _0x57520c=window[_0x38b0ea([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x38b0ea([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x38b0ea([0x6e,0x6f,0x77])]())[_0x38b0ea([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x38b0ea([0x2e]),'');let _0x460f4f=_0x38b0ea([0x6e]);for(let _0x3fcad5=0x0;_0x3fcad5<_0x57520c[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3fcad5+=0x2){let _0x332f4c=window[_0x38b0ea([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x57520c[_0x38b0ea([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3fcad5,_0x3fcad5+0x2));_0x332f4c>=_0x3215ef[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x332f4c-=_0x3215ef[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x460f4f+=_0x3215ef[_0x332f4c];}return _0x460f4f;}function _0x499965(){const _0x3dc006=_0x2d55bc[_0x38b0ea([0x73,0x70,0x6c,0x69,0x74])](_0x38b0ea([0x2e]));if(0x3!=_0x3dc006[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x11f70a(_0x3dc006[0x1]);function _0x11f70a(_0xce1aa4){const _0x536ac1=_0x2d3cd0(_0xce1aa4);return _0x536ac1&&_0x287082()?_0x536ac1:null;function _0x287082(){const _0x190c0c=_0x536ac1[_0x38b0ea([0x6a,0x74,0x69])],_0xf65263=window[_0x38b0ea([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x190c0c[_0x38b0ea([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x190c0c[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3e3fed={..._0x536ac1,[_0x38b0ea([0x6a,0x74,0x69])]:_0x190c0c[_0x38b0ea([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x190c0c[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3e3fed[_0x38b0ea([0x76,0x63])],_0x501f09(_0x3e3fed)==_0xf65263;}}}async function _0x3c17b9(){let _0x510dc3=!0x0;try{const _0x23a8ba=_0x2d55bc[_0x38b0ea([0x73,0x70,0x6c,0x69,0x74])](_0x38b0ea([0x2e])),[_0xa6c6e7,_0x4750e4,_0x4118c6]=_0x23a8ba;return _0x53e400(_0xa6c6e7),await _0x456d8d(_0xa6c6e7,_0x4750e4,_0x4118c6),_0x510dc3;}catch{return!0x1;}function _0x53e400(_0x2f7309){const _0xf2bda2=_0x2d3cd0(_0x2f7309);_0xf2bda2&&_0xf2bda2[_0x38b0ea([0x61,0x6c,0x67])]==_0x38b0ea([0x45,0x53,0x32,0x35,0x36])||(_0x510dc3=!0x1);}async function _0x456d8d(_0x4b585d,_0x2b0850,_0x30243f){const _0x2ae8c8=window[_0x38b0ea([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x38b0ea([0x66,0x72,0x6f,0x6d])](_0x126c53(_0x30243f),_0x1c4e20=>_0x1c4e20[_0x38b0ea([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x51a052=new window[(_0x38b0ea([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x38b0ea([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4b585d+_0x38b0ea([0x2e])+_0x2b0850),_0x31f17b=window[_0x38b0ea([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x38b0ea([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x31f17b)return;const _0x161550=await _0x31f17b[_0x38b0ea([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x38b0ea([0x6a,0x77,0x6b]),_0x55126f,{[_0x38b0ea([0x6e,0x61,0x6d,0x65])]:_0x38b0ea([0x45,0x43,0x44,0x53,0x41]),[_0x38b0ea([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x38b0ea([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x38b0ea([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x31f17b[_0x38b0ea([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x38b0ea([0x6e,0x61,0x6d,0x65])]:_0x38b0ea([0x45,0x43,0x44,0x53,0x41]),[_0x38b0ea([0x68,0x61,0x73,0x68])]:{[_0x38b0ea([0x6e,0x61,0x6d,0x65])]:_0x38b0ea([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x161550,_0x2ae8c8,_0x51a052)||(_0x510dc3=!0x1);}}function _0x2d3cd0(_0xe61d0b){return _0xe61d0b[_0x38b0ea([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x38b0ea([0x65,0x79]))?JSON[_0x38b0ea([0x70,0x61,0x72,0x73,0x65])](_0x126c53(_0xe61d0b)):null;}function _0x126c53(_0x4ab5c1){return window[_0x38b0ea([0x61,0x74,0x6f,0x62])](_0x4ab5c1[_0x38b0ea([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x38b0ea([0x2b]))[_0x38b0ea([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x38b0ea([0x2f])));}function _0x501f09(_0x4b1d72){let _0x299d1a=0x1505;function _0x4c2774(_0x5c5002){for(let _0x1275b0=0x0;_0x1275b0<_0x5c5002[_0x38b0ea([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1275b0++){const _0x1485bf=_0x5c5002[_0x38b0ea([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x1275b0);_0x299d1a=(_0x299d1a<<0x5)+_0x299d1a+_0x1485bf,_0x299d1a&=_0x299d1a;}}function _0x2abe3e(_0x5b737f){Array[_0x38b0ea([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x5b737f)?_0x5b737f[_0x38b0ea([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x2abe3e):_0x5b737f&&typeof _0x5b737f==_0x38b0ea([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x38b0ea([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x5b737f)[_0x38b0ea([0x73,0x6f,0x72,0x74])]()[_0x38b0ea([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x1f8edf,_0x1e7737])=>{_0x4c2774(_0x1f8edf),_0x2abe3e(_0x1e7737);}):_0x4c2774(window[_0x38b0ea([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x5b737f));}return _0x2abe3e(_0x4b1d72),_0x299d1a>>>0x0;}function _0x587310(_0x31eec0){return _0x31eec0[_0x38b0ea([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x38b0ea([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x38b0ea([0x30]));}function _0x42a561(_0x5603ce){return _0x5603ce[_0x38b0ea([0x73,0x70,0x6c,0x69,0x74])]('')[_0x38b0ea([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x38b0ea([0x6a,0x6f,0x69,0x6e])]('');}function _0x29a874(){}function _0x38b0ea(_0x371de9){return _0x371de9['map'](_0x317e42=>String['fromCharCode'](_0x317e42))['join']('');}_0xcdc8b5(await _0xc2b078());}(this);}['showFakeVisualSelection'](){const _0x59dd14=this['editor']['model'];_0x59dd14['change'](_0x55f522=>{const _0x8fc15a=_0x59dd14['document']['selection']['getRanges']();let _0xd30ad3=0x0;for(const _0x467d12 of _0x8fc15a){const _0x5ea394=f+':'+_0xd30ad3;if(_0x59dd14['markers']['has'](_0x5ea394))_0x55f522['updateMarker'](_0x5ea394,{'range':_0x467d12});else{if(_0x467d12['start']['isAtEnd']){const _0x451cf4=_0x467d12['start']['getLastMatchingPosition'](({item:_0x28a3ba})=>!_0x59dd14['schema']['isContent'](_0x28a3ba),{'boundaries':_0x467d12});_0x55f522['addMarker'](_0x5ea394,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x55f522['createRange'](_0x451cf4,_0x467d12['end'])});}else _0x55f522['addMarker'](_0x5ea394,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x467d12});}_0xd30ad3++;}});}['hideFakeVisualSelection'](){const _0x5bc1fe=this['editor']['model'],_0x42c732=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x42c732['length']&&_0x5bc1fe['change'](_0x5a5737=>{_0x42c732['forEach'](_0xb5430c=>{_0x5a5737['removeMarker'](_0xb5430c);});});}['insertContent'](_0x2d2904,_0x1ab6e9){const _0x238a50=this['_getAISelection'](),_0x527005=_0x1ab6e9||_0x238a50['getFirstRange']();this['editor']['model']['canEditAt'](_0x527005)&&this['editor']['model']['change'](_0x2b8cef=>{this['hideFakeVisualSelection'](),_0x1ab6e9||this['_resetContentOfSelectedTableCells'](_0x2b8cef,_0x238a50),this['_pasteHTMLUsingClipboard']({'insertAt':_0x527005,'writer':_0x2b8cef,'html':_0x2d2904});});}['insertContentBelow'](_0x946e98){const {model:_0x1c0e8a}=this['editor'],_0x5a6bf1=this['_getAISelection']();_0x1c0e8a['change'](()=>{const _0x2606f9=this['_prepareTableInsertBelowPosition'](_0x946e98,_0x5a6bf1)||this['_getDefaultInsertBelowPosition'](_0x5a6bf1);this['insertContent'](_0x946e98,_0x2606f9);});}['_getAISelection'](){const _0xfb4bf2=this['editor']['model'],_0x2c8171=Array['from'](_0xfb4bf2['markers']['getMarkersGroup'](f))['map'](_0x18d3ba=>_0x18d3ba['getRange']());return _0xfb4bf2['createSelection'](_0x2c8171);}['_pasteHTMLUsingClipboard']({writer:_0x3b0323,html:_0x526c2a,insertAt:_0x1dc0f8}){const {view:_0x4a8fd3}=this['editor']['editing'],_0xd3b81c=this['editor']['plugins']['get'](_0x40b091),_0x4525ef=new Gn();_0x4525ef['setData']('text/html',_0x526c2a);const _0x4a626e=new ClipboardEvent('paste',{'clipboardData':_0x4525ef}),_0xbab946=new _0x2e4e75(_0x4a8fd3,_0x4a626e,{'dataTransfer':new _0x181e06(_0x4525ef)});_0x3b0323['setSelection'](_0x1dc0f8);const _0x247710=(_0x431969,_0x104227)=>{_0x104227['resultRange']&&_0x3b0323['setSelection'](_0x104227['resultRange']);};_0xd3b81c['once']('contentInsertion',_0x247710,{'priority':'lowest'}),_0x4a8fd3['document']['fire']('paste',_0xbab946),_0xd3b81c['off']('contentInsertion',_0x247710);}['_getDefaultInsertBelowPosition'](_0xcc6d77){const {model:_0x2dfcf3}=this['editor'],_0x4dcc9a=Array['from'](_0xcc6d77['getSelectedBlocks']());return _0x4dcc9a['length']?_0x2dfcf3['createPositionAfter'](_0x4dcc9a['pop']()):_0xcc6d77['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x1dea84,_0x58af1f){const {model:_0x97fa5f,plugins:_0x25530c}=this['editor'];if(_0x25530c['has']('TableUtils')){const _0x219ee2=_0x25530c['get']('TableUtils')['getSelectedTableCells'](_0x58af1f);if(_0x219ee2['length']){const _0x53cc8f=this['_getTableRowCountFromContent'](_0x1dea84),_0x3858ff=this['_createEmptyTableRows'](_0x219ee2,_0x53cc8f);return _0x97fa5f['createPositionAt'](_0x3858ff,0x0);}}return null;}['_getTableRowCountFromContent'](_0x382aa3){const _0x47029b=this['editor']['plugins']['get']('TableUtils'),_0x426525=this['editor']['data']['parse'](_0x382aa3),_0x59da4f=Array['from'](_0x426525['getChildren']())['filter'](_0x59ad9e=>_0x59ad9e['is']('element','table'));let _0x1399d8=0x0;return _0x59da4f['forEach'](_0x5389ce=>{_0x1399d8+=_0x47029b['getRows'](_0x5389ce);}),_0x1399d8;}['_createEmptyTableRows'](_0x2db382,_0xe963c){const _0x57cfa=this['editor']['plugins']['get']('TableUtils'),_0x185c26=_0x57cfa['getRowIndexes'](_0x2db382),_0x1ebe32=_0x57cfa['getColumnIndexes'](_0x2db382),_0x40a995=_0x185c26['last']+0x1,_0x4023ce=_0x1ebe32['first'],_0xcfa4f6=_0x2db382[0x0]['findAncestor']('table');for(let _0x213589=0x0;_0x213589<_0xe963c;_0x213589++)_0x57cfa['insertRows'](_0xcfa4f6,{'at':_0x40a995});return _0xcfa4f6['getChild'](_0x40a995)['getChild'](_0x4023ce);}['_resetContentOfSelectedTableCells'](_0x493dc2,_0xb135d6){const {plugins:_0x3c8598}=this['editor'],{model:_0x569b2a}=_0x493dc2;if(!_0x3c8598['has']('TableUtils'))return;_0x3c8598['get']('TableUtils')['getSelectedTableCells'](_0xb135d6)['length']&&_0x569b2a['deleteContent'](_0xb135d6);}}class K extends _0x361c0d{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x563e6a('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x435cc6){super(_0x435cc6),this['name']='AIRequestError';}}function Fn(_0x227cb0,_0x194ee2,_0x5042f3){const t=_0x227cb0['t'];switch(_0x194ee2){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',_0x5042f3);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5042f3);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'},_0x5042f3);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 _0x194ee2;}}class E extends Lt{['_commandDefinitions'];constructor(_0x419633,_0x15f28a){super(_0x419633),this['_commandDefinitions']=_0x15f28a,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x245aed,_0x3e849f,_0x1018fb)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x1018fb));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xed3c8a,_0x342b4e,_0x50342f)=>{this['enabledCommandsIds']=_0x50342f?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x521202=this['editor']['model'];this['_hasContext']=function(_0x9c5fa7){const _0x3cc57f=_0x9c5fa7['document']['selection'];return _0x3cc57f['isCollapsed']?0x0!==[..._0x3cc57f['getSelectedBlocks']()]['length']&&![..._0x3cc57f['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x9c5fa7['hasContent'](_0x3cc57f['getFirstRange']());}(_0x521202);const _0x2349d7=_0x521202['document']['selection'],_0x225f65=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x2ffb2c of _0x2349d7['getRanges']())for(const _0x537510 of _0x2ffb2c['getItems']())if(_0x537510['is']('element')&&_0x225f65['includes'](_0x537510['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0xb83b57='',_0x5c53bb='',_0x980654='custom'){this['editor']['plugins']['get'](n)['showUI'](_0xb83b57,_0x5c53bb,_0x980654);}}function ns(_0x3b9b5f,_0x7a638e){const _0x287b83=new Set();for(const _0x17a2a2 of _0x3b9b5f['values']())(_0x7a638e||!0x1===_0x17a2a2['requiresContent'])&&_0x287b83['add'](_0x17a2a2['id']);return Array['from'](_0x287b83);}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(_0x18b816,_0x10c51b,_0x1f13b4){super(),this['editor']=_0x18b816,this['textAdapter']=_0x10c51b,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x1f13b4,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x2a1ba1,_0x4e4385,_0x4e6c2f)=>{this['view']['value']=this['_sanitizeHTML'](_0x4e6c2f);}),this['listenTo'](this['view'],'submitPrompt',(_0xa9a1c0,_0x8971f7)=>{const _0x4ef6ea=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x8971f7,_0x4ef6ea,'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:_0x41f8a6,query:_0x389c58,htmlContent:_0x649f4,label:_0x1783e2,mainActionLabel:_0x2c5525}){this['view']['prompt']=_0x1783e2,this['view']['mainAction']=_0x2c5525,this['initialContext']=_0x649f4,_0x389c58&&(this['view']['isRendered']?this['_handleQuery'](_0x389c58,_0x649f4,_0x41f8a6,_0x1783e2):this['view']['once']('render',()=>{this['_handleQuery'](_0x389c58,_0x649f4,_0x41f8a6,_0x1783e2);}));}['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'](_0x293b41,_0x258a61,_0x5e3f99,_0x259aa5){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x258a61,this['previousQuery']=_0x293b41,this['previousLabel']=_0x259aa5||_0x293b41,this['previousActionId']=_0x5e3f99,new Promise(_0x1364d6=>{this['textAdapter']['makeRequest']({'query':_0x293b41,'context':_0x258a61,'onData':_0x56e30d=>{this['currentResponse']=_0x56e30d,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x5e3f99})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x586d27=>{_0x586d27 instanceof er?this['view']['handleError'](_0x586d27['message']):this['view']['handleError'](),_0x1364d6();})['finally'](()=>{this['stopProcessing'](),_0x1364d6();});});}['_parseAndNormalizeContent'](_0x1d8c55,_0x1a954c=!0x1){const _0x59ed3f=hs['exec'](_0x1d8c55);_0x1d8c55=_0x59ed3f?_0x1d8c55['substring'](_0x59ed3f[0x1]['length']):_0x1d8c55['length']<0x64&&!_0x1a954c?'':this['_stripMarkdownSyntax'](_0x1d8c55);const _0x222043=this['_domParser']['parseFromString'](_0x1d8c55,'text/html');if(_0x59ed3f){const _0x4e671d=Array['from'](_0x222043['body']['childNodes']);_0x4e671d['reverse']();for(const _0x125ccb of _0x4e671d){if(_0x125ccb['nodeType']==Node['ELEMENT_NODE'])break;_0x125ccb['remove']();}}const _0x27217b=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x222043['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x27217b);const _0x40f0e0=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x4abf04=this['editor']['data']['toModel'](_0x27217b);return _0x40f0e0||_0x4abf04['markers']['clear'](),this['editor']['data']['stringify'](_0x4abf04);}['_normalizeResponseHeadings'](_0x101ae8){const _0x3c101a=new _0x25de84(this['editor']['editing']['view']['document']),_0x441420=new _0x2901ef({'name':/^h[1-5]$/}),_0x25f839=[];let _0x57e912=!0x1;for(const _0x42e8ba of _0x101ae8)_0x42e8ba['is']('element')&&_0x441420['match'](_0x42e8ba)&&(_0x25f839['push'](_0x42e8ba),'h1'==_0x42e8ba['name']&&(_0x57e912=!0x0));if(_0x57e912){for(const _0x1a4c38 of _0x25f839)_0x3c101a['rename']('h'+(parseInt(_0x1a4c38['name'][0x1])+0x1),_0x1a4c38);}}['_isH1TagSupportEnabled'](){const {data:_0x2e52ec,editing:_0x2be412}=this['editor'],_0x19f1d2=_0x2e52ec['htmlProcessor']['toView']('<h1></h1>'),_0x1c012f=_0x2e52ec['toView'](_0x2e52ec['toModel'](_0x19f1d2));return!!_0x2be412['view']['domConverter']['viewToDom'](_0x1c012f)['querySelector']('h1');}['_sanitizeHTML'](_0x4e8393){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x4e8393),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x190c0a){const _0x36bbf5=_0x190c0a['trim']();return _0x36bbf5['startsWith']('```html')?_0x36bbf5['endsWith']('```')?_0x36bbf5['substring'](0x7,_0x36bbf5['length']-0x3):_0x36bbf5['substring'](0x7):_0x190c0a;}}const _={'REPLACE':'replace','INSERT':'insert'};class Ar extends _0x14c71e{constructor(_0x214d17){super(_0x214d17),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x1553b6=>Fn(_0x214d17,'AI_'+_0x1553b6['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Fn(_0x214d17,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Fn(_0x214d17,'Try\x20again')),this['stopButton']=this['_createButton'](Fn(_0x214d17,'Stop'));const _0xa144d8=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0xa144d8['if']('isVisible','ck-hidden',_0x4a5edb=>!_0x4a5edb)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x36da91,_0x1ba45b){const _0x260d6f=new _0x2cf640(this['locale']);return _0x260d6f['set']({'label':_0x36da91,'class':_0x1ba45b||'','isVisible':!0x0,'withText':!0x0}),_0x260d6f;}}class Pr extends _0xc3e5b1{['contentFieldView'];['copyButtonView'];constructor(_0xe8643e,_0x463c5b=''){super(_0xe8643e),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x508739=this['bindTemplate'];this['contentFieldView']=new ContentFieldView(_0xe8643e,_0x463c5b),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x508739['if']('isVisible','ck-hidden',_0x3767b7=>!_0x3767b7)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x508739['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 _0x47c83a=!0x1;this['on']('change:value',(_0x2574bf,_0x266038,_0x2946d6)=>{const _0x3e13c5=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2946d6),this['isProcessing']&&_0x3e13c5&&!_0x47c83a&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x27ed00,_0x24e760,_0x3d9bf4)=>{_0x47c83a=!0x1,_0x3d9bf4?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x47c83a=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x47c83a=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x4075fa=this['locale'],_0x4d1074=new _0x2cf640(this['locale']),_0x3de8de='ck-ai-form__copy-button';return _0x4d1074['set']({'label':Fn(_0x4075fa,'Copy'),'icon':_0x41a51c,'class':_0x3de8de,'tooltip':!0x0}),_0x4d1074['bind']('isVisible')['to'](this,'value',_0x22b34c=>!!_0x22b34c),_0x4d1074['bind']('isEnabled')['to'](this,'isProcessing',_0x1f2fb0=>!_0x1f2fb0),_0x4d1074['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4d1074['icon']=_0x24d29c,_0x4d1074['class']=_0x3de8de+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4d1074['icon']=_0x41a51c,_0x4d1074['class']=_0x3de8de;},0x3e8);}),_0x4d1074;}['_copyHTMLToClipboard'](_0x18571b){const {window:_0x43c710,document:_0x499c0c}=_0x44426a;if(_0x43c710['ClipboardItem']){const {Blob:_0x25269d,ClipboardItem:_0x20cb8a}=_0x43c710,_0x5b5fda=[new _0x20cb8a({'text/html':new _0x25269d([_0x18571b['innerHTML']],{'type':'text/html'}),'text/plain':new _0x25269d([_0x18571b['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x5b5fda);}else{const _0x42cd8d=_0x499c0c['createElement']('div');_0x42cd8d['style']['position']='absolute',_0x42cd8d['style']['left']='-9999px',_0x42cd8d['innerHTML']='<span>[</span>'+_0x18571b['innerHTML']+'<span>]</span>',_0x499c0c['body']['appendChild'](_0x42cd8d);const _0x159a69=_0x499c0c['createRange']();_0x159a69['setStartAfter'](_0x42cd8d['firstElementChild']),_0x159a69['setEndBefore'](_0x42cd8d['lastElementChild']);const _0x2b2771=_0x43c710['getSelection']();_0x2b2771['removeAllRanges'](),_0x2b2771['addRange'](_0x159a69),_0x499c0c['execCommand']('copy'),_0x42cd8d['remove']();}}}class ContentFieldView extends _0xc3e5b1{constructor(_0x5d6993,_0x3ecba0=''){super(_0x5d6993),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x3ecba0,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3657ae){this['element']['innerHTML']=_0x3657ae;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x5d20d6=new _0xc3e5b1(),_0xcfafb6=this['locale'],_0x3f7c63=new _0x559c75();return _0x3f7c63['isVisible']=!0x0,_0x5d20d6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3f7c63,{'text':Fn(_0xcfafb6,'AI\x20is\x20writing...')}]}),_0x5d20d6['render'](),_0x5d20d6;}}class Vr extends _0xc3e5b1{constructor(_0x4d36bf,_0x39833b=''){super(_0x4d36bf);const _0x20b1c0=new _0x59b3d9(),_0x31fc33=this['bindTemplate'];this['set']('text',_0x39833b),_0x20b1c0['content']=_0xf1053e,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x20b1c0,{'text':_0x31fc33['to']('text')}]});}}class Cr extends _0xf03a68{['submitButtonView'];['showHistoryButtonView'];constructor(_0x4d665c,_0x5f0ebc){super(_0x4d665c,_0x5f0ebc),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',(_0x1ff531,_0x1d9eed)=>{_0x1ff531['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1d9eed());});}['_createSubmitButton'](){const _0xddb30c=new _0x2cf640(this['locale']),_0x399194=this['locale'];return _0xddb30c['set']({'icon':_0x40c783,'label':Fn(_0x399194,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0xddb30c['on']('execute',()=>{this['submit']();}),_0xddb30c['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0xc0e3ae,_0x476ace)=>!_0xc0e3ae&&_0x476ace),_0xddb30c;}['_createShowHistoryButton'](){const _0x44423e=new _0x2cf640(this['locale']),_0x4b706c=this['resultsView'],_0x4e9ae3=this['locale'];_0x44423e['set']({'label':Fn(_0x4e9ae3,'History'),'withText':!0x1,'icon':Nt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x44423e['bind']('isOn')['to'](_0x4b706c,'isVisible'),_0x44423e['bind']('isEnabled')['to'](this,'isEnabled'),_0x44423e['on']('execute',()=>{_0x4b706c['isVisible']=!_0x4b706c['isVisible'],_0x4b706c['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x36ed24=()=>{_0x44426a['window']['requestAnimationFrame'](()=>{if(_0x334b9e(this['element'])){const _0x45c64e=new _0x4b725e(this['queryView']['fieldView']['element']),_0x39b558=_0x45c64e['width'],_0x5c933a='rtl'===_0x4e9ae3['uiLanguageDirection']?'left':'right';_0x45c64e['excludeScrollbarsAndBorders'](),_0x44423e['element']['style'][_0x5c933a]=_0x39b558-_0x45c64e['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x36ed24),this['on']('render',_0x36ed24),_0x44423e;}['submit'](){const _0x50b964=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x50b964);}['focus'](_0x1c6545){-0x1===_0x1c6545?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Hr extends _0x163c9e{['historyGroupView'];['clearHistoryButton'];constructor(_0x26a78a){super(_0x26a78a),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x4cfb21(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Fn(_0x26a78a,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4fc877=0x0;for(const _0x13dfb3 of this['items'])_0x4fc877+=_0x13dfb3['items']['length'];return{'resultsCount':_0x4fc877,'totalItemsCount':_0x4fc877};}['_createClearHistoryButton'](){const _0x59b16a=this['locale'],_0x56def7=new _0x2cf640(this['locale']);return _0x56def7['set']({'label':'('+Fn(_0x59b16a,'Clear')+')','withText':!0x0}),_0x56def7['on']('execute',()=>this['fire']('clearHistory')),_0x56def7;}}class Rr extends _0x663ac1{constructor(_0x378926){super();const _0x2ce27e=new _0x23a78e(),_0x48fa27=new _0x2cf640(this['locale'],_0x2ce27e);this['children']['add'](_0x48fa27),_0x48fa27['set']({'label':_0x378926['prompt'],'withText':!0x0}),_0x48fa27['on']('execute',()=>{this['fire']('execute',{'value':_0x4a8a27(_0x378926['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Br extends _0x7916ba{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x2328c9,_0x5e8015)=>{const _0x30c9c5=go(_0x5e8015['prompt']);for(const _0x1a5094 of this)if(_0x1a5094!=_0x5e8015&&go(_0x1a5094['prompt'])===_0x30c9c5){this['remove'](_0x1a5094);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x4d48a5=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x4d48a5));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x417875=>_0x417875)));}}function go(_0x40be19){return _0x40be19['toLowerCase']()['trim']();}class k extends _0xc3e5b1{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x57df7f,_0x31900c,_0x5e216c=''){super(_0x57df7f),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(_0x57df7f),this['contentArea']=new Pr(_0x57df7f,_0x5e216c),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 _0x5f2dfb(),this['keystrokes']=new _0x15425(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x1af4a5({'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 _0x1dcf2e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x31900c],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x1dcf2e['if']('isError','ck-hidden',_0x44ab2d=>!_0x44ab2d)]},'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'](_0x517104=0x1){-0x1===_0x517104?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 _0x1f82b4=this['locale'],_0x3e3e4c=new Cr(_0x1f82b4,{'queryView':{'label':Fn(_0x1f82b4,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0xbfd767,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Fn(_0x1f82b4,'Empty\x20history'),'secondary':Fn(_0x1f82b4,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x3e3e4c['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xc76c58,_0x5b39b6)=>_0xc76c58&&!_0x5b39b6),this['listenTo'](_0x3e3e4c,'submit',(_0x5bfe54,_0x1b6059)=>{this['prompt']=_0x1b6059;const _0x4aa03c=_0x528e40(_0x1b6059);this['fire']('submitPrompt',_0x4aa03c),_0x1b6059['trim']()&&this['_promptHistory']['add']({'prompt':_0x4aa03c},0x0);},{'priority':'high'}),_0x3e3e4c;}['_createHistoryView'](){const _0x11dbb1=new Hr(this['locale']);return _0x11dbb1['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Rr),_0x11dbb1['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x11dbb1;}['_createToolbar'](){const _0x4a197e=new Ar(this['locale']);return _0x4a197e['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x54ef0a,_0x2a3492,_0x56b6af)=>_0x54ef0a&&!_0x2a3492&&!!_0x56b6af),_0x4a197e['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4a197e['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x560186,_0x2b291d,_0x24ff8b)=>_0x560186&&!_0x2b291d&&!!_0x24ff8b),_0x4a197e['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4a197e['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x12902d,_0x22bdbd)=>_0x12902d&&!_0x22bdbd),_0x4a197e['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4a197e['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4a197e['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4a197e;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x4612fe=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Fn(_0x4612fe,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x3ac213){const _0x1b6657=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x3ac213||Fn(_0x1b6657,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x361c0d{['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[_0x5a0b98,a,K,_0x3a1450];}constructor(_0xda933a){super(_0xda933a),_0xda933a['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0xda933a['config']['define']('ai.assistant.contentAreaCssClass',''),_0xda933a['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0xda933a['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x37da3c}=this;this['_aiAdapter']=_0x37da3c['plugins']['get'](K),this['_dialog']=_0x37da3c['plugins']['get'](_0x3a1450),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x3e658a=new E(_0x37da3c,Array['from'](this['_commandDefinitions']['values']()));_0x37da3c['commands']['add']('showAIAssistant',_0x3e658a),_0x37da3c['ui']['componentFactory']['add']('aiCommands',_0x2ae405=>{const _0x574602=_0x3e48f8(_0x2ae405);return _0x574602['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x574602['buttonView']['set']({'label':Fn(_0x2ae405,'AI\x20Commands'),'icon':_0x3699a1,'tooltip':!0x0}),_0x574602['on']('execute',_0x54c9d5=>this['_onExecute'](_0x54c9d5['source']['id'])),_0x4923a2(_0x574602,_0x37da3c['ui']['view']['body'],function(_0x577b93){const _0x5875d6=o(_0x577b93['config']['get']('ai.assistant.commands'),_0x577b93['locale']),_0xb39a18=B(_0x577b93,_0x5875d6)['filter'](_0x39e32d=>_0x39e32d['commands']['length']);if(0x1===_0xb39a18['length'])return B(_0x577b93,_0xb39a18[0x0]['commands'])['map'](_0x870a7d=>({'id':_0x870a7d['id'],'label':_0x870a7d['label']}));return _0xb39a18['map'](_0x39eada=>{const {groupId:_0x225bdd,groupLabel:_0x394cef,commands:_0x5d8ba0}=_0x39eada,_0x223bd9=B(_0x577b93,_0x5d8ba0)['map'](_0x53db7d=>({'id':_0x53db7d['id'],'label':_0x53db7d['label']}));return{'id':_0x225bdd,'menu':_0x394cef||_0x225bdd,'children':_0x223bd9};});}(_0x37da3c),{'ariaLabel':Fn(_0x2ae405,'AI\x20Commands')}),_0x574602['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x3e658a['on']('change:enabledCommandsIds',_0x1884cf),_0x574602['menuView']['once']('render',_0x1884cf),_0x574602;function _0x1884cf(){_0x574602['isEnabled']=_0x3e658a['enabledCommandsIds']['length']>0x0;for(const _0x13bcf2 of _0x574602['menuView']['buttons'])_0x13bcf2['isEnabled']=_0x3e658a['enabledCommandsIds']['includes'](_0x13bcf2['id']);}}),_0x37da3c['ui']['componentFactory']['add']('menuBar:aiCommands',_0x434239=>{const _0x44e1f5=new _0x580086(_0x434239);_0x44e1f5['buttonView']['set']({'label':Fn(_0x434239,'AI\x20Commands'),'icon':_0x3699a1}),_0x44e1f5['bind']('isEnabled')['to'](_0x3e658a,'enabledCommandsIds',_0x3c5307=>_0x3c5307['length']>0x0);const _0x44bdac=o(_0x37da3c['config']['get']('ai.assistant.commands'),_0x434239);return this['_populateMenuBarMenu'](_0x3e658a,_0x44e1f5,_0x44bdac,_0xd02b7c=>this['_onExecute'](_0xd02b7c)),_0x44e1f5;}),_0x37da3c['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x48cda4=this['_createAIAssistantUIButton'](_0x2cf640);return _0x48cda4['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x48cda4;}),_0x37da3c['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x55c129=this['_createAIAssistantUIButton'](_0x226c2e);return _0x55c129['set']({'role':'menuitemcheckbox'}),_0x55c129;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x35706d=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x2c3453;for(const _0x3786dd in _0x35706d){const _0x1a29cb=_0x3786dd,_0x114c34=_0x35706d[_0x1a29cb];if('aiLicenseKeyValid'==_0x114c34||'aiLicenseKeyInvalid'==_0x114c34||'aiLicenseKeyExpired'==_0x114c34||'aiLicenseKeyDomainLimit'==_0x114c34||'aiLicenseKeyNotAllowed'==_0x114c34||'aiLicenseKeyEvaluationLimit'==_0x114c34||'aiLicenseKeyUsageLimit'==_0x114c34){delete _0x35706d[_0x1a29cb],_0x2c3453=_0x114c34,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x2c3453&&_0x35706d['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x2c3453&&_0x35706d['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x2c3453&&_0x35706d['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x2c3453&&_0x35706d['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x2c3453&&_0x35706d['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x2c3453&&_0x35706d['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x34a6db='',_0xe94cf3='',_0x312bbb='custom'){const _0x1878b5=this['editor'],_0xa592c5=_0x1878b5['editing']['view'],_0x446375=_0x1878b5['plugins']['get'](a),_0x16899d=_0x1878b5['plugins']['get'](_0x5a0b98);_0x446375['showFakeVisualSelection']();const _0x5bc6c5=new w(),_0x161cfa=new ClipboardEvent('copy',{'clipboardData':_0x5bc6c5}),_0x1f0c82=new _0x181e06(_0x5bc6c5),_0x110f9d=new _0x2e4e75(_0xa592c5,_0x161cfa,{'dataTransfer':_0x1f0c82});_0x16899d['_forceMarkersCopy']('comment',()=>{_0xa592c5['document']['fire']('copy',_0x110f9d);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x1878b5,this['_aiAdapter']['textAdapter'],this['_formView']));let _0xee4945=_0x1f0c82['getData']('text/html');const _0x57e6c4=_0x1878b5['model']['document']['selection'],_0x1865a1=Array['from'](_0x57e6c4['getRanges']());0x1===_0x1865a1['length']&&_0x1865a1[0x0]['isFlat']&&!_0x57e6c4['getSelectedElement']()&&''!==_0xee4945['replace'](/&nbsp;/g,'')['trim']()&&(_0xee4945='<p>'+_0xee4945+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x312bbb,'query':_0x34a6db,'htmlContent':_0xee4945,'label':_0xe94cf3,'mainActionLabel':_[_0x1878b5['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x152ed0,'title':Fn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x1c5421['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x446375['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x114fd7=new Map(),_0x4d0653=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x38eb99 of _0x4d0653)for(const _0x11231c of _0x38eb99['commands'])_0x114fd7['set'](_0x11231c['id'],{..._0x11231c,'groupId':_0x38eb99['groupId'],'groupLabel':_0x38eb99['groupLabel']||_0x38eb99['groupId']});return _0x114fd7;}['_createAIAssistantUIButton'](_0x17cf79){const _0x3fae38=this['editor'],_0x573dff=_0x3fae38['commands']['get']('showAIAssistant'),_0x1f19e6=new _0x17cf79(_0x3fae38['locale']);return _0x1f19e6['set']({'label':Fn(_0x3fae38['locale'],'AI\x20Assistant'),'icon':_0x152ed0,'isToggleable':!0x0}),_0x1f19e6['bind']('isEnabled')['to'](_0x573dff),_0x1f19e6['bind']('isOn')['to'](this['_dialog'],'id',_0x1a8cac=>'aiAssistant'===_0x1a8cac),this['listenTo'](_0x1f19e6,'execute',()=>{_0x1f19e6['isOn']?this['hideUI']():_0x573dff['execute']();}),_0x1f19e6;}['_initView'](){const _0x174cab=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',()=>{_0x174cab['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x174cab['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x9e6934,ui:{ariaLiveAnnouncer:_0x15ae68}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x4f1ed7,_0x1dd1cc,_0x332478)=>{const _0x8b5e85=this['_aiAssistantController']['currentContext'];_0x332478?_0x15ae68['announce'](Fn(_0x9e6934,'AI\x20is\x20writing')):_0x8b5e85&&_0x15ae68['announce'](Fn(_0x9e6934,'Generated\x20content:\x20%0',_0x8b5e85),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x36b740,_0x1745b6,_0x5d975b)=>{if(_0x5d975b){const _0x5bb858=this['_formView']['errorView']['text'];_0x15ae68['announce'](Fn(_0x9e6934,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5bb858));}});}['_onExecute'](_0x1f1977){const _0x19ae8e=this['_commandDefinitions']['get'](_0x1f1977),_0x5b2f69=this['editor'],_0x30859a=_0x5b2f69['model']['document']['selection'],_0x57b70d=_0x5b2f69['commands']['get']('showAIAssistant'),_0x4c3107=_0x5b2f69['plugins']['get'](a),_0x2d056f=''+(_0x19ae8e['groupId']!==x?_0x19ae8e['groupLabel']+':\x20':'')+_0x19ae8e['label'];if(!0x1!==_0x19ae8e['requiresContent']&&_0x30859a['isCollapsed']){const _0x4cba17=_0x42aa06(_0x30859a['getSelectedBlocks']())||_0x5b2f69['model']['schema']['getLimitElement'](_0x30859a);_0x5b2f69['model']['change'](_0x387d48=>{_0x387d48['setSelection'](_0x4cba17,'in');});}_0x4c3107['showFakeVisualSelection'](),_0x57b70d['execute'](_0x19ae8e['prompt'],_0x2d056f,'command:'+_0x1f1977);}['_populateMenuBarMenu'](_0xf211e0,_0x2a85df,_0x36a4cc,_0x1179fa){const _0x536269=this['editor'],_0x102289=_0x536269['locale'],_0x2dbb75=new _0x3dd394(_0x102289),_0x1559e3=B(_0x536269,_0x36a4cc)['filter'](_0x789718=>_0x789718['commands']['length']);0x1===_0x1559e3['length']?this['_getMenuBarGroupButtons']({'command':_0xf211e0,'commands':_0x1559e3[0x0]['commands'],'parentMenuView':_0x2a85df,'onExecute':_0x1179fa})['forEach'](_0x51ed86=>_0x2dbb75['items']['add'](_0x51ed86)):_0x1559e3['forEach'](({groupId:_0x1463f5,groupLabel:_0x11ddb4,commands:_0x162daf})=>{const _0x333a0e=new _0x30af6d(_0x102289,_0x2a85df),_0x5e96ba=new _0x580086(_0x102289),_0x180f10=new _0x3dd394(_0x102289),_0x55e5f8=this['_getMenuBarGroupButtons']({'command':_0xf211e0,'commands':_0x162daf,'parentMenuView':_0x5e96ba,'onExecute':_0x1179fa});_0x5e96ba['buttonView']['set']({'label':_0x11ddb4||_0x1463f5}),_0x5e96ba['delegate']('execute')['to'](_0x2a85df),_0x180f10['items']['addMany'](_0x55e5f8),_0x5e96ba['panelView']['children']['add'](_0x180f10),_0x333a0e['children']['add'](_0x5e96ba),_0x2dbb75['items']['add'](_0x333a0e);}),_0x2a85df['panelView']['children']['add'](_0x2dbb75);}['_getMenuBarGroupButtons']({command:_0x1135cc,commands:_0x45e7be,parentMenuView:_0x42f20f,onExecute:_0x4d1a05}){const _0x3b0921=this['editor'],_0x58f845=_0x3b0921['locale'];return B(_0x3b0921,_0x45e7be)['map'](_0xf3b653=>{const _0x3a9f59=new _0x30af6d(_0x58f845,_0x42f20f),_0x22e03c=new _0x226c2e(_0x58f845);return _0x22e03c['set']({'label':_0xf3b653['label']}),_0x22e03c['delegate']('execute')['to'](_0x42f20f),_0x22e03c['on']('execute',()=>_0x4d1a05(_0xf3b653['id'])),_0x22e03c['bind']('isEnabled')['to'](_0x1135cc,'enabledCommandsIds',_0xeec3d4=>_0xeec3d4['includes'](_0xf3b653['id'])),_0x3a9f59['children']['add'](_0x22e03c),_0x3a9f59;});}}function U(_0x49432a,_0xd0b78){return void 0x0!==_0x49432a['order']&&void 0x0===_0xd0b78['order']?0x1:void 0x0===_0x49432a['order']&&void 0x0!==_0xd0b78['order']?-0x1:void 0x0!==_0x49432a['order']&&void 0x0!==_0xd0b78['order']?_0x49432a['order']-_0xd0b78['order']:0x0;}function B(_0x138416,_0x26f086){_0x26f086['sort'](U);const _0x3e5007={},_0x1f6eaa=[];for(const _0x11ec28 of _0x26f086)if(void 0x0!==_0x11ec28['order']){if(_0x11ec28['order']in _0x3e5007)throw new _0x563e6a('ai-commands-config-order-collision',_0x138416,{'conflictingDefinitions':[_0x11ec28,_0x3e5007[_0x11ec28['order']]]});_0x3e5007[_0x11ec28['order']]=_0x11ec28,_0x1f6eaa['splice'](_0x11ec28['order'],0x0,_0x11ec28);}else _0x1f6eaa['push'](_0x11ec28);return _0x1f6eaa;}class AIAssistant extends _0x361c0d{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x44d3f1){super(_0x44d3f1);const _0x30a33b=_0x44d3f1['config'],_0x4ba9a0=_0x44d3f1['locale'];_0x30a33b['define']('ai.assistant.preserveComments',!0x0),_0x30a33b['define']('ai.assistant.commands',Wn(_0x4ba9a0)),_0x30a33b['define']('ai.assistant.extraCommandGroups',[]),_0x30a33b['define']('ai.assistant.removeCommands',[]);let _0x385c6b=o(_0x30a33b['get']('ai.assistant.commands'),_0x4ba9a0);const _0x2fdd46=_0x30a33b['get']('ai.assistant.extraCommandGroups'),_0x2a2be8=_0x30a33b['get']('ai.assistant.removeCommands');_0x2fdd46['forEach'](_0x49c457=>{const _0x417214=_0x385c6b['find'](_0x5788f1=>_0x5788f1['groupId']===_0x49c457['groupId']);_0x417214?_0x417214['commands']=_0x417214['commands']['concat'](_0x49c457['commands']):_0x385c6b['push'](_0x49c457);}),_0x385c6b=_0x385c6b['filter'](_0xdb605e=>!_0x2a2be8['includes'](_0xdb605e['groupId'])),_0x385c6b['forEach'](_0x356158=>{_0x356158['commands']=_0x356158['commands']['filter'](_0x3eb198=>!_0x2a2be8['includes'](_0x3eb198['id']));}),_0x30a33b['set']('ai.assistant.commands',_0x385c6b);}}function Wn(_0x3cc3dd){return[{'groupId':'editOrReview','groupLabel':Fn(_0x3cc3dd,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Fn(_0x3cc3dd,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Fn(_0x3cc3dd,'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':Fn(_0x3cc3dd,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Fn(_0x3cc3dd,'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':Fn(_0x3cc3dd,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Fn(_0x3cc3dd,'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':Fn(_0x3cc3dd,'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':Fn(_0x3cc3dd,'Change\x20tone'),'commands':[{'id':'professional','label':Fn(_0x3cc3dd,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Fn(_0x3cc3dd,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Fn(_0x3cc3dd,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Fn(_0x3cc3dd,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Fn(_0x3cc3dd,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Fn(_0x3cc3dd,'Change\x20style'),'commands':[{'id':'business','label':Fn(_0x3cc3dd,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Fn(_0x3cc3dd,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Fn(_0x3cc3dd,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Fn(_0x3cc3dd,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Fn(_0x3cc3dd,'Translate'),'commands':[{'id':'translateEnglish','label':Fn(_0x3cc3dd,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Fn(_0x3cc3dd,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Fn(_0x3cc3dd,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Fn(_0x3cc3dd,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Fn(_0x3cc3dd,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Fn(_0x3cc3dd,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Fn(_0x3cc3dd,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Fn(_0x3cc3dd,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ar extends _0x361c0d{['abortController'];static get['requires'](){return[K];}constructor(_0x10cc25){super(_0x10cc25),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'](_0x4f34fb){return this['sendRequest'](_0x4f34fb)['catch'](_0x2d7006=>{if(_0x2d7006 instanceof er)return Promise['reject'](_0x2d7006);if('AbortError'==_0x2d7006['name'])return Promise['resolve']();throw console['error'](_0x2d7006),new _0x563e6a('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x480b8c,_0x388b1f){const _0x5e1f93=this['editor']['locale'],_0x25fc7b={'Content-Type':'application/json'};if('object'==typeof _0x480b8c)Object['assign'](_0x25fc7b,_0x480b8c);else{if(_0x480b8c)try{const _0x6268c8=await _0x480b8c(_0x388b1f);Object['assign'](_0x25fc7b,_0x6268c8);}catch{return Promise['reject'](new er(Fn(_0x5e1f93,'AI_ERROR_GET_HEADERS')));}}return _0x25fc7b;}async['_prepareRequestParameters'](_0x6f1179,_0x374cff){const _0x516502=this['editor']['locale'];if('object'==typeof _0x6f1179)return _0x6f1179;try{return await _0x6f1179(_0x374cff);}catch{return Promise['reject'](new er(Fn(_0x516502,'AI_ERROR_GET_PARAMETERS')));}}}class OpenAITextAdapter extends ar{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4c74d2){super(_0x4c74d2),_0x4c74d2['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4c74d2['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x4c74d2['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4c74d2['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x4c74d2['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x4c74d2['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x2c6298,context:_0x59dc7c,onData:_0x39e4c8,actionId:_0x3a7f5e}){const _0x358a0b=this['editor']['locale'],_0x4fc3f3=await this['prepareMessages'](_0x2c6298,_0x59dc7c,_0x3a7f5e),_0x42b338=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3a7f5e),_0x14d50c=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3a7f5e),_0x3f6b50={'messages':_0x4fc3f3,..._0x14d50c},_0x1aca66={'method':'POST','headers':_0x42b338,'body':JSON['stringify'](_0x3f6b50),'signal':this['abortController']['signal']},_0x20d1e4=await fetch(this['_apiUrl'],_0x1aca66);if(_0x20d1e4['ok'])return _0x14d50c['stream']?await this['_readStreamableResponse'](_0x20d1e4,_0x39e4c8):await this['_readStaticResponse'](_0x20d1e4,_0x39e4c8),Promise['resolve']();{const _0xae6c5d=await _0x20d1e4['text']();return _0xae6c5d['includes']('context_length_exceeded')?Promise['reject'](new er(Fn(_0x358a0b,'AI_ERROR_CONTEXT_LENGTH'))):_0xae6c5d['includes']('Moderation')?Promise['reject'](new er(Fn(_0x358a0b,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0xae6c5d));}}async['prepareMessages'](_0x229d5a,_0xf8aa47,_0xcb3b81){let _0x39abd5,_0x3b5cba;return _0xf8aa47?(_0x39abd5='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.',_0x3b5cba='Instruction:\x0a'+_0x229d5a+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xf8aa47):(_0x39abd5='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.',_0x3b5cba=_0x229d5a),[{'role':'system','content':_0x39abd5},{'role':'user','content':_0x3b5cba}];}async['_readStreamableResponse'](_0x1cba37,_0x1d1c82){const _0x420906=_0x1cba37['body']['getReader'](),_0x5d0043=new TextDecoder();let _0xbd6d78='',_0x5921af='',_0x546872='',_0x3ea82b=!0x1;for(;!_0x3ea82b;){const {done:_0x1fe006,value:_0x570732}=await _0x420906['read'](),_0x1544b8=_0xbd6d78+_0x5d0043['decode'](_0x570732);let _0x282991='';_0x3ea82b=_0x1fe006;try{_0x282991=this['_cleanUpData'](_0x1544b8),_0xbd6d78='';}catch{_0xbd6d78=_0x1544b8;continue;}_0x5921af+=_0x282991,!_0x3ea82b&&this['_isBufferIncomplete'](_0x5921af)||_0x5921af&&(_0x546872+=_0x5921af,_0x5921af='',_0x1d1c82(_0x546872));}return Promise['resolve']();}async['_readStaticResponse'](_0x3e0f9c,_0x35ad8b){return _0x35ad8b((await _0x3e0f9c['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x2e83a8){const _0x597a48=_0x2e83a8['split']('<')['length']!==_0x2e83a8['split']('>')['length'],_0x615d74=_0x2e83a8['length']<0x1e;return _0x597a48&&_0x615d74;}['_cleanUpData'](_0x3fa6a5){return _0x3fa6a5['split'](/\n(?![^{]*\})/g)['map'](_0x13280f=>_0x13280f['replace']('data:\x20',''))['filter'](_0x2e8891=>_0x2e8891&&_0x2e8891['length']>0x0&&'[DONE]'!==_0x2e8891)['map'](_0x3a6182=>{const {choices:_0x275a95}=JSON['parse'](_0x3a6182);if(_0x275a95[0x0]?.['delta']?.['content'])return _0x275a95[0x0]['delta']['content'];})['filter'](_0x2e66e4=>_0x2e66e4)['join']('');}}class AWSTextAdapter extends ar{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),_0xa8aac2('ai-aws-adapter-not-supported');}async['sendRequest'](_0x52970f){throw _0x4e5dbd('ai-aws-adapter-not-supported'),new er(Fn(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ia extends _0x2cf640{constructor(_0x5ae55c,_0x4a139d={}){super(_0x5ae55c),this['isToggleable']=!0x0,this['set']('side',_0x4a139d['side']||'top');const _0x444a12=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x5f0c81(_0x4a139d['class']||[]),_0x444a12['to']('side',_0x2c0945=>'ck-tab-button_'+_0x2c0945),_0x444a12['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0xc3e5b1{['children'];constructor(_0xb6ef17,_0x545a6a={}){super(_0xb6ef17);const _0x2d1c51=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x5f0c81(_0x545a6a['class']||[]),_0x2d1c51['to']('class'),_0x2d1c51['if']('isVisible','ck-hidden',_0x36774e=>!_0x36774e)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0xc3e5b1{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x3270d4,_0x47c2e1={}){super(_0x3270d4),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x47c2e1['side']||'top'),this['set']('isMaximized',!0x1);const _0x554973=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x5f0c81(_0x47c2e1['class']||[]),_0x554973['to']('side',_0x19481f=>'ck-tabs_'+_0x19481f),_0x554973['to']('class'),_0x554973['to']('isMaximized',_0x3c9cb=>_0x3c9cb?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x554973['to']('side',_0x4cc745=>'ck-tabs__buttons-container_'+_0x4cc745)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x554973['to']('side',_0x1849cf=>'ck-tabs__panels-container_'+_0x1849cf)]},'children':this['panelViews']},..._0x5f0c81(_0x47c2e1['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x23ecea){const _0x58a82d=this['_tabs']['get'](_0x23ecea);return _0x58a82d||null;}['addTab'](_0x11cdc5){const _0x194960=this['_setupButton']({'id':_0x11cdc5['id'],'label':_0x11cdc5['buttonLabel'],'icon':_0x11cdc5['buttonIcon'],'order':_0x11cdc5['order']}),_0x4e8c0a=new ea(this['locale']);return _0x4e8c0a['render'](),_0x11cdc5['content']&&_0x4e8c0a['children']['add'](_0x11cdc5['content']),this['panelViews']['add'](_0x4e8c0a),this['_tabs']['set'](_0x11cdc5['id'],{'button':_0x194960,'panel':_0x4e8c0a,'order':void 0x0!==_0x11cdc5['order']?_0x11cdc5['order']:null}),this['fire']('addTab:'+_0x11cdc5['id'],{'id':_0x11cdc5['id'],'button':_0x194960,'panel':_0x4e8c0a}),null===this['activeTab']?this['activateTab'](_0x11cdc5['id']):this['_hidePanel'](_0x11cdc5['id']),{'button':_0x194960,'panel':_0x4e8c0a};}['activateTab'](_0x3f9f72){if(null!==_0x3f9f72&&!this['getTab'](_0x3f9f72))throw new _0x563e6a('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3f9f72});this['activeTab']!==_0x3f9f72&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x3f9f72,_0x3f9f72&&this['_showPanel'](_0x3f9f72),this['fire']('activateTab:'+_0x3f9f72,_0x3f9f72));}['showTab'](_0xd35a32){if(!this['getTab'](_0xd35a32))throw new _0x563e6a('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xd35a32});this['_showPanel'](_0xd35a32),this['_showButton'](_0xd35a32),this['fire']('show:'+_0xd35a32,_0xd35a32);}['hideTab'](_0x198586){if(!this['getTab'](_0x198586))throw new _0x563e6a('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x198586});const _0xebcad7=this['activeTab'];this['_hidePanel'](_0x198586),this['_hideButton'](_0x198586);const _0x1f2f5a=this['getTabIds']();_0xebcad7===_0x198586&&_0x1f2f5a['length']>0x1&&this['activateTab'](_0x1f2f5a['find'](_0x44d9a6=>_0x44d9a6!==_0x198586)),this['fire']('hide:'+_0x198586,_0x198586);}['_getPanel'](_0x49cd23){const _0x3633b0=this['_tabs']['get'](_0x49cd23);return _0x3633b0?_0x3633b0['panel']:null;}['_showPanel'](_0x18c493){null!==this['activeTab']&&this['activeTab']!==_0x18c493||this['_getPanel'](_0x18c493)['show']();}['_hidePanel'](_0x120d13){const _0x4753db=this['_getPanel'](_0x120d13);_0x4753db['isVisible']&&(this['activeTab']===_0x120d13&&(this['activeTab']=null),_0x4753db['hide']());}['_getButton'](_0x29c593){const _0x270f92=this['_tabs']['get'](_0x29c593);return _0x270f92?_0x270f92['button']:null;}['_showButton'](_0x4768c7){this['_getButton'](_0x4768c7)['show']();}['_hideButton'](_0xb53933){this['_getButton'](_0xb53933)['hide']();}['_setupButton'](_0xacacd9){const _0x22189b=new ia(this['locale'],{'side':this['side']}),_0x26649b=this['buttonViews'];if(_0x22189b['set']({'label':_0xacacd9['label'],'icon':_0xacacd9['icon'],'tooltip':!0x0,'withText':!0x0}),_0x22189b['bind']('isOn')['to'](this,'activeTab',_0x4c0d60=>_0x4c0d60===_0xacacd9['id']),_0x22189b['bind']('side')['to'](this,'side'),_0xacacd9['order']){const _0x3f4ba1=[...this['_tabs']]['reduce']((_0x38543b,_0x1292ee)=>{const _0x137a32=_0x1292ee[0x0],{order:_0x1e9632}=_0x1292ee[0x1];return!_0x1e9632||_0x1e9632>_0xacacd9['order']?_0x38543b:_0x1e9632>=_0x38543b['order']?{'id':_0x137a32,'order':_0x1e9632}:_0x38543b;},{'id':'','order':0x0}),_0x5709bb=_0x26649b['getIndex'](this['_getButton'](_0x3f4ba1['id']));_0x26649b['add'](_0x22189b,_0x5709bb+0x1);}else _0x26649b['add'](_0x22189b);return _0x22189b['on']('execute',()=>{this['activateTab'](_0xacacd9['id']);}),_0x22189b;}}const ni=['overlay','sidebar','custom'],oi=['left','right'];class hi extends ss{constructor(_0x590e57,_0x23826f={}){super(_0x590e57,_0x23826f),this['set']('type',_0x23826f['type']||'sidebar'),this['set']('side',_0x23826f['side']||'right'),this['set']('isVisible',_0x23826f['visibleByDefault']??!0x0);const _0x489093=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x489093['if']('type','ck-ai-tabs__overlay',_0x9b606f=>'overlay'===_0x9b606f),_0x489093['if']('type','ck-ai-tabs__sidebar',_0x3f995d=>'sidebar'===_0x3f995d),_0x489093['if']('isVisible','ck-hidden',_0x134383=>!_0x134383)]}}),this['buttonViews']['on']('add',(_0x47b0eb,_0x53bc85)=>{_0x53bc85['set']('withText',!0x1);});}}class it extends _0x3a5602{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x573600){super(_0x573600);const _0xd7c5dc=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0xd7c5dc)throw new _0x563e6a('ai-tabs-configuration-not-found');if(void 0x0!==_0xd7c5dc['showResizeButton']&&(this['showResizeButton']=_0xd7c5dc['showResizeButton']),'sidebar'!==_0xd7c5dc['type']&&'overlay'!==_0xd7c5dc['type']||_0xd7c5dc['side']&&(this['side']=_0xd7c5dc['side']),'sidebar'===_0xd7c5dc['type']){if(this['container']=_0xd7c5dc['element'],this['set']('type','sidebar'),!this['container'])throw new _0x563e6a('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0xd7c5dc['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===_0xd7c5dc['visibleByDefault']||_0xd7c5dc['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 _0x2cda04&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x11dccf){if(_0x11dccf&&this['type']!==_0x11dccf){if(!ni['includes'](_0x11dccf))throw new _0x563e6a('ai-tabs-unsupported-ui-type');this['type']=_0x11dccf;}}['switchSide'](_0x1a9887){if(_0x1a9887&&this['side']!==_0x1a9887){if(!oi['includes'](_0x1a9887))throw new _0x563e6a('ai-tabs-unsupported-ui-side');this['side']=_0x1a9887;}}['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 tt extends _0x3a5602{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x49cfd7){super(_0x49cfd7),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 _0xc35e13=this['context']['plugins']['get']('CloudServices');if(!_0xc35e13['token'])throw new _0x563e6a('ai-missing-token',this);this['_token']=_0xc35e13['token'];}['startConversation'](_0x26bb6d,_0x203cef){const _0x3f70c7=this['_sendApiRequest']('/conversations','POST',{'id':_0x26bb6d,'group':_0x203cef});return{'getConversation':async()=>(await _0x3f70c7['request'])['json'](),'abortController':_0x3f70c7['abortController']};}['queryAssistant']({message:_0xc8c5bf,conversationId:_0xcca93a,parts:_0x444b62,capabilities:_0x1d439f,model:_0x294a0a,attributes:_0x518071}){const _0x45c84a={'prompt':_0xc8c5bf,'content':_0x444b62,'model':_0x294a0a,..._0x1d439f&&{'capabilities':_0x1d439f},..._0x518071&&{'attributes':_0x518071}},_0x28582b=this['_sendApiRequest']('/conversations/'+_0xcca93a+'/messages','POST',_0x45c84a);return{'getStream':async()=>{const _0x1bca08=(await _0x28582b['request'])['body'];return this['_getStreamReader'](_0x1bca08);},'abortController':_0x28582b['abortController']};}['executeCustomAction']({content:_0x32e4db,message:_0x3777ff,model:_0x4e442d,outputFormat:_0x4853f6}){const _0x175757={'content':[{'type':'text','content':_0x32e4db}],'prompt':_0x3777ff,'model':_0x4e442d,'outputFormat':_0x4853f6},_0x247aa7=this['_sendApiRequest']('/actions/custom/calls','POST',_0x175757);return{'getStream':async()=>{const _0x1c8e9e=(await _0x247aa7['request'])['body'];return this['_getStreamReader'](_0x1c8e9e);},'abortController':_0x247aa7['abortController']};}['executeAction']({actionName:_0x41631d,content:_0x59e4c8,args:_0x58dd13}){const _0x3573a8={'content':[{'type':'text','content':_0x59e4c8}],'args':_0x58dd13},_0xca5197=this['_sendApiRequest']('/actions/system/'+_0x41631d+'/calls','POST',_0x3573a8);return{'getStream':async()=>{const _0x5f323e=(await _0xca5197['request'])['body'];return this['_getStreamReader'](_0x5f323e);},'abortController':_0xca5197['abortController']};}['uploadFile'](_0x19788c,_0x27fcfb,_0x2732f4){const _0x592fa2=new FormData();_0x592fa2['append']('file',_0x27fcfb,_0x27fcfb['name']),_0x2732f4&&_0x592fa2['append']('attributes',JSON['stringify'](_0x2732f4));const _0x174d18=this['_sendApiRequest']('/conversations/'+_0x19788c+'/files','POST',_0x592fa2);return{'getId':async()=>(await _0x174d18['request'])['json'](),'abortController':_0x174d18['abortController']};}['fetchDocument'](_0x10d3d8,_0x5777b7){const _0x3a52cf=this['_sendApiRequest']('/conversations/'+_0x10d3d8+'/documents/'+_0x5777b7,'GET');return{'getDocument':async()=>(await _0x3a52cf['request'])['json'](),'abortController':_0x3a52cf['abortController']};}['uploadDocument'](_0x1f0c83,_0x4b5ef9,_0x33a82e){const _0x2e3d8f={'content':_0x4b5ef9};_0x33a82e&&(_0x2e3d8f['attributes']=_0x33a82e);const _0x30aae6=this['_sendApiRequest']('/conversations/'+_0x1f0c83+'/documents','POST',_0x2e3d8f);return{'getId':async()=>(await _0x30aae6['request'])['json'](),'abortController':_0x30aae6['abortController']};}['fetchConversations'](_0x3109a9,_0x32a693={}){const _0x4823c2=new URLSearchParams();_0x4823c2['append']('group',_0x3109a9),_0x4823c2['append']('excludeEmpty',!0x1!==_0x32a693['excludeEmpty']?'true':'false'),_0x4823c2['append']('limit',_0x32a693['limit']?_0x32a693['limit']['toString']():'100'),_0x4823c2['append']('sortBy',_0x32a693['sortBy']?_0x32a693['sortBy']:'createdAt'),_0x4823c2['append']('order',_0x32a693['order']?_0x32a693['order']:'desc');const _0x2c6d06=this['_sendApiRequest']('/conversations?'+_0x4823c2['toString'](),'GET');return{'getConversations':async()=>{const _0x34e080=await _0x2c6d06['request'];return(await _0x34e080['json']())['items'];},'abortController':_0x2c6d06['abortController']};}['deleteConversation'](_0x5b123e){const _0x26f3bb=this['_sendApiRequest']('/conversations/'+_0x5b123e,'DELETE');return{'execute':async()=>{await _0x26f3bb['request'];},'abortController':_0x26f3bb['abortController']};}['updateConversation'](_0x42be59,_0x182969){const _0x1ae802=this['_sendApiRequest']('/conversations/'+_0x42be59,'PATCH',_0x182969);return{'getResult':async()=>(await _0x1ae802['request'],_0x182969),'abortController':_0x1ae802['abortController']};}['fetchConversation'](_0x5194be){const _0x420e81=this['_sendApiRequest']('/conversations/'+_0x5194be,'GET');return{'getConversation':async()=>(await _0x420e81['request'])['json'](),'abortController':_0x420e81['abortController']};}['fetchConversationMessages'](_0x4b3d3b){const _0x3a75a5=this['_sendApiRequest']('/conversations/'+_0x4b3d3b+'/messages','GET');return{'getMessages':async()=>{const _0x49f619=await _0x3a75a5['request'];return(await _0x49f619['json']())['items'];},'abortController':_0x3a75a5['abortController']};}['uploadUrl'](_0x22a013,_0x5db73a,_0x4ea6f8){const _0x539d23=this['_sendApiRequest']('/conversations/'+_0x22a013+'/web-resources','POST',{'url':_0x5db73a,'attributes':_0x4ea6f8});return{'getId':async()=>(await _0x539d23['request'])['json'](),'abortController':_0x539d23['abortController']};}['getModels'](_0x2d149f='en'){const _0x451f3d=new URLSearchParams();_0x451f3d['append']('language',_0x2d149f);const _0x4252f7='/models/1?'+_0x451f3d['toString'](),_0x85cbe5=this['_sendApiRequest'](_0x4252f7,'GET');return{'list':async()=>await(await _0x85cbe5['request'])['json'](),'abortController':_0x85cbe5['abortController']};}['deleteFile'](_0xfceb9e,_0x4e9981){const _0x48fe67=this['_sendApiRequest']('/conversations/'+_0xfceb9e+'/files/'+_0x4e9981,'DELETE');return{'execute':async()=>{await _0x48fe67['request'];},'abortController':_0x48fe67['abortController']};}['deleteDocument'](_0x3137b5,_0x13f8a9){const _0x48c4f9=this['_sendApiRequest']('/conversations/'+_0x3137b5+'/documents/'+_0x13f8a9,'DELETE');return{'execute':async()=>{await _0x48c4f9['request'];},'abortController':_0x48c4f9['abortController']};}['deleteWebResource'](_0x4f6d3b,_0x5866f6){const _0x4c8da0=this['_sendApiRequest']('/conversations/'+_0x4f6d3b+'/web-resources/'+_0x5866f6,'DELETE');return{'execute':async()=>{await _0x4c8da0['request'];},'abortController':_0x4c8da0['abortController']};}['callSystemReview']({reviewName:_0x45d6be,content:_0x1ad0cf,args:_0x2d3588}){const _0x51a6d1=this['_sendApiRequest']('/reviews/system/'+_0x45d6be+'/calls','POST',{'content':[{'type':'text','content':_0x1ad0cf}],'args':_0x2d3588});return{'getStream':async()=>{const _0x32f0de=(await _0x51a6d1['request'])['body'];return this['_getStreamReader'](_0x32f0de);},'abortController':_0x51a6d1['abortController']};}['callCustomReview']({content:_0xe4f081,prompt:_0x24c8e6,model:_0x2bf851}){const _0xa21c0f=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0xe4f081}],'prompt':_0x24c8e6,'model':_0x2bf851});return{'getStream':async()=>{const _0xf24813=(await _0xa21c0f['request'])['body'];return this['_getStreamReader'](_0xf24813);},'abortController':_0xa21c0f['abortController']};}['upsertAIChatRating'](_0x3e5054,_0x416dba,_0x274757){const _0x10ca93=this['_sendApiRequest']('/conversations/'+_0x3e5054+'/messages/'+_0x416dba+'/ratings','PUT',{'positiveCount':_0x274757['positiveCount'],'totalCount':_0x274757['totalCount'],'modificationId':_0x274757['modificationId']});return{'execute':async()=>{await _0x10ca93['request'];},'abortController':_0x10ca93['abortController']};}['upsertAIActionRating'](_0x5334e0,_0x85f741,_0x3d8a70){const _0x56f32d=this['_sendApiRequest']('/actions/system/'+_0x5334e0+'/calls/'+_0x85f741+'/ratings','PUT',{'positiveCount':_0x3d8a70['positiveCount'],'totalCount':_0x3d8a70['totalCount']});return{'execute':async()=>{await _0x56f32d['request'];},'abortController':_0x56f32d['abortController']};}['upsertCustomAIActionRating'](_0x589ebb,_0x4e6f4c){const _0xb1d43d=this['_sendApiRequest']('/actions/custom/calls/'+_0x589ebb+'/ratings','PUT',{'positiveCount':_0x4e6f4c['positiveCount'],'totalCount':_0x4e6f4c['totalCount']});return{'execute':async()=>{await _0xb1d43d['request'];},'abortController':_0xb1d43d['abortController']};}['upsertAIReviewRating'](_0x2e4e28,_0x8b97f8,_0x151ba7,_0x5a6ae6){const _0x53c00b=this['_sendApiRequest']('/reviews/system/'+_0x2e4e28+'/calls/'+_0x8b97f8+'/ratings','PUT',{'positiveCount':_0x151ba7['positiveCount'],'totalCount':_0x151ba7['totalCount'],'dataId':_0x5a6ae6});return{'execute':async()=>{await _0x53c00b['request'];},'abortController':_0x53c00b['abortController']};}['upsertCustomAIReviewRating'](_0x311d6f,_0x1d982a,_0x34b21d){const _0x5c44d9=this['_sendApiRequest']('/reviews/custom/calls/'+_0x311d6f+'/ratings','PUT',{'positiveCount':_0x1d982a['positiveCount'],'totalCount':_0x1d982a['totalCount'],'dataId':_0x34b21d});return{'execute':async()=>{await _0x5c44d9['request'];},'abortController':_0x5c44d9['abortController']};}['_sendApiRequest'](_0x3df665,_0x2ff277,_0x4927d4){const _0x42b500=new AbortController(),_0x58f4f9=_0x4927d4 instanceof FormData,_0x93aeb1={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x4927d4&&!_0x58f4f9&&(_0x93aeb1['Content-Type']='application/json');const _0x11fbb8={'method':_0x2ff277,'headers':_0x93aeb1,'signal':_0x42b500['signal']};return _0x4927d4&&(_0x11fbb8['body']=_0x58f4f9?_0x4927d4:JSON['stringify'](_0x4927d4)),{'request':fetch(''+this['_apiUrl']+_0x3df665,_0x11fbb8)['catch'](_0x1f70e0=>{this['_handleError'](_0x1f70e0);})['then'](_0x5ea8fc=>_0x5ea8fc['ok']?_0x5ea8fc:_0x5ea8fc['json']()['then'](_0x369fec=>{throw{'url':this['_apiUrl'],'path':_0x3df665,'method':_0x2ff277,'body':_0x4927d4,'status':(_0x5ea8fc||{})['status'],'statusText':(_0x5ea8fc||{})['statusText'],'code':_0x369fec['code'],'message':_0x369fec['message'],'traceId':_0x369fec['traceId']};})),'abortController':_0x42b500};}async*['_getStreamReader'](_0x15ae6e){const _0x5df930=[],_0xe67a54=_0x15ae6e['getReader'](),_0x7c836c=$t({'onError':_0x59ce7d=>{this['_handleError'](_0x59ce7d);},'onEvent':_0xff1d32=>{_0xff1d32['data']=JSON['parse'](_0xff1d32['data']),_0x5df930['push'](_0xff1d32);}});try{let _0x11de79=!0x1;for(;!_0x11de79;){const {done:_0x2d1fa4,value:_0xdc1800}=await _0xe67a54['read']();_0x2d1fa4&&(_0x11de79=!0x0),_0x7c836c['feed'](this['_decoder']['decode'](_0xdc1800,{'stream':!0x0})),yield*_0x5df930,_0x5df930['length']=0x0;}}catch(_0xb0df63){this['_handleError'](_0xb0df63);}finally{_0xe67a54['releaseLock'](),_0x7c836c['reset']();}}['_handleError'](_0x551951){if(_0x551951 instanceof _0x563e6a)throw _0x551951;if(_0x551951 instanceof Error&&'AbortError'===_0x551951['name'])throw new _0x563e6a('ai-request-aborted',this,{'originalError':_0x551951});throw new _0x563e6a('ai-request-failed',this,{'originalError':_0x551951});}}function i(_0x11a33f,_0xe77c5b,_0x41c25d){const t=_0x11a33f['t'];switch(_0xe77c5b){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'},_0x41c25d);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.'},_0x41c25d);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.'},_0x41c25d);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.'},_0x41c25d);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'},_0x41c25d);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x41c25d);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'},_0x41c25d);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.'},_0x41c25d);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.'},_0x41c25d);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.'},_0x41c25d);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.'},_0x41c25d);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'},_0x41c25d);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.'},_0x41c25d);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 _0xe77c5b;}}function us(_0x2c2328,_0x54021a){const _0x59d36c=new _0x2cf640(_0x2c2328),_0x5d414e=i(_0x2c2328,'AI_TABS_LABEL_MINIMIZE'),_0x3c522a=i(_0x2c2328,'AI_TABS_LABEL_MAXIMIZE');return _0x59d36c['set']({'withText':!0x1,'icon':_0x3ff106,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0x59d36c['bind']('label')['to'](_0x54021a,'isMaximized',_0x1441fd=>_0x1441fd?_0x5d414e:_0x3c522a),_0x59d36c['bind']('icon')['to'](_0x54021a,'isMaximized',_0x32be05=>_0x32be05?_0x2e4568:_0x3ff106),_0x59d36c['bind']('isOn')['to'](_0x54021a,'isMaximized'),_0x59d36c['on']('execute',()=>{_0x54021a['fire']('resizeTabs');}),_0x59d36c;}function Wi(_0x3eddf8){return _0x4b17c9(_0x3eddf8);}function pt(_0x3aec94){return _0x17e525(_0x3aec94);}function It(_0x56014a,_0x21164e,_0x2eca3c){const _0x222191=null!==_0x21164e?_0x5979a0=>_0x5979a0['attribs'][_0x56014a]===_0x21164e:_0xe8824a=>Boolean(_0xe8824a['attribs'][_0x56014a]);return gt(_0x29e9b4=>_0x40e032(_0x29e9b4)&&_0x222191(_0x29e9b4),_0x2eca3c);}function Qi(_0x332aec,_0x78b9f1,_0x54b192){const _0x4720ec=null!==_0x78b9f1?_0x40a9f7=>_0x40a9f7['attribs'][_0x332aec]===_0x78b9f1:_0x2a75df=>Boolean(_0x2a75df['attribs'][_0x332aec]);return _0x4c7e33(_0x814e4a=>_0x40e032(_0x814e4a)&&_0x4720ec(_0x814e4a),_0x54b192);}function ut(_0x2ca81e,_0x41661a){return _0x2ca81e&&_0x40e032(_0x2ca81e)?_0x2ca81e['attribs'][_0x41661a]:null;}function Is(_0x114e87,_0x40e0f7,_0x4e3174){_0x40e032(_0x114e87)&&(null===_0x4e3174?delete _0x114e87['attribs'][_0x40e0f7]:_0x114e87['attribs'][_0x40e0f7]=_0x4e3174);}function $i(_0x3eac8a,_0x201e9d,_0x553415){const _0x21af26=_0x201e9d['cloneNode'](!0x0);'beforebegin'===_0x553415?_0x4856b5(_0x3eac8a,_0x21af26):'afterbegin'===_0x553415?_0x8342b6(_0x3eac8a,_0x21af26):'beforeend'===_0x553415?_0xadca60(_0x3eac8a,_0x21af26):'afterend'===_0x553415&&_0x43ba66(_0x3eac8a,_0x21af26);}function Ui(_0x3449d6){const _0x3e2ad6=[];let _0x2d5087=_0x3449d6;for(;_0x2d5087;)_0x2d5087=_0x4708b7(_0x2d5087),_0x2d5087&&_0x3e2ad6['push'](_0x2d5087);return _0x3e2ad6;}function Kn(_0x2f0eb1){return _0x2f0eb1['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function vs(_0x1e58f3){let _0x5ee200=0x0;for(;_0x1e58f3['parentNode'];)_0x1e58f3=_0x1e58f3['parentNode'],_0x5ee200++;return _0x5ee200;}function xs(_0x252524){const _0x5a2fcd=[];let _0x54dba4=_0x252524['nextSibling'];for(;_0x54dba4;)_0x5a2fcd['push'](_0x54dba4),_0x54dba4=_0x54dba4['nextSibling'];_0x5a2fcd['forEach'](_0x46d1e6=>{_0x12acc3(_0x46d1e6);});}class Fi extends/* #__PURE__ -- @preserve */
25
- ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x499648();}['convertMarkdownToHTML'](_0x28db4e){const _0x190723=this['_m2html']['parse'](_0x28db4e);return this['parseAndNormalizeHTML'](_0x190723);}['parseAndNormalizeHTML'](_0x4671e1){return this['_parseHTML'](_0x4671e1);}['_parseHTML'](_0xb3e774){const _0x43e238=Wi('<dummy>'+_0xb3e774['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x43e238['children']=_0x43e238['children'][0x0]['children'],_0x43e238;}}class Ji extends/* #__PURE__ -- @preserve */
26
- ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x444254){super(),this['_generateUid']=_0x444254||_0x48eb5e;}['merge'](_0x51359e,_0x5b5a1f,_0x1b1b56){const _0x4316af=_0x51359e['cloneNode'](!0x0);if(0x0===_0x5b5a1f['childNodes']['length']){const _0x5a7284=[];return Qi('data-id','new-element',_0x4316af)['forEach'](_0x4f0229=>{const _0x3eaff5=this['_generateUid']();Is(_0x4f0229,'data-id',_0x3eaff5),_0x5a7284['push'](_0x3eaff5);}),this['_removeSpecialComments'](_0x4316af),{'parsedContent':_0x4316af,'newNodeIds':_0x5a7284,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x1b1b56&&_0x1b1b56['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x4316af),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Qi('data-id',null,_0x5b5a1f)['map'](_0x37b48b=>ut(_0x37b48b,'data-id'))['filter'](_0x3133f6=>!!_0x3133f6));let _0xbd8b1a=-0x1,_0x3240a4=!0x1;const _0x412d70=_0x4316af['childNodes'],_0x6f2399=Array['from'](_0x412d70)['filter'](_0x1b817e=>!(0x3===_0x1b817e['nodeType']&&''===pt(_0x1b817e)['trim']())),_0x506f59=_0x6f2399['length'];for(let _0x3818dc=0x0;_0x3818dc<_0x506f59;_0x3818dc++){const _0xf91065=_0x6f2399[_0x3818dc],_0x1fbd6e=_0x6f2399[_0x3818dc+0x1];if(this['_isNewNode'](_0xf91065)){if(-0x1===_0xbd8b1a&&(_0xbd8b1a=_0x3818dc),this['_markWrappedElements'](_0xf91065),!this['_isNewNode'](_0x1fbd6e)){const [_0x5baac6,_0x4465b0]=this['_findReferenceNode'](_0xf91065,_0x3240a4,_0x5b5a1f);if(_0x5baac6){const _0xd79d=Array['from'](_0x6f2399)['slice'](_0xbd8b1a,_0x3818dc+0x1);this['_insertNodes'](_0x5baac6,_0xd79d,_0x4465b0),_0xbd8b1a=-0x1;}}}else{if(this['_isExistingContentComment'](_0xf91065))_0x3240a4=!0x0;else{if(this['_isExistingNode'](_0xf91065)){const _0x4ec327=ut(_0xf91065,'data-id');if(_0x4ec327&&this['_existingDataIds']['has'](_0x4ec327)){const _0x45f949=It('data-id',_0x4ec327,_0x5b5a1f);this['_replaceNode'](_0x45f949,_0xf91065);}if(this['_touchedNodesState']['removedIds']['includes'](_0x4ec327)){const _0x27a872=this['_touchedNodesState']['removedIds']['indexOf'](_0x4ec327);this['_touchedNodesState']['removedIds']['splice'](_0x27a872,0x1);}}else{if(this['_isDelNode'](_0xf91065)){const _0xfdec83=ut(_0xf91065,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0xfdec83)||this['_storeDeletedElementIds'](_0xf91065);}}}}}for(const _0x1c74f2 of this['_touchedNodesState']['removedIds']){const _0x1f9827=It('data-id',_0x1c74f2,_0x5b5a1f);if(_0x1f9827){if(_0x1b1b56&&_0x1b1b56['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x1c74f2;const _0x1cc63d=_0x1b1b56['replaceRemovedWith']['cloneNode'](!0x0);Is(_0x1cc63d,'data-id',_0x1c74f2),Is(_0x1cc63d,'data-removed','true'),_0xd8634b(_0x1f9827,_0x1cc63d);}else _0x12acc3(_0x1f9827);}}if(Qi('data-wrapped-id',null,_0x5b5a1f)['forEach'](_0x104868=>{const _0x1b6324=It('data-id',ut(_0x104868,'data-wrapped-id'),_0x5b5a1f);var _0xbd90aa,_0x489877;_0x1b6324&&(_0x489877=_0x104868,_0x12acc3(_0xbd90aa=_0x1b6324),_0xd8634b(_0x489877,_0xbd90aa));}),Qi('data-id','new-element',_0x5b5a1f)['forEach'](_0x197f2b=>{const _0x3d2b82=this['_getUid'](_0x197f2b);Is(_0x197f2b,'data-id',_0x3d2b82),this['_touchedNodesState']['newIds']['push'](_0x3d2b82);}),this['_removeSpecialComments'](_0x5b5a1f),_0x1b1b56&&_0x1b1b56['markUnstableElements']&&this['_markUnstableElements'](_0x5b5a1f,_0x1b1b56['markUnstableElementsDepth']||0x0),_0x1b1b56&&_0x1b1b56['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x47161e=It('data-id',this['_touchedNodesState']['lastTouchedId'],_0x5b5a1f);for(;_0x47161e;)xs(_0x47161e),_0x47161e=_0x47161e['parentNode'];}return{'parsedContent':_0x5b5a1f,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x263e13,_0x49c2d0,_0x24c2ff){for(const _0xa83ace of _0x49c2d0){const _0xbbba25=this['_getUid'](_0xa83ace);Is(_0xa83ace,'data-id',_0xbbba25),this['_touchedNodesState']['newIds']['push'](_0xbbba25),this['_touchedNodesState']['lastTouchedId']=_0xbbba25;}const _0x2ec5fe='afterbegin'===_0x24c2ff||'afterend'===_0x24c2ff?_0x49c2d0['reverse']():_0x49c2d0;for(const _0x4f4cfc of _0x2ec5fe)$i(_0x263e13,_0x4f4cfc,_0x24c2ff);}['_replaceNode'](_0x421a87,_0x2c43d5){if(!_0x421a87)return;if(_0x32badd=_0x2c43d5,Kn(pt(_0x421a87))===Kn(pt(_0x32badd)))return;var _0x32badd;const _0x1995a6=this['_getUid'](_0x421a87);Is(_0x2c43d5,'data-id',_0x1995a6),this['_touchedNodesState']['modifiedIds']['push'](_0x1995a6),this['_touchedNodesState']['lastTouchedId']=_0x1995a6,_0xd8634b(_0x421a87,_0x2c43d5['cloneNode'](!0x0));}['_findReferenceNode'](_0x2f6777,_0x9845ed,_0x25f21d){const _0x29b60c=this['_findPrevElementWithDataId'](_0x2f6777,!0x1);if(_0x29b60c){const _0x3863c7=this['_getNodeDataId'](_0x29b60c),_0x30e34a=It('data-id',_0x3863c7,_0x25f21d);if(_0x30e34a)return[_0x30e34a,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x3863c7);}const _0x510d8b=this['_findNextElementWithDataId'](_0x2f6777,!0x1);if(_0x510d8b){const _0x52e680=this['_getNodeDataId'](_0x510d8b),_0x254a75=It('data-id',_0x52e680,_0x25f21d);if(_0x254a75)return[_0x254a75,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x52e680);}return _0x9845ed?_0x2f6777['nextSibling']?this['_findFallbackReferenceNode'](_0x2f6777,_0x25f21d):[_0x25f21d['childNodes'][_0x25f21d['childNodes']['length']-0x1],'afterend']:[_0x25f21d['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x3ca457,_0xb5f1f0){const _0x2f78b0=[],_0x3e00cf=this['_findPrevElementWithDataId'](_0x3ca457,!0x0);if(_0x3e00cf){const _0x48efa8=It('data-id',this['_getNodeDataId'](_0x3e00cf),_0xb5f1f0);_0x48efa8&&_0x2f78b0['push']([_0x48efa8,'afterend']);}const _0x568523=this['_findNextElementWithDataId'](_0x3ca457,!0x0);if(_0x568523){const _0x4d9162=It('data-id',this['_getNodeDataId'](_0x568523),_0xb5f1f0);_0x4d9162&&_0x2f78b0['push']([_0x4d9162,'beforebegin']);}if(_0x2f78b0['length']>0x1)return vs(_0x2f78b0[0x0][0x0])<=vs(_0x2f78b0[0x1][0x0])?_0x2f78b0[0x0]:_0x2f78b0[0x1];return 0x1===_0x2f78b0['length']?_0x2f78b0[0x0]:[_0xb5f1f0['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x5ebc99,_0x5142a4){let _0x575e35=_0x5ebc99['nextSibling'],_0x5d41fb=null,_0x3e9d44=!0x1;for(;_0x575e35;){if(_0x38b3c0(_0x575e35)){if(this['_isDelNode'](_0x575e35)&&(_0x5d41fb=_0x575e35),this['_isExistingContentComment'](_0x575e35)&&_0x5142a4&&!_0x3e9d44){_0x3e9d44=!0x0,_0x575e35=_0x575e35['nextSibling'];continue;}break;}const _0x184ba5=ut(_0x575e35,'data-id');if(_0x184ba5&&'new-element'!==_0x184ba5&&this['_existingDataIds']['has'](_0x184ba5)){_0x5d41fb=_0x575e35;break;}_0x575e35=_0x575e35['nextSibling'];}return _0x5d41fb;}['_findPrevElementWithDataId'](_0xdcc989,_0x5e4108){let _0x1b5dbf=_0xdcc989['previousSibling'],_0x2b844d=null,_0x3852f8=!0x1;for(;_0x1b5dbf;){if(_0x38b3c0(_0x1b5dbf)){if(this['_isDelNode'](_0x1b5dbf)&&(_0x2b844d=_0x1b5dbf),this['_isExistingContentComment'](_0x1b5dbf)&&_0x5e4108&&!_0x3852f8){_0x3852f8=!0x0,_0x1b5dbf=_0x1b5dbf['previousSibling'];continue;}break;}const _0x2e1c3b=ut(_0x1b5dbf,'data-id');if(_0x2e1c3b&&'new-element'!==_0x2e1c3b&&this['_existingDataIds']['has'](_0x2e1c3b)){_0x2b844d=_0x1b5dbf;break;}_0x1b5dbf=_0x1b5dbf['previousSibling'];}return _0x2b844d;}['_markWrappedElements'](_0x2d0bf0){_0x40e032(_0x2d0bf0)&&Qi('data-id',null,_0x2d0bf0)['forEach'](_0xd3fbc1=>{this['_isExistingNode'](_0xd3fbc1)&&!this['_hasWrappedParent'](_0xd3fbc1)&&(Is(_0xd3fbc1,'data-wrapped-id',ut(_0xd3fbc1,'data-id')),Is(_0xd3fbc1,'data-id',null));});}['_getNodeDataId'](_0x2c6d31){if(!_0x2c6d31)return null;if(_0x40e032(_0x2c6d31))return ut(_0x2c6d31,'data-id');if(_0x38b3c0(_0x2c6d31)){const _0x4ad792=pt(_0x2c6d31)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x4ad792&&_0x4ad792[0x1])return _0x4ad792[0x1];}return null;}['_storeDeletedElementIds'](_0x5b34d3){if(_0x38b3c0(_0x5b34d3)){const _0x220144=pt(_0x5b34d3)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x220144&&_0x220144[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x220144[0x1]);}}['_getUid'](_0x2d3d4f){return this['_isExistingNode'](_0x2d3d4f)?ut(_0x2d3d4f,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x3bf488){(function(_0x939eab){return _0x284730(_0x16c7f8=>_0x38b3c0(_0x16c7f8),_0x939eab,!0x0,0x1/0x0);}(_0x3bf488)['filter'](_0x357b05=>this['_isDelNode'](_0x357b05)||this['_isExistingContentComment'](_0x357b05))['forEach'](_0x2fae43=>{_0x12acc3(_0x2fae43);}));}['_markLastTagElementUnstable'](_0x268821){const _0x54f92e=_0x268821['childNodes'],_0x28137b=_0x54f92e[_0x54f92e['length']-0x1];_0x28137b&&_0x40e032(_0x28137b)&&Is(_0x28137b,'data-unstable','true');}['_markUnstableElements'](_0x300a11,_0x547398){const _0xbad882=It('data-unstable','true',_0x300a11);if(!_0xbad882)return;const _0x326c17=Ui(_0xbad882)['slice'](0x0,-0x1),_0x1c3043=_0x326c17['length'];let _0x46c3a8=_0xbad882;if(_0x1c3043>_0x547398){let _0x248bc7=_0x1c3043,_0x93bb74=null;for(;_0x248bc7>_0x547398&&_0x248bc7>=0x0;)_0x248bc7--,_0x93bb74=_0x326c17[_0x248bc7];_0x93bb74&&(_0x46c3a8=_0x93bb74,Is(_0xbad882,'data-unstable',null),Is(_0x93bb74,'data-unstable','true'));}else{if(_0x1c3043<_0x547398){let _0x20b96b=_0x1c3043,_0x3ff617=_0xbad882;for(;_0x20b96b<_0x547398;){const _0xa8a0a0=_0x3ff617['childNodes']['filter'](_0x18457b=>_0x40e032(_0x18457b));if(0x0===_0xa8a0a0['length'])break;_0x20b96b++,_0x3ff617=_0xa8a0a0[_0xa8a0a0['length']-0x1];}_0x3ff617&&(_0x46c3a8=_0x3ff617,Is(_0xbad882,'data-unstable',null),Is(_0x3ff617,'data-unstable','true'));}}let _0x463150=_0x46c3a8;for(;_0x463150;){for(;_0x463150['nextSibling'];)_0x463150=_0x463150['nextSibling'],_0x40e032(_0x463150)&&Is(_0x463150,'data-unstable','true');_0x463150=_0x463150['parentNode'];}}['_isNewNode'](_0x4dce4a){return Boolean('new-element'===ut(_0x4dce4a,'data-id'));}['_isExistingNode'](_0x15ffc8){return Boolean((ut(_0x15ffc8,'data-id')||'')['length']>0x0&&'new-element'!==ut(_0x15ffc8,'data-id'));}['_isDelNode'](_0x11706b){return!!_0x11706b&&Boolean(_0x38b3c0(_0x11706b)&&pt(_0x11706b)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x18b31a){let _0x498d06=_0x18b31a['parentNode'];for(;_0x498d06;){if(ut(_0x498d06,'data-wrapped-id'))return!0x0;_0x498d06=_0x498d06['parentNode'];}return!0x1;}['_isExistingContentComment'](_0xd12672){return Boolean(_0x38b3c0(_0xd12672)&&pt(_0xd12672)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function wt({editor:_0x3fb891,changeGroups:_0x4b6bcb,documentContextContent:_0x25dfd8,showDiff:_0x1a9666,trimUnchanged:_0x3b4e7f=!0x0}){return _0x4b6bcb['map'](_0x71fcc4=>{const _0x3c1937=new _t([]),_0x2807d9=new _t([]);for(const _0x7e67ca of _0x71fcc4['changes'])if(_0x1a9666&&'removed'==_0x7e67ca['type']||_0x2807d9['children']['push'](_0x7e67ca['node']['cloneNode'](!0x0)),'new'!=_0x7e67ca['type']&&(_0x1a9666||'removed'!=_0x7e67ca['type'])){const _0x55589e=gt(_0x1cf36a=>ut(_0x1cf36a,'data-id')==_0x7e67ca['id'],_0x25dfd8,!0x0);_0x55589e&&_0x3c1937['children']['push'](_0x55589e['cloneNode'](!0x0));}const {content:_0x334843,hasChanges:_0x1ad524}=function(_0x3c6595,_0x95681b,_0x330388,_0x30128a,_0x24fb93=!0x0){const _0x4c371c=_0x3c6595['plugins']['get']('DocumentCompare'),_0xf22bef=pt(_0x95681b),_0xdadee1=pt(_0x330388),_0x6544ae=_0x3c6595['data']['parse'](_0xf22bef,'$root'),_0x2af3e9=_0x3c6595['model']['createPositionAt'](_0x6544ae,0x0),_0x504f1b=_0x4c371c['getDiff'](_0xf22bef,_0xdadee1,{'anchor':_0x2af3e9,'markDeletions':_0x30128a}),_0x555e0a=_0x504f1b['getOperations']();if(0x0==_0x555e0a['length'])return{'content':_0x95681b['cloneNode'](!0x0),'hasChanges':!0x1};_0x30128a?function(_0x223b12,_0x565a93,_0x555cd3){if(0x0==_0x223b12['length'])return;const _0x5c262b=_0x555cd3['plugins']['get']('DocumentCompare'),_0x1ec3ee=_0x555cd3['plugins']['get']('SuggestionsConversion');_0x555cd3['model']['change'](_0xb3a9e6=>{const _0x497150=new Set();for(let _0x56f2e0=0x0;_0x56f2e0<_0x223b12['length'];_0x56f2e0++){const _0x19a031=_0x223b12[_0x56f2e0];if(_0x19a031['baseVersion']=null,_0x19a031['isDocumentOperation']=!0x1,_0x5c262b['isMarkedRemoveOperation'](_0x19a031)){const _0x4f9f97=_0x5df738(_0x19a031['newRange'],_0x555cd3['model']),_0x3b7c6c='suggestion:deletion:'+_0x48eb5e()+':$aiSuggestion';_0x565a93['markers']['set'](_0x3b7c6c,_0x4f9f97);}else switch(_0x19a031['type']){case'rename':{if(_0x19a031['oldName']==_0x19a031['newName'])break;_0xb3a9e6['batch']['addOperation'](_0x19a031),_0x555cd3['model']['applyOperation'](_0x19a031);const _0x535147='$elementName',_0x4e8d30=_0x19a031['position'],_0x23c40b=_0x555cd3['model']['createRange'](_0x4e8d30,_0x555cd3['model']['createPositionAt'](_0x4e8d30['nodeAfter'],'end')),_0xcf177a='suggestion:attribute:'+_0x535147+':'+_0x48eb5e()+':$aiSuggestion';_0x565a93['markers']['set'](_0xcf177a,_0x23c40b);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x19a031['oldValue']==_0x19a031['newValue'])break;_0xb3a9e6['batch']['addOperation'](_0x19a031),_0x555cd3['model']['applyOperation'](_0x19a031);const _0x55f8b8=_0x19a031['key'];if(!_0x1ec3ee['isRegisteredAttribute'](_0x55f8b8))break;const _0x22b201=_0x5df738(_0x19a031['range'],_0x555cd3['model']),_0x1eb97e='suggestion:attribute:'+_0x55f8b8+':'+_0x48eb5e()+':$aiSuggestion';_0x565a93['markers']['set'](_0x1eb97e,_0x22b201);break;}case'insert':{_0xb3a9e6['batch']['addOperation'](_0x19a031),_0x555cd3['model']['applyOperation'](_0x19a031);if(_0x223b12[_0x56f2e0+0x1]&&'move'==_0x223b12[_0x56f2e0+0x1]['type']){no(_0x565a93,_0x19a031);break;}const _0x10e704=_0x19a031['position'],_0x3bef1f=_0x19a031['howMany'],_0x59d9d0=_0x5df738(_0x555cd3['model']['createRange'](_0x10e704,_0x10e704['getShiftedBy'](_0x3bef1f)),_0x555cd3['model']),_0x37bf3f='suggestion:insertion:'+_0x48eb5e()+':$aiSuggestion';_0x565a93['markers']['set'](_0x37bf3f,_0x59d9d0);break;}case'split':{_0xb3a9e6['batch']['addOperation'](_0x19a031),_0x555cd3['model']['applyOperation'](_0x19a031);const _0x19046f=_0x19a031['splitPosition'],_0x192eb0=_0x19a031['moveTargetPosition'],_0x23381a=_0x555cd3['model']['createRange'](_0x19046f,_0x192eb0),_0x20d4cc='suggestion:insertion:'+_0x48eb5e()+':$aiSuggestion';_0x565a93['markers']['set'](_0x20d4cc,_0x23381a);break;}case'move':{_0xb3a9e6['batch']['addOperation'](_0x19a031),_0x555cd3['model']['applyOperation'](_0x19a031),_0x223b12[_0x56f2e0-0x1]&&'insert'==_0x223b12[_0x56f2e0-0x1]['type']&&no(_0x565a93,_0x19a031);const _0x52f4ce=_0x19a031['getMovedRangeStart'](),_0x3a0dca=_0x19a031['howMany'];for(let _0x3e897c=0x0;_0x3e897c<_0x3a0dca;_0x3e897c++){const _0x5f1a9c=_0x52f4ce['getShiftedBy'](_0x3e897c)['nodeAfter'];_0x497150['add'](_0x5f1a9c);}break;}case'remove':{const _0x70d7fa=_0x19a031['sourcePosition'],_0x5bf048=_0x19a031['howMany'],_0x15b9f7=new lt(_0x70d7fa,_0x5bf048);_0xb3a9e6['batch']['addOperation'](_0x15b9f7),_0x555cd3['model']['applyOperation'](_0x15b9f7);break;}}}for(const _0x9bca56 of _0x497150){const _0x4d28d6=_0x555cd3['model']['createRangeOn'](_0x9bca56),_0x28d5c9='suggestion:formatBlock:$fakeWrap:'+_0x48eb5e()+':$aiSuggestion';_0x565a93['markers']['set'](_0x28d5c9,_0x5df738(_0x4d28d6,_0x555cd3['model']));}});}(_0x555e0a,_0x6544ae,_0x3c6595):_0x3c6595['model']['change'](_0x26be09=>{for(const _0x151ea2 of _0x555e0a)if('remove'==_0x151ea2['type']){const _0x12564c=_0x151ea2['sourcePosition'],_0x46ed75=_0x151ea2['howMany'],_0x5b7987=new lt(_0x12564c,_0x46ed75);_0x26be09['batch']['addOperation'](_0x5b7987),_0x3c6595['model']['applyOperation'](_0x5b7987);}else{if('marker'==_0x151ea2['type']){const _0x3f2adb=_0x151ea2['name'],_0x10a1da=_0x151ea2['newRange'];null!==_0x10a1da?_0x6544ae['markers']['set'](_0x3f2adb,_0x10a1da):_0x6544ae['markers']['delete'](_0x3f2adb);}else _0x151ea2['baseVersion']=null,_0x151ea2['isDocumentOperation']=!0x1,_0x26be09['batch']['addOperation'](_0x151ea2),_0x3c6595['model']['applyOperation'](_0x151ea2);}});if(_0x24fb93){const _0x5b4c87=ct(_0x3c6595,_0x555e0a,_0x6544ae);ht(_0x3c6595['model'],_0x5b4c87),function(_0x4e32a4,_0x451619){const _0x12337f=_0x451619['getFirstRange']()['start'];let _0x74eea7=_0x451619['getFirstRange']()['end'];const _0x1bb5f7=_0x12337f['root'];(_0x74eea7['textNode']||_0x74eea7['nodeAfter']&&_0x74eea7['nodeAfter']['is']('$text'))&&(_0x296e10(_0x74eea7,'...'),_0x74eea7=_0x74eea7['getShiftedBy'](0x3)),(_0x12337f['textNode']||_0x12337f['nodeBefore']&&_0x12337f['nodeBefore']['is']('$text'))&&(_0x296e10(_0x12337f,'...'),function(_0xbb9cb,_0x6f8814,_0x58d446){for(let [_0x58eedd,_0x6de8b7]of _0xbb9cb['markers']){const _0x4311a9=_0x6de8b7['_getTransformedByInsertion'](_0x6f8814,_0x58d446,!0x1);_0x6de8b7=_0x4311a9[0x0],_0xbb9cb['markers']['set'](_0x58eedd,_0x6de8b7);}}(_0x1bb5f7,_0x12337f,0x3),_0x12337f['parent']==_0x74eea7['parent']&&(_0x74eea7=_0x74eea7['getShiftedBy'](0x3)));const _0x2bf604=_0x4e32a4['createRange'](_0x4e32a4['createPositionAt'](_0x1bb5f7,0x0),_0x12337f),_0x1b22a9=_0x4e32a4['createRange'](_0x74eea7,_0x4e32a4['createPositionAt'](_0x1bb5f7,'end')),_0x4f64df=[..._0x2bf604['getMinimalFlatRanges'](),..._0x1b22a9['getMinimalFlatRanges']()];_0x4f64df['reverse']();for(const _0x23226d of _0x4f64df)to(_0x23226d),Yn(_0x1bb5f7,_0x23226d);}(_0x3c6595['model'],_0x5b4c87);}const _0x1b72b7=_0x3c6595['data']['stringify'](_0x6544ae,{'showSuggestionHighlights':!0x0});return{'content':Wi(_0x1b72b7),'hasChanges':!0x0};}(_0x3fb891,_0x3c1937,_0x2807d9,_0x1a9666,_0x3b4e7f);return{'type':_0x71fcc4['changes'][0x0]['type'],'index':_0x71fcc4['index'],'content':_0x334843,'hasChanges':_0x1ad524};});}function no(_0x24257e,_0x1f2de5){for(const [_0x48ea29,_0x2a2d85]of _0x24257e['markers']){const _0x1f82a5=dt['_createFromRanges'](_0x2a2d85['getTransformedByOperation'](_0x1f2de5));_0x24257e['markers']['set'](_0x48ea29,_0x1f82a5);}}function ct(_0x229fba,_0x5219f9,_0x31406){const _0x1d9b3e=_0x229fba['plugins']['get']('DocumentCompare');let _0x13dcbb=_0x229fba['model']['createPositionAt'](_0x31406,Number['POSITIVE_INFINITY']),_0x3de301=_0x229fba['model']['createPositionAt'](_0x31406,0x0);for(const _0x1b4109 of _0x5219f9){let _0x467c4a,_0x499346;if(_0x1d9b3e['isMarkedRemoveOperation'](_0x1b4109))_0x467c4a=_0x1b4109['newRange']['start'],_0x499346=_0x1b4109['newRange']['end'];else switch(_0x13dcbb=_0x13dcbb['getTransformedByOperation'](_0x1b4109),_0x3de301=_0x3de301['getTransformedByOperation'](_0x1b4109),_0x1b4109['type']){case'rename':_0x467c4a=_0x1b4109['position'],_0x499346=_0x467c4a['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x467c4a=_0x1b4109['range']['start'],_0x499346=_0x1b4109['range']['end'];break;case'insert':_0x467c4a=_0x1b4109['position'],_0x499346=_0x467c4a['getShiftedBy'](_0x1b4109['howMany']);break;case'split':_0x467c4a=_0x1b4109['splitPosition'],_0x499346=_0x1b4109['moveTargetPosition'];break;case'merge':{const _0x4ed64e=_0x1b4109['targetPosition']['path']['slice'](0x0,-0x1);_0x467c4a=_0x229fba['model']['createPositionFromPath'](_0x31406,_0x4ed64e),_0x499346=_0x467c4a['getShiftedBy'](0x1);break;}case'remove':{const _0x164baa=_0x1b4109['howMany'],_0x3014fe=_0x1b4109['sourcePosition']['_getTransformedByInsertion'](_0x1b4109['targetPosition'],_0x164baa),_0xd7086d=_0x1b4109['getMovedRangeStart']();'remove'==_0x1b4109['type']?(_0x467c4a=_0x3014fe,_0x499346=_0x3014fe):(_0x467c4a=_0xd7086d,_0x499346=_0xd7086d['getShiftedBy'](_0x164baa));break;}}_0x467c4a&&_0x467c4a['isBefore'](_0x13dcbb)&&(_0x13dcbb=_0x467c4a['clone'](),_0x13dcbb['stickiness']='toNone'),_0x499346&&_0x499346['isAfter'](_0x3de301)&&(_0x3de301=_0x499346['clone'](),_0x3de301['stickiness']='toNone');}return _0x229fba['model']['createSelection'](_0x229fba['model']['createRange'](_0x13dcbb,_0x3de301));}function ht(_0x5bd301,_0x171f08){ro(_0x5bd301,_0x171f08,'forward');const _0xb512a3=_0x171f08['getFirstRange']();_0x171f08['setTo']([]),_0x171f08['setTo'](_0xb512a3,{'backward':!0x0}),ro(_0x5bd301,_0x171f08,'backward');}function ro(_0x3b75f3,_0x4a4f7a,_0x4716b4){let _0x37ee6a=0x14;for(;_0x37ee6a;){_0x3b75f3['modifySelection'](_0x4a4f7a,{'unit':'word','direction':_0x4716b4}),_0x37ee6a--;const _0x3d02ed=_0x4a4f7a['focus']['forward'==_0x4716b4?'nodeBefore':'nodeAfter'];if(_0x3d02ed&&_0x3d02ed['is']('element')&&_0x3b75f3['schema']['isBlock'](_0x3d02ed)&&_0x3b75f3['schema']['isObject'](_0x3d02ed))break;}}function Yn(_0x7d3e21,_0x9e7cfe){for(const [_0x2d2090,_0x4ccfc5]of _0x7d3e21['markers']){const _0x2f9030=_0x4ccfc5['_getTransformedByDeletion'](_0x9e7cfe['start'],_0x9e7cfe['end']['offset']-_0x9e7cfe['start']['offset']);null!=_0x2f9030?_0x7d3e21['markers']['set'](_0x2d2090,_0x2f9030):_0x7d3e21['markers']['delete'](_0x2d2090);}}class xi extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _t([]);['parsedMergedContent']=new _t([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x570abe,content:_0x2345be='',isDone:_0xab0a6f=!0x1,interactionId:_0xbe2081,areActionsDisabled:_0x2a2766,documentContextContent:_0x2cf07c,editor:_0x3f0487,id:_0x357ef5}){super(),this['id']=_0x357ef5||_0x48eb5e(),this['interactionId']=_0xbe2081,this['type']=_0x570abe,this['areActionsDisabled']=!!_0x2a2766,this['editor']=_0x3f0487,this['aiResponseParser']=new Fi(),this['aiResponseApplier']=new Ji(),this['documentContextContent']=Wi(_0x2cf07c||''),this['set']('isDone',_0xab0a6f),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x2345be);}['appendContent'](_0x5fed21){this['set']('content',this['content']+_0x5fed21);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x5b0a49,_0x268473){this['changeGroups'][_0x5b0a49]['state']=_0x268473,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x5b0a49,'state':_0x268473});}['getContentParts']({showDiff:_0xdccea2,groupIndex:_0x2dd445}){if(!this['editor'])throw new _0x563e6a('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x1ff6ea=this['_getCachedContentParts'](_0xdccea2,_0x2dd445);if(_0x1ff6ea)return _0x1ff6ea;let _0x53688f=[];if(void 0x0===_0x2dd445)_0x53688f=this['changeGroups'];else{const _0x14ef30=this['changeGroups']['find'](({index:_0x11bd95})=>_0x11bd95===_0x2dd445);if(!_0x14ef30)throw new _0x563e6a('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x2dd445});_0x53688f=[_0x14ef30];}const _0x71480b=wt({'editor':this['editor'],'showDiff':_0xdccea2,'changeGroups':_0x53688f,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0xdccea2,_0x71480b),_0x71480b;}['_getCachedContentParts'](_0x295aa1,_0x16b45e){const _0x3791a6=_0x295aa1?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x3791a6]['length'])return null;const _0x32bd09=this['cachedSuggestionContentParts'][_0x3791a6];if(void 0x0===_0x16b45e)return _0x32bd09['length']>0x0&&_0x32bd09['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x295aa1,null),null):_0x4f0e8d(_0x32bd09);{const _0x3f5e68=_0x32bd09['find'](({index:_0x2a25f4})=>_0x2a25f4===_0x16b45e);if(_0x3f5e68)return[_0x4f0e8d(_0x3f5e68)];}return null;}['_setCachedContentParts'](_0x114330,_0x423daa){const _0x3f1725=_0x114330?'withDiff':'withoutDiff';_0x423daa?_0x423daa['forEach'](_0x1c9ca8=>{const _0x37b22c=this['cachedSuggestionContentParts'][_0x3f1725],_0x34aa60=_0x37b22c['find'](({index:_0x47d7d1})=>_0x47d7d1===_0x1c9ca8['index']);if(_0x34aa60){const _0x2cae7e=_0x37b22c['indexOf'](_0x34aa60);_0x37b22c['splice'](_0x2cae7e,0x1,_0x1c9ca8);}else _0x37b22c['push'](_0x1c9ca8);}):this['cachedSuggestionContentParts'][_0x3f1725]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0xd25def=this['changeGroups'];this['updateChangeGroups']();const _0xeb7b09=this['_getDifferentChangeGroups'](_0xd25def,this['changeGroups']);(_0xeb7b09['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0xeb7b09),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x1ed6e7,_0x435b8e){const _0x36bd78=[];for(const _0x2fb80e of _0x435b8e){const _0x17457e=_0x1ed6e7[_0x2fb80e['index']];_0x17457e?_0x17457e['changes']['length']!==_0x2fb80e['changes']['length']?_0x36bd78['push'](_0x2fb80e):_0x17457e['changes']['forEach']((_0x48f82b,_0x1f48f9)=>{const _0x2e30bb=_0x2fb80e['changes'][_0x1f48f9];_0x48f82b['id']!==_0x2e30bb['id']&&_0x36bd78['push'](_0x2fb80e);}):_0x36bd78['push'](_0x2fb80e);}return _0x36bd78;}['updateChangeGroups'](){const _0x262e92=new _0x504ef3('p',{},[new _0x504ef3('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x201b94(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x30bc55=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x262e92,'cutAfterLastChange':!this['isDone']});if(!_0x30bc55['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x30bc55['parsedContent'];let _0x23ce76=[];if(_0x4c7e33(_0x180a51=>{const _0x36d414=ut(_0x180a51,'data-id');if(!_0x36d414||!_0x3960c1(_0x36d414))return!0x1;const _0x203e26=[_0x180a51,...Ui(_0x180a51)]['at'](-0x2);if(_0x180a51!=_0x203e26){const _0x1d2a7f=ut(_0x203e26,'data-id');_0x3960c1(_0x1d2a7f)||(_0x23ce76['push']({'node':_0x203e26,'id':_0x1d2a7f,'type':'modified'}),_0x30bc55['modifiedNodeIds']['push'](_0x1d2a7f));}else _0x30bc55['modifiedNodeIds']['includes'](_0x36d414)?_0x23ce76['push']({'node':_0x180a51,'type':'modified','id':_0x36d414}):_0x30bc55['newNodeIds']['includes'](_0x36d414)?_0x23ce76['push']({'node':_0x180a51,'type':'new','id':_0x36d414,'anchorId':ut(_0x180a51['previousSibling'],'data-id')}):_0x23ce76['push']({'node':_0x180a51,'type':'removed','id':_0x36d414});return!0x0;},this['parsedMergedContent']),_0x23ce76=_0x23ce76['filter'](({node:_0x3443ea})=>[...Ui(_0x3443ea),_0x3443ea]['every'](_0x21eaf3=>!ut(_0x21eaf3,'data-unstable'))),0x0==_0x23ce76['length'])return;const _0x9278af=[[_0x23ce76[0x0]]];for(let _0xa503ac=0x1;_0xa503ac<_0x23ce76['length'];_0xa503ac++){const _0x48c2e4=_0x9278af[_0x9278af['length']-0x1],_0x35f9fa=_0x48c2e4[_0x48c2e4['length']-0x1];_0x23ce76[_0xa503ac]['node']['previousSibling']==_0x35f9fa['node']&&'modified'!=_0x23ce76[_0xa503ac]['type']&&'modified'!=_0x35f9fa['type']?_0x48c2e4['push'](_0x23ce76[_0xa503ac]):_0x9278af['push']([_0x23ce76[_0xa503ac]]);}for(const _0x3b8d3c of _0x9278af){const _0x6031fc=_0x3b8d3c[0x0],_0x1accf5=_0x3b8d3c[_0x3b8d3c['length']-0x1],_0x196f32=_0x23d0ed(_0x6031fc['node']['previousSibling']);_0x196f32&&_0x3b8d3c['unshift'](_0x196f32);const _0x249409=_0x23d0ed(_0x1accf5['node']['nextSibling']);_0x249409&&_0x3b8d3c['push'](_0x249409);}function _0x3960c1(_0x306132){return _0x30bc55['modifiedNodeIds']['includes'](_0x306132)||_0x30bc55['newNodeIds']['includes'](_0x306132)||_0x30bc55['removedNodeIds']['includes'](_0x306132);}function _0x23d0ed(_0x141f08){if(_0x141f08&&ut(_0x141f08,'data-id')&&!ut(_0x141f08,'data-unstable')){const _0x3ff0a2=ut(_0x141f08,'data-id');if(!_0x3960c1(_0x3ff0a2))return{'node':_0x141f08,'type':'context','id':_0x3ff0a2};}return null;}this['changeGroups']=_0x9278af['map']((_0x472923,_0x67968b)=>({'changes':_0x472923,'state':'pending','index':_0x67968b}));}}const De=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class os extends _0x5bd7c6(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x650124,editor:_0x13f1cf}){super(),this['id']=_0x48eb5e(),this['connector']=_0x650124,this['isStopped']=!0x0,this['editor']=_0x13f1cf;}async['start'](){const _0x899b75=[];let _0x2497de,_0x48a565,_0x4f3d99;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x4b4f58=await this['currentRequest']['getStream']();for await(const _0x1ddaae of _0x4b4f58){if(this['isStopped'])return;if('error'==_0x1ddaae['event'])return void this['fire']('error',{'error':new _0x563e6a('ai-chat-interaction-error',this)});switch(_0x1ddaae['event']){case'message-metadata':this['messageId']=_0x1ddaae['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x1ddaae['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x1ddaae['data']['conversationTitle'],!0x0);break;case'source':_0x899b75['push'](_0x1ddaae['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'](),_0x2497de='modification-delta'==_0x1ddaae['event']?'modification':'text',_0x48a565='modification-delta'==_0x1ddaae['event']?_0x1ddaae['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x2497de&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x2497de,'interactionId':this['id'],'id':_0x48a565}),'modification'==_0x2497de&&(this['currentReply']['sources']=_0x899b75['splice'](0x0))),this['currentReply']['appendContent'](_0x1ddaae['data']['textDelta']);break;case'mcp-tool-result':_0x4f3d99=JSON['parse'](_0x1ddaae['data']['result']),this['_handleToolResultData']({'toolName':_0x1ddaae['data']['toolName'],'data':_0x4f3d99['data'],'attributes':_0x4f3d99['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x1ddaae['data']['toolName'],'data':_0x1ddaae['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x899b75['length']>0x0&&(this['currentReply']['sources']=_0x899b75['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x4ba0ff){return this['replies']['find'](_0x48b9cd=>_0x48b9cd['id']===_0x4ba0ff);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x4642fd=>_0x4642fd['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x383a9a){const _0x369e98=new xi({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x383a9a});return this['replies']['push'](_0x369e98),_0x369e98['delegate'](...De)['to'](this),this['fire']('replyCreated',_0x369e98),_0x369e98;}['setConversationTitle'](_0x42a942,_0x13556d=!0x1){this['fire']('setConversationTitle',_0x42a942,_0x13556d);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x123ec2){this['fire']('toolDataReceived',{'type':'result','toolName':_0x123ec2['toolName'],'data':structuredClone(_0x123ec2['data']||{}),'attributes':structuredClone(_0x123ec2['attributes']||{})},this);}['_handleToolNotificationData'](_0xde6209){this['fire']('toolDataReceived',{'type':'notification','toolName':_0xde6209['toolName'],'data':structuredClone(_0xde6209['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var xe=function(_0x37e689){return _0x37e689['TOOL']='mcp-tool-context',_0x37e689['FILE']='file',_0x37e689['DOCUMENT']='document',_0x37e689['URL']='web-resource',_0x37e689['TEXT']='text',_0x37e689['SELECTION']='selection',_0x37e689;}({}),ye=function(_0x4dd990){return _0x4dd990['TEXT']='text',_0x4dd990['MARKDOWN']='markdown',_0x4dd990['HTML']='html',_0x4dd990;}({});const Oe=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']]),ze=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class We extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x95dd63,config:_0x39e0f0,ownerId:_0x333a51}){super(),this['_connector']=_0x95dd63,this['_config']=_0x39e0f0,this['_ownerId']=_0x333a51;}['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'](_0x29bfcf){const _0x10d0a4=await this['_createContextItemFromContent'](_0x29bfcf);return this['_addToConversationContextItem'](_0x10d0a4),'current-document'===_0x10d0a4['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x10d0a4;}async['_createContextItemFromContent'](_0x4aa1c6){if(_0x4aa1c6['type']===xe['DOCUMENT']){const _0x229de2=await this['_connector']['fetchDocument'](this['_ownerId'],_0x4aa1c6['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x4aa1c6['type'],'content':_0x229de2['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x229de2['attributes']?.['version'],'sessionId':_0x229de2['attributes']?.['sessionId']};}if(_0x4aa1c6['type']===xe['TOOL'])return{'id':_0x4aa1c6['id'],'uiId':_0x4aa1c6['id'],'label':_0x4aa1c6['data']?.['label']||_0x4aa1c6['id'],'type':xe['TOOL'],'mcpServerName':_0x4aa1c6['mcpServerName'],'toolName':_0x4aa1c6['toolName'],'data':_0x4aa1c6['data']||{}};return{'id':_0x4aa1c6['id'],'uiId':_0x4aa1c6['id'],'label':_0x4aa1c6['attributes']?.['label']||_0x4aa1c6['name']||_0x4aa1c6['url']||_0x4aa1c6['id'],'type':_0x4aa1c6['type'],..._0x4aa1c6?.['attributes']?.['resourceId']?{'resourceId':_0x4aa1c6['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x180e3b){const _0x49f5fe=this['_pendingContextItems']['get'](_0x180e3b);_0x49f5fe?.['isReadOnly']||this['_removeContextItem'](_0x180e3b);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x3145e7 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x3145e7['uiId']);const _0x3442d8=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x3442d8&&this['_addContextItem']({..._0x3442d8,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x28b9f5){for(const _0x76356d of _0x28b9f5['values']())this['_addToConversationContextItem'](_0x76356d);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'](_0x4e69cf){return Array['from'](_0x4e69cf['values']())['map'](_0x3b6892=>this['_mapContextItemToRequestData'](_0x3b6892))['filter'](_0x11a0cb=>null!==_0x11a0cb);}async['addFilesToContext'](_0x38e973,_0x9da36b,_0x304241=xe['FILE']){const _0x3c9a35='files-'+_0x48eb5e();this['_startUploadOperation'](_0x3c9a35);try{await Promise['all'](_0x38e973['map'](async _0x2fe717=>{const _0x2d921d='file-'+_0x48eb5e(),_0x4fd561=_0x528e40(_0x2fe717['name']);try{this['_addContextItem']({'type':_0x304241,'label':_0x9da36b?.['label']||_0x4fd561,'uiId':_0x2d921d,'resourceId':_0x9da36b?.['resourceId']},!0x0);const _0x6f5c1f=this['_connector']['uploadFile'](this['_ownerId'],_0x2fe717,_0x9da36b);this['_ongoingUploads']['set'](_0x2d921d,_0x6f5c1f['abortController']);const {id:_0x25c653}=await _0x6f5c1f['getId']();this['_ongoingUploads']['delete'](_0x2d921d),this['_finishContextItemLoading']({'type':_0x304241,'id':_0x25c653,'label':_0x9da36b?.['label']||_0x4fd561,'uiId':_0x2d921d,'resourceId':_0x9da36b?.['resourceId']},!0x1);}catch(_0x283aa8){this['_ongoingUploads']['delete'](_0x2d921d);if(!(_0x283aa8 instanceof _0x563e6a&&_0x283aa8['message']['startsWith']('ai-request-aborted'))){const _0x3ebb3c=Oe['get'](_0x283aa8['code'])||'ai-chat-file-upload-failed',_0x39296c=new _0x563e6a(_0x3ebb3c,null,{'fileName':_0x4fd561,..._0x283aa8});_0x39296c['stack']=_0x283aa8['stack'],this['fire']('error',{'error':_0x39296c});}this['_removeContextItem'](_0x2d921d);}}));}finally{this['_finishUploadOperation'](_0x3c9a35);}}['addCurrentDocumentToContext'](_0x3e6019){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x2dcde4={'type':xe['DOCUMENT'],'uiId':'current-document','label':_0x3e6019,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x2dcde4);}async['updateCurrentDocument'](_0x4d8edd,_0x2600aa,_0x558413,_0x544502){const _0x54a067=this['_pendingContextItems']['get']('current-document');if(_0x54a067&&_0x4d8edd){_0x54a067['selection']=_0x544502?_0x544502['map'](_0x12b4d7=>({'start':_0x12b4d7['start'],'end':_0x12b4d7['end']})):[];try{if(_0x54a067['version']===_0x2600aa)return;const {id:_0x47d4c5}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x4d8edd,{'version':_0x2600aa,'sessionId':_0x558413})['getId']();_0x54a067['id']=_0x47d4c5,_0x54a067['content']=_0x4d8edd,_0x54a067['version']=_0x2600aa,_0x54a067['sessionId']=_0x558413;}catch(_0x292264){const _0x2bcf44=new _0x563e6a('ai-chat-document-upload-failed',null);_0x2bcf44['stack']=_0x292264['stack'],this['fire']('error',{'error':_0x2bcf44});}}}['addSelectionToContext'](_0x2df15e){this['_addContextItem']({'type':xe['SELECTION'],'label':_0x2df15e,'uiId':'selection','content':_0x2df15e});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x2096f2,_0x3c875d){const _0x115302='url-'+_0x48eb5e();this['_startUploadOperation'](_0x115302);const _0x4b0746='url-'+_0x48eb5e();try{this['_addContextItem']({'type':xe['URL'],'label':_0x3c875d?.['label']||_0x2096f2,'uiId':_0x4b0746,'resourceId':_0x3c875d?.['resourceId']},!0x0);const _0x2321d8=this['_connector']['uploadUrl'](this['_ownerId'],_0x2096f2,_0x3c875d);this['_ongoingUploads']['set'](_0x4b0746,_0x2321d8['abortController']);const {id:_0x541f05}=await _0x2321d8['getId']();this['_ongoingUploads']['delete'](_0x4b0746),this['_finishContextItemLoading']({'type':xe['URL'],'id':_0x541f05,'label':_0x3c875d?.['label']||_0x2096f2,'uiId':_0x4b0746,'resourceId':_0x3c875d?.['resourceId']},!0x1);}catch(_0x489c85){this['_ongoingUploads']['delete'](_0x4b0746),(_0x489c85['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x563e6a('ai-chat-url-upload-failed',this,{'url':_0x2096f2,'originalError':_0x489c85}),'url':_0x2096f2}),this['_removeContextItem'](_0x4b0746));}finally{this['_finishUploadOperation'](_0x115302);}}['addToolItemToContext'](_0x552a58){_0x552a58['id']=_0x552a58['id']??_0x48eb5e()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x552a58['uiId'],_0x552a58),this['fire']('contextItemAdded',{'contextItem':_0x552a58,'isLoading':!0x1});}async['loadSourceResources'](_0x53294b,_0x4b58be,_0x375a5e){const _0x1da920=this['_addContextOptionsState']['sources']['find'](_0x350bc2=>_0x350bc2['id']===_0x53294b);if(!_0x1da920)return this['fire']('error',{'error':new _0x563e6a('ai-chat-source-not-found',this,{'sourceId':_0x53294b}),'sourceId':_0x53294b}),[];try{const _0x38cde3=(await _0x1da920['getResources'](_0x4b58be))['map'](_0x5fa114=>{const _0x3639a3=this['_isResourceInContext'](_0x5fa114['id']);return{..._0x5fa114,'isInContext':_0x3639a3};});return _0x1da920['resources']=_0x38cde3,this['fire']('sourceResourcesLoaded',{'sourceId':_0x53294b,'source':_0x1da920,'resources':_0x38cde3,'uid':_0x375a5e}),_0x38cde3;}catch(_0x2b9f5e){return this['fire']('error',{'error':new _0x563e6a('ai-chat-source-resources-load-failed',this,{'sourceId':_0x53294b,'originalError':_0x2b9f5e}),'sourceId':_0x53294b,'sourceLabel':_0x1da920['label']}),[];}}async['addResourceToContext'](_0x378ca7,_0x3bec8b){if(this['_isResourceInContext'](_0x3bec8b['id']))return;let _0x1ac97f=_0x3bec8b['data'];if(!_0x1ac97f&&_0x378ca7['getData'])try{_0x1ac97f=await _0x378ca7['getData'](_0x3bec8b['id']);}catch(_0x5ae552){return void this['fire']('error',{'error':new _0x563e6a('ai-chat-resource-load-failed',this,{'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id'],'originalError':_0x5ae552}),'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']});}if(_0x1ac97f)switch(_0x3bec8b['type']){case xe['URL']:if('string'!=typeof _0x1ac97f)return void this['fire']('error',{'error':new _0x563e6a('ai-chat-context-invalid-data',this,{'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id'],'expectedType':'string','actualType':typeof _0x1ac97f}),'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']});await this['addUrlToContext'](_0x1ac97f,{'label':_0x3bec8b['label'],'resourceId':_0x3bec8b['id']});break;case xe['FILE']:if(!(_0x1ac97f instanceof File))return void this['fire']('error',{'error':new _0x563e6a('ai-chat-context-invalid-data',this,{'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id'],'expectedType':'File','actualType':typeof _0x1ac97f}),'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']});await this['addFilesToContext']([_0x1ac97f],{'label':_0x3bec8b['label'],'resourceId':_0x3bec8b['id']});break;case xe['TEXT']:if('object'!=typeof _0x1ac97f||!('content'in _0x1ac97f)||!('type'in _0x1ac97f))return void this['fire']('error',{'error':new _0x563e6a('ai-chat-context-invalid-data',this,{'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x1ac97f}),'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']});_0x1ac97f=We['_convertTextResourceToFile'](_0x1ac97f,_0x3bec8b['label']),await this['addFilesToContext']([_0x1ac97f],{'label':_0x3bec8b['label'],'resourceId':_0x3bec8b['id']},xe['TEXT']);break;case xe['TOOL']:break;default:this['fire']('error',{'error':new _0x563e6a('ai-chat-context-unsupported-type',this,{'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id'],'resourceType':_0x3bec8b['type']}),'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']});}else this['fire']('error',{'error':new _0x563e6a('ai-chat-resource-no-data',this,{'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']}),'resourceId':_0x3bec8b['id'],'sourceId':_0x378ca7['id']});}static['_convertTextResourceToFile'](_0xaddd44,_0xeb103c){switch(_0xaddd44['type']){case ye['MARKDOWN']:return new File([_0xaddd44['content']],_0xeb103c,{'type':'text/markdown'});case ye['HTML']:return new File([_0xaddd44['content']],_0xeb103c,{'type':'text/html'});default:return new File([_0xaddd44['content']],_0xeb103c,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x521cfc){switch(_0x521cfc['type']){case xe['FILE']:return{'type':xe['FILE'],'id':_0x521cfc['id']};case xe['URL']:return{'type':xe['URL'],'id':_0x521cfc['id']};case xe['DOCUMENT']:return{'type':xe['DOCUMENT'],'id':_0x521cfc['id'],..._0x521cfc['selection']?.['length']&&{'selection':_0x521cfc['selection']}};case xe['TEXT']:return{'type':xe['FILE'],'id':_0x521cfc['id']};case xe['TOOL']:{const _0x1a115c=_0x521cfc;return{'type':xe['TOOL'],'mcpServerName':_0x1a115c['mcpServerName'],'toolName':_0x1a115c['toolName'],'data':_0x1a115c['data'],'id':_0x1a115c['id']};}default:return null;}}['_addContextItem'](_0x5ef5b2,_0x3b6a68=!0x1){if(this['_pendingContextItems']['set'](_0x5ef5b2['uiId'],_0x5ef5b2),_0x5ef5b2['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x5ef5b2,'isLoading':_0x3b6a68}),'current-document'===_0x5ef5b2['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x5ef5b2['resourceId']){const _0x21f101=this['_findSourceIdsByResourceId'](_0x5ef5b2['resourceId']);_0x21f101&&_0x21f101['forEach'](_0x32a873=>{this['_updateResourceInContextState'](_0x32a873,_0x5ef5b2['resourceId'],!0x0);});}}['_removeContextItem'](_0x1b75be){const _0x2b8c91=this['_pendingContextItems']['get'](_0x1b75be),_0x515619=this['_ongoingUploads']['get'](_0x1b75be);if(_0x515619&&(_0x515619['abort'](),this['_ongoingUploads']['delete'](_0x1b75be)),_0x2b8c91?.['resourceId']){const _0x324c90=this['_findSourceIdsByResourceId'](_0x2b8c91['resourceId']);_0x324c90&&_0x324c90['forEach'](_0x243be=>{this['_updateResourceInContextState'](_0x243be,_0x2b8c91['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x1b75be),this['fire']('contextItemRemoved',{'uiId':_0x1b75be,'type':_0x2b8c91?.['type']}),'current-document'===_0x1b75be&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x5e4ab4,_0x4ef090){if(this['_pendingContextItems']['has'](_0x5e4ab4['uiId'])&&(this['_pendingContextItems']['set'](_0x5e4ab4['uiId'],_0x5e4ab4),this['fire']('contextItemLoadingEnded',{'contextItem':_0x5e4ab4,'isLoading':_0x4ef090}),_0x5e4ab4['resourceId'])){const _0x54e97d=this['_findSourceIdsByResourceId'](_0x5e4ab4['resourceId']);_0x54e97d&&_0x54e97d['forEach'](_0x15f9e0=>{this['_updateResourceInContextState'](_0x15f9e0,_0x5e4ab4['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x71906e){this['_conversationContextItems']['set'](_0x71906e['uiId'],_0x71906e);}['_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'](_0x3bdca1=>({..._0x3bdca1,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x20b168=>({..._0x20b168,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x217230=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x217230,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x1f8f59){for(const _0x1825af of this['_pendingContextItems']['values']())if(_0x1825af['resourceId']===_0x1f8f59)return!0x0;for(const _0x3c696d of this['_conversationContextItems']['values']())if(_0x3c696d['resourceId']===_0x1f8f59)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x43905e){const _0x433e58=[];for(const _0x5fbc76 of this['_addContextOptionsState']['sources']){_0x5fbc76['resources']['find'](_0x54e596=>_0x54e596['id']===_0x43905e)&&_0x433e58['push'](_0x5fbc76['id']);}return 0x0===_0x433e58['length']?null:_0x433e58;}['_updateResourceInContextState'](_0x6476dd,_0x33efe9,_0xddbf2f){const _0x512971=this['_addContextOptionsState']['sources']['find'](_0x8d3cae=>_0x8d3cae['id']===_0x6476dd);if(!_0x512971)return;const _0x272f9f=_0x512971['resources']['find'](_0xf8581e=>_0xf8581e['id']===_0x33efe9);_0x272f9f&&(_0x272f9f['isInContext']=_0xddbf2f,this['fire']('resourceStateChanged',{'sourceId':_0x6476dd,'resourceId':_0x33efe9,'isInContext':_0xddbf2f}));}['_startUploadOperation'](_0x5d775b){this['_ongoingUploadOperations']['set'](_0x5d775b,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x391cb6){this['_ongoingUploadOperations']['delete'](_0x391cb6),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const He=['capabilitiesUpdated'];class Ue extends _0x5bd7c6(){['_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'](_0x364fcd){const _0x5e9cb8={};return _0x364fcd&&_0x364fcd['isWebSearchEnabled']&&(_0x5e9cb8['webSearch']={}),_0x364fcd&&_0x364fcd['isReasoningEnabled']&&(_0x5e9cb8['reasoning']={}),_0x5e9cb8;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x5e48e3){_0x5e48e3!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x5e48e3,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x18a2e7){_0x18a2e7!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x18a2e7,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Je extends os{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x37248b){super(_0x37248b),this['conversationId']=_0x37248b['conversationId'],this['contextItems']=_0x37248b['contextItems'],this['capabilities']=_0x37248b['capabilities'],this['userMessage']=_0x37248b['userMessage'],this['model']=_0x37248b['model'],this['attributes']=_0x37248b['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':We['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ue['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class st extends _0x5bd7c6(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x12e3bc){super(),this['options']=_0x12e3bc,this['connector']=_0x12e3bc['connector'],this['chatModels']=_0x12e3bc['chatModels'],this['id']=_0x12e3bc['conversationId'],this['isFromHistory']=_0x12e3bc['isFromHistory'];}async['init'](_0x46de16){try{this['chatContext']=new We({'connector':this['connector'],'config':_0x46de16,'ownerId':this['id']}),this['chatContext']['delegate'](...ze)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ue(),this['chatCapabilities']['delegate'](...He)['to'](this),this['chatCapabilities']['init']();const _0x5a1f87=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x5a1f87});const _0x3cfeab=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x3cfeab&&await this['setModel'](_0x3cfeab);}catch(_0x383d9e){const _0x13444c=new _0x563e6a('ai-chat-conversation-init-failed',null,{'message':_0x383d9e['message']||_0x383d9e});_0x13444c['stack']=_0x383d9e['stack'],this['fire']('error',{'error':_0x13444c});}}async['start'](){if(this['isStarted'])throw new _0x563e6a('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x563e6a('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x33a346}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x33a346,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x51bf83){const _0x48e8ee=new _0x563e6a('ai-chat-conversation-start-failed',null,{'message':_0x51bf83['message'],'conversationId':this['id']});throw _0x48e8ee['stack']=_0x51bf83['stack'],this['fire']('error',{'error':_0x48e8ee}),_0x48e8ee;}}async['load'](_0x4a98e4,_0x58a866){try{const _0xc639fa=await this['connector']['fetchConversation'](_0x4a98e4)['getConversation'](),_0x63e9de=await this['connector']['fetchConversationMessages'](_0x4a98e4)['getMessages'](),_0x5cc555=_0x63e9de[0x0]['model'];this['isStarted']=!0x0,this['id']=_0xc639fa['id'],'title'in _0xc639fa?this['fire']('setConversationTitle',_0xc639fa['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x31c781=(await this['chatModels']['getAll']())['find'](_0x3d1de8=>_0x3d1de8['id']['toLowerCase']()===_0x5cc555['toLowerCase']());return this['selectedModel']=_0x31c781,this['fire']('modelSelected',{'selectedModel':_0x31c781,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x63e9de,_0x58a866,_0x5cc555),this['currentInteraction']=void 0x0,this;}catch(_0x4505a0){const _0xeecc65=new _0x563e6a('ai-chat-conversation-init-from-id-failed',null,{'message':_0x4505a0['message'],'conversationId':_0x4a98e4});throw _0xeecc65['stack']=_0x4505a0['stack'],this['fire']('error',{'error':_0xeecc65}),_0xeecc65;}}async['_processMessagesToInteractions'](_0x29ac98,_0x40f5e5,_0x13b0bb){let _0x4ba82e;for(const _0x58d56a of _0x29ac98)if('user'===_0x58d56a['role']){const _0x364ffd=await this['_extractContextItems'](_0x58d56a),_0x5b5437={'isReasoningEnabled':Object['hasOwn'](_0x58d56a['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x58d56a['capabilities'],'webSearch')};_0x4ba82e=this['createInteraction']({'userMessage':_0x58d56a['prompt'],'contextItems':_0x364ffd,'capabilities':_0x5b5437,'modelId':_0x13b0bb,'attributes':_0x58d56a['attributes']}),this['currentInteraction']=_0x4ba82e,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x58d56a['role']&&_0x4ba82e){const _0x1bcc4e=[];for(const _0x50278e of _0x58d56a['content'])switch(_0x50278e['type']){case'text':case'modification':{const _0x3b4678=_0x4ba82e['getDocumentContext']()?.['sessionId']!==_0x40f5e5;_0x4ba82e['currentReply']=_0x4ba82e['createReply']({'type':_0x50278e['type'],'isDone':!0x0,'interactionId':_0x4ba82e['id'],'areActionsDisabled':_0x3b4678}),_0x4ba82e['currentReply']['appendContent'](_0x50278e['content']),_0x1bcc4e['length']>0x0&&(_0x4ba82e['currentReply']['sources']=_0x1bcc4e['splice'](0x0));break;}case'url':_0x1bcc4e['push'](_0x50278e);break;case'mcp-tool-result':{const {data:_0x1b37f8,attributes:_0x4e2efd}=JSON['parse'](_0x50278e['content']);_0x4ba82e['_handleToolResultData']({'toolName':_0x50278e['toolName'],'data':_0x1b37f8,'attributes':_0x4e2efd});break;}}}}}async['_extractContextItems'](_0x509e5b){const _0x14d699=new Map();if(!_0x509e5b['content'])return _0x14d699;for(const _0x4ead55 of _0x509e5b['content']){const _0x39b76d=await this['chatContext']['populateFromMessage'](_0x4ead55);_0x39b76d&&_0x14d699['set'](_0x39b76d['id'],_0x39b76d);}return _0x14d699;}async['handleUserInteraction']({userMessage:_0x5ea830,attributes:_0xe1c7c7}){if(!this['isStarted'])throw new _0x563e6a('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x563e6a('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x1e7d86=this['chatContext']['getPendingContextItems'](),_0x1d0411=this['chatCapabilities']['getCapabilitiesConfig'](),_0x216b37=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x5ea830,'contextItems':_0x1e7d86,'capabilities':_0x1d0411,'modelId':_0x216b37,'attributes':_0xe1c7c7}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x5e7a47){if(_0x5e7a47 instanceof _0x563e6a)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x5e7a47});else{const _0x38c5c1=Oe['get'](_0x5e7a47['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x563e6a(_0x38c5c1,null,{'error':_0x5e7a47})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x5a3825,contextItems:_0x5163ef,capabilities:_0x465eef,modelId:_0x2ce9f9,attributes:_0x562373}){const _0x2fc657=new Je({'userMessage':_0x5a3825,'contextItems':_0x5163ef,'capabilities':_0x465eef,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x2ce9f9,'attributes':_0x562373});return _0x2fc657['delegate'](...De)['to'](this),this['interactions']['push'](_0x2fc657),this['fire']('interactionCreated',_0x2fc657),_0x2fc657;}['getInteraction'](_0x1226ab){return this['interactions']['find'](_0x19ffdc=>_0x19ffdc['id']===_0x1226ab);}['removeInteraction'](_0x1a4e1c){const _0x49431a=this['getInteraction'](_0x1a4e1c);_0x49431a&&(_0x49431a['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x49431a),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x50f0cc){this['chatContext']['addCurrentDocumentToContext'](_0x50f0cc);}async['updateCurrentDocumentInContext']({content:_0x2d87b3,version:_0x184bcf,sessionId:_0x2a0ade,selections:_0x266d34}){await this['chatContext']['updateCurrentDocument'](_0x2d87b3,_0x184bcf,_0x2a0ade,_0x266d34);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0xc460fb){this['chatContext']['addSelectionToContext'](_0xc460fb);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x356bab){this['chatContext']['addFilesToContext'](_0x356bab);}['addUrlToContext'](_0x28ca42){this['chatContext']['addUrlToContext'](_0x28ca42);}['addToolItemToContext'](_0xd067f){this['chatContext']['addToolItemToContext'](_0xd067f);}['addResourceToContext'](_0x138ae8,_0x212262){this['chatContext']['addResourceToContext'](_0x138ae8,_0x212262);}['loadSourceResources'](_0xa5cac4,_0x18b348,_0x3ab3fb){return this['chatContext']['loadSourceResources'](_0xa5cac4,_0x18b348,_0x3ab3fb);}['removeFromContext'](_0x3012ec){this['chatContext']['removeFromContext'](_0x3012ec);}['setWebSearch'](_0x40869f){this['chatCapabilities']['setWebSearch'](_0x40869f);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x4a339c){this['chatCapabilities']['setReasoning'](_0x4a339c);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x9a66f5){_0x9a66f5?!0x1===await this['chatModels']['isAvailable'](_0x9a66f5)&&(_0xa8aac2('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x9a66f5}),_0x9a66f5=(await this['chatModels']['getAvailableModels']())[0x0]):(_0xa8aac2('ai-chat-conversation-set-model-null',{'conversation':this}),_0x9a66f5=(await this['chatModels']['getAvailableModels']())[0x0]),_0x9a66f5['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x9a66f5,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x9a66f5}));}}class et extends _0x5bd7c6(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x3b449e,config:_0x44e2d8,locale:_0x41b86e}){super(),this['_connector']=_0x3b449e,this['_config']=_0x44e2d8,this['_locale']=_0x41b86e;}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 _0x4824f4=await this['getAll']();let _0xbd822b;return _0xbd822b=this['_availableModels']?this['_filterModels'](_0x4824f4,this['_availableModels']):_0x4824f4['filter'](_0xea34a1=>_0xea34a1['recommended']),_0xbd822b;}async['getModel'](_0x4863dc){const _0x559d4a=await this['getAll']();if(!_0x559d4a['length'])return null;if(_0x4863dc){const _0x54d95f=this['_getModelById'](_0x559d4a,_0x4863dc);if(_0x54d95f)return _0x54d95f;_0xa8aac2('ai-chat-model-id-unrecognized',{'modelId':_0x4863dc,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0xc7d03d=await this['getAvailableModels']();if(!_0xc7d03d['length'])return null;if(this['_defaultModelId']){const _0x437eef=this['_getModelById'](_0xc7d03d,this['_defaultModelId']);if(_0x437eef)return _0x437eef;_0xa8aac2('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0xc7d03d[0x0]['id']});}return _0xc7d03d[0x0];}async['isAvailable'](_0x256319){return(await this['getAvailableModels']())['some'](_0x2e62b2=>_0x2e62b2['name']===_0x256319['name']&&_0x2e62b2['provider']===_0x256319['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x402e64=this['_locale']['uiLanguage']||'en',_0x2b168a=this['_connector']['getModels'](_0x402e64),_0x473551=await _0x2b168a['list']();this['_modelList']=_0x473551['items']['map'](_0x10b463=>Bi(_0x10b463)?{..._0x10b463,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x10b463);}catch(_0x103285){throw _0x4e5dbd('ai-models-unable-to-retrieve',{'error':_0x103285}),_0x103285;}return[...this['_modelList']];}['_filterModels'](_0x583a46,_0x471cfa){let _0xeedd60;if(_0x471cfa){_0xeedd60=[];const _0xa135e4=new Set(),_0xe8c2d4='string'==typeof _0x471cfa?[_0x471cfa['toLocaleLowerCase']()]:_0x471cfa['map'](_0x5b4b24=>_0x5b4b24['toLocaleLowerCase']());for(const _0x560507 of _0xe8c2d4)for(const _0x5a1dc5 of _0x583a46)!_0xa135e4['has'](_0x5a1dc5['id'])&&this['_isMatchingFilter'](_0x5a1dc5,_0x560507)&&(_0xeedd60['push'](_0x5a1dc5),_0xa135e4['add'](_0x5a1dc5['id']));}else _0xeedd60=_0x583a46;return _0xeedd60;}['_isMatchingFilter'](_0x5d669a,_0x53ddf3){const _0x1ce6e8=_0x5d669a['id']['toLocaleLowerCase'](),_0x2a814a=_0x5d669a['name']['toLocaleLowerCase'](),_0x5f3eee=_0x5d669a['provider']['toLocaleLowerCase']();return _0x1ce6e8===_0x53ddf3||_0x2a814a===_0x53ddf3||Bi(_0x5d669a)&&'auto'===_0x53ddf3||_0x5f3eee===_0x53ddf3||_0x1ce6e8['startsWith'](_0x53ddf3);}['_getModelById'](_0x4ab46e,_0x488399){return _0x4ab46e['find'](_0x29bce8=>Bi(_0x29bce8)&&'auto'===_0x488399?_0x29bce8:_0x29bce8['id']===_0x488399)||null;}}function Bi(_0x34c9c2){return _0x34c9c2['id']['startsWith']('agent');}function T(_0x47efb2){if(_0x47efb2 instanceof _0x2cda04)return _0x47efb2;if(_0x47efb2?.['editors']&&_0x47efb2['editors']['get'](0x0))return _0x47efb2['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.'),_0x47efb2['editors']['get'](0x0);throw new _0x563e6a('ai-get-editor-from-context-no-editor');}function at({editor:_0x6d97bb,interaction:_0x43a49a,reply:_0x23f325,groups:_0x1e531d,transform:_0x2a2f87,documentCompare:_0x509572,documentCompareOptions:_0x14e857}){const _0x46ea19=_0x43a49a['getDocumentContext']();if(!_0x46ea19)return[];const _0x4dfd26=_0x46ea19['content'],_0x3d5824=_0x46ea19['version'],_0x46f130=_0x23f325['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x2eec37}of _0x1e531d){const _0x2686aa=_0x2eec37['filter'](_0x55a305=>'new'!=_0x55a305['type'])['map'](_0x18a343=>It('data-id',_0x18a343['id'],_0x46f130)),_0xec405b=_0x2eec37['filter'](_0x471cf1=>'removed'!=_0x471cf1['type'])['map'](_0x46974e=>_0x46974e['node']['cloneNode'](!0x0));let _0x1df039=null;if(_0x2686aa['length']){_0x1df039=_0x2686aa[0x0]['previousSibling'];for(let _0x3fd194=0x0;_0x3fd194<_0x2686aa['length'];_0x3fd194++)_0x12acc3(_0x2686aa[_0x3fd194]);}if(_0xec405b['length']){_0x1df039||(_0x2eec37[0x0]['anchorId']?_0x1df039=It('data-id',_0x2eec37[0x0]['anchorId'],_0x46f130):(_0x1df039=_0xec405b['shift'](),_0x8342b6(_0x46f130,_0x1df039)));for(let _0x11a35a=0x0;_0x11a35a<_0xec405b['length'];_0x11a35a++)_0x43ba66(_0x1df039,_0xec405b[_0x11a35a]),_0x1df039=_0xec405b[_0x11a35a];}}const _0x5d656c=pt(_0x46f130),_0x566fef=_0x509572['getDiff'](_0x4dfd26,_0x5d656c,_0x14e857)['getOperations']();if(_0x2a2f87){const _0x50a076=_0x6d97bb['model']['document']['history']['getOperations'](_0x3d5824),_0xc29ad2={'document':_0x6d97bb['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return kt(_0x566fef,_0x50a076,_0xc29ad2)['operationsA'];}return _0x566fef;}function rt(_0x2e18ec,_0x4a8074){if('marker'!=_0x4a8074['type'])return;const _0x3c66cb=_0x2e18ec['model']['markers']['get'](_0x4a8074['name']);_0x3c66cb&&(_0x4a8074['oldRange']=_0x3c66cb['getRange']());}class q extends _0x3a5602{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[tt,ot];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x340c25(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 et({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x279fdd=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x39def7,_0x3f64c6)=>{this['_handleUIUserMessage']({'userMessage':_0x3f64c6});}),this['listenTo'](_0x279fdd,'resizedTabs',(_0x504357,_0x566a70)=>{this['_setIsMaximized'](_0x566a70);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x279fdd['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',(_0x2710bd,_0x12b161)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x12b161));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x4d39d3,_0x5e21dd)=>{this['activeConversation']?.['addUrlToContext'](_0x5e21dd);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x24288d,_0x1f275a)=>{_0x1f275a['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x436b49,_0x4db57d)=>{this['activeConversation']?.['addResourceToContext'](_0x4db57d['source'],_0x4db57d['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x5c702e,_0x3aa427)=>{this['_removeFromContext'](_0x3aa427);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x3387bd,_0x58bc67)=>{this['activeConversation']?.['loadSourceResources'](_0x58bc67['sourceId'],_0x58bc67['query'],_0x58bc67['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0xb4deb4,_0x2c68bc)=>{this['activeConversation']?.['setModel'](_0x2c68bc);}),this['listenTo'](this['_aiChatUi'],'like',(_0x4ecd66,{replyId:_0x5e71b1})=>{console['log']('Liked\x20response',_0x5e71b1);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x196a9e,{replyId:_0x4cacbe})=>{console['log']('Disliked\x20response',_0x4cacbe);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x366a84,_0x3da812)=>{this['_insertSuggestion'](_0x3da812);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x40408d,{replyId:_0x1a82c2,partIndex:_0x426bfe})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x1a82c2,_0x426bfe);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x50683c,{replyId:_0x102cc7,partIndex:_0x376a25})=>{const _0x25a3b4=this['_getDocumentRangeForReplyChanges'](_0x102cc7,_0x376a25);_0x25a3b4&&'$graveyard'!=_0x25a3b4['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x25a3b4['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x489309,_0x18cddc)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x18cddc);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x333a55,{replyId:_0x628ef7,showDiff:_0x308c2d})=>{const {reply:_0x3c02c8}=this['getInteractionAndReplyById'](_0x628ef7),_0x437590=_0x3c02c8['getContentParts']({'showDiff':_0x308c2d});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3c02c8['id'],'parts':_0x437590,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0xb9c478,{replyId:_0x420681,partIndex:_0x4cd19f})=>{this['_rejectSuggestion']({'replyId':_0x420681,'partIndex':_0x4cd19f}),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:_0x2bb07f,partIndex:_0x550245}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x9bc463}=this['getInteractionAndReplyById'](_0x2bb07f),_0x90c906=_0x9bc463['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x550245});this['_aiChatBalloon']['updateContent']({'part':_0x90c906[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x252dc1,partIndex:_0x4b2682}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x252dc1,'partIndex':_0x4b2682}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x56481f,partIndex:_0x2f5adc}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x56481f,'partIndex':_0x2f5adc}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x4c3175,partIndex:_0x1d90cb}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x4c3175,'partIndex':_0x1d90cb}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x1b69f0,partIndex:_0x4aca09}=this['_currentPreviewedChangeGroup'],_0x4d43bb=this['_getPresentableSiblingContentPartIndex'](_0x1b69f0,_0x4aca09,'next');null!==_0x4d43bb&&this['_openBalloonFor'](_0x1b69f0,_0x4d43bb);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x588f67,partIndex:_0x23b40b}=this['_currentPreviewedChangeGroup'],_0x34cbff=this['_getPresentableSiblingContentPartIndex'](_0x588f67,_0x23b40b,'previous');null!==_0x34cbff&&this['_openBalloonFor'](_0x588f67,_0x34cbff);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x514c22,{id:_0x41ce9a})=>{if('aiChatBalloon'!==_0x41ce9a)return;const {replyId:_0x3246dc,partIndex:_0x241e65}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x3246dc,'index':_0x241e65,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof _0x2cda04?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x278f35,_0x15e469)=>{_0x15e469['on']('ready',()=>{this['_integrateEditor'](_0x15e469);});});const _0x5da10a=this['context']['config']['get']('ai.chat.initialConversation');let _0x3a1e9b=_0x5da10a;if('lastCreated'!=_0x5da10a||(_0x3a1e9b=await this['_getLastCreatedConversationId'](),_0x3a1e9b))return'new'==_0x3a1e9b?this['_startConversationSafely']():this['loadConversation'](_0x3a1e9b);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x5e639a){const _0x4f948a=T(this['context']);if(!_0x4f948a['plugins']['has']('TrackChanges'))throw new _0x563e6a('ai-no-track-changes',null);const _0x439fa2=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x181464,interaction:_0x5f23c1}=this['getInteractionAndReplyById'](_0x5e639a['replyId']),_0x483a33=this['_getDocumentRangeForReplyChanges'](_0x5e639a['replyId'],_0x5e639a['partIndex']),_0x52ba4c=void 0x0!==_0x5e639a['partIndex']?[_0x181464['changeGroups'][_0x5e639a['partIndex']]]:_0x181464['changeGroups']['filter'](_0x22df24=>'pending'==_0x22df24['state']),_0x3f3c71=_0x52ba4c['map'](_0x2ca1f8=>_0x181464['changeGroups']['indexOf'](_0x2ca1f8));if(!_0x483a33||'$graveyard'==_0x483a33['range']['root']['rootName'])return void _0x3f3c71['forEach'](_0x24782d=>_0x181464['setChangeGroupState'](_0x24782d,'outdated'));_0x3f3c71['forEach'](_0x2434e5=>_0x181464['setChangeGroupState'](_0x2434e5,'accepted'));const _0x3f2b3d=at({'editor':_0x4f948a,'reply':_0x181464,'interaction':_0x5f23c1,'groups':_0x52ba4c,'transform':!0x0,'documentCompare':_0x439fa2,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x438df4;_0x483a33&&this['_scrollToSuggestionRange'](_0x483a33['range']),_0x4f948a['model']['change'](_0x1fa269=>{_0x438df4=_0x1fa269['batch'],_0x4f948a['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3f2b3d),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x438df4,{'interactionId':_0x5f23c1['id'],'replyId':_0x181464['id'],'indexes':_0x3f3c71['slice']()}),this['_updateRatings'](_0x181464);}['_applySuggestion'](_0x4f0063){const _0x475d96=T(this['context']),_0x5eb99e=this['context']['plugins']['get'](ot),{reply:_0x311600,interaction:_0x4fc0c8}=this['getInteractionAndReplyById'](_0x4f0063['replyId']),_0x4007de=this['_getDocumentRangeForReplyChanges'](_0x4f0063['replyId'],_0x4f0063['partIndex']),_0x487da8=void 0x0!==_0x4f0063['partIndex']?[_0x311600['changeGroups'][_0x4f0063['partIndex']]]:_0x311600['changeGroups']['filter'](_0x1253ee=>'pending'==_0x1253ee['state']),_0x33c4ba=_0x487da8['map'](_0x956c53=>_0x311600['changeGroups']['indexOf'](_0x956c53));if(!_0x4007de||'$graveyard'==_0x4007de['range']['root']['rootName'])return void _0x33c4ba['forEach'](_0x589c3a=>_0x311600['setChangeGroupState'](_0x589c3a,'outdated'));_0x33c4ba['forEach'](_0x2af0bf=>_0x311600['setChangeGroupState'](_0x2af0bf,'accepted'));const _0xbc28e2=at({'editor':_0x475d96,'reply':_0x311600,'interaction':_0x4fc0c8,'groups':_0x487da8,'transform':!0x0,'documentCompare':_0x5eb99e,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x5f1fe2;_0x4007de&&this['_scrollToSuggestionRange'](_0x4007de['range']),_0x475d96['model']['change'](_0x2d7ba3=>{_0x5f1fe2=_0x2d7ba3['batch'];for(const _0x4e7766 of _0xbc28e2)_0x4e7766['baseVersion']=_0x475d96['model']['document']['version'],rt(_0x475d96,_0x4e7766),_0x2d7ba3['batch']['addOperation'](_0x4e7766),_0x475d96['model']['applyOperation'](_0x4e7766);}),this['_batchToChanges']['set'](_0x5f1fe2,{'interactionId':_0x4fc0c8['id'],'replyId':_0x311600['id'],'indexes':_0x33c4ba['slice']()}),this['_updateRatings'](_0x311600);}['_rejectSuggestion'](_0x1f89be){const {reply:_0x32779a}=this['getInteractionAndReplyById'](_0x1f89be['replyId']);_0x32779a['setChangeGroupState'](_0x1f89be['partIndex'],'rejected');}['_openBalloonFor'](_0x5110a6,_0x16e789){if(!this['_aiChatBalloon'])return;const {reply:_0x2f1eda}=this['getInteractionAndReplyById'](_0x5110a6),_0x6b2e7f=_0x2f1eda['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x252347,_0x1d7ea7;if(void 0x0!==_0x16e789?(_0x1d7ea7=_0x6b2e7f['find'](_0x44b65e=>_0x44b65e['index']==_0x16e789),_0x252347=_0x1d7ea7?.['index']):(_0x1d7ea7=_0x6b2e7f[0x0],_0x252347=_0x1d7ea7['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x5110a6&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x252347)return;const _0x372673=this['_getUserPresentableContentPartDocumentRange'](_0x5110a6,_0x2f1eda,_0x1d7ea7);if(!_0x372673)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x5110a6,'partIndex':_0x252347},this['_scrollToSuggestionRange'](_0x372673,!0x0);const _0x28a40d=this['_getPresentableSiblingContentPartIndex'](_0x5110a6,_0x252347,'next');this['_aiChatBalloon']['updateContent']({'part':_0x1d7ea7,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x252347,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x252347+0x1)['toString']()),'showRotator':null!==_0x28a40d,'ranges':[_0x372673],'areActionsDisabled':_0x2f1eda['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x5110a6,_0x252347),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x5110a6,'index':_0x252347,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x34935d,_0x59e971,_0x49f0ef){const {reply:_0x116af7}=this['getInteractionAndReplyById'](_0x34935d),_0x487941=_0x116af7['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x487941['length'])return null;const _0x28ad06=_0x487941['findIndex'](_0x1b2173=>_0x1b2173['index']==_0x59e971),_0x24bed0='next'==_0x49f0ef?0x1:-0x1;let _0xc17fef=_0x487941['at']((_0x28ad06+_0x24bed0)%_0x487941['length'])['index'],_0x5981aa=_0x487941[_0xc17fef];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x34935d,_0x116af7,_0x5981aa);){if(_0xc17fef=_0x487941['at']((_0xc17fef+_0x24bed0)%_0x487941['length'])['index'],_0xc17fef===_0x28ad06)return null;_0x5981aa=_0x487941[_0xc17fef];}return _0xc17fef;}['_getUserPresentableContentPartDocumentRange'](_0x5e28c4,_0x557d52,_0x453398){const _0x1f0775=_0x557d52['changeGroups'];if(!_0x453398['hasChanges'])return null;const _0x3bf5df=_0x1f0775['find'](_0x1eaad1=>_0x1eaad1['index']==_0x453398['index']);if('pending'!==_0x3bf5df?.['state'])return null;const _0x36e069=this['_getDocumentRangeForReplyChanges'](_0x5e28c4,_0x453398['index']);if(!_0x36e069)return null;const {range:_0x49e3ea,currentIndex:_0x2d97c0}=_0x36e069;return'$graveyard'==_0x49e3ea['root']['rootName']?(_0x557d52['setChangeGroupState'](_0x2d97c0,'outdated'),null):_0x36e069['range'];}['_getDocumentRangeForReplyChanges'](_0xa0a9f7,_0x5cebf7){const _0x27cb32=T(this['context']),{reply:_0x589cfc,interaction:_0x6340d4}=this['getInteractionAndReplyById'](_0xa0a9f7),_0xb6879=_0x589cfc['changeGroups']['filter'](_0x1ce31f=>'pending'==_0x1ce31f['state']),_0x5ee2d5=_0xb6879['map'](_0x2cf728=>_0x589cfc['changeGroups']['indexOf'](_0x2cf728));void 0x0===_0x5cebf7&&(_0x5cebf7=_0x5ee2d5[0x0]);const _0x155a9f=_0x5ee2d5['indexOf'](_0x5cebf7);if(-0x1==_0x155a9f)return null;const _0x1099cc=_0xb6879[_0x155a9f],_0x1a9406=new _t([]),_0x29bad3=new _t([]);for(const _0x49985b of _0x1099cc['changes'])if('removed'!=_0x49985b['type']&&_0x29bad3['children']['push'](_0x49985b['node']['cloneNode'](!0x0)),'new'!=_0x49985b['type']){const _0x4f5b1b=gt(_0x28c31c=>ut(_0x28c31c,'data-id')==_0x49985b['id'],_0x589cfc['documentContextContent'],!0x0);_0x1a9406['children']['push'](_0x4f5b1b['cloneNode'](!0x0));}if(0x0==_0x1a9406['children']['length']){if(_0x1099cc['changes'][0x0]['anchorId']){const _0x2eeeea=It('data-id',_0x1099cc['changes'][0x0]['anchorId'],_0x589cfc['documentContextContent']);_0x1a9406['children']['unshift'](_0x2eeeea['cloneNode'](!0x0)),_0x29bad3['children']['unshift'](_0x2eeeea['cloneNode'](!0x0)),_0x2eeeea['nextSibling']&&(_0x1a9406['children']['push'](_0x2eeeea['nextSibling']['cloneNode'](!0x0)),_0x29bad3['children']['push'](_0x2eeeea['nextSibling']['cloneNode'](!0x0)));}else{const _0x1975f1=_0x589cfc['documentContextContent']['children'][0x0];if(!_0x1975f1)return null;_0x1a9406['children']['push'](_0x1975f1['cloneNode'](!0x0)),_0x29bad3['children']['push'](_0x1975f1['cloneNode'](!0x0));}}const _0x1c25c2=_0x6340d4['getDocumentContext'](),_0x58bc47=_0x27cb32['data']['parse'](_0x1c25c2['content']),_0x4a1a6e=pt(_0x1a9406),_0x35cef7=_0x27cb32['data']['parse'](_0x4a1a6e),_0x509320=_0x27cb32['data']['parse'](_0x4a1a6e),_0x1811f1=_0x27cb32['model']['createPositionAt'](_0x35cef7,0x0),_0x3a549a=pt(_0x29bad3),_0x519fdc={'anchor':_0x1811f1,'markDeletions':!0x1},_0x5d3bcf=_0x27cb32['plugins']['get'](ot)['getDiff'](_0x4a1a6e,_0x3a549a,_0x519fdc)['getOperations']();if(!_0x5d3bcf['length'])return null;_0x27cb32['model']['change'](_0x4683e3=>{for(const _0x31967a of _0x5d3bcf)if('remove'==_0x31967a['type']){const _0x12eb0a=_0x31967a['sourcePosition'],_0x12d0df=_0x31967a['howMany'],_0x469b3a=new lt(_0x12eb0a,_0x12d0df);_0x4683e3['batch']['addOperation'](_0x469b3a),_0x27cb32['model']['applyOperation'](_0x469b3a);}else'marker'!==_0x31967a['type']&&(_0x31967a['baseVersion']=null,_0x31967a['isDocumentOperation']=!0x1,_0x4683e3['batch']['addOperation'](_0x31967a),_0x27cb32['model']['applyOperation'](_0x31967a));});const _0x40f03d=ct(_0x27cb32,_0x5d3bcf,_0x35cef7);ht(_0x27cb32['model'],_0x40f03d);const _0x38aaa9=_0x40f03d['getFirstRange']()['start']['path']['slice'](),_0x3fa282=_0x40f03d['getFirstRange']()['end']['path']['slice'](),_0x1db5ba=[];let _0x15a404=_0x35cef7,_0x4297b0=_0x509320;for(let _0x27e2f5=0x0;_0x27e2f5<_0x3fa282['length'];_0x27e2f5++){const _0x377f7f=_0x15a404['maxOffset']-_0x3fa282[_0x27e2f5];_0x1db5ba[_0x27e2f5]=_0x4297b0['maxOffset']-_0x377f7f,_0x15a404=_0x15a404['getChildAtOffset'](_0x3fa282[_0x27e2f5]),_0x4297b0=_0x4297b0['getChildAtOffset'](_0x1db5ba[_0x27e2f5]);}const _0x1ffe30=_0x27cb32['model']['createRange'](_0x27cb32['model']['createPositionFromPath'](_0x509320,_0x38aaa9),_0x27cb32['model']['createPositionFromPath'](_0x509320,_0x1db5ba)),_0xed6af2=_0x509320['getChild'](0x0)['getAttribute'](nt),_0x20f740=Array['from'](_0x58bc47['getChildren']())['find'](_0x472a0d=>_0x472a0d['getAttribute'](nt)==_0xed6af2)['getPath'](),_0x516db7=_0x1ffe30['start']['path']['slice'](),_0x543564=_0x1ffe30['end']['path']['slice']();_0x516db7[0x0]=_0x20f740[0x0]+_0x516db7[0x0],_0x543564[0x0]=_0x20f740[0x0]+_0x543564[0x0];let _0x1aaeb0=_0x27cb32['model']['createRange'](_0x27cb32['model']['createPositionFromPath'](_0x27cb32['model']['document']['getRoot'](),_0x516db7),_0x27cb32['model']['createPositionFromPath'](_0x27cb32['model']['document']['getRoot'](),_0x543564));const _0x49b4c8=_0x27cb32['model']['document']['history']['getOperations'](_0x1c25c2['version']);for(const _0x390556 of _0x49b4c8)_0x1aaeb0=dt['_createFromRanges'](_0x1aaeb0['getTransformedByOperation'](_0x390556));return{'range':_0x1aaeb0,'currentIndex':_0x5cebf7};}['_integrateEditor'](_0x484849){if(!_0x484849['plugins']['has']('Undo'))return;const _0x5ee927=_0x484849['commands']['get']('undo'),_0x1331a3=_0x484849['commands']['get']('redo');this['listenTo'](_0x5ee927,'revert',(_0x540ac4,_0x4ed3c2,_0x1810b9)=>{const _0x59b1e4=this['_batchToChanges']['get'](_0x4ed3c2);if(!_0x59b1e4)return;const _0xf25f5=this['activeConversation']['getInteraction'](_0x59b1e4['interactionId'])['getReply'](_0x59b1e4['replyId']);_0x59b1e4['indexes']['forEach'](_0x1e77ab=>_0xf25f5['setChangeGroupState'](_0x1e77ab,'pending')),this['_batchToChanges']['delete'](_0x4ed3c2),this['_batchToChanges']['set'](_0x1810b9,_0x59b1e4);}),this['listenTo'](_0x1331a3,'revert',(_0x31e433,_0x5836c8,_0x377981)=>{const _0x597315=this['_batchToChanges']['get'](_0x5836c8);if(!_0x597315)return;const _0x5ddaf1=this['activeConversation']['getInteraction'](_0x597315['interactionId'])['getReply'](_0x597315['replyId']);_0x597315['indexes']['forEach'](_0x46e305=>_0x5ddaf1['setChangeGroupState'](_0x46e305,'accepted')),this['_batchToChanges']['delete'](_0x5836c8),this['_batchToChanges']['set'](_0x377981,_0x597315);});}async['loadConversation'](_0x32727d){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](it)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x32727d)['getConversation'](),await this['_startConversationSafely'](_0x32727d),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x32727d,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x56fc17){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x32727d}),this['_logError'](new _0x563e6a('ai-chat-conversation-not-found',this,{'error':_0x56fc17}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0xfd29d0=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x5474c2=await _0xfd29d0['getConversations']();return _0x5474c2['length']?_0x5474c2[0x0]['id']:'new';}catch(_0x33aa4b){return this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x48eb5e()}),this['_logError'](new _0x563e6a('ai-chat-conversation-init-failed',this,{'error':_0x33aa4b})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x4f167f){this['activeConversation']['id']===_0x4f167f&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x519943=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x519943),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x1ed3c8,attributes:_0x37e7e1}){await this['_handleUIUserMessage']({'userMessage':_0x1ed3c8,'attributes':_0x37e7e1});}['getGroupId'](){const _0x3823b9=this['context']['config']['get']('collaboration.channelId');if(!_0x3823b9)throw new _0x563e6a('ai-chat-missing-channel-id',this);return _0x3823b9;}async['_startConversationSafely'](_0x56a56d){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x56a56d);}catch(_0x2ce40e){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x56a56d||_0x48eb5e()}),console['error'](_0x2ce40e),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0xff69b7){let _0xd6993a;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0xff69b7||!this['activeConversation']?_0xd6993a=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0xd6993a=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x42711f=this['getGroupId'](),_0x17e846=_0xff69b7||_0x48eb5e();this['activeConversation']=new st({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0xd6993a,'conversationId':_0x17e846,'group':_0x42711f,'getEditor':()=>T(this['context']),'isFromHistory':!!_0xff69b7}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x13ce60,_0x5f1613)=>{this['_aiChatUi']['createConversation'](_0x5f1613),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0xff69b7||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x5c0a44,_0x173307)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x173307['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x580d09,_0x4c6063)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x4c6063);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x89d751=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x89d751);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x3392f3=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x3392f3);}),this['activeConversation']['on']('webSearchFinished',(_0x13aed5,_0x3028be)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3028be,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x3d5cb6,_0x4aa2f5)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x4aa2f5,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x3b069c,_0x204ddf)=>{this['_aiChatUi']['removeFeedInteraction'](_0x204ddf['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x10ebd2,_0x46c734,_0x2164fd)=>{this['updateConversationTitle'](_0x46c734,_0x2164fd);}),this['activeConversation']['on']('replyCreated',(_0x352ab5,_0x5b4041)=>{'text'===_0x5b4041['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x5b4041):this['_aiChatUi']['addFeedItemAISuggestion'](_0x5b4041);}),this['activeConversation']['on']('replyContentUpdated',async(_0x352b6f,_0x48e6ed)=>{await this['_updateReplyContent']({'reply':_0x48e6ed});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x75ca05,{reply:_0x3c83bb,index:_0x35fb10,state:_0x4cb069})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x3c83bb['id'],'index':_0x35fb10,'state':_0x4cb069}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x3c83bb['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x35fb10&&this['_aiChatBalloon']?.['setState'](_0x4cb069);}),this['activeConversation']['on']('contextItemAdded',(_0x39933e,_0x5ee7e4)=>{if(this['_aiChatUi']['addContextItem'](_0x5ee7e4['contextItem'],_0x5ee7e4['isLoading']),'selection'===_0x5ee7e4['contextItem']['type']){const _0x55ac12=[...T(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x55ac12,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x128776,_0x413139)=>{this['_aiChatUi']['removeContextItem'](_0x413139['uiId']),'current-document'==_0x413139['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x413139['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x2dc53c,_0x1bd9ee)=>{this['_aiChatUi']['setContextItemLoading'](_0x1bd9ee['contextItem']['uiId'],_0x1bd9ee['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x374c97,_0x4dd0c8)=>{this['_aiChatUi']['setConversationContext'](_0x4dd0c8['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x3ab97d,_0x514211)=>{this['_aiChatUi']['setAddContextOptions'](_0x514211['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x4adac0,_0x1838cb)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x1838cb['sourceId'],_0x1838cb['source'],_0x1838cb['resources'],_0x1838cb['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x4cb160,_0x178fd3)=>{this['_aiChatUi']['updateResourceState'](_0x178fd3['sourceId'],_0x178fd3['resourceId'],_0x178fd3['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x344661,_0x4b9654)=>{this['_aiChatUi']['updateCapabilities'](_0x4b9654);}),this['activeConversation']['on']('modelSelected',async(_0x4524dc,_0x16e8ad)=>{const _0x2e68aa=(await this['_aiChatModels']['getAll']())['find'](_0x299d7c=>_0x299d7c['id']===_0x16e8ad['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x2e68aa,_0x16e8ad['isDisabled']);}),this['activeConversation']['on']('error',(_0x3794b2,{error:_0x361988,interactionId:_0x56e57c,fileName:_0x7eefd5,url:_0x463ead,sourceId:_0x44260d,sourceLabel:_0xe108ce})=>{const _0x32339d=_0x56e57c?_0x56e57c+':'+_0x48eb5e():_0x48eb5e();_0x361988['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x32339d}):_0x361988['message']['startsWith']('ai-chat-conversation-init-failed')||_0x361988['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x32339d}),this['_logError'](_0x361988)):_0x361988['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x7eefd5),'id':_0x32339d}):_0x361988['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x463ead),'id':_0x32339d}):_0x361988['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x32339d}):_0x361988['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x32339d}):_0x361988['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x44260d&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x44260d),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0xe108ce||'source'),'id':_0x32339d}),this['_logError'](_0x361988)):_0x361988['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x32339d}),this['_logError'](_0x361988)):_0x361988['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x32339d}),this['_logError'](_0x361988)):_0x361988['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x32339d}),this['_logError'](_0x361988)):_0x361988['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x32339d}),this['_logError'](_0x361988)):_0x361988['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':_0x32339d}),this['_logError'](_0x361988)):_0x361988['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':_0x32339d}),this['_logError'](_0x361988)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x32339d}),this['_logError'](_0x361988));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0xff69b7||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x2fa790,attributes:_0x1ccb7b}){if(!this['activeConversation'])throw new _0x563e6a('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x314245=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x314245);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x2fa790,'attributes':_0x1ccb7b});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x270615){this['_aiChatUi']['setIsMaximized'](_0x270615);}['_logError'](_0x529f62){_0x4e5dbd(_0x529f62['message']);}['_removeFromContext'](_0x2df217){this['activeConversation']?.['removeFromContext'](_0x2df217);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x10cff1){const [_0x560eee,_0x2c96ee]=_0x10cff1['split'](':'),_0x4588d3=this['activeConversation']['getInteraction'](_0x560eee),_0x2ff4b6=_0x4588d3['getReply'](_0x2c96ee);return{'interaction':_0x4588d3,'reply':_0x2ff4b6};}['_scrollToSuggestionRange'](_0x20ded6,_0x19b501=!0x1){const _0x495768=T(this['context']),_0x17cea5={'target':_0x495768['editing']['view']['domConverter']['viewRangeToDom'](_0x495768['editing']['mapper']['toViewRange'](_0x20ded6)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x19b501};_0x19b501&&(_0x17cea5['alignToTop']=!0x0),_0x1fa956(_0x17cea5);}['updateConversationTitle'](_0x2d4e19,_0x41bcaa=!0x1){this['_aiChatUi']['setConversationTitle'](_0x2d4e19||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x41bcaa);}async['_updateReplyContent']({reply:_0x3c2ded,renderingStrategy:_0x3ecd08}){const {id:_0x1a7a73,interactionId:_0x300cc2,isDone:_0x2e39ab,type:_0x1bf26f,parsedContent:_0x512af7}=_0x3c2ded,_0x10e0ae=_0x300cc2+':'+_0x1a7a73;if('modification'===_0x1bf26f){const _0x586853=_0x3c2ded['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x10e0ae,'parts':_0x586853,'renderingStrategy':_0x3ecd08,'isDone':_0x2e39ab});}else'text'===_0x1bf26f&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x10e0ae,'parsedContent':_0x512af7,'renderingStrategy':_0x3ecd08,'isDone':_0x2e39ab});_0x2e39ab&&_0x3c2ded['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x10e0ae,_0x3c2ded['sources']);}async['_stopLastInteraction'](){const _0x245da9=this['activeConversation']?.['lastInteraction'];_0x245da9&&(_0x245da9['stop'](),this['_aiChatUi']['stopInteraction'](_0x245da9));}async['_flushLastInteractionUI'](){const _0x18eac0=this['activeConversation']?.['lastInteraction'];if(_0x18eac0){for await(const _0x13bfef of _0x18eac0['replies'])await this['_updateReplyContent']({'reply':_0x13bfef,'renderingStrategy':'static'});}}['_updateRatings'](_0x3466eb){const _0x238c62={'positiveCount':_0x3466eb['changeGroups']['filter'](_0x204cb7=>'accepted'===_0x204cb7['state'])['length'],'totalCount':_0x3466eb['changeGroups']['length'],'modificationId':_0x3466eb['id']},_0x1b6673=this['activeConversation']['getInteraction'](_0x3466eb['interactionId'])['messageId'];_0x1b6673&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x1b6673,_0x238c62);}['_registerToolDataCallback'](_0x2fce02){let _0x48dc28=null,_0x10de4d=null;this['on']('toolDataReceived',(_0x15e6c2,_0x473469,_0x3393b3)=>{_0x3393b3['id']!==_0x48dc28&&(_0x48dc28=_0x3393b3['id'],_0x10de4d=this['_getAIChatInteractionAPI'](_0x3393b3)),_0x2fce02(_0x473469,_0x10de4d);});}['_getAIChatInteractionAPI'](_0xb12623){const _0x19ab61=this['_aiChatUi'],_0x174f8d=()=>{_0xb12623['resetWebSearchState'](),_0xb12623['resetReasoningState'](),_0x19ab61['clearLoadingMessage']();},_0x1b0cec=()=>{_0xb12623['currentReply']&&(_0xb12623['currentReply']['done'](),_0xb12623['currentReply']=void 0x0);};return{'insertTextReply':(_0x120107,_0x1e30e7)=>{_0x1b0cec(),_0x174f8d();const _0x443bfc=_0xb12623['currentReply']=_0xb12623['createReply']({'type':'text','interactionId':_0xb12623['id'],'content':_0x120107,'id':_0x1e30e7||_0x48eb5e()});return _0x1b0cec(),_0x443bfc;},'insertCustomElement':async(_0x1bf2eb,_0x215d9e)=>(_0x1b0cec(),_0x174f8d(),_0x19ab61['addFeedItemCustomElement'](_0x1bf2eb,_0x215d9e||_0x48eb5e())),'setLoadingMessage':_0x407166=>{_0x19ab61['setLoadingMessage'](_0x407166);},'clearLoadingMessage':()=>{_0x19ab61['clearLoadingMessage']();}};}}const R='ai-selection';class D extends _0x3a5602{constructor(_0x5518bd){super(_0x5518bd),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 _0x4386b6=T(this['context']),_0xcd5335=_0x4386b6['plugins']['has']('RealTimeCollaborationClient')&&_0x4386b6['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0xcd5335||_0x48eb5e();}return this['_sessionId'];}async['getDocumentData'](){const _0xb5b1d5=T(this['context']),_0x323777=_0xb5b1d5['model'],_0x33df85=_0xb5b1d5['data']['toView'](_0x323777['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x3d3827=new Dt(_0xb5b1d5['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x33df85,_0x3d3827);let _0x4a2161=await this['_getDocumentDataStringFromView'](_0x33df85);const _0x4596ce=this['_getMarkersInDocumentOrder'](),_0x1cf69b=[];for(const _0x5697f8 of _0x4596ce){const _0x52937b='<'+_0x5697f8['name']+':start></'+_0x5697f8['name']+':start>',_0xd207e3=_0x4a2161['indexOf'](_0x52937b);_0x4a2161=_0x4a2161['substring'](0x0,_0xd207e3)+_0x4a2161['substring'](_0xd207e3+_0x52937b['length']);const _0x15e452='<'+_0x5697f8['name']+':end></'+_0x5697f8['name']+':end>',_0x4e071a=_0x4a2161['indexOf'](_0x15e452);_0x4a2161=_0x4a2161['substring'](0x0,_0x4e071a)+_0x4a2161['substring'](_0x4e071a+_0x15e452['length']),_0x1cf69b['push']({'markerName':_0x5697f8['name'],'start':_0xd207e3,'end':_0x4e071a,'htmlFragment':_0x4a2161['substring'](_0xd207e3,_0x4e071a)});}return{'content':_0x4a2161,'version':_0xb5b1d5['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x1cf69b};}async['afterInit'](){this['context']instanceof _0x2cda04?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x5cbf86,_0x330b36)=>{_0x330b36['on']('ready',()=>{this['_integrateEditor'](_0x330b36);});});}['_setOutputDataProcessor'](_0x2bae05){this['_outputDataProcessor']=_0x2bae05;}async['_getDocumentDataStringFromView'](_0x48133d){let _0x2e66cb;const _0x25e0eb=T(this['context']);if(this['_outputDataProcessor']){const _0x3f715d=_0x25e0eb['data']['processor']['domConverter']['viewToDom'](_0x48133d),_0x4bc2dc=await this['_outputDataProcessor'](_0x3f715d);_0x2e66cb=_0x25e0eb['data']['processor']['htmlWriter']['getHtml'](_0x4bc2dc);}else _0x2e66cb=_0x25e0eb['data']['processor']['toData'](_0x48133d);return _0x2e66cb;}['_integrateEditor'](_0x49d0d8){_0x49d0d8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':R,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x49d0d8['conversion']['for']('dataDowncast')['markerToElement']({'model':R,'view':(_0x22664b,{writer:_0x28ab47,options:_0x100988})=>_0x100988['convertAiChatSelectionMarker']?_0x28ab47['createUIElement'](_0x22664b['markerName']+':'+(_0x22664b['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x59e0db,_0x56626e,_0xcfed46=!0x1,_0x474df9=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x474df9)return!0x1;const _0x7c7abd=T(this['context'])['model'];return _0x7c7abd['change'](_0x40406e=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x56626e,this['_displayedFakeSelectionLocked']=_0xcfed46;let _0x309037=0x0;for(let _0x1586a6 of _0x59e0db){const _0x16f7a7=R+':'+_0x309037;if(_0x1586a6['start']['isAtEnd']){const _0x491755=_0x1586a6['start']['getLastMatchingPosition'](({item:_0x19dc0f})=>!_0x7c7abd['schema']['isContent'](_0x19dc0f),{'boundaries':_0x1586a6});_0x1586a6=_0x40406e['createRange'](_0x491755,_0x1586a6['end']);}_0x40406e['addMarker'](_0x16f7a7,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1586a6}),_0x309037++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x1d9c4e){if(this['_displayedFakeSelectionId']!=_0x1d9c4e)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x29e24c=T(this['context']),_0x1c0113=_0x29e24c['model']['markers']['getMarkersGroup'](R);return _0x29e24c['model']['change'](_0x24ac11=>{for(const _0x3aaa62 of _0x1c0113)_0x24ac11['removeMarker'](_0x3aaa62);}),!0x0;}async['modelToDataWithIds'](_0x127ab9){const _0x25f290=T(this['context']),_0x48e1dc=_0x25f290['data']['toView'](_0x127ab9),_0x3e3f72=new Dt(_0x25f290['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x48e1dc,_0x3e3f72),this['_getDocumentDataStringFromView'](_0x48e1dc);}['_setDataIdsOnChildren'](_0x2d419b,_0x474fb8){let _0x3edf6a=!0x1;const _0x2b8fc1=new Set();for(const _0x5df101 of _0x2d419b['getChildren']()){const _0x40bca6=_0x5df101['is']('emptyElement')||_0x5df101['is']('containerElement');if(!_0x5df101['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x5df101,_0x474fb8)||_0x40bca6)&&(_0x474fb8['setAttribute']('data-id',this['_nextDataId'](_0x2b8fc1),_0x5df101),_0x3edf6a=!0x0);}return _0x3edf6a;}['_nextDataId'](_0x367ccb){let _0x5d4dd3;do{_0x5d4dd3='';for(let _0x1f54ef=0x0;_0x1f54ef<0x4;_0x1f54ef++)_0x5d4dd3+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x367ccb['has'](_0x5d4dd3));return _0x367ccb['add'](_0x5d4dd3),_0x5d4dd3;}['getSelectionText'](){const {model:_0x5a411a}=T(this['context']),_0x408c6e=_0x5a411a['document']['selection'],_0x1ba024=[];for(const _0x99df91 of _0x408c6e['getRanges']())for(const _0x21255b of _0x99df91['getItems']())_0x21255b['is']('$textProxy')?_0x1ba024['push'](_0x21255b['data']):_0x21255b['is']('element')&&_0x1ba024['length']>0x0&&'\x20'!==_0x1ba024[_0x1ba024['length']-0x1]&&_0x1ba024['push']('\x20');return _0x1ba024['length']?'\x22'+_0x1ba024['join']('')['trim']()+'\x22':i(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0x15e40d=T(this['context'])['model'];return Array['from'](_0x15e40d['markers']['getMarkersGroup'](R))['sort']((_0x443077,_0x574af1)=>_0x443077['getStart']()['isBefore'](_0x574af1['getStart']())?-0x1:_0x443077['getStart']()['isAfter'](_0x574af1['getStart']())?0x1:0x0);}}const W=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Rt=[...W,'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(_0x365b5c){this['options']={'delay':_0x365b5c['delay']??0x14,'textNodeStyle':_0x365b5c['textNodeStyle'],'onStreamUpdate':_0x365b5c['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x4030cc,targetElement:_0x477134,abortSignal:_0xf4fe89}){this['isStreaming']&&this['stop'](),_0xf4fe89?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x38bb01(_0x4030cc,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x432da7=0x0;_0x432da7<this['currentIndex'];_0x432da7++)this['nodesList'][_0x432da7]['shouldBeStreamed']=!0x0;do{const _0x45ac59=Date['now'](),_0x2cc4fd=this['nodesList'][this['currentIndex']],_0x3e08be=_0x45ac59-this['lastUpdateTime'];if(_0x2cc4fd){_0x2cc4fd['shouldBeStreamed']=!0x0;let _0x4a82ed=_0x2cc4fd['parent'];for(;_0x4a82ed;)_0x4a82ed['shouldBeStreamed']=!0x0,_0x4a82ed=_0x4a82ed['parent'];}if(_0x3e08be<this['options']['delay'])try{const {promise:_0x2c4981,abortController:_0x3a88c8}=Cs(this['options']['delay']-_0x3e08be);this['timeoutAbortController']=_0x3a88c8,await _0x2c4981;}catch(_0x4d72e2){return;}_0x352e48(_0x477134,'<'+_0x477134['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x477134['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:_0x41a659}){Array['from'](_0x41a659['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x121f1b=>{_0x121f1b['replaceWith'](_0x121f1b['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x62e4b9){let _0x323aab='';if(function(_0x221ef0){return _0x82e93c(_0x221ef0);}(_0x62e4b9)){for(const _0x5761d4 of _0x62e4b9['children'])_0x323aab+=this['renderNode'](_0x5761d4);}else{if(Ts(_0x62e4b9)){if(!_0x62e4b9['shouldBeStreamed'])return'';const _0x7ada32=_0x62e4b9,_0x3cc99e=Object['entries'](_0x7ada32['attribs'])['map'](([_0x1ae261,_0xcef3b3])=>_0x1ae261+'=\x22'+_0xcef3b3+'\x22')['join']('\x20');_0x323aab+='<'+_0x7ada32['tagName']+(_0x3cc99e?'\x20'+_0x3cc99e:'')+'>';for(const _0x58039c of _0x3a470b(_0x7ada32))_0x323aab+=this['renderNode'](_0x58039c);_0x323aab+='</'+_0x7ada32['tagName']+'>';}else{if(!Ss(_0x62e4b9))return'';if(!_0x62e4b9['shouldBeStreamed'])return'';!function(_0x21f8cb){if(!_0x21f8cb['parent']||!Ts(_0x21f8cb['parent']))return!0x1;if(!ys['includes'](_0x21f8cb['parent']['tagName']))return!0x1;return!_0x1099ea(_0x21f8cb)['match'](/^\s*[<>]\s*$/);}(_0x62e4b9)?_0x323aab+=_0x17e525(_0x62e4b9):_0x323aab+=_0x17e525(new _0x504ef3('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x62e4b9]));}}return _0x323aab;}['getParsedDocumentNodeList'](){const _0x17ef8a=[];return function(_0x543cfa,_0x18b8df){const _0x8ce5a5=_0x4751a1=>{if(_0x18b8df(_0x4751a1),_0x4751a1 instanceof _0x409cd6)for(let _0x1da74e=0x0;_0x1da74e<_0x4751a1['children']['length'];_0x1da74e++){const _0x419288=_0x4751a1['children'][_0x1da74e];_0x8ce5a5(_0x419288);}};for(let _0x536a3b=0x0;_0x536a3b<_0x543cfa['children']['length'];_0x536a3b++)_0x8ce5a5(_0x543cfa['children'][_0x536a3b]);}(this['document'],_0x49586e=>{if(Ss(_0x49586e)){const _0x7788e0=this['splitTextNodeIntoWordNodes'](_0x49586e);_0x7788e0['length']&&_0x17ef8a['push'](..._0x7788e0);}_0x49586e['isWordSplitSource']||_0x49586e['isWordSplitResult']||_0x17ef8a['push'](_0x49586e);}),_0x17ef8a;}['splitTextNodeIntoWordNodes'](_0x25d855){if(_0x25d855['isWordSplitSource']||_0x25d855['isWordSplitResult'])return[];const _0x285621=_0x1099ea(_0x25d855)['match'](/(?:\s*\S+\s*)/g),_0x10b76b=[];if(_0x285621&&_0x285621['length']>0x1){for(const _0x4f1ee7 of _0x285621){const _0x2fa4a5=new _0x201b94(_0x4f1ee7);_0x2fa4a5['isWordSplitResult']=!0x0,_0x4856b5(_0x25d855,_0x2fa4a5),_0x10b76b['push'](_0x2fa4a5);}_0x25d855['isWordSplitSource']=!0x0,_0x12acc3(_0x25d855);}return _0x10b76b;}}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(_0x18b744){return _0x207546(_0x18b744);}function Ts(_0x1fe6cf){return _0x40e032(_0x1fe6cf);}function Cs(_0x48d47a){const _0x541820=new AbortController();return{'promise':new Promise((_0x243cc0,_0x449cc8)=>{const _0x3cb0ad=setTimeout(_0x243cc0,_0x48d47a);_0x541820['signal']['addEventListener']('abort',()=>{clearTimeout(_0x3cb0ad),_0x449cc8();});}),'abortController':_0x541820};}class Fr extends _0xc3e5b1{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x5ad6ac){super();const _0x6c3aab=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']=_0x5ad6ac,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x6c3aab['if']('isDone','ck-ai-chat__feed__item_done'),_0x6c3aab['if']('isVisible','ck-hidden',_0x320f92=>!_0x320f92),'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'](_0x3ff700=>{_0x3ff700['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x4755b9,_0x2d3d80,_0x5f3125){await this['htmlStreamer']['stream']({'document':_0x4755b9,'targetElement':_0x2d3d80,'abortSignal':_0x5f3125});}}class oa extends _0xc3e5b1{['showChangesToggleView'];constructor(_0x23811a,_0x521813){super(_0x23811a),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new ShowChangesToggleView(_0x23811a),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x23811a,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x521813['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x96c591=>_0x96c591?_0x2f2c13:_0x189462),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x421a92=new _0x59b3d9();_0x421a92['content']=_0x53a0ad,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x521813['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x421a92,{'tag':'span','children':[i(_0x23811a,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class ShowChangesToggleView extends _0x2cf640{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const $n={'accepted':_0x327ee4,'rejected':_0x1e26a1,'outdated':_0x1e26a1};class mi extends _0xc3e5b1{['stateIconView'];constructor(_0x18b52c){super(_0x18b52c);const _0x574aec=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new StateIconView(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x574aec['to']('state',_0x482f74=>'ck-ai-suggestion__content-part-state_'+_0x482f74),_0x574aec['if']('isVisible','ck-hidden',_0x5dae83=>!_0x5dae83)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x574aec['to']('state',_0x12806c=>{switch(_0x12806c){case'accepted':return i(_0x18b52c,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return i(_0x18b52c,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return i(_0x18b52c,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x3a6fce){this['state']=_0x3a6fce;}}class StateIconView extends _0x59b3d9{constructor(){super(),this['set']('state','accepted'),this['content']=$n[this['state']],this['on']('change:state',()=>{this['content']=$n[this['state']];});}}class gi extends _0x14c71e{['_applyButton'];['_suggestButton'];constructor(_0x341770,_0x2c90b2,_0x3e185e){super(_0x341770);const _0x8b124e=Boolean(_0x3e185e);this['set']('isEnabled',!_0x8b124e),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x4c9972=[];if(_0x8b124e){const _0x517c0a=new _0x2cf640(_0x341770);_0x517c0a['set']({'label':i(_0x341770,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x169d70}),_0x4c9972['push'](_0x517c0a);}else{_0x2c90b2['includes']('applySuggestion')&&(this['_applyButton']=new _0x2cf640(_0x341770),this['_applyButton']['set']({'label':i(_0x341770,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x327ee4}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x4c9972['push'](this['_applyButton'])),_0x2c90b2['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x2cf640(_0x341770),this['_suggestButton']['set']({'label':i(_0x341770,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x40fbce}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x4c9972['push'](this['_suggestButton']));const _0x4b14e8=new _0x2cf640(_0x341770);_0x4b14e8['set']({'label':i(_0x341770,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1e26a1}),_0x4b14e8['bind']('isEnabled')['to'](this),_0x4b14e8['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x4c9972['push'](_0x4b14e8);}this['items']['addMany'](_0x4c9972);const _0x104cab=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x104cab['if']('isVisible','ck-hidden',_0x7f3cb1=>!_0x7f3cb1)]}});}['setButtonsVisibility']({showApplyButton:_0x11a217,showSuggestButton:_0x48619f}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x11a217),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x48619f);}}class vn extends _0xc3e5b1{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x500072,{part:_0x58bb2c,uiIndex:_0x4c6484,availableActions:_0x288e9f,areActionsDisabled:_0x525e3b}){super(_0x500072),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new gi(_0x500072,_0x288e9f,_0x525e3b),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x58bb2c['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x58bb2c['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x58bb2c['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new mi(_0x500072),this['titleLabelView']=new AISuggestionBodyContentPartTitleLabelView(_0x500072,_0x4c6484),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',(_0x3fee5f,_0x3eb841,_0x4b83d2,_0x1656d6)=>{'pending'===_0x1656d6?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x4b83d2?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x4b83d2),this['children']['add'](this['stateView']));});}}class AISuggestionBodyContentPartTitleLabelView extends _0xc3e5b1{constructor(_0x156a90,_0x520eb6){super(_0x156a90),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x156a90,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x520eb6['toString']())]});}}class ui extends _0xc3e5b1{['htmlStreamer'];constructor(_0x427dfe){super(_0x427dfe),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:_0x40d5e9,renderingStrategy:_0x262276,abortSignal:_0x24fe31}){'streaming'===_0x262276?await this['htmlStreamer']['stream']({'document':_0x40d5e9['content'],'targetElement':this['element'],'abortSignal':_0x24fe31}):this['element']['innerHTML']=pt(_0x40d5e9['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0xc3e5b1{['_children'];['_headerView'];['_streamableContentView'];constructor(_0xbc28a9,{part:_0x2b1760,uiIndex:_0x14425f,areActionsDisabled:_0x563617,availableActions:_0x158087}){super(_0xbc28a9);const _0x3cb8ca=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x15a7a4=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x563617;};this['on']('change:state',_0x15a7a4),this['on']('change:isDone',_0x15a7a4),_0x15a7a4(),this['_children']=this['createCollection'](),this['_headerView']=new vn(_0xbc28a9,{'part':_0x2b1760,'uiIndex':_0x14425f,'availableActions':_0x158087,'areActionsDisabled':_0x563617}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...W)['to'](this),this['_streamableContentView']=new ui(_0xbc28a9),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x3cb8ca['to']('state',_0x2bbf80=>'ck-ai-suggestion__body__content-part_'+_0x2bbf80),_0x3cb8ca['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x3cb8ca['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x3cb8ca['if']('isVisible','ck-hidden',_0x4c4b43=>!_0x4c4b43)]},'children':this['_children'],'on':{'mouseenter':_0x3cb8ca['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x2b1760['index']});}),'mouseleave':_0x3cb8ca['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x2b1760['index']});}),'click':_0x3cb8ca['to'](_0x438a6c=>{const _0x43d18e=_0x438a6c['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x43d18e)&&this['fire']('showChangeInText',{'index':_0x2b1760['index']});})}});}async['updateContent']({part:_0x4abd6d,renderingStrategy:_0x44f2fd,showUnchangedParts:_0xbf0ae0=!0x1,abortSignal:_0x3d34b9}){this['partDefinition']=_0x4abd6d,this['isVisible']=this['partDefinition']['hasChanges']||_0xbf0ae0,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x4abd6d,'renderingStrategy':_0x44f2fd,'abortSignal':_0x3d34b9});}['markAsDone'](){this['isDone']=!0x0;}}class St extends _0x5bd7c6(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x5042a6){const _0x2d58a7=this['createTask'](_0x5042a6);return this['queue']['push'](_0x2d58a7),this['_processQueue'](),_0x2d58a7['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(_0x593eb7=>{this['once']('_queueEmpty',()=>{_0x593eb7();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x425428=this['queue']['shift']();try{await _0x425428['callback'](this['_abortController']['signal']),_0x425428['resolve']();}catch(_0x190278){_0x425428['reject'](_0x190278);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x1b445b){let _0x1272fd,_0x1e9995;const _0x3d5d5b=new Promise((_0x424fc1,_0x1a4218)=>{_0x1272fd=_0x424fc1,_0x1e9995=_0x1a4218;});return{'callback':_0x1b445b,'resolve':_0x1272fd,'reject':_0x1e9995,'completePromise':_0x3d5d5b};}}class Ke extends Fr{constructor(_0x3c48d2){super(_0x3c48d2),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x3c48d2['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x260b86){this['element']['innerHTML']=_0x260b86;}}const J=['applySuggestion','insertSuggestion'];class ra extends _0xc3e5b1{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x5cd18a,_0xd652a0=[...J],_0x531441){super(_0x5cd18a);const _0x28c80d=this['bindTemplate'],_0xe1400b=Boolean(_0x531441);if(this['set']('isEnabled',!_0xe1400b),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0xe1400b){const _0x1f211e=new _0x2cf640(_0x5cd18a);_0x1f211e['set']({'label':i(_0x5cd18a,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x169d70});const _0xf7cc9e=new _0xc3e5b1(_0x5cd18a);_0xf7cc9e['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[i(_0x5cd18a,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x1f211e]}]}),this['children']['add'](_0xf7cc9e);}else this['_applyChangesButton']=new _0x2cf640(_0x5cd18a),this['_applyChangesButton']['set']({'label':i(_0x5cd18a,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0xd652a0['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x2cf640(_0x5cd18a),this['_insertSuggestionsButton']['set']({'label':i(_0x5cd18a,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0xd652a0['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'](_0x190cca=>{_0x190cca['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',_0x28c80d['if']('isVisible','ck-hidden',_0x3fea59=>!_0x3fea59)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x1829fa){this['isVisible']=_0x1829fa;}['_switchButtonLabelsPlurality'](_0x33b2d3){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x33b2d3?(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 _0xc3e5b1{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x2182e1,_0x3accb9){super(_0x2182e1),this['bodyCollection']=_0x3accb9,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',_0x156fda=>!_0x156fda)]},'children':this['children']});const _0x384079=new _0xc3e5b1(this['locale']),_0x34f21b=new _0x59b3d9();_0x34f21b['content']=_0xd8346c,_0x384079['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x34f21b,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x384079),this['_setupBalloonPanel'](_0x2182e1);}['addSource'](_0x54d776){this['children']['add'](new qr(this['locale'],_0x54d776,this['balloonPanelView']));}['_setupBalloonPanel'](_0x302bf2){this['balloonPanelView']=new _0x5442ef(_0x302bf2),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class qr extends _0x2cf640{['balloonPanelView'];['source'];constructor(_0x2d7979,_0x4f3a6e,_0x5d9d89){super(_0x2d7979),this['source']=_0x4f3a6e,this['balloonPanelView']=_0x5d9d89,this['set']({'label':_0x4f3a6e['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x19f8b6=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x19f8b6['to'](()=>{window['open'](_0x4f3a6e['url'],'_blank');}),'mouseenter':_0x19f8b6['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x19f8b6['to'](()=>{this['_hideTooltip']();})}}),_0x4f3a6e['favicon']){const _0x1e60b4=new _0xc3e5b1(_0x2d7979);_0x1e60b4['setTemplate']({'tag':'img','attributes':{'src':_0x4f3a6e['favicon']||_0xd8346c,'alt':_0x4f3a6e['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x1e60b4);}else this['set']('icon',_0xd8346c);}['_createTooltipContentView'](_0x3a0dbe,_0x156f30){const _0x40e53a=new _0xc3e5b1(_0x3a0dbe),_0x59da62=[];let _0x5e1c30;_0x156f30?.['favicon']?(_0x5e1c30=new _0xc3e5b1(_0x3a0dbe),_0x5e1c30['setTemplate']({'tag':'img','attributes':{'src':_0x156f30['favicon'],'alt':_0x156f30['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x5e1c30=new _0x59b3d9(),_0x5e1c30['content']=_0xd8346c,_0x5e1c30['extendTemplate']({'attributes':{'alt':_0x156f30['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x59da62['push'](_0x5e1c30);const _0x6756f5=new _0xc3e5b1(_0x3a0dbe);_0x6756f5['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x156f30['url']},'children':[{'text':new URL(_0x156f30['url'])?.['hostname']}]}),_0x59da62['push'](_0x6756f5);const _0x36664f=new _0xc3e5b1(_0x3a0dbe);_0x36664f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x59da62});const _0x4a2eca=new _0xc3e5b1(_0x3a0dbe);return _0x4a2eca['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x156f30['title']['length']>0x190?_0x156f30['title']['substring'](0x0,0x190)+'...':_0x156f30['title']}]}),_0x40e53a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x36664f,_0x4a2eca]}),_0x40e53a;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x5442ef['defaultPositions']['northArrowSouth'],_0x5442ef['defaultPositions']['northArrowSouthWest'],_0x5442ef['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 _0x24721c=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x24721c);}}class ca extends _0xc3e5b1{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x45d769,_0x37e670){super(_0x45d769);const {areActionsDisabled:_0x57702f,showUnchangedParts:_0x51b3d3,availableActions:_0x4d2f55}=_0x37e670;this['_areActionsDisabled']=_0x57702f,this['_showUnchangedParts']=_0x51b3d3,this['_availableActions']=_0x4d2f55,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new St(),this['_emptyPartsWarningView']=new Ke({'id':'empty-parts-warning','initialContent':i(_0x45d769,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x45d769,_0x37e670['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sr(this['locale'],_0x37e670['bodyCollection']),_0x37e670['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...W)['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:_0x3570c1,renderingStrategy:_0xedc685,abortSignal:_0x162321}){this['_children']['length']?_0x3570c1['forEach'](_0x52fcdc=>{const _0x294743=this['_cachedContentParts']['findIndex'](_0x289be9=>_0x289be9['index']==_0x52fcdc['index']);-0x1===_0x294743?this['_cachedContentParts']['push'](_0x52fcdc):this['_cachedContentParts'][_0x294743]=_0x52fcdc;}):this['_cachedContentParts']=_0x3570c1;const _0xcabc86=this['_showUnchangedParts']?_0x3570c1:_0x3570c1['filter'](_0x12237b=>_0x12237b['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0xcabc86['length']>0x1);for(const _0x4ecc12 of _0xcabc86)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x13374c=>{let _0x4864a4=this['getPartView'](_0x4ecc12['index']);_0x4864a4||(_0x4864a4=new na(this['locale'],{'part':_0x4ecc12,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x4864a4['delegate'](...W)['to'](this),this['_children']['add'](_0x4864a4),this['hasPendingParts']=!0x0),await _0x4864a4['updateContent']({'part':_0x4ecc12,'renderingStrategy':_0xedc685,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x13374c}),_0x4864a4['markAsDone']();});return _0x162321?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x4d68f0,_0x9982eb){const _0x70a07f=this['getPartView'](_0x4d68f0);_0x70a07f&&(_0x70a07f['state']=_0x9982eb),this['hasPendingParts']='pending'==_0x9982eb||Array['from'](this['_children'])['some'](_0x3e0a2b=>'pending'==_0x3e0a2b['state']);}['setPartActive'](_0x4c913f,_0x115a4a){if(!0x1===_0x4c913f){for(const _0x5eb0d3 of this['_children'])_0x5eb0d3['isActive']=!0x1;}else{const _0x5c711e=this['getPartView'](_0x4c913f);_0x5c711e&&(_0x5c711e['isActive']=_0x115a4a);}}['updateSources'](_0x10444d){_0x10444d['forEach'](_0x2ce349=>this['_sourcesView']['addSource'](_0x2ce349)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x115609){return this['_children']['find'](_0x4fbafb=>_0x4fbafb['partDefinition']['index']==_0x115609)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x1bc851=!this['_cachedContentParts']['find'](({hasChanges:_0x3447dc})=>_0x3447dc),_0x1ac007=!!this['_cachedContentParts']['find'](({hasChanges:_0x2c396a})=>!_0x2c396a);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x1ac007,_0x1bc851?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'](_0x1179df=>_0x1179df['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x1b3d21=>_0x1b3d21['partDefinition']['hasChanges'])['length']>0x0;}}class gn extends _0xc3e5b1{['bodyView'];['children'];['headerView'];constructor(_0x1634dd,_0x5bb1fa,_0x439d2b){super(_0x1634dd);const {showDiff:_0x458d91,areActionsDisabled:_0x41f554,showUnchangedParts:_0x2f9fd5,availableActions:_0x48ff53}=_0x5bb1fa;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0x1634dd,{'showDiff':_0x458d91}),this['headerView']['on']('toggleShowChanges',(_0xc2c474,_0x16c491)=>{this['areChangesVisible']=_0x16c491['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x16c491['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ca(_0x1634dd,{'areActionsDisabled':_0x41f554,'showUnchangedParts':!!_0x2f9fd5,'availableActions':_0x48ff53,'bodyCollection':_0x439d2b}),this['bodyView']['delegate'](...W)['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'](_0x52a8f1){await this['bodyView']['updateContentParts'](_0x52a8f1);}['updateSources'](_0x545852){this['bodyView']['updateSources'](_0x545852);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Be extends Fr{['containerView'];constructor(_0x31e95a,_0x3f0924,_0x49f86b){super(_0x3f0924),this['set']('isTrackChangesOn',!0x1),this['containerView']=new gn(_0x31e95a,{'showDiff':_0x3f0924['showDiff'],'areActionsDisabled':_0x3f0924['areActionsDisabled'],'availableActions':_0x3f0924['availableActions']},_0x49f86b),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x18a7eb,_0x37634e)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x37634e['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',(_0x373685,{index:_0xb26f})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0xb26f});}),this['containerView']['on']('applySuggestion',(_0x3550c5,{index:_0x3c86b0}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x3c86b0});}),this['containerView']['on']('insertSuggestion',(_0x5909c4,{index:_0x26cd1c}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x26cd1c});}),this['containerView']['on']('rejectSuggestion',(_0x41c36a,{index:_0x3ab450})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3ab450});}),this['containerView']['on']('mouseOverSuggestion',(_0x5bc32b,{index:_0x164b53})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x164b53});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x2a817c,{index:_0x44a4b5})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x44a4b5});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x195231){await this['containerView']['updateContent'](_0x195231);}['updatePartState'](_0x30fd77,_0x327b35){this['containerView']['bodyView']['updatePartState'](_0x30fd77,_0x327b35);}['setPartActive'](_0x1be93a,_0x36d16b){!0x1===_0x1be93a?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x1be93a,_0x36d16b);}['updateSources'](_0x109313){this['containerView']['updateSources'](_0x109313);}['getPartView'](_0x12484c){return this['containerView']['bodyView']['getPartView'](_0x12484c);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class qe extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x1a3666,_0x56159a,_0x11f031){super(_0x56159a),this['_bodyCollection']=_0x11f031,this['locale']=_0x1a3666,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0xc3e5b1(),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':Wi(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x32395e,renderingStrategy:_0x51281f,abortSignal:_0x4e30d4}){'streaming'===_0x51281f?await this['streamIntoElement'](_0x32395e,this['replyContainer']['element'],_0x4e30d4):this['replyContainer']['element']['innerHTML']=_0x17e525(_0x32395e);}['updateSources'](_0x19d54d){const _0x58459c=new Sr(this['locale'],this['_bodyCollection']);_0x58459c['children']['addMany'](_0x19d54d['map'](_0x20783d=>new qr(this['locale'],_0x20783d,_0x58459c['balloonPanelView']))),_0x58459c['isVisible']=!0x0,this['children']['add'](_0x58459c);}}class Ze extends _0x559c75{constructor(_0x20efd7=void 0x0){super();const _0x1b6e37=_0x20efd7?'ck-ai-spinner_'+_0x20efd7:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x1b6e37]}});}}const xn={'file':_0x4d62fe,'document':_0x2ff8c2,'web-resource':_0xa0ac3e,'text':_0x4d62fe,'selection':_0x413c92,'mcp-tool-context':_0x2ff8c2},qn='ck-ai-chat-context-chip',Qn='ck-ai-chat-context-chip_wide',Xn='ck-ai-chat-context-chip_document',zn='ck-ai-chat-context-chip__label',Jn='ck-ai-chat-context-chip__type-icon',Zn='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class vo extends _0x2cf640{constructor(_0x4cb9ea,_0xc869ac,_0x5b2971,_0x1cf2af,_0x41966f=!0x1){super(_0x4cb9ea),this['_isAnimationOnEnterEnabled']=_0x1cf2af,this['_initializeProperties'](_0xc869ac,_0x5b2971,_0x41966f),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'](_0x7e8983,_0x487c89,_0x1f3222){this['set']('label',_0x7e8983['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x7e8983['type']),this['set']('id',_0x7e8983['uiId']),this['set']('readonly',_0x487c89),this['set']('isLoading',_0x1f3222);}['_setupTemplate'](){const _0x26ef5c=this['_createIconView'](),_0x13c83f=this['_createRemoveButton'](),_0x23603f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x23603f),'children':this['_createTemplateChildren'](_0x26ef5c,_0x13c83f,_0x23603f)});}['_createTemplateAttributes'](_0xca3c48){return{'class':[qn,_0xca3c48['if']('itemType',Xn,_0x61dec1=>'document'==_0x61dec1),_0xca3c48['if']('itemType',Qn,_0x3cfbb9=>'selection'==_0x3cfbb9)],'data-cke-tooltip-text':_0xca3c48['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':Zn};}['_createTemplateChildren'](_0x43014c,_0xc55fdc,_0x537bbd){const _0x466a2d=this['_createLabelElement'](_0x537bbd),_0x436511=this['_createLoaderIcon']();return this['readonly']?[_0x43014c,_0x466a2d]:[_0x43014c,_0x436511,_0x466a2d,_0xc55fdc];}['_createLabelElement'](_0x48c92e){return{'tag':'span','attributes':{'class':zn},'children':[{'text':_0x48c92e['to']('label')}]};}['_createRemoveButton'](){const _0x4e41cd=new _0x2cf640(this['locale']);return _0x4e41cd['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x3daaaf}),this['_setupRemoveButtonEvent'](_0x4e41cd),_0x4e41cd;}['_setupRemoveButtonEvent'](_0x584c0c){_0x584c0c['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x3bd552=this['bindTemplate'],_0x325f75=new _0x59b3d9();return _0x325f75['content']=xn[this['itemType']],_0x325f75['extendTemplate']({'attributes':{'class':[Jn,_0x3bd552['if']('isLoading','ck-hidden',_0x8e78ad=>_0x8e78ad)]}}),_0x325f75;}['_handleAnimationEndOnce'](_0x7df12,_0x5d54ec){if(!_0x7df12)return;const _0x18bd5e=()=>{_0x5d54ec(),_0x7df12['removeEventListener']('animationend',_0x18bd5e),_0x7df12['removeEventListener']('webkitAnimationEnd',_0x18bd5e);};_0x7df12['addEventListener']('animationend',_0x18bd5e),_0x7df12['addEventListener']('webkitAnimationEnd',_0x18bd5e);}['_createLoaderIcon'](){const _0x4e326b=new Ze('small');return _0x4e326b['bind']('isVisible')['to'](this,'isLoading',_0x4a8be7=>_0x4a8be7),_0x4e326b;}}function In(_0x70814f){if(!_0x70814f)return _0x70814f;if(_0x70814f['length']<=0x78)return _0x70814f;const _0xa3e229=_0x70814f['slice'](0x0,0x78),_0x44b50a=_0xa3e229['lastIndexOf']('\x20');return(_0x44b50a>0x0?_0xa3e229['slice'](0x0,_0x44b50a):_0xa3e229)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Io{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x55ee8b,_0x559355,_0x2c547e,_0x2cc194,_0x5aaf31){this['_locale']=_0x55ee8b,this['_visibleChips']=_0x559355,this['_config']={...hn,..._0x2c547e,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x2c547e['cssClasses']}},this['_overflowChips']=new _0x7916ba(),this['_bodyCollection']=_0x2cc194,this['_parentView']=_0x5aaf31||null;}['setContainerElement'](_0x2baf85){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x2baf85,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 _0x3eb9ad=[...this['_visibleChips'],...this['_overflowChips']],_0x5d785c=this['_createCalculationContainer'](),_0x3dfd6a=this['_calculateOverflowInContainer'](_0x5d785c,_0x3eb9ad),_0x22a8b7=_0x5d785c['_ancestorsToRestore'];_0x22a8b7&&this['_restoreAncestorVisibility'](_0x22a8b7),_0x5d785c['remove'](),this['_applyOverflowResults'](_0x3eb9ad,_0x3dfd6a);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x1d212b({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0xa509fa=new _0x2cf640(this['_locale']);_0xa509fa['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x5f4e3d=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x5f4e3d['push'](this['_config']['cssClasses']['controlsButton']),_0xa509fa['extendTemplate']({'attributes':{'class':_0x5f4e3d}}),_0xa509fa;}['_createShowMoreBalloonPanelView'](){const _0x13dd96=new _0x5442ef(this['_locale']);return _0x13dd96['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x13dd96),_0x13dd96;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x34a2c3=>{_0x34a2c3['disableAnimationOnEnter']();});const _0x406db6=new _0xc3e5b1(this['_locale']);_0x406db6['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x406db6);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x3034a0=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x3034a0?'':'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'](_0x126909){const _0x331034=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x3029ca=this['_containerElement']?.['classList'];if(_0x3029ca){const _0x2ca3e7=_0x3029ca[0x0]||'',_0x2476d4=_0x126909['querySelector']('.'+_0x2ca3e7),_0x428d3a=_0x126909['querySelector'](_0x331034);return _0x2476d4||_0x428d3a||_0x126909;}return _0x126909['querySelector'](_0x331034)||_0x126909;}['_calculateContainerWidth'](){const _0x3b9049=this['_parentView']?.['element']||this['_containerElement'];if(!_0x3b9049)return an;const _0x31233a=window['getComputedStyle'](_0x3b9049)['width'];if('auto'===_0x31233a||'0px'===_0x31233a||!_0x31233a){const _0x4ed139=_0x3b9049['parentElement'];if(_0x4ed139){const _0x50c440=window['getComputedStyle'](_0x4ed139);return'auto'!==_0x50c440['width']?_0x50c440['width']:an;}return an;}return _0x31233a;}['_applyCalculationStyles'](_0x4cad33,_0xf438b3){this['_config']['cssClasses']['calculationContainer']&&_0x4cad33['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x4cad33['style']['width']=_0xf438b3,_0x4cad33['style']['position']='absolute',_0x4cad33['style']['top']='-9999px',_0x4cad33['style']['left']='-9999px',_0x4cad33['style']['opacity']='0',_0x4cad33['style']['pointerEvents']='none',_0x4cad33['style']['zIndex']='-1',_0x4cad33['style']['visibility']='visible\x20!important',_0x4cad33['style']['display']='block\x20!important',_0x4cad33['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x137f19){_0x137f19['forEach'](({element:_0x53784d,originalDisplay:_0x533337,originalVisibility:_0x16cf31})=>{_0x53784d['style']['display']=_0x533337,_0x53784d['style']['visibility']=_0x16cf31;});}['_makeAncestorsVisible'](_0x4f49b7){const _0x4df9e8=[];let _0x34bb49=_0x4f49b7;for(;_0x34bb49&&_0x34bb49!==document['body'];){const _0x2e1489=window['getComputedStyle'](_0x34bb49);'none'!==_0x2e1489['display']&&'hidden'!==_0x2e1489['visibility']||(_0x4df9e8['push']({'element':_0x34bb49,'originalDisplay':_0x34bb49['style']['display'],'originalVisibility':_0x34bb49['style']['visibility']}),_0x34bb49['style']['display']='block',_0x34bb49['style']['visibility']='visible'),_0x34bb49=_0x34bb49['parentElement'];}return _0x4df9e8;}['_createContainerElements'](){let _0x4902d7,_0x365d41;return this['_parentView']?.['element']?(_0x4902d7=this['_parentView']['element']['cloneNode'](!0x0),_0x365d41=this['_findTargetContainer'](_0x4902d7)):(_0x4902d7=document['createElement']('div'),_0x365d41=_0x4902d7),{'calculationContainer':_0x4902d7,'targetContainer':_0x365d41};}['_createCalculationContainer'](){const {calculationContainer:_0x1e097c,targetContainer:_0x53b086}=this['_createContainerElements'](),_0x3327bb=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x1e097c,_0x3327bb);const _0x49354c=this['_parentView']?.['element']||this['_containerElement'],_0x1df882=_0x49354c?.['parentElement'];_0x1df882?_0x1df882['appendChild'](_0x1e097c):document['body']['appendChild'](_0x1e097c),_0x1e097c['_targetContainer']=_0x53b086;const _0x3fe92d=this['_makeAncestorsVisible'](_0x1df882||null);return _0x1e097c['offsetWidth'],_0x1e097c['_ancestorsToRestore']=_0x3fe92d,_0x1e097c;}['_calculateOverflowInContainer'](_0x248f81,_0x56bb58){const _0x1faf11=_0x248f81['_targetContainer']||_0x248f81,_0x58f0a4=[],{rowCount:_0x50441b}=this['_renderChipsAndCountRows'](_0x1faf11,_0x56bb58);if(_0x50441b<=this['_config']['maxVisibleRows'])return _0x58f0a4;const _0x33cdfd=_0x56bb58['slice']();for(;_0x33cdfd['length']>0x0;){if(this['_testButtonFit'](_0x248f81,_0x1faf11,_0x33cdfd)){const _0x1f98c0=_0x56bb58['filter'](_0x2e1ee1=>!_0x33cdfd['includes'](_0x2e1ee1));_0x58f0a4['push'](..._0x1f98c0);break;}if(!_0x33cdfd['pop']())break;}return _0x58f0a4;}['_renderChipsAndCountRows'](_0x567480,_0x2ff4ba){_0x567480['innerHTML']='',_0x2ff4ba['forEach'](_0x27545f=>{if(_0x27545f['element']){const _0x22e54b=_0x27545f['element']['cloneNode'](!0x0);_0x567480['appendChild'](_0x22e54b);}}),_0x567480['offsetWidth'];const _0x3f1059=_0x567480['children'],_0x2c5d99=[];return Array['from'](_0x3f1059)['forEach'](_0x36d731=>{const _0x20edf4=_0x36d731['getBoundingClientRect']()['top'];_0x2c5d99['some'](_0x23d965=>Math['abs'](_0x23d965-_0x20edf4)<this['_config']['rowDetectionTolerance'])||_0x2c5d99['push'](_0x20edf4);}),{'rowCount':_0x2c5d99['length']};}['_createMockButton'](){const _0x5860db=document['createElement']('button');return _0x5860db['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x5860db['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x5860db['textContent']='+\x201',_0x5860db;}['_testButtonFit'](_0x86de32,_0x25bbaa,_0x46fc38){this['_renderChipsAndCountRows'](_0x25bbaa,_0x46fc38);const _0x254a9b=this['_createMockButton']();_0x86de32['appendChild'](_0x254a9b),_0x86de32['offsetWidth'];const _0x20fe1b=[..._0x25bbaa['children'],_0x254a9b],_0x250a27=[];_0x20fe1b['forEach'](_0x5512cd=>{const _0x15ff4c=_0x5512cd['getBoundingClientRect']()['top'];_0x250a27['some'](_0x1111a4=>Math['abs'](_0x1111a4-_0x15ff4c)<this['_config']['rowDetectionTolerance'])||_0x250a27['push'](_0x15ff4c);});const _0x4591d7=_0x250a27['length'];return _0x254a9b['remove'](),_0x4591d7<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x1d1904,_0x575bcd){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x1d1904['forEach'](_0x4db0f0=>{_0x575bcd['includes'](_0x4db0f0)?this['_overflowChips']['add'](_0x4db0f0):this['_visibleChips']['add'](_0x4db0f0);});}['_updateOverflowUI'](_0x1d53af){if(_0x1d53af>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x1d53af>0x0&&this['_showMoreButtonView']){const _0x324813=''+this['_config']['showMoreLabelPrefix']+(_0x1d53af<0x63?_0x1d53af:'99');this['_showMoreButtonView']['label']=_0x324813;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x41e103,_0x2ded91){this['_distributeChips'](_0x41e103,_0x2ded91),this['_updateOverflowUI'](_0x2ded91['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x123b95=>{_0x123b95[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 _0x9606f1=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x9606f1['width']||0x0===_0x9606f1['height'])return!0x1;const _0x286d7e=window['innerHeight']||document['documentElement']['clientHeight'],_0x364459=window['innerWidth']||document['documentElement']['clientWidth'],_0x5b927b=0xc8;return _0x9606f1['bottom']>=-0xc8&&_0x9606f1['top']<=_0x286d7e+_0x5b927b&&_0x9606f1['right']>=-0xc8&&_0x9606f1['left']<=_0x364459+_0x5b927b;}}const Or='ck-ai-chat__feed__context-chips',Nr='ck-ai-chat-context-chips-wrapper',Ur='ck-ai-chat-context-chips-wrapper-balloon',Wr='ck-ai-chat-controls-button',Yr='ck-ai-chat-controls_context_show-more-button',$r='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0xc3e5b1{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x2f0fce,_0x45d302,_0x492cfe){super(_0x2f0fce),this['_bodyCollection']=_0x492cfe,this['_createContextChips'](_0x45d302);const _0x2b195b={'cssClasses':{'showMoreButton':Yr,'showMoreBalloon':$r,'overflowContainer':Ur,'controlsButton':Wr}};this['_overflowManager']=new Io(_0x2f0fce,this['_contextChips'],_0x2b195b,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Or,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Nr},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x32e04c=this['element']['querySelector']('.'+Nr);_0x32e04c&&(this['_overflowManager']['setContainerElement'](_0x32e04c),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x5cbd3c){for(const _0x4f9105 of _0x5cbd3c){const _0x5c23f1=new vo(this['locale'],_0x4f9105,!0x0,!0x1);this['_contextChips']['add'](_0x5c23f1);}}}class Ge extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x4b5e74,_0x107a47,_0x679bb4){super(_0x107a47),this['_locale']=_0x4b5e74,this['_bodyCollection']=_0x679bb4,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'](_0x18194b=>!_0x18194b['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0xc3e5b1(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 Ct extends Fr{['capabilities'];constructor(_0x5eecb5,_0x302648){super(_0x302648);const {isWebSearchEnabled:_0x5d733d,isReasoningEnabled:_0x14d26e}=_0x302648['capabilities'],_0x51fbd5=[];let _0x3975fb='';_0x5d733d&&_0x14d26e?(_0x3975fb=i(_0x5eecb5,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x51fbd5['push'](aa(_0xd8346c)),_0x51fbd5['push'](aa(_0xd8dd72))):_0x5d733d?(_0x3975fb=i(_0x5eecb5,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x51fbd5['push'](aa(_0xd8346c))):_0x14d26e&&(_0x3975fb=i(_0x5eecb5,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x51fbd5['push'](aa(_0xd8dd72))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x3975fb?'':'ck-hidden']}});const _0x209698=new _0xc3e5b1();_0x209698['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x51fbd5,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x3975fb]}]}),this['children']['add'](_0x209698),this['capabilities']=_0x302648['capabilities'];}}function aa(_0x2e5f43){const _0x111bb4=new _0x59b3d9();return _0x111bb4['content']=_0x2e5f43,_0x111bb4;}const Fs=['wheel','touchstart','pointerdown','keydown'],Us=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Qe{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x3fb3c0){this['element']=_0x3fb3c0,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x3f6a56 of Fs){const _0x518f72='keydown'!==_0x3f6a56;this['element']['addEventListener'](_0x3f6a56,this['_onUserEvent']['bind'](this),{'passive':_0x518f72,'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'](_0x2e0882){if(this['isRunning']){if('keydown'===_0x2e0882['type']){const _0x26b902=_0x2e0882['key'];if(!Us['includes'](_0x26b902))return;}_0x2e0882 instanceof WheelEvent?_0x2e0882['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x3681ed,scrollHeight:_0x33282b,clientHeight:_0x2989e0}=this['element'];return _0x33282b-_0x3681ed-_0x2989e0<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class Xe extends _0xc3e5b1{constructor(_0x506561,_0x2f2294){super(_0x506561),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x2f2294)});}['_createSkeletonItems'](_0x110212){const _0x45d924=['ck','ck-ai-skeleton__item'];return _0x110212['map'](_0x1052f8=>{let _0x145889='';switch(_0x1052f8['attributes']['align']){case'right':_0x145889='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x145889='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x145889='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x1052f8['tag'],'attributes':{'class':[..._0x45d924,_0x1052f8['attributes']['class']?_0x1052f8['attributes']['class']:''],'style':'width:\x20'+_0x1052f8['attributes']['width']+';\x20height:\x20'+_0x1052f8['attributes']['height']+';'+_0x145889}};});}}const Ye={'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(_0x4511e0,_0x565ddd,_0x3e49b6,_0x417c19){return new Array(_0x4511e0)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x565ddd,'height':_0x3e49b6,'align':_0x417c19}}));}class $e extends Fr{constructor(_0x38efbf){super(_0x38efbf),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 di extends _0xc3e5b1{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x4c25d1,_0x101320){super(_0x4c25d1),this['_bodyCollection']=_0x101320,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Rt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Qe(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x5e2f3c,_0x4d9bff){let _0x3a7246;return'ai-reply'===_0x5e2f3c?_0x3a7246=new qe(this['locale'],_0x4d9bff,this['_bodyCollection']):'ai-suggestion-reply'===_0x5e2f3c?(_0x3a7246=new Be(this['locale'],_0x4d9bff,this['_bodyCollection']),_0x3a7246['bind']('isTrackChangesOn')['to'](this)):_0x3a7246='user-message'===_0x5e2f3c?new Ge(this['locale'],_0x4d9bff,this['_bodyCollection']):'interaction-header'===_0x5e2f3c?new Ct(this['locale'],_0x4d9bff):'custom-element'===_0x5e2f3c?new $e(_0x4d9bff):new Ke(_0x4d9bff),this['children']['add'](_0x3a7246),_0x3a7246;}async['updateReplyItem']({id:_0x460e70,parsedContent:_0x27555b,renderingStrategy:_0x455a39,abortSignal:_0x27b087}){const _0x502e50=this['getItemById'](_0x460e70);if(!(_0x502e50 instanceof qe))throw new _0x563e6a('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x502e50,'id':_0x460e70,'parsedContent':_0x27555b});await _0x502e50['updateContent']({'parsedContent':_0x27555b,'renderingStrategy':_0x455a39,'abortSignal':_0x27b087});}async['updateWebSources'](_0x190537,_0x305fb6){const _0x3793cd=this['getItemById'](_0x190537);if(_0x3793cd instanceof Be)_0x3793cd['updateSources'](_0x305fb6);else{if(!(_0x3793cd instanceof qe))throw new _0x563e6a('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x3793cd,'id':_0x190537,'sources':_0x305fb6});_0x3793cd['updateSources'](_0x305fb6);}}async['updateSuggestionItem']({id:_0x1e3906,parts:_0x46e941,renderingStrategy:_0x4b4735,abortSignal:_0x1f094f}){const _0x25fadf=this['getItemById'](_0x1e3906);if(!(_0x25fadf instanceof Be))throw new _0x563e6a('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x25fadf,'id':_0x1e3906,'parts':_0x46e941});await _0x25fadf['updateContent']({'parts':_0x46e941,'renderingStrategy':_0x4b4735,'abortSignal':_0x1f094f});}['updateSuggestionPartState']({id:_0x2ea8a8,index:_0x3d1d83,state:_0x55b355}){const _0x242d5a=this['getItemById'](_0x2ea8a8);if(!(_0x242d5a instanceof Be))throw new _0x563e6a('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x2ea8a8});_0x242d5a['updatePartState'](_0x3d1d83,_0x55b355);}['setSuggestionPartActive']({id:_0x5231e7,index:_0x219b9d,isActive:_0x190f9d}){const _0xc3241d=this['getItemById'](_0x5231e7);if(!(_0xc3241d instanceof Be))throw new _0x563e6a('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x5231e7});this['children']['filter'](_0x2f98d1=>_0x2f98d1 instanceof Be)['forEach'](_0x5ea295=>{_0x5ea295['setPartActive'](!0x1);}),_0xc3241d['setPartActive'](_0x219b9d,_0x190f9d);}['markItemAsDone'](_0x18df6c){this['getItemById'](_0x18df6c)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x71740e=>_0x71740e['options']['id']);}['removeItem'](_0x5dba64){this['children']['remove'](this['getItemById'](_0x5dba64));}['hasItem'](_0x91283e){return!!this['children']['find'](_0x20bb64=>_0x20bb64['options']['id']['includes'](_0x91283e));}['scrollToSuggestion'](_0x3e5c13,_0x541af0){const _0x1c0125=this['getItemById'](_0x3e5c13);if(!(_0x1c0125 instanceof Be))return void _0xa8aac2('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x3e5c13,'partIndex':_0x541af0});const _0xa58dcf=_0x1c0125['getPartView'](_0x541af0);_0xa58dcf?_0x54a145(_0xa58dcf['element'],0x14,this['element']['parentElement'],!0x0,!0x0):_0xa8aac2('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x3e5c13,'partIndex':_0x541af0});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x407867=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x407867,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x432923=new Xe(this['locale'],Ye['aiFeed']);return _0x432923['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x5c4756=>!_0x5c4756)]}}),_0x432923;}['_createFeedItems'](){const _0x1be631=new _0xc3e5b1(this['locale']);return _0x1be631['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x1be631;}['_createFeedLoader'](){const _0x29fbd3=new _0xc3e5b1(this['locale']);return _0x29fbd3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0xc3d1d9=>!_0xc3d1d9)]},'children':this['_createLoaderChildren']()}),_0x29fbd3;}['_createLoaderChildren'](){const _0xd3b4e6=new Ze();return _0xd3b4e6['isVisible']=!0x0,[_0xd3b4e6,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x1473d5){const _0x516e75=this['children']['find'](_0x5f2c59=>_0x5f2c59['options']['id']['includes'](_0x1473d5));if(!_0x516e75)throw new _0x563e6a('ai-chat-feed-view-item-not-found',this,{'id':_0x1473d5});return _0x516e75;}['setLoadingMessage'](_0x51ad78){this['set']('loadingMessage',_0x51ad78);}['toggleLoadingSkeleton'](_0x2e2f30){this['set']('isLoadingSkeletonVisible',_0x2e2f30);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class nh extends _0x163c9e{['filter'](){let _0x338b7c=0x0;for(const _0x52a697 of this['items'])_0x338b7c+=_0x52a697['items']['length'];return{'resultsCount':_0x338b7c,'totalItemsCount':_0x338b7c};}}const ah='ck-ai-chat__prompt-input_highlighted';class cs extends _0xf03a68{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x5bea9b,_0x29ea1d){super(_0x5bea9b,{'queryView':{'label':'','creator':_0xbfd767,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new nh(_0x5bea9b),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x29ea1d,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=cs['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=cs['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',(_0x141ad6,_0x2ab647)=>!_0x141ad6&&!_0x2ab647),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x346729,_0x50d6b9)=>{this['isUploadInProgress']||this['isEmpty']||_0x346729['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x50d6b9());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0xc20a62=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0xc20a62)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x528b46=_0x528e40(_0xc20a62);this['fire']('sendUserMessage',_0x528b46),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x305882){this['queryView']['fieldView']['set']('placeholder',_0x305882);}['focus'](_0x228e8b=!0x1){super['focus'](),_0x228e8b&&(this['element']['classList']['contains'](ah)||(this['element']['classList']['add'](ah),setTimeout(()=>{this['element']['classList']['remove'](ah);},0x320)));}['_createSubmitButton'](){const _0x44377b=new _0x2cf640(this['locale']);return _0x44377b['set']({'icon':_0x40c783,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x44377b['on']('execute',()=>{this['submit']();}),_0x44377b;}['setIsUploadInProgress'](_0x201d86){this['isUploadInProgress']=_0x201d86;}['_setUpAddContextButtonPositioning'](){const _0x30a01b=this['locale'],_0x5cceda=()=>{_0x44426a['window']['requestAnimationFrame'](()=>{if(_0x334b9e(this['element'])){const _0x54118d=new _0x4b725e(this['queryView']['fieldView']['element']),_0x3d60a7=new _0x4b725e(this['_addContextButtonView']['element']),_0x2e7d7d=_0x54118d['width'],_0x4b15ed='rtl'===_0x30a01b['uiLanguageDirection']?'right':'left';_0x54118d['excludeScrollbarsAndBorders']();const _0x2e2f0f=_0x2e7d7d-_0x54118d['width']+0x1;this['_addContextButtonView']['element']['style'][_0x4b15ed]='calc('+(_0x2e7d7d-_0x3d60a7['width']-_0x2e2f0f)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x5cceda),this['on']('render',()=>{_0x5cceda(),this['_queryViewResizeObserver']=new _0x592694(this['queryView']['fieldView']['element'],()=>{_0x5cceda();});});}}const Qr='ck-ai-chat__prompt-capabilities',Xr='ck-ai-chat-controls-button',Zr='ck-ai-chat-controls-button--commands',la='ck-ai-button-tertiary',ua='ck-ai-chat-controls__model-selection',da='ck-ai-chat-controls__model-selection__item-name',_a='ck-ai-chat-controls__model-selection__item-description',Aa='ck-ai-chat-controls__model-selection__item-capabilities',Ia='n';class rs extends _0xc3e5b1{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x42b47e){super(_0x42b47e),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',_0x3d9a8b=>'selector'===_0x3d9a8b),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x26bdbc=>_0x26bdbc?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x58eb25=>_0x58eb25),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x16bc75=>_0x16bc75),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x12ef46=>i(this['locale'],_0x12ef46?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x494ddc=>_0x494ddc),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x424e0d=>i(this['locale'],_0x424e0d?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Qr]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x7916ba(),_0x5aa31c(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x5790f2,_0x540848){if(_0x540848)this['set']('modelDisplayMode','hidden');else{const _0x3508b3=0x1===_0x5790f2['length'];this['set']('modelDisplayMode',_0x3508b3?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x5790f2?.['length'])for(const _0x8259fa of _0x5790f2){const _0xbaaa0e=new _0x201273({'label':_0x8259fa['name'],'withText':!0x0,'role':'menuitemradio','id':_0x8259fa['id'],'model':_0x8259fa});_0xbaaa0e['bind']('isOn')['to'](this,'activeModelId',_0x3cdf4d=>_0x3cdf4d===_0x8259fa['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xbaaa0e,'labelView':new ga(this['locale'],_0x8259fa)});}}['setWebSearch'](_0x3a0225){this['set']('webSearchActive',_0x3a0225);}['setReasoning'](_0x48af50){this['set']('reasoningActive',_0x48af50);}['setModel'](_0x40e996){if(!_0x40e996)return;this['activeModelId']=_0x40e996['id'],this['activeModelName']=_0x40e996['name']||_0x40e996['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x40e996['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x40e996['name']);const _0x23bf1b=_0x40e996['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x23bf1b),this['_webSearchButton']['set']('isVisible',_0x23bf1b);const _0x866e0e=_0x40e996['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x866e0e),this['_reasoningButton']['set']('isVisible',_0x866e0e);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x421109){this['set']('modelSelectorEnabled',!0x1),_0x421109&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x170fa6=new _0x2cf640();return _0x170fa6['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0xd8346c,'class':Xr,'isToggleable':!0x0,'tooltipPosition':Ia}),_0x170fa6['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x170fa6;}['_createReasoningButton'](){const _0x2f5b47=new _0x2cf640();return _0x2f5b47['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0xd8dd72,'class':Xr,'isToggleable':!0x0,'tooltipPosition':Ia}),_0x2f5b47['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x2f5b47;}['_createCommandsButton'](){const _0x5e8db7=new _0x2cf640();return _0x5e8db7['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x51d4bb,'withText':!0x0,'class':Xr,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ia}),_0x5e8db7['extendTemplate']({'attributes':{'class':[Zr]}}),_0x5e8db7['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x5e8db7;}['_createModelSelectionDropdown'](){const _0x95ca1b=_0x3e48f8(this['locale']);return _0x95ca1b['set']({'panelPosition':'ne','class':[ua]}),_0x95ca1b['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ia,'class':la}),this['listenTo'](_0x95ca1b,'execute',_0x6c0523=>{this['fire']('selectModel',_0x6c0523['source']['model']);}),_0x95ca1b;}['_createModelNameView'](){const _0x45e4a2=new Ca(this['locale']);return _0x45e4a2['bind']('text')['to'](this,'activeModelName',_0x3a03d4=>_0x3a03d4??''),_0x45e4a2['bind']('isVisible')['to'](this,'modelDisplayMode',_0x14b0fb=>'name'===_0x14b0fb),_0x45e4a2;}}let ga=class ModelButtonLabelView extends _0x23a78e{constructor(_0x312a9d,_0x34be0b){super();const _0x1d0db2=this['bindTemplate'],_0x417416=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1d0db2['to']('style'),'id':_0x1d0db2['to']('id')},'children':[{'tag':'div','attributes':{'class':[da]},'children':[{'text':_0x1d0db2['to']('text')}]},{'tag':'div','attributes':{'class':[_a]},'children':[{'tag':'span','children':[{'text':_0x34be0b['description']}]}]},{'tag':'div','attributes':{'class':[Aa]},'children':_0x417416}]}),_0x417416['addMany'](this['_getCapabilityParts'](_0x312a9d,_0xd8346c,'AI_CHAT_SEARCH_WEB',_0x34be0b['capabilities']['webSearch']?.['enabled']??!0x1)),_0x417416['addMany'](this['_getCapabilityParts'](_0x312a9d,_0xd8dd72,'AI_CHAT_REASONING',_0x34be0b['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x39ada6,_0x137287,_0x5e7468,_0x424852){const _0xd3abd1=new _0x59b3d9();_0xd3abd1['content']=_0x137287;const _0x8f875f=new _0xc3e5b1(_0x39ada6);_0x8f875f['setTemplate']({'tag':'span','children':[{'text':i(_0x39ada6,_0x5e7468)+':\x20'}]});const _0x5161d4=new _0xc3e5b1(_0x39ada6);return _0x5161d4['setTemplate']({'tag':'span','children':[{'text':i(_0x39ada6,_0x424852?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0xd3abd1,_0x8f875f,_0x5161d4];}},Ca=class ModelNameView extends _0xc3e5b1{constructor(_0x210d1b){super(_0x210d1b),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x350b73=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x350b73['if']('isVisible','ck-hidden',_0x5d5041=>!_0x5d5041)]},'children':[{'text':_0x350b73['to']('text')}]});}};const Ea='ck-ai-chat-context-controls__url-form',pa='ck-ai-chat-context-controls__url-input-section';class Vo extends _0xc3e5b1{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x20495b){super(_0x20495b),this['focusTracker']=new _0x5f2dfb(),this['keystrokes']=new _0x15425(),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 _0x1af4a5({'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'](_0x21daf4=>{this['focusTracker']['add'](_0x21daf4['element']),this['keystrokes']['listenTo'](_0x21daf4['element']);}),_0x28e7fc({'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'](_0xcb3ba6){this['urlInputField']['errorText']=_0xcb3ba6,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x15fce7=new _0x2cf640(this['locale']);return _0x15fce7['set']({'icon':_0x5d4f8c,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x25c3a0,_0x6c2d11,_0x3020d4)=>{_0x15fce7['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x3020d4?'':'\x20ck-hidden')]});}),_0x15fce7;}['_createUrlInputField'](){const _0x14cb80=new _0x16298f(this['locale'],th);return _0x14cb80['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x14cb80['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x14cb80;}['_createConfirmButton'](){const _0x440b6=new _0x2cf640(this['locale']);return _0x440b6['set']({'icon':_0x2b7211,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x440b6;}['_setupTemplate'](){const _0xfc8b85=new _0x1e299f(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'});_0xfc8b85['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Ea,'tabindex':'-1'},'children':[_0xfc8b85,{'tag':'div','attributes':{'class':pa},'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',_0x2cdf93=>{_0x2cdf93['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x4511f9,_0x2bec9b)=>{this['clear'](),this['fire']('cancel'),_0x2bec9b();});}['_handleSubmit'](){const _0x1970a5=this['getValue']()['trim']();_0x1970a5?this['_isValidUrl'](_0x1970a5)?(this['clearError'](),this['fire']('submitUrl',_0x1970a5)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0xd01727=this['getValue']()['trim'](),_0x517796=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0xd01727['length']>0x0&&!_0x517796;}['_isValidUrl'](_0x54f4dc){try{return!!new URL(_0x54f4dc);}catch{return!0x1;}}}const Ta='ck-ai-chat-resources__item',ma='ck-ai-chat-resources__item--in-context',wa='ck-ai-chat-resources__item-title',fa='ck-ai-chat-resources__item__icon';class hc extends _0x663ac1{['resource'];['_titleView'];['_iconView'];constructor(_0x4995ee,_0x37a4e9){super(_0x4995ee),this['resource']=_0x37a4e9,this['set']('isInContext',!!_0x37a4e9['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x36b4e6){if(_0x36b4e6['isInContext'])return _0x2b7211;switch(_0x36b4e6['type']){case xe['DOCUMENT']:return _0x2ff8c2;case xe['URL']:return _0xa0ac3e;case xe['FILE']:case xe['TEXT']:return _0x4d62fe;default:return _0x5313d0;}}['highlightText'](_0x961bbc){if(!_0x961bbc||''===_0x961bbc['trim']())return void this['_titleView']['highlightText'](null);const _0x383a55=new RegExp(_0x15b1ec(_0x961bbc),'gi');this['_titleView']['highlightText'](_0x383a55);}['updateResourceState'](_0xba2365){this['resource']['isInContext']=_0xba2365,this['isInContext']=_0xba2365,this['_updateIcon']();}['_createTitleView'](){const _0x1de1a0=new _0x19afdf();return _0x1de1a0['text']=this['resource']['label'],_0x1de1a0['extendTemplate']({'tag':'span','attributes':{'class':[wa]}}),_0x1de1a0;}['_createIconView'](){const _0x240cdc=new _0x59b3d9();return _0x240cdc['content']=this['getResourceIcon'](this['resource']),_0x240cdc;}['_setupTemplate'](){const _0x10d455=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Ta,_0x10d455['if']('isVisible','ck-hidden',_0x35bb7e=>!_0x35bb7e),_0x10d455['if']('isInContext',ma)]},'children':[{'tag':'div','attributes':{'class':[fa]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x10d455['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const Sa='ck-ai-chat-resources__list';class Lr extends _0x163c9e{['_source'];constructor(_0x44dd3a,_0x3ee963){super(_0x44dd3a),this['_source']=_0x3ee963,this['extendTemplate']({'attributes':{'class':[Sa]}});}['setResources'](_0xde6a10,_0x363790){this['items']['clear']();let _0x2c0da4=_0xde6a10;if(this['_source']['useDefaultFiltering']&&_0x363790&&''!==_0x363790['trim']()){const _0x5c3d03=new RegExp(_0x363790['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x2c0da4=_0xde6a10['filter'](_0x4f5bec=>_0x5c3d03['test'](_0x4f5bec['label']));}for(const _0x54cc9d of _0x2c0da4){const _0x50baae=new hc(this['locale'],_0x54cc9d);_0x50baae['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x54cc9d);}),this['items']['add'](_0x50baae);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x363790);}['highlightText'](_0x5a4c6e){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x2b0694=>{_0x2b0694['highlightText'](_0x5a4c6e);});}['updateResourceState'](_0xf252e6,_0xce96d){for(const _0x51ca27 of this['items']){const _0xf550ff=_0x51ca27;_0xf550ff['resource']['id']===_0xf252e6&&_0xf550ff['updateResourceState'](_0xce96d);}}['_handleResourceSelection'](_0x50672d,_0x3e2757){this['fire']('addResourceToContext',{'source':_0x50672d,'resource':_0x3e2757});}}class Tr extends _0x16298f{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x2a9731){const t=_0x2a9731['t'],_0x63be30={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':i(_0x2a9731,'AI_CHAT_SEARCH_RESOURCES')};super(_0x2a9731,_0x63be30['creator']),this['label']=_0x63be30['label'],this['_viewConfig']=_0x63be30,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x2a9731,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x15ea79){this['fire']('search',_0x15ea79);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x59b3d9(),this['iconView']['content']=_0x4c94fe,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x64f4d2,t){this['resetButtonView']=new _0x2cf640(_0x64f4d2),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x4718d2,'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',_0x404878=>!_0x404878),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 _0xc3e5b1{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x55c3a6,_0xde1a7d){super(_0x55c3a6),this['_source']=_0xde1a7d['source'],this['_searchInputVisibleFrom']=_0xde1a7d['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 _0xf5a45d([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 _0x4289b9=new _0xc3e5b1(this['locale']);return _0x4289b9['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x55e9bc,_0x18a41f)=>{this['loadResources'](_0x18a41f),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x18a41f);}),_0x4289b9;}['_createResourcesListView'](){const _0x9c438b=new Lr(this['locale'],this['_source']);return _0x9c438b['delegate']('addResourceToContext')['to'](this),_0x9c438b['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x9c438b;}['_createSkeletonView'](){const _0x16be19=new Xe(this['locale'],Ye['aiChatResources']);return _0x16be19['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x2c8cd5=>!_0x2c8cd5)]}}),_0x16be19;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x275cfe){const _0x552196=_0x48eb5e();this['_latestLoadResourcesUid']=_0x552196,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x275cfe,'uid':_0x552196}),this['isLoading']=!0x0;}['setResources'](_0x202511,_0x3ef417){if(_0x3ef417&&_0x3ef417!==this['_latestLoadResourcesUid'])return;const _0x4e7f52=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x202511,_0x4e7f52),_0x202511['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x5a18f3,_0x31a6ab){this['_resourcesListView']['updateResourceState'](_0x5a18f3,_0x31a6ab);}}const Ra='ck-ai-chat-context-controls__source-balloon-panel',ba='ck-button-icon\x20ck-button-back',Oa='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Po{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x107ec9,_0x3e7393,_0x33d77b){this['_locale']=_0x107ec9,this['_bodyCollection']=_0x3e7393,this['_config']=_0x33d77b;}['showSourceResourcesBalloon']({source:_0x5d459f,withBackButton:_0x50ba5c}){let _0x34fc48=this['_sourceResourceBalloons']['get'](_0x5d459f['id']);_0x34fc48||(_0x34fc48=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x5d459f['id'],_0x34fc48),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x34fc48)),this['_addSourceResourceContent']({'balloonPanel':_0x34fc48,'source':_0x5d459f,'withBackButton':_0x50ba5c}),_0x34fc48['show']();const _0xcf82fc=this['_config']['getTargetElement']();_0xcf82fc&&_0x34fc48['pin']({'target':_0xcf82fc,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x14a1e7,_0x4e0b13,_0x149c9f){const _0x405762=this['_sourceResourceBalloons']['get'](_0x14a1e7);if(!_0x405762)return;const _0x459fe6=this['_getResourcesViewFromBalloon'](_0x405762);_0x459fe6&&(_0x459fe6['setResources'](_0x4e0b13,_0x149c9f),_0x459fe6['once']('change:isLoading',()=>{_0x405762['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x403b4b){const _0x4cf3fa=this['_sourceResourceBalloons']['get'](_0x403b4b);_0x4cf3fa&&requestAnimationFrame(()=>{_0x4cf3fa['hide'](),this['_sourceResourceBalloons']['delete'](_0x403b4b),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x33e15a of this['_sourceResourceBalloons']['values']())if(_0x33e15a['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x509de2,_0x50c630,_0x4e6cd0){const _0x171853=this['_sourceResourceBalloons']['get'](_0x509de2);if(!_0x171853||!_0x171853['isVisible'])return;const _0xde27c7=this['_config']['getTargetElement']();if(!_0xde27c7)return;_0x171853['pin']({'target':_0xde27c7,'limiter':this['_config']['getLimiterElement']()});const _0x39e3be=this['_getResourcesViewFromBalloon'](_0x171853);_0x39e3be&&_0x39e3be['updateResourceState'](_0x50c630,_0x4e6cd0);}['destroy'](){for(const _0xc53493 of this['_sourceResourceBalloons']['values']())_0xc53493['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x4bbd0d=new _0x5442ef(this['_locale']);return _0x4bbd0d['extendTemplate']({'attributes':{'class':Ra}}),this['_bodyCollection']['add'](_0x4bbd0d),_0x4bbd0d;}['_addSourceResourceContent']({balloonPanel:_0x539405,source:_0x3a5b0d,withBackButton:_0x1c0cb7}){_0x539405['content']['clear']();const _0x5100a2=this['_createBalloonHeader']({'balloonPanel':_0x539405,'source':_0x3a5b0d,'withBackButton':_0x1c0cb7});_0x539405['content']['add'](_0x5100a2);const _0x58b55e=this['_createBalloonResourcesView'](_0x3a5b0d);_0x539405['content']['add'](_0x58b55e);}['_createBalloonHeader']({balloonPanel:_0x54c178,source:_0x1c09a7,withBackButton:_0x580c35}){const _0x3bce9=new _0x1e299f(this['_locale'],{'label':_0x1c09a7['label'],'class':Oa});return _0x580c35&&_0x3bce9['children']['add'](this['_createBackButton'](_0x54c178),0x0),_0x3bce9;}['_createBackButton'](_0x545156){const _0x41fcf8=new _0x2cf640(this['_locale']);return _0x41fcf8['set']({'icon':_0x5d4f8c,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':ba}),_0x41fcf8['on']('execute',()=>{_0x545156['hide'](),this['_config']['onBackToContext']();}),_0x41fcf8;}['_createBalloonResourcesView'](_0x20b59f){const _0x14304a=new lc(this['_locale'],{'source':_0x20b59f,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x14304a['on']('loadSourceResources',(_0x26c26f,_0x46337e)=>{this['_config']['onLoadSourceResources'](_0x46337e);}),_0x14304a['on']('addResourceToContext',(_0x2cac08,_0x3e5871)=>{this['_config']['onResourceSelected'](_0x3e5871['source'],_0x3e5871['resource']),this['closeSourceResourceBalloon'](_0x20b59f['id']);}),_0x14304a;}['_getResourcesViewFromBalloon'](_0x10a1a5){const _0x5af1b6=_0x10a1a5['content']['get'](0x1);return _0x5af1b6 instanceof lc?_0x5af1b6:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x54b766){_0x1d212b({'emitter':_0x54b766,'contextElements':[_0x54b766['element']],'callback':()=>{_0x54b766['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x54b766['isVisible']});}}const ps=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Ro='ck-ai-chat-context-controls',Oo='ck-ai-chat-context-controls__pending-contexts',Uo='ck-ai-chat-context-controls__add-context-balloon-panel',Lo='ck-ai-chat-context-controls__add-context-button',No='ck-ai-chat-context-controls__url-balloon-panel',Mo='ck-ai-chat-context-controls__balloon-button',Ho='ck-ai-chat-context-controls__balloon-button-source',jo='ck-ai-chat-controls-button',Fo='ck-ai-chat-context-chips-wrapper-balloon',Xo='ck-ai-chat-controls_context_show-more-button',yo='ck-ai-chat-context-controls__show-more-balloon-panel',Do='ck-ai-chat',$o=[_0x5442ef['defaultPositions']['northArrowSouthWest'],_0x5442ef['defaultPositions']['northArrowSouth'],_0x5442ef['defaultPositions']['northArrowSouthEast'],_0x5442ef['defaultPositions']['southArrowNorthWest'],_0x5442ef['defaultPositions']['southArrowNorth'],_0x5442ef['defaultPositions']['southArrowNorthEast']];class ls extends _0xc3e5b1{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x29d334,_0x1d70e6){super(_0x29d334),this['bodyCollection']=_0x1d70e6['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x29d334),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x29d334),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x29d334),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x29d334,_0x1d70e6);const _0x5758b6={'cssClasses':{'showMoreButton':Xo,'showMoreBalloon':yo,'overflowContainer':Fo,'controlsButton':jo}};this['_overflowManager']=new Io(_0x29d334,this['_currentContextsChips'],_0x5758b6,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'](_0x47bec4,_0x592ff3){const _0x5c1c99=this['_createContextButton'](_0x47bec4,'current',!0x0,_0x592ff3);this['_addContextToCollection'](_0x5c1c99,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x2fd001){this['_removeContextFromCollection'](_0x2fd001,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x2fd001,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x9ae22d,_0x955346){let _0x7af6ea=this['_currentContextsChips']['find'](_0x53c82a=>_0x53c82a['id']===_0x9ae22d);_0x7af6ea||(_0x7af6ea=this['_overflowManager']['overflowChips']['find'](_0x2a3605=>_0x2a3605['id']===_0x9ae22d)),_0x7af6ea&&(_0x7af6ea['isLoading']=_0x955346);}['setConversationContext'](_0x3adc9c){this['_conversationContextsChips']['clear']();for(const _0x39f298 of _0x3adc9c){const _0x49eda0=this['_createContextButton'](_0x39f298,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x49eda0,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x854fab,_0x4e8587,_0x1b8ac1){this['_resourcesBalloonView']['updateResourceState'](_0x854fab,_0x4e8587,_0x1b8ac1);}['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:_0x1c7ad8,withBackButton:_0x4a1133}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x1c7ad8,'withBackButton':_0x4a1133}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x75058d,_0x379420,_0x237a0d,_0x458b15){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x75058d,_0x237a0d,_0x458b15);}['closeSourceResourceBalloon'](_0x2da6df){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x2da6df),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x405a25){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x405a25),this['_setAddContextButtonEnabled'](_0x405a25);}['_setAddContextButtonEnabled'](_0x1265db){const _0x214172=!_0x1265db['document']['isHidden']&&_0x1265db['document']['enabled'],_0x4c940d=_0x1265db['urls']['enabled'],_0x448c7b=_0x1265db['files']['enabled'],_0x231ddb=_0x1265db['sources']['length']>0x0,_0x46118c=_0x1265db['customItems']&&_0x1265db['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x214172||_0x4c940d||_0x448c7b||_0x231ddb||_0x46118c;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Ro,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Oo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x1054e6){const _0x55dfa6=new _0x2cf640(_0x1054e6);return _0x55dfa6['set']({'label':i(_0x1054e6,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':jo+'\x20'+Lo,'icon':_0x3b2e9c,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x55dfa6;}['_createAddContextBalloonPanelView'](_0x54c90a){return this['_createBaseBalloonPanel'](_0x54c90a,Uo);}['_createUrlBalloonPanelView'](_0x40294a){const _0x29a1d1=this['_createBaseBalloonPanel'](_0x40294a,No);return this['_addUrlContent'](_0x29a1d1,_0x40294a),_0x29a1d1;}['_createResourcesBalloonView'](_0x4ac093,_0x5243b6){const _0x2580a9={'searchInputVisibleFrom':_0x5243b6['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o});},'onResourceSelected':(_0x5be715,_0x4c7445)=>{this['fire']('addResourceToContext',{'source':_0x5be715,'resource':_0x4c7445});},'onLoadSourceResources':_0x5803f0=>{this['fire']('loadSourceResources',_0x5803f0);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Po(_0x4ac093,_0x5243b6['bodyCollection'],_0x2580a9);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Do)||document['body'];}['_createBaseBalloonPanel'](_0x1be3d2,_0x160e78){const _0xd42378=new _0x5442ef(_0x1be3d2);return _0xd42378['extendTemplate']({'attributes':{'class':_0x160e78}}),this['bodyCollection']['add'](_0xd42378),_0xd42378;}['_setBalloonPanelContent'](_0x3b2b4c,_0x22e88f,_0xcfdbfb){if(_0x3b2b4c['content']['clear'](),!_0xcfdbfb['document']['isHidden']&&_0xcfdbfb['document']['enabled']){const _0xb882a5=this['_createBalloonButton'](_0x22e88f,{'label':i(_0x22e88f,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x2ff8c2});_0xb882a5['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x3b2b4c['content']['add'](_0xb882a5);}if(_0xcfdbfb['urls']['enabled']){const _0x438511=this['_createBalloonButton'](_0x22e88f,{'label':i(_0x22e88f,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0xa0ac3e});_0x438511['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o}),this['_urlInputView']['focus']();}),_0x3b2b4c['content']['add'](_0x438511);}if(_0xcfdbfb['files']['enabled']){const _0x139155=new _0x538cbe(_0x22e88f);_0x139155['set']({'label':i(_0x22e88f,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x3e59fd,'withText':!0x0,'tooltip':!0x0,'class':Mo,'allowMultipleFiles':!0x0}),_0x139155['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x139155['on']('done',(_0x159190,_0x484350)=>{this['fire']('addFileToContext',_0x484350);}),_0x139155['tooltip']=!0x0,_0x3b2b4c['content']['add'](_0x139155);}for(const _0x57b513 of _0xcfdbfb['sources']){const _0x364f9f=this['_createBalloonButton'](_0x22e88f,{'label':_0x57b513['label'],'icon':_0x57b513['icon']||_0x5313d0,'type':'source'});_0x3b2b4c['content']['add'](_0x364f9f),_0x364f9f['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x57b513,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x49bdc0 of _0xcfdbfb['customItems']||[]){const _0x21ec86=this['_createBalloonButton'](_0x22e88f,{'label':_0x49bdc0['label'],'icon':_0x49bdc0['icon']||_0x5313d0,'type':'customItem'});_0x3b2b4c['content']['add'](_0x21ec86),_0x21ec86['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x49bdc0);});}this['_hasExactlyOneSource']=0x1===_0x3b2b4c['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x3130fe,_0x39ad51){this['_urlInputView']=new Vo(_0x39ad51),this['_urlInputView']['on']('submitUrl',(_0x3adf81,_0x94ac52)=>{this['_handleUrlSubmit'](_0x94ac52);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o});}),_0x3130fe['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x3158eb,_0x5c9556){const _0x54de2='source'===_0x5c9556['type']?new SourcesBalloonButtonView(_0x3158eb):new _0x2cf640(_0x3158eb);return _0x54de2['set']({'label':_0x5c9556['label'],'icon':_0x5c9556['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Mo}),_0x54de2;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x1d212b({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x31b722){const _0x228404=this['_addContextBalloonConfig'];_0x228404['buttonView']['isOn']=_0x31b722,_0x31b722?_0x228404['balloonView']['show']():_0x228404['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x935612,buttonView:_0x58c68b,hideMethod:_0x5ea1d4}=this['_addContextBalloonConfig'];_0x1d212b({'emitter':_0x935612,'contextElements':[_0x935612['element'],_0x58c68b['element']],'callback':()=>{_0x5ea1d4();},'activator':()=>_0x58c68b['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x14e662,_0x2609b3,_0x2401e6=!0x1,_0x3a6d1d=!0x1){const _0x1237d3='conversation'===_0x2609b3||!0x0===_0x14e662['isReadOnly'],_0x12ec18=new vo(this['locale'],_0x14e662,_0x1237d3,_0x2401e6,_0x3a6d1d);return _0x1237d3||_0x12ec18['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x12ec18['id']);}),_0x12ec18;}['_addContextToCollection'](_0x28a405,_0x138d67){_0x138d67['add'](_0x28a405,0x0);}['_removeContextFromCollection'](_0x253cd1,_0x44294a){const _0x1edb28=_0x44294a['find'](_0x1c4429=>_0x1c4429['id']===_0x253cd1);_0x1edb28&&_0x44294a['remove'](_0x1edb28);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x2e578b){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x2e578b);}}class SourcesBalloonButtonView extends _0x2cf640{['arrowView'];constructor(_0x517ee4){super(_0x517ee4),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ho]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x5e4ca4=new _0x59b3d9();return _0x5e4ca4['content']=_0x468b06,_0x5e4ca4['extendTemplate']({'attributes':{'class':Ho+'__arrow'}}),_0x5e4ca4;}}class ds extends _0xc3e5b1{['_cancelButtonView'];['_loaderView'];constructor(_0x482c0c){super(_0x482c0c),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 _0x3f8f95=new _0x2cf640(this['locale']);return _0x3f8f95['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x197784}),_0x3f8f95['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x3f8f95;}['_createLoaderView'](){const _0x54a950=new _0xc3e5b1(this['locale']);return _0x54a950['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')}]}),_0x54a950;}}class ji extends _0xc3e5b1{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x4720e1,_0x22755e){super(_0x4720e1),this['_contextPanelView']=this['_createContextPanelView'](_0x4720e1,{'bodyCollection':_0x22755e['bodyCollection'],'searchInputVisibleFrom':_0x22755e['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x4720e1),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x4720e1),this['_loaderView']=this['_createLoaderView'](_0x4720e1),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x4720e1),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'](...ps)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x153b57=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x153b57['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x153b57['if']('isLoading','ck-hidden',_0x32c614=>_0x32c614||!this['isModelAvailable']),_0x153b57['if']('isModelAvailable','ck-hidden',_0x19290a=>!_0x19290a||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x153b57['if']('isLoading','ck-hidden',_0x3331f1=>!_0x3331f1)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x153b57['if']('isModelAvailable','ck-hidden',_0x5dc297=>_0x5dc297)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x1d212b({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x280368,_0x21293a){return new ls(_0x280368,_0x21293a);}['_createPromptInputView'](_0x517fd2){return new cs(_0x517fd2,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x56f242){return new rs(_0x56f242);}['_createLoaderView'](_0x56f67b){return new ds(_0x56f67b);}['_createModelUnavailableMessageView'](_0x37f3fb){const _0x4702cd=new AIChatModelUnavailableMessageView(_0x37f3fb);return _0x4702cd['delegate']('startConversation')['to'](this),_0x4702cd;}['_handlePromptInputFocus'](_0x1ee248,_0x2397e9,_0x551039){_0x551039?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x1dd225,_0x569249){this['_contextPanelView']['addContextItem'](_0x1dd225,_0x569249);}['removeContextItem'](_0x9ff51){this['_contextPanelView']['removeContextItem'](_0x9ff51);}['setContextItemLoading'](_0x42efe0,_0x5eb45b){this['_contextPanelView']['setContextItemLoading'](_0x42efe0,_0x5eb45b);}['setIsUploadInProgress'](_0xc38dc4){this['_promptInputView']['setIsUploadInProgress'](_0xc38dc4);}['setConversationContext'](_0x1026aa){this['_contextPanelView']['setConversationContext'](_0x1026aa);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x2e1061,_0x40ef04,_0x327112){this['_contextPanelView']['updateResourceState'](_0x2e1061,_0x40ef04,_0x327112);}['setWebSearch'](_0x20ce8a){this['_promptCapabilitiesView']['setWebSearch'](_0x20ce8a);}['setReasoning'](_0x3d4745){this['_promptCapabilitiesView']['setReasoning'](_0x3d4745);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x2bfec8){this['_contextPanelView']['setAddContextOptions'](_0x2bfec8);}['setInputPlaceholder'](_0x43b154){this['_promptInputView']['setPlaceholderText'](_0x43b154);}['setModelList'](_0x5ca2ce,_0x10fa88){this['_promptCapabilitiesView']['setModelList'](_0x5ca2ce,_0x10fa88);}['setModel'](_0x474f0b){_0x474f0b?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x474f0b)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x503063){this['_promptCapabilitiesView']['disableModelSelector'](_0x503063);}['populateSourceResourceBalloon'](_0x46756f,_0x4344e1,_0x324600,_0x250358){this['_contextPanelView']['populateSourceResourceBalloon'](_0x46756f,_0x4344e1,_0x324600,_0x250358);}['closeSourceResourceBalloon'](_0x5e8acd){this['_contextPanelView']['closeSourceResourceBalloon'](_0x5e8acd);}['focusPromptInput'](_0x541354=!0x1){this['_promptInputView']['focus'](_0x541354);}['setPromptInputValue'](_0x20ffd8){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x20ffd8;}}class AIChatModelUnavailableMessageView extends _0xc3e5b1{constructor(_0xb8b7c0){super(_0xb8b7c0);const _0x447b56=new _0x2cf640(_0xb8b7c0);_0x447b56['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x447b56['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'},_0x447b56]}]});}}class ki extends _0x1e299f{['conversationStartButton'];['resizeButton'];constructor(_0x1ff210,_0x1d153f){super(_0x1ff210,{'label':i(_0x1ff210,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Et}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x1ff210),this['children']['add'](this['conversationStartButton']),_0x1d153f&&(this['resizeButton']=us(_0x1ff210,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x5d825){const _0x3859b4=new _0x2cf640(_0x5d825);return _0x3859b4['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x1fce8d,'class':'ck-ai-chat__start-conversation'}),_0x3859b4['on']('execute',()=>{this['fire']('startConversation');}),_0x3859b4;}}class vi extends _0xc3e5b1{constructor(_0x3f874a){super(_0x3f874a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x3f874a,'AI_DISCLAIMER_TEXT')}]}]});}}class At extends _0xc3e5b1{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x43637b,_0x5e56c4){super(_0x43637b),this['_bodyCollection']=new _0x340c25(_0x43637b),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new ki(_0x43637b,_0x5e56c4['showResizeButton']),this['chatHeader']['delegate'](...Rt)['to'](this),this['chatFeed']=new di(_0x43637b,this['_bodyCollection']),this['chatFeed']['delegate'](...Rt)['to'](this),this['chatControls']=new ji(_0x43637b,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x5e56c4['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Rt)['to'](this),this['chatDisclaimer']=new vi(_0x43637b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x43637b['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x5e3af8,_0x1b0e21,_0x583bb2,_0x17eac7){this['chatControls']['populateSourceResourceBalloon'](_0x5e3af8,_0x1b0e21,_0x583bb2,_0x17eac7);}['closeSourceResourceBalloon'](_0x58abd2){this['chatControls']['closeSourceResourceBalloon'](_0x58abd2);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class z extends _0x3a5602{static get['requires'](){return[it];}['_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(_0x42e474){super(_0x42e474);const _0x2e4db9=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new St(),this['_view']=new At(this['context']['locale'],{'showResizeButton':_0x2e4db9['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Rt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x3a7024,{showDiff:_0xdc2250})=>{this['showDiff']=_0xdc2250;}),_0x2e4db9['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':Et,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x480a4e=>_0x480a4e),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x529fba=>_0x529fba),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x50b9f4){const _0x2411b9=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'](_0x50b9f4['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x2411b9}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0xa137f2,staticMessage:_0x2994bd}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0xa137f2,'initialContent':'<p>'+_0x2994bd+'</p>'});}['addFeedItemUserMessage'](_0x509a43){const _0x2bc53b=_0x509a43['attributes']?.['displayedPrompt']||_0x509a43['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x509a43['contextItems']['values']()),'initialContent':'<p>'+_0x2bc53b+'</p>','id':_0x509a43['id']});}['addFeedItemError']({errorMessage:_0x27fcc6,id:_0x17eb8d}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x27fcc6+'</p>','id':_0x17eb8d});}['addFeedItemAIReply'](_0x546ae6){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x546ae6['interactionId']+':'+_0x546ae6['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x4c0f61){const _0x5959a6=T(this['context']);let _0x43ac91=_0x5959a6['config']['get']('ai.availableReplyActions')||[...J];if(_0x5959a6['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x923eb4=_0x5959a6['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x923eb4,'value');}}else _0x43ac91=_0x43ac91['filter'](_0xd8559a=>'insertSuggestion'!=_0xd8559a);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x4c0f61['interactionId']+':'+_0x4c0f61['id'],'areActionsDisabled':_0x4c0f61['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x43ac91}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x58842c,_0x1045b6){const _0x4983d3=this['_view']['chatFeed']['children']['last'];if(_0x4983d3 instanceof Ct)return this['_view']['chatFeed']['children']['remove'](_0x4983d3),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x58842c['id'],'capabilities':{'isWebSearchEnabled':_0x4983d3['capabilities']['isWebSearchEnabled']||_0x1045b6['isWebSearchEnabled'],'isReasoningEnabled':_0x4983d3['capabilities']['isReasoningEnabled']||_0x1045b6['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x58842c['id'],'capabilities':_0x1045b6});}async['addFeedItemCustomElement'](_0x5056d5,_0x1166f7){let _0xeb7ccf;return await this['_promiseQueue']['enqueue'](async()=>{_0xeb7ccf=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x5056d5,'id':_0x1166f7});}),_0xeb7ccf;}['removeFeedItem'](_0x22c391){this['_view']['chatFeed']['removeItem'](_0x22c391);}['hasFeedItem'](_0x344c6a){return this['_view']['chatFeed']['hasItem'](_0x344c6a);}['updateFeedInteractionHeader'](_0x2281a3){const _0x3a78a7=this['_view']['chatFeed']['children']['find'](_0x2c30de=>_0x2c30de['options']['id']==_0x2281a3['id']&&_0x2c30de instanceof Ct);_0x3a78a7&&_0x3a78a7['set']('isVisible',_0x2281a3['isVisible']);}async['updateFeedItemAIReplyContent'](_0x15c48e){const _0x3a858e=_0x15c48e['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x384f0c=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x15c48e,'abortSignal':_0x384f0c,'renderingStrategy':_0x3a858e}),_0x15c48e['isDone']&&this['markFeedItemAsDone'](_0x15c48e['id']);});}['updateFeedItemAIReplySources'](_0x5395d5,_0x5966a0){this['_view']['chatFeed']['updateWebSources'](_0x5395d5,_0x5966a0);}async['updateFeedItemAIReplySuggestionContent'](_0x321447){const _0x12acab=_0x321447['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x4e962c=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x321447,'abortSignal':_0x4e962c,'renderingStrategy':_0x12acab}),_0x321447['isDone']&&this['markFeedItemAsDone'](_0x321447['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x2cf78c){this['_view']['chatFeed']['updateSuggestionPartState'](_0x2cf78c);}['setFeedItemAIReplySuggestionPartActive'](_0x25d536){this['_view']['chatFeed']['setSuggestionPartActive'](_0x25d536);}['markFeedItemAsDone'](_0x2c9098){this['_view']['chatFeed']['markItemAsDone'](_0x2c9098);}['removeFeedInteraction'](_0xf67b72){this['_view']['chatFeed']['getItemIds']()['filter'](_0x55aca0=>_0x55aca0['startsWith'](_0xf67b72))['forEach'](_0x5252c7=>this['_view']['chatFeed']['removeItem'](_0x5252c7));}['startInteraction'](){const _0x5d8842=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x5d8842),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x3238f5){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x331da3=>_0x331da3['startsWith'](_0x3238f5['id']))['forEach'](_0x5a5de6=>this['markFeedItemAsDone'](_0x5a5de6)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x6da17a,_0x483a4a){this['_view']['chatControls']['addContextItem'](_0x6da17a,_0x483a4a);}['removeContextItem'](_0x5a5b7c){this['_view']['chatControls']['removeContextItem'](_0x5a5b7c);}['setContextItemLoading'](_0x1f65fd,_0x2c4e00){this['_view']['chatControls']['setContextItemLoading'](_0x1f65fd,_0x2c4e00);}['setIsUploadInProgress'](_0x3dc4de){this['_view']['chatControls']['setIsUploadInProgress'](_0x3dc4de);}['setConversationContext'](_0x9a3379){this['_view']['chatControls']['setConversationContext'](_0x9a3379);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x2d7027,_0x543935,_0x6265dc){this['_view']['chatControls']['updateResourceState'](_0x2d7027,_0x543935,_0x6265dc);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x1e192a){this['_view']['chatControls']['setAddContextOptions'](_0x1e192a);}['updateCapabilities'](_0x4e8c04){this['_view']['chatControls']['setWebSearch'](_0x4e8c04['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x4e8c04['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x4e8c04));}['setSelectedModel'](_0x3baf45,_0x12bbfa){this['_view']['chatControls']['setModel'](_0x3baf45),_0x12bbfa&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x1523d7){this['feedItemRenderingStrategy']=_0x1523d7;}['toggleLoadingSkeleton'](_0x5cc772){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x5cc772);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x2bfec3,_0x27c151=!0x1){if(_0x27c151&&!mt()&&_0x2bfec3['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x2bfec3);this['_view']['chatHeader']['label']=_0x2bfec3;}['setLoadingMessage'](_0x4498b4){this['_view']['chatFeed']['setLoadingMessage'](_0x4498b4);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x90b1a){let _0x4c3a28=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x90b1a[_0x4c3a28],_0x4c3a28++,_0x4c3a28===_0x90b1a['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x5c8af9){this['_view']['chatHeader']['isMaximized']=_0x5c8af9;}['prepareLoadingMessage'](_0x172432){return _0x172432['isWebSearchEnabled']&&_0x172432['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x172432['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x172432['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x7730b1){return _0x7730b1?_0x7730b1['isWebSearchEnabled']&&_0x7730b1['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x7730b1['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x7730b1['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'](_0x5f4cf6,_0x4c2be2,_0x18eba9,_0x1ab823){this['_view']['populateSourceResourceBalloon'](_0x5f4cf6,_0x4c2be2,_0x18eba9,_0x1ab823);}['closeSourceResourceBalloon'](_0x223c14){this['_view']['closeSourceResourceBalloon'](_0x223c14);}['setPromptInputValue'](_0x40c0f6){this['_view']['chatControls']['setPromptInputValue'](_0x40c0f6);}['focusPromptInput'](_0x2e8220=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x2e8220);}['scrollFeedToSuggestion'](_0x4150c5,_0x22df87){this['_view']['chatFeed']['scrollToSuggestion'](_0x4150c5,_0x22df87);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Li extends _0x163c9e{['sections'];constructor(_0x51fd2a,_0x2a3d8c){super(_0x51fd2a),this['sections']=_0x2a3d8c,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x8894bb){let _0x30d2a1=0x0,_0x5137a9=0x0;for(const _0x56613e of this['sections']){const {resultsCount:_0x3d48e5,totalItemsCount:_0x1d886a}=_0x56613e['filter'](_0x8894bb);_0x30d2a1+=_0x3d48e5,_0x5137a9+=_0x1d886a;}return{'resultsCount':_0x30d2a1,'totalItemsCount':_0x5137a9};}}class Yi extends _0x663ac1{['title'];['itemsViews'];['_itemsListView'];constructor(_0x543fc2,{title:_0x5b8e26,items:_0x4288ae}){super(_0x543fc2);const _0xa58407=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x5b8e26,this['itemsViews']=_0x4288ae;const _0x5baeb3=new _0xc3e5b1(_0x543fc2);_0x5baeb3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x163c9e(_0x543fc2),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0xa58407['if']('isVisible','ck-hidden',_0x4e34dc=>!_0x4e34dc)]},'children':[_0x5baeb3,this['_itemsListView']]});}['filter'](_0x2c07a2){const _0x233ee5=this['itemsViews']['length'];let _0x8e01f9=0x0;for(const _0x359ac7 of this['itemsViews']){if(_0x2c07a2){const _0x174a1d=_0x359ac7['isMatching'](_0x2c07a2);_0x359ac7['isVisible']=!!_0x174a1d,_0x359ac7['highlightText'](_0x2c07a2);}else _0x359ac7['isVisible']=!0x0,_0x359ac7['highlightText'](null);_0x359ac7['isVisible']&&_0x8e01f9++;}return this['isVisible']=_0x8e01f9>0x0,{'resultsCount':_0x8e01f9,'totalItemsCount':_0x233ee5};}['getItem'](_0x27cd6f){return this['itemsViews']['find'](_0x29de0e=>_0x29de0e['id']===_0x27cd6f);}['removeItem'](_0x38c860){const _0xa9d9fa=this['itemsViews']['indexOf'](_0x38c860);-0x1!==_0xa9d9fa&&(this['itemsViews']['splice'](_0xa9d9fa,0x1),this['_itemsListView']['items']['remove'](_0x38c860));}}class Di extends/* #__PURE__ -- @preserve */
27
- _0x28ab1a(_0x663ac1){['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(_0x413617,_0x3c116c){super(_0x413617);const _0x365678=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x3c116c['pinned']),this['set']('loadingState',null),this['id']=_0x3c116c['id'];const {title:_0x171abf,createdAt:_0x1d132e,active:_0x5509b4=!0x1}=_0x3c116c;this['_titleView']=new _0x19afdf(),this['_titleView']['text']=_0x171abf,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x52ac5a=this['_createCheckView'](),_0x4e7591=this['_createPinButtonView'](_0x413617),_0x20ebf5=this['_createMenuDropdownView'](),_0x247ec2=this['_createEditInputView'](_0x413617,_0x171abf),_0x38baba=this['_createAcceptEditButtonView'](_0x413617,_0x247ec2),_0xeb2c47=this['_createCancelEditButtonView'](_0x413617,_0x247ec2);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x4e7591),this['actions']['add'](_0x20ebf5),this['on']('change:isEdit',(_0x4ea3f6,_0x3e6c02,_0x448533)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x448533?(this['actions']['add'](_0x38baba),this['actions']['add'](_0xeb2c47),this['mainContent']['add'](_0x247ec2),_0x247ec2['element']['focus']()):(this['actions']['add'](_0x4e7591),this['actions']['add'](_0x20ebf5),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x5509b4?'ck-ai-chat-history__item--active':'',_0x365678['if']('isVisible','ck-hidden',_0x2e9b21=>!_0x2e9b21),_0x365678['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',_0x365678['if']('loadingState','ck-hidden',_0x8cdf24=>!!_0x8cdf24)]},'children':_0x5509b4?[_0x52ac5a]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x365678['if']('loadingState','ck-hidden',_0x2182a9=>!_0x2182a9)]},'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',_0x365678['if']('loadingState','ck-hidden',_0x38f687=>!!_0x38f687)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x365678['if']('loadingState','ck-hidden',_0x283d9a=>!_0x283d9a)]},'children':[{'text':_0x365678['to']('loadingState',_0x2fd505=>_0x2fd505?i(this['locale'],Di['LOADING_LABELS'][_0x2fd505]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x1d132e]}]},{'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'](_0x3757a1){this['_titleView']['text']=_0x528e40(_0x3757a1);}['updateLoadingState'](_0x1c21c8,_0x31f21b){this['set']('loadingState',_0x31f21b?_0x1c21c8:null);}['_createCheckView'](){const _0x580e27=new _0x59b3d9();return _0x580e27['set']({'content':_0x24d29c}),_0x580e27;}['_createPinButtonView'](_0x41768d){const _0x5e5be0=new _0x2cf640(_0x41768d);return _0x5e5be0['set']({'label':i(_0x41768d,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x404f94,'withText':!0x1,'tooltip':!0x0}),_0x5e5be0['bind']('isOn')['to'](this,'pinned'),_0x5e5be0['on']('execute',()=>{const _0xa6ae97=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0xa6ae97});}),_0x5e5be0;}['_createMenuDropdownView'](){const _0x37019b=_0x3e48f8(this['locale'],_0x3c46f6),_0x3992ba=_0x37019b['panelView']['children'];_0x37019b['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x214ca4}),_0x37019b['panelPosition']='sw';const _0x1eb028=new _0x2cf640(this['locale']);_0x1eb028['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x1eb028['withText']=!0x0,_0x1eb028['on']('execute',()=>{this['isEdit']=!0x0;});const _0x3a2a1e=new _0x2cf640(this['locale']);_0x3a2a1e['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x3a2a1e['withText']=!0x0,_0x3a2a1e['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x5f04c5=new _0x163c9e(this['locale']),_0x145988=new _0x663ac1(this['locale']);_0x145988['children']['add'](_0x1eb028);const _0x420b17=new _0x663ac1(this['locale']);return _0x420b17['children']['add'](_0x3a2a1e),_0x5f04c5['items']['addMany']([_0x145988,_0x420b17]),_0x3992ba['add'](_0x5f04c5),_0x37019b;}['_createEditInputView'](_0x3963e1,_0x1c28a4){const _0x28a723=new _0x4a24d0(_0x3963e1),_0x3b0637=_0x28a723['bindTemplate'];return _0x28a723['value']=_0x1c28a4,_0x28a723['extendTemplate']({'on':{'keydown':_0x3b0637['to'](_0x7132d1=>{'Enter'==_0x7132d1['key']&&this['_commitEditInputValue'](_0x28a723);})}}),_0x28a723;}['_createAcceptEditButtonView'](_0x3fee94,_0x53bc3f){const _0xa07358=new _0x2cf640(_0x3fee94);return _0xa07358['set']({'icon':_0x24d29c,'withText':!0x1,'tooltip':i(_0x3fee94,'AI_CHAT_HISTORY_ACCEPT')}),_0xa07358['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0xa07358['on']('execute',()=>{this['_commitEditInputValue'](_0x53bc3f);}),_0xa07358;}['_commitEditInputValue'](_0x11a1bb){const _0xfe55b6=_0x11a1bb['element']['value']||'';this['_titleView']['text']=_0xfe55b6,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0xfe55b6});}['_createCancelEditButtonView'](_0xff322,_0x454c56){const _0x3d00cc=new _0x2cf640(_0xff322);return _0x3d00cc['set']({'icon':_0x4718d2,'withText':!0x1,'tooltip':i(_0xff322,'AI_CHAT_HISTORY_CANCEL')}),_0x3d00cc['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x3d00cc['on']('execute',()=>{this['isEdit']=!0x1,_0x454c56['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x3d00cc;}['_createSpinnerView'](){const _0x43f5de=new Ze('tiny');return _0x43f5de['isVisible']=!0x0,_0x43f5de;}['isMatching'](_0x55b277){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x55b277)?{'title':!0x0}:null;}['highlightText'](_0x380e07){this['_titleView']['highlightText'](_0x380e07);}}class Ot extends _0xc3e5b1{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x29914f,_0x5f171c){super(_0x29914f),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 _0x51d723=new _0x1e299f(_0x29914f,{'label':i(_0x29914f,'AI_CHAT_HISTORY_HEADING'),'icon':Nt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x5f171c&&(this['resizeButton']=us(_0x29914f,this),_0x51d723['children']['add'](this['resizeButton'])),this['sectionsView']=new Li(_0x29914f,[]),this['sectionsView']['delegate'](...zi)['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',_0x3a6fd1=>!_0x3a6fd1)]}}),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':[_0x51d723,{'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 _0x3c121d=new _0x56da7a(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x330494=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x330494),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x28ecf8=this['_createErrorView']();return _0x28ecf8['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x560987=>!_0x560987)]}}),_0x3c121d['on']('render',()=>{_0x3c121d['children']['add'](_0x28ecf8,0x1);}),_0x3c121d['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x4e0004=>!_0x4e0004)]}}),_0x3c121d;}['_createSkeletonView'](){const _0x48761a=new Xe(this['locale'],Ye['aiHistory']);return _0x48761a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x8293ce=>!_0x8293ce)]}}),_0x48761a;}['_createErrorView'](){const _0x1c9b39=new _0xc3e5b1(this['locale']),_0x27e2fd=new _0x2cf640(this['locale']);_0x27e2fd['set']({'withText':!0x1,'icon':_0x4718d2,'class':'ck-ai-notification_error__dismiss-button'}),_0x27e2fd['bind']('isVisible')['to'](this,'hasItems',_0x17f565=>!!_0x17f565),_0x27e2fd['on']('execute',()=>{this['errorMessage']='';});const _0x46d483=this['bindTemplate'];return _0x1c9b39['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x46d483['to']('errorMessage')}]},_0x27e2fd]}),_0x1c9b39;}['_createEmptyStateView'](){const _0x15c3f1=new _0x2cf640(this['locale']);_0x15c3f1['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x1fce8d,'class':'ck-ai-chat__start-conversation'}),_0x15c3f1['on']('execute',()=>{this['fire']('openChat');});const _0x20b9a5=new _0xc3e5b1(this['locale']);return _0x20b9a5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x33b3fd=>!_0x33b3fd)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x15c3f1]}),_0x20b9a5;}['_createListItemViews'](_0x32eef8,_0x4f7ee8){const _0x1f0043=[];for(const _0x444499 of _0x32eef8){const _0x4fb005=new Di(_0x4f7ee8,_0x444499);_0x4fb005['delegate'](...zi)['to'](this),_0x1f0043['push'](_0x4fb005);}return _0x1f0043;}['updateHistoryItemsWithCategories'](_0x156866){const _0x4cca51=this['locale']||'en',_0x14ff93=[];for(const _0x2deb0c of _0x156866){const _0x5768a5=this['_createListItemViews'](_0x2deb0c['items'],_0x4cca51);_0x14ff93['push'](new Yi(_0x4cca51,{'title':_0x2deb0c['title'],'items':_0x5768a5}));}this['sectionsView']['sections']=_0x14ff93,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x14ff93),this['hasItems']=_0x156866['some'](_0x532f6b=>_0x532f6b['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x3bf6cd){for(const _0x172a37 of this['sectionsView']['sections']){const _0x24dd8c=_0x172a37['getItem'](_0x3bf6cd);if(_0x24dd8c){if(_0x172a37['removeItem'](_0x24dd8c),0x0===_0x172a37['itemsViews']['length']){const _0x5643c3=this['sectionsView']['sections']['indexOf'](_0x172a37);-0x1!==_0x5643c3&&(this['sectionsView']['sections']['splice'](_0x5643c3,0x1),this['sectionsView']['items']['remove'](_0x172a37));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x90009d,_0x3c2556){for(const _0x5bcb6d of this['sectionsView']['sections']){const _0x3ce47b=_0x5bcb6d['getItem'](_0x90009d);if(_0x3ce47b){_0x3ce47b['updateTitle'](_0x3c2556);break;}}}['updateItemLoadingState'](_0x3f0a82,_0x3f8d42,_0x346590){for(const _0x3fc4ee of this['sectionsView']['sections']){const _0x5e32a2=_0x3fc4ee['getItem'](_0x3f0a82);if(_0x5e32a2){_0x5e32a2['updateLoadingState'](_0x3f8d42,_0x346590);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x2adf40=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x2adf40);}}}const zi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends _0x3a5602{static get['requires'](){return[it];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x496e4d){super(_0x496e4d);const _0x2d6deb=this['context']['plugins']['get']('AITabs');this['_historyView']=new Ot(this['context']['locale'],_0x2d6deb['showResizeButton']),this['_historyView']['delegate'](...zi)['to'](this),_0x2d6deb['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Nt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x36ee68){this['_historyView']['removeHistoryItem'](_0x36ee68);}['updateItems'](_0x1548b5){this['_historyView']['updateHistoryItemsWithCategories'](_0x1548b5);}['updateItemTitle'](_0x1910fa,_0x88598f){this['_historyView']['updateItemTitle'](_0x1910fa,_0x88598f);}['updateItemLoadingState'](_0x531aec,_0x7888d7,_0x424f44){this['_historyView']['updateItemLoadingState'](_0x531aec,_0x7888d7,_0x424f44);}['setLoadingSkeleton'](_0x593142){this['_historyView']['isLoading']=_0x593142;}['showError'](_0x179065){this['_historyView']['errorMessage']=_0x179065;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x34902e){this['_historyView']['isMaximized']=_0x34902e;}}class nr extends ts(){['id'];['createdAt'];constructor({id:_0x10a3d1,title:_0x211fa5,createdAt:_0x2a39e8,updatedAt:_0x1983d7,pinned:_0x410eb4}){super(),this['id']=_0x10a3d1,this['createdAt']=new Date(_0x2a39e8),this['set']('title',_0x211fa5),this['set']('updatedAt',_0x1983d7?new Date(_0x1983d7):null),this['set']('pinned',_0x410eb4||!0x1);}['updateTitle'](_0xccdcb5){this['set']('title',_0x528e40(_0xccdcb5)),this['updatedAt']=new Date();}['updatePinned'](_0x26f2e9){this['set']('pinned',_0x26f2e9),this['updatedAt']=new Date();}}class Ht extends _0x5bd7c6(){['items']=[];['connector'];['group'];constructor({connector:_0x2d49a5,group:_0x4efb62}){super(),this['connector']=_0x2d49a5,this['group']=_0x4efb62;}async['init'](){try{const _0x395cc8=this['connector']['fetchConversations'](this['group']),_0xc0d375=await _0x395cc8['getConversations']();this['loadItems'](_0xc0d375);}catch(_0x15ed98){this['fire']('error',{'error':_0x15ed98,'operation':'init'});}}['addItem'](_0x16427f){this['items']['push'](_0x16427f);}async['removeItem'](_0x859e8c){const _0x166b0f=this['items']['findIndex'](_0x2ede3e=>_0x2ede3e['id']===_0x859e8c);if(-0x1===_0x166b0f)return!0x1;try{return await this['connector']['deleteConversation'](_0x859e8c)['execute'](),this['items']['splice'](_0x166b0f,0x1),this['fire']('itemRemoved',{'itemId':_0x859e8c}),!0x0;}catch(_0x17c02d){return this['fire']('error',{'error':_0x17c02d,'operation':'removeItem','itemId':_0x859e8c}),!0x1;}}['getItem'](_0x407d0f){return this['items']['find'](_0x1ca105=>_0x1ca105['id']===_0x407d0f);}async['updateItemTitle'](_0x43fd99,_0x2e726f){const _0x1342b4=this['getItem'](_0x43fd99);if(!_0x1342b4)return!0x1;try{return await this['connector']['updateConversation'](_0x43fd99,{'title':_0x2e726f})['getResult'](),_0x1342b4['updateTitle'](_0x2e726f),this['fire']('itemUpdated',{'itemId':_0x43fd99,'updates':{'title':_0x2e726f}}),!0x0;}catch(_0x41c085){return this['fire']('error',{'error':_0x41c085,'operation':'updateItemTitle','itemId':_0x43fd99}),!0x1;}}async['updateItemPinned'](_0xd76156,_0x33f25f){const _0x4a5241=this['getItem'](_0xd76156);if(!_0x4a5241)return!0x1;try{return await this['connector']['updateConversation'](_0xd76156,{'pinned':_0x33f25f})['getResult'](),_0x4a5241['updatePinned'](_0x33f25f),this['fire']('itemUpdated',{'itemId':_0xd76156,'updates':{'pinned':_0x33f25f}}),!0x0;}catch(_0x58d175){return this['fire']('error',{'error':_0x58d175,'operation':'updateItemPinned','itemId':_0xd76156}),!0x1;}}['loadItems'](_0x4c9b11){try{this['items']=[],_0x4c9b11['map'](_0x561ad0=>{this['addItem'](new nr(_0x561ad0));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x4307ac){this['fire']('error',{'error':_0x4307ac,'operation':'loadItems'});}}['getItems'](_0x58bfe9={}){const _0x2849af=void 0x0!==_0x58bfe9['pinned']&&_0x58bfe9['pinned'],_0x5caac8=_0x58bfe9['from']?new Date(_0x58bfe9['from']['getFullYear'](),_0x58bfe9['from']['getMonth'](),_0x58bfe9['from']['getDate']()):null,_0x52754f=_0x58bfe9['to']?new Date(_0x58bfe9['to']['getFullYear'](),_0x58bfe9['to']['getMonth'](),_0x58bfe9['to']['getDate']()):null;return this['items']['filter'](_0x1e7442=>{if(_0x1e7442['pinned']!==_0x2849af)return!0x1;if(_0x52754f){const _0x5c531d=new Date(_0x1e7442['createdAt']['getFullYear'](),_0x1e7442['createdAt']['getMonth'](),_0x1e7442['createdAt']['getDate']());return _0x5caac8?_0x5caac8['getTime']()===_0x52754f['getTime']()?_0x5c531d['getTime']()===_0x5caac8['getTime']():_0x5c531d<_0x52754f&&_0x5c531d>=_0x5caac8:_0x5c531d<_0x52754f;}return!0x0;});}}class jt extends _0x3a5602{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[tt,q,xt,it];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](tt),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](q);const _0x2f2c9c=this['context']['plugins']['get'](it);try{const _0xfb7f14=this['_aiChatController']['getGroupId']();this['history']=new Ht({'connector':this['_aiConnector'],'group':_0xfb7f14}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x3ea6ee,_0x221ae9)=>{this['_setItemLoading'](_0x221ae9['id'],'remove'),this['_handleRemove'](_0x221ae9['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x928c02,_0x2662e4)=>{this['_setItemLoading'](_0x2662e4['id'],'rename'),this['_handleEditTitle'](_0x2662e4['id'],_0x2662e4['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x542ced,_0xfb7310)=>{void 0x0!==_0xfb7310['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0xfb7310['itemId'],_0xfb7310['updates']['title']),void 0x0!==_0xfb7310['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0xfb7310['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x5cd81b,_0x242d4b)=>{this['_aiChatController']['handleRemovedConversation'](_0x242d4b['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x242d4b['itemId']),this['_clearItemLoading'](_0x242d4b['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x3900cb,_0x3c7dcb)=>{this['_handleHistoryErrorUI'](_0x3c7dcb['error'],_0x3c7dcb['operation'],_0x3c7dcb['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0xf69c3e,_0x9a8b47)=>{this['_handleSelectConversation'](_0x9a8b47['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x2aecfb,_0x48c538)=>{const _0x14fdf3=_0x48c538['pinned']?'pin':'unpin';this['_setItemLoading'](_0x48c538['id'],_0x14fdf3),this['_handleTogglePin'](_0x48c538['id'],_0x48c538['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x2f2c9c['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x2f2c9c['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x2f2c9c,'resizedTabs',(_0x6837dd,_0x2decfc)=>{this['_setIsMaximized'](_0x2decfc);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x2f2c9c['resize']();});}catch(_0x7ca17b){this['_handleHistoryErrorUI'](_0x7ca17b,'init');}}async['_handleEditTitle'](_0x2cff7f,_0x1d9691){await this['history']['updateItemTitle'](_0x2cff7f,_0x1d9691);}async['_handleTogglePin'](_0x4297cd,_0x46c5d7){await this['history']['updateItemPinned'](_0x4297cd,_0x46c5d7);}async['_handleRemove'](_0x5420c6){await this['history']['removeItem'](_0x5420c6);}async['_handleSelectConversation'](_0x4c2b56){await this['_aiChatController']['loadConversation'](_0x4c2b56);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x205048=this['_aiChatController']['activeConversation']?.['id'],_0x967bc8=this['_getCategorizedItems']()['map'](_0x3f04fd=>({'title':_0x3f04fd['title'],'items':_0x3f04fd['items']['map'](_0x4f33de=>({'id':_0x4f33de['id'],'title':_0x4f33de['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x4f33de['createdAt'])['toLocaleDateString'](),'active':_0x4f33de['id']===_0x205048,'pinned':_0x4f33de['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x967bc8);}['_setItemLoading'](_0x10d157,_0x16bdb8){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x10d157,_0x16bdb8,!0x0);}['_clearItemLoading'](_0x38e496){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x38e496,null,!0x1);}['_handleHistoryErrorUI'](_0x17c06a,_0x49024a,_0x27e9d3){const _0x5d4fc1=this['_generateErrorMessage'](_0x49024a,_0x27e9d3);this['_aiChatHistoryUi']['showError'](_0x5d4fc1),_0x27e9d3&&this['_clearItemLoading'](_0x27e9d3),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x43f132,_0x447d7d){const _0x1996b4=_0x447d7d?this['history']['getItem'](_0x447d7d):null,_0x3f9c50=_0x1996b4?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x43f132){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x3f9c50);case'updateItemPinned':{const _0x349907=i(this['context']['locale'],_0x1996b4?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x349907,_0x3f9c50]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x3f9c50);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 _0x53c852=new Date(),_0x5591d8=new Date(_0x53c852['getFullYear'](),_0x53c852['getMonth'](),_0x53c852['getDate']()),_0x3b7597=new Date(_0x5591d8);_0x3b7597['setDate'](_0x3b7597['getDate']()-0x1);const _0x1bb199=new Date(_0x5591d8);_0x1bb199['setDate'](_0x1bb199['getDate']()-0xe);const _0x316328=this['history']['getItems']({'pinned':!0x0}),_0x11209d=this['history']['getItems']({'from':_0x5591d8,'to':_0x5591d8}),_0x4747e7=this['history']['getItems']({'from':_0x3b7597,'to':_0x3b7597}),_0x223e34=this['history']['getItems']({'from':_0x1bb199,'to':_0x3b7597}),_0x2410dc=this['history']['getItems']({'to':_0x1bb199}),_0x46b217=[];return _0x316328['length']>0x0&&_0x46b217['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x316328}),_0x11209d['length']>0x0&&_0x46b217['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x11209d}),_0x4747e7['length']>0x0&&_0x46b217['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x4747e7}),_0x223e34['length']>0x0&&_0x46b217['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x223e34}),_0x2410dc['length']>0x0&&_0x46b217['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x2410dc}),_0x46b217;}['_setIsMaximized'](_0x1cdc87){this['_aiChatHistoryUi']['setIsMaximized'](_0x1cdc87);}}class G extends _0x3a5602{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class AIChat extends _0x3a5602{static get['requires'](){return[q,D,z,G];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x41542c){super(_0x41542c),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'](q)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](q)['startConversation']();}async['sendMessage']({message:_0x2bad14,attributes:_0x3ba2a8}){await this['context']['plugins']['get'](q)['sendMessage']({'message':_0x2bad14,'attributes':_0x3ba2a8});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](q)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](q)['focusPromptInput']();}['registerToolDataCallback'](_0x3b7b51){this['context']['plugins']['get'](q)['_registerToolDataCallback'](_0x3b7b51);}}class ws extends _0x2cf640{['id'];constructor(_0x4b6acb,_0x430800){super(_0x4b6acb);const {id:_0x42c59e,type:_0x4c72a8,icon:_0x826ea5}=_0x430800;this['id']=_0x42c59e,this['set']({'label':_0x430800['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x430800['id']}}),_0x826ea5?this['icon']=_0x826ea5:'chat'===_0x4c72a8?this['icon']=_0x382801:'review'===_0x4c72a8?this['icon']=_0x17e3b2:'translate'===_0x4c72a8&&(this['icon']=Vt);}}class Mt extends _0xc3e5b1{['listView'];constructor(_0x36dc40,_0x38a5b4){super(_0x36dc40);const _0x1d234a=_0x38a5b4['map'](_0x160daa=>{const _0x5e7226=new _0x663ac1(this['locale']),_0x101be9=new ws(this['locale'],_0x160daa);return _0x5e7226['children']['add'](_0x101be9),_0x101be9['delegate']('execute')['to'](this),_0x5e7226;});this['listView']=new _0x163c9e(this['locale']),this['listView']['items']['addMany'](_0x1d234a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const Ut='chat-shortcuts';var ka=function(_0x2d5486){return _0x2d5486['CHAT']='chat',_0x2d5486['REVIEW']='review',_0x2d5486['TRANSLATE']='translate',_0x2d5486;}({});class AIChatShortcuts extends _0x3a5602{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[z];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](z),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x20e50d=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x20e50d['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x20e50d,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x3d9dfc=Object['values'](ka);this['_shortcuts']['forEach'](_0x242f98=>{let _0x169d25=!0x0;if(_0x242f98['id']&&_0x242f98['label']&&_0x3d9dfc['includes'](_0x242f98['type'])?'chat'===_0x242f98['type']&&(_0x169d25='string'==typeof _0x242f98['prompt']):_0x169d25=!0x1,!_0x169d25)throw new _0x563e6a('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x242f98});});}['_injectShortcuts'](){const _0x1d90af=this['context']['plugins']['get'](z);this['_shortcutsView']=new Mt(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x1d90af['addFeedItemCustomElement'](this['_shortcutsView']['element'],Ut),this['_shortcutsView']['on']('execute',_0xa63d35=>{const _0x56bb18=_0xa63d35['source']['id'];this['_executeShortcut'](_0x56bb18);});}['_removeShortcuts'](){const _0x30407b=this['context']['plugins']['get'](z);_0x30407b['hasFeedItem'](Ut)&&_0x30407b['removeFeedItem'](Ut),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x4b000f){const _0x781ca9=this['_shortcuts']['find'](_0x504919=>_0x504919['id']===_0x4b000f),_0x3b5230=_0x781ca9['type'];'chat'===_0x3b5230?this['_runChatShortcut'](_0x781ca9):'review'===_0x3b5230?_0x781ca9['check']?this['_runReviewShortcut'](_0x781ca9):this['_switchTab']('reviewMode'):'translate'===_0x3b5230&&(_0x781ca9['language']?this['_runTranslateShortcut'](_0x781ca9):this['_switchTab']('translate'));}['_switchTab'](_0x2ca6f6){if(!this['context']['plugins']['has']('AITabs'))throw new _0x563e6a('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x2ca6f6});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x2ca6f6);}async['_runChatShortcut']({prompt:_0x2a35f4,draftMode:_0x4e94e3,useWebSearch:_0x5ab1f1=!0x1,useReasoning:_0x5c9fae=!0x1,model:_0x5e2803}){const _0x419bb8=this['context']['plugins']['get']('AIChat'),_0x2f9f91=this['context']['plugins']['get']('AIChatController'),_0x43765b=_0x2f9f91['activeConversation'];let _0x3d1eef;_0x3d1eef=_0x5e2803?await _0x43765b['chatModels']['getModel'](_0x5e2803):await _0x43765b['chatModels']['getDefault'](),_0x3d1eef&&await _0x43765b['setModel'](_0x3d1eef),_0x43765b['setWebSearch'](_0x5ab1f1),_0x43765b['setReasoning'](_0x5c9fae),_0x2f9f91['addCurrentDocumentToChatContext'](),_0x4e94e3?(this['_aiChatUI']['setPromptInputValue'](_0x2a35f4),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x419bb8['sendMessage']({'message':_0x2a35f4});}['_runReviewShortcut']({check:_0x14c37f,model:_0x5dae70,prompt:_0x5cc038,params:_0x1c517e}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0x563e6a('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x150dab={'id':_0x14c37f,'isCustom':'custom'===_0x14c37f};_0x5dae70&&_0x5cc038&&(_0x150dab['args']={'model':_0x5dae70,'prompt':_0x5cc038}),_0x1c517e&&(_0x150dab['params']=_0x1c517e),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x150dab);}['_runTranslateShortcut']({language:_0x54a7dd}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0x563e6a('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x54a7dd,'args':{'language':_0x54a7dd}});}}class io extends Lt{constructor(_0xdfa794){super(_0xdfa794);const _0x3d4a78=_0xdfa794['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x3d4a78,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x33399b=this['editor']['plugins']['get']('AITabs')['view'];_0x33399b['isVisible']=!_0x33399b['isVisible'];}}class Pt extends _0x361c0d{static get['requires'](){return[it];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1dea3c=this['editor'];_0x1dea3c['commands']['add']('toggleAi',new io(_0x1dea3c)),_0x1dea3c['ui']['componentFactory']['add']('toggleAi',()=>{const _0x4ecce9=this['_createAIUIButton'](_0x2cf640);return _0x4ecce9['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x4ecce9;}),_0x1dea3c['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x1239a6=this['_createAIUIButton'](_0x226c2e);return _0x1239a6['set']({'role':'menuitemcheckbox'}),_0x1239a6;});}['_createAIUIButton'](_0x1f6eb7){const _0x545b4e=this['editor'],_0x2a8b9f=_0x545b4e['commands']['get']('toggleAi'),_0x49d3bc=new _0x1f6eb7(_0x545b4e['locale']);return _0x49d3bc['set']({'label':i(_0x545b4e['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x2ab699,'isToggleable':!0x0}),_0x49d3bc['bind']('isEnabled')['to'](_0x2a8b9f),_0x49d3bc['bind']('isOn')['to'](_0x2a8b9f,'value',_0x490a31=>!!_0x490a31),this['listenTo'](_0x49d3bc,'execute',()=>{_0x2a8b9f['execute']();}),_0x49d3bc;}}const F=['applySuggestion','insertSuggestion','showNext','showPrevious'];class pi extends _0xc3e5b1{['_errorView'];constructor(_0x103fd8){super(_0x103fd8),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x16d3bd){this['showError'](_0x16d3bd);}['showError'](_0xb1c343){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0xb1c343,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x21ef9f=new _0xc3e5b1(this['locale']),_0x3c4557=new _0xc3e5b1(this['locale']);return _0x3c4557['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x21ef9f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x461677=>!_0x461677)]},'children':[_0x3c4557]}),_0x21ef9f;}}const $=0xa;class H extends _0x3a5602{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'](_0x407c82){const {id:_0x1c49d7}=this['_currentConfig']??{};this['_currentConfig']=_0x407c82;const {id:_0x2813aa}=this['_currentConfig'];this['isOpen']&&_0x1c49d7===_0x2813aa?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x1eff3c=T(this['context'])['plugins']['get']('Dialog');_0x1eff3c['isOpen']&&this['_currentConfig']&&_0x1eff3c['id']===this['_currentConfig']['id']&&_0x1eff3c['hide']();}['_updateDialog'](){const _0x55f730=T(this['context'])['plugins']['get']('Dialog'),{icon:_0x118734,title:_0x2707d2}=this['_currentConfig'];_0x55f730['view']?.['headerView']&&(_0x55f730['view']['headerView']['label']=_0x2707d2,_0x55f730['view']['headerView']['iconView']&&_0x118734&&(_0x55f730['view']['headerView']['iconView']['content']=_0x118734)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x55f730['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](D)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x861d8c){this['context']['plugins']['get'](D)['hideFakeVisualSelection']('ai-balloon-'+_0x861d8c);}['_showDialog'](){const _0x29df73=T(this['context'])['plugins']['get']('Dialog'),{id:_0x47729f,title:_0x5ea44b,icon:_0x4ca317,class:_0x389a7c,mainView:_0x3e21ad}=this['_currentConfig'];_0x3e21ad['delegate'](...F)['to'](this),_0x29df73['show']({'title':_0x5ea44b,'icon':_0x4ca317,'hasCloseButton':!0x0,'id':_0x47729f,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x389a7c||''),'content':_0x3e21ad,'onShow':_0x1f6434=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x5b1f19=this['_getSelectionElements']();_0x5b1f19&&_0x5b1f19[0x0]&&_0x1fa956({'target':_0x5b1f19[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x1f6434['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x47729f});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x47729f}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x47b804,_0x3f28f6){if(!_0x3f28f6)return null;const _0x434406=this['_getSelectionElements']();if(!_0x434406||0x0===_0x434406['length'])return{'left':Math['round'](_0x3f28f6['left']+_0x3f28f6['width']/0x2-_0x47b804['width']/0x2),'top':Math['round'](_0x3f28f6['top']+_0x3f28f6['height']/0x2-_0x47b804['height']/0x2)};const _0x5346a0=Math['round'](_0x3f28f6['left']+_0x3f28f6['width']/0x2-_0x47b804['width']/0x2),_0x4cde34=_0x434406['map'](_0x240969=>new _0x4b725e(_0x240969)),_0x473a9a=_0x47b804['height'];return{'left':_0x5346a0,'top':this['_calculateOptimalTopPosition'](_0x4cde34,_0x473a9a,_0x3f28f6)};}['_calculateOptimalTopPosition'](_0x20eb3a,_0x2b0d16,_0x7c880e){const _0x3e36c9=new _0x4b725e(_0x44426a['window']),_0x57e27f=_0x20eb3a['map'](_0x4162a9=>_0x4162a9['getVisible']())['filter'](_0xadecb9=>_0xadecb9),_0x17a8cd=_0x4b725e['getBoundingRect'](_0x57e27f);if(!_0x17a8cd)return Math['round'](_0x7c880e['top']+_0x7c880e['height']/0x2);const _0x406f0d=_0x3e36c9['getIntersection'](_0x17a8cd);if(!_0x406f0d)return Math['round'](_0x7c880e['top']+_0x7c880e['height']/0x2);const _0x494129=_0x7c880e['getVisible'](),_0x34e6a0=_0x494129&&_0x17a8cd['height']>_0x494129['height'],_0x517751=_0x406f0d['top'],_0x4b770a=_0x406f0d['bottom'];if(_0x34e6a0){const _0x3ac14b=(_0x494129||_0x3e36c9)['height']/0x2-_0x2b0d16/0x2,_0x24cd5a=_0x517751-$-_0x7c880e['top'],_0x154d52=_0x7c880e['bottom']-_0x4b770a-$;return _0x24cd5a>=_0x2b0d16?Math['max']($,_0x517751-_0x2b0d16-$):_0x154d52>=_0x2b0d16?_0x4b770a+$:Math['max']($,_0x3ac14b);}const _0x3a4612=_0x517751-_0x2b0d16,_0xa87e72=_0x7c880e['bottom']-_0x4b770a-$,_0x4a9c53=_0x517751-$-_0x7c880e['top'];let _0xdcce1b;if(_0xa87e72>=_0x2b0d16)_0xdcce1b=_0x4b770a+$;else{if(_0x4a9c53>=_0x2b0d16)_0xdcce1b=_0x3a4612-$;else _0xdcce1b=_0x517751+_0x17a8cd['height']/0x2-_0x2b0d16/0x2;}return _0xdcce1b;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x2d9125=T(this['context']);this['listenTo'](_0x2d9125['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0xeb823c,data:{newRange:_0x12154a}}of _0x2d9125['model']['document']['differ']['getChangedMarkers']())if(_0xeb823c['startsWith'](R+':')&&(_0x12154a&&(_0x12154a['start']['isEqual'](_0x12154a['end'])||'$graveyard'==_0x12154a['root']['rootName'])||null==_0x12154a)){const _0xb70d2b=i(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0xb70d2b),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x14008e=T(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x14008e['model']['document']);}['_getSelectionElements'](){const _0x3aa7ab=T(this['context']);return _0x18a8b5(_0x3aa7ab['editing'],[..._0x3aa7ab['model']['markers']['getMarkersGroup']('ai-selection'),..._0x3aa7ab['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class wi extends _0x14c71e{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x548633,_0x3b1d6f={}){super(_0x548633),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x3b1d6f};const _0x283781=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x283781?'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'](_0x5aa6b7){this['showChangesButton']['isEnabled']=_0x5aa6b7;}['_setupRatingButtons'](){this['likeButton']=new _0x2cf640(this['locale']),this['likeButton']['set']({'icon':_0x2ea5c6,'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 _0x2cf640(this['locale']),this['dislikeButton']['set']({'icon':_0x427eb3,'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 _0x2cf640(this['locale']),this['copyButton']['set']({'icon':_0x571e92,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x2805de=new _0x59b3d9();_0x2805de['set']({'content':_0x2b7211}),_0x2805de['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'](_0x2805de);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x2cf640(this['locale']),this['showChangesButton']['set']({'icon':_0x1c481d,'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',_0x32735b=>_0x32735b?_0x339447:_0x1c481d),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class Q extends pi{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0xf247af,_0xdd6ce2){super(_0xf247af);const _0x509870=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _0x5f2dfb(),this['_keystrokes']=new _0x15425(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x1af4a5({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0xdd6ce2,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new ui(_0xf247af),this['_partToolbarView']=new gi(_0xf247af,_0xdd6ce2['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0xdd6ce2),this['_stateView']=new mi(_0xf247af),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new wi(_0xf247af,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new AIChatBalloonToolbarContainerView(_0xf247af,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x3cf55e,_0x5dcb3d,_0x24620a,_0x135757)=>{let _0x4e5026,_0x2b035c;'pending'===_0x135757?(_0x4e5026=this['_partToolbarView'],_0x2b035c=this['_stateView']):(_0x4e5026=this['_stateView'],_0x2b035c=this['_partToolbarView']),this['_stateView']['setState'](_0x24620a),_0x4e5026['isVisible']=!0x1,_0x2b035c['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x509870['to']('_state',_0x578c8a=>'ck-ai-chat-balloon-main_state_'+_0x578c8a)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0xdd6ce2);});}['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'](_0x44944b){_0x44944b?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x44944b);}['setState'](_0x4990c1){this['_state']=_0x4990c1;}['showError'](_0x19d038){super['showError'](_0x19d038),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x1d5db1){super['showBlockingError'](_0x1d5db1),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x4eb942){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x4eb942;}['togglePartToolbarEnabled'](_0x2f2e72){this['_partToolbarView']['isEnabled']=_0x2f2e72;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x167706,showSuggestButton:_0x4da5f6}){_0x167706=_0x167706&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x4da5f6=_0x4da5f6&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x167706,'showSuggestButton':_0x4da5f6});}['_createNextButtonView'](){const _0x5edaf1=new _0x2cf640(this['locale']);return _0x5edaf1['set']({'icon':_0x179898,'label':i(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x5edaf1['on']('execute',()=>{this['fire']('showNext');}),_0x5edaf1;}['_createPreviousButtonView'](){const _0x3c0577=new _0x2cf640(this['locale']);return _0x3c0577['set']({'icon':_0x2ca36b,'label':i(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x3c0577['on']('execute',()=>{this['fire']('showPrevious');}),_0x3c0577;}}class AIChatBalloonToolbarContainerView extends _0xc3e5b1{constructor(_0x5c9354,_0x3a386d){super(_0x5c9354),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x3a386d});}}class qt extends _0x361c0d{static get['requires'](){return[_0x3a1450,H];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x603eae){super(_0x603eae),this['set']('showDiff',!0x1);}['open'](_0x23edb5){const _0x5a6004=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x5a6004['plugins']['get']('AIBalloon')['open']({..._0x23edb5,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x23edb5['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x23edb5['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0xa7d7c5){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0xa7d7c5);}['setState'](_0x17509c){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x17509c);}['_createChatBalloonView'](){const _0x4e9af3=this['editor'],_0x452fad=_0x4e9af3['plugins']['get']('AIBalloon'),_0x2bf02c=_0x4e9af3['commands']['get']('trackChanges');let _0x5ee80=_0x4e9af3['config']['get']('ai.availableReplyActions')||[...J];_0x4e9af3['plugins']['has']('TrackChanges')||(_0x5ee80=_0x5ee80['filter'](_0x2c4259=>'insertSuggestion'!=_0x2c4259));const _0x28de5f=new Q(_0x4e9af3['locale'],{'availableActions':_0x5ee80,'showApplyButton':!0x0,'showSuggestButton':!!_0x2bf02c});return _0x28de5f['bind']('showDiff')['to'](this),_0x28de5f['delegate'](...W)['to'](this),_0x28de5f['delegate']('showPrevious','showNext')['to'](this),_0x452fad['delegate']('dialogClosed')['to'](this),_0x28de5f['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x28de5f['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x28de5f['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x2bf02c&&_0x28de5f['bind']('isTrackChangesOn')['to'](_0x2bf02c,'value'),_0x28de5f['render'](),_0x28de5f;}['_toggleRotatorButtonsInDialogHeader'](_0x22a8b4){const _0x145099=this['editor'],_0x49040b=_0x145099['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x22a8b4),_0x49040b['has'](this['_chatBalloonView']['previousButtonView'])||(_0x49040b['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x145099['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x49040b['remove'](this['_chatBalloonView']['previousButtonView']),_0x49040b['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class AIEditorIntegration extends _0x361c0d{static get['requires'](){return[Pt,qt,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Zt(_0x46b734){const {editor:_0x5a83b6,action:_0xc822ad,withText:_0x3b5700=!0x1,withIcon:_0x50bd81=!0x0,isInDropdown:_0x144280=!0x0,shouldPreventFocus:_0x1097b6=!0x1}=_0x46b734;return()=>{const _0x55dee1=_0x5a83b6['locale'],_0x54610b=new _0x2cf640(_0x55dee1),_0x308e17=_0x54610b['bindTemplate'];_0x144280&&_0x54610b['extendTemplate']({'on':{'mouseenter':_0x308e17['to'](()=>{_0x1097b6&&_0x1097b6()||_0x54610b['focus']();})}});const _0x2943df=_0xc822ad['icon']??_0xc822ad['parent']?.['icon'];return _0x54610b['set']({'label':_0xc822ad['displayedPrompt'],'withText':_0x3b5700,'role':'menuitem','icon':_0x50bd81?_0x2943df??yt:void 0x0,'tooltip':!_0x3b5700,'class':'ck-ai-quick-actions-button','isEnabled':_0xc822ad['isEnabled']}),_0x54610b['on']('execute',()=>{_0x5a83b6['editing']['view']['focus'](),_0x5a83b6['commands']['execute']('aiQuickAction',_0xc822ad);}),_0x54610b;};}class Ps extends _0x4e6947{['arrowView'];constructor(_0x401c71,_0x705e26){super(_0x401c71,_0x705e26);const _0x3473c5=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',_0x34f9c8=>String(_0x34f9c8)),'data-cke-tooltip-disabled':_0x3473c5['to']('isOn')},'on':{'mouseenter':_0x3473c5['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0xe69d46=new _0x59b3d9();return _0xe69d46['content']=_0x468b06,_0xe69d46['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0xe69d46;}}class Ls extends _0x163c9e{['_allListItems'];['_allSearchableItems'];constructor(_0x4c9aa3,_0x45ce8d,_0x302c8e){super(_0x4c9aa3),this['_allListItems']=_0x45ce8d,this['_allSearchableItems']=_0x302c8e;}['filter'](_0x5baf7f){if(!_0x5baf7f)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x512e3b=_0x5baf7f['source']['toLowerCase']()['trim'](),_0x1b1cbd=this['_allSearchableItems']['filter'](_0x1d81b2=>(_0x1d81b2['groupLabel']?_0x1d81b2['label']+'\x20('+_0x1d81b2['groupLabel']+')':_0x1d81b2['label'])['toLowerCase']()['includes'](_0x512e3b));return this['items']['clear'](),this['items']['addMany'](_0x1b1cbd['sort']((_0x58d713,_0x302cf9)=>{const _0x1a82c7=_0x58d713['groupLabel'],_0x7bab25=_0x302cf9['groupLabel'];return _0x1a82c7||_0x7bab25?_0x1a82c7?0x1:-0x1:0x0;})['map'](_0x1d0226=>_0x1d0226['item'])),this['_highlightQuery'](_0x512e3b,_0x1b1cbd),{'resultsCount':_0x1b1cbd['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x205719,_0x328c29){if(!_0x205719)return;const _0x317ca1=new RegExp(_0x15b1ec(_0x205719),'gi');_0x328c29['forEach'](_0x1b220a=>{_0x1b220a['highlightViews']&&_0x1b220a['highlightViews']['forEach'](_0x372eb9=>{'function'==typeof _0x372eb9['highlightText']&&_0x372eb9['highlightText'](_0x317ca1);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0xc7e70=>{_0xc7e70['highlightViews']&&_0xc7e70['highlightViews']['forEach'](_0x317d49=>{'function'==typeof _0x317d49['highlightText']&&_0x317d49['highlightText'](null);});});}}const Qs='menu',Gs='menuitem';class co extends _0xc3e5b1{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x1b99a0,_0x4a17a3,_0x407546,_0x3be597,_0x4889a3=!0x1){const _0x1955ac=_0x1b99a0['locale'];super(_0x1955ac),this['_bodyCollection']=_0x3be597,this['_hasSearch']=_0x4889a3;const _0x2525ec=this['_createListItems'](_0x1b99a0,_0x4a17a3,_0x407546);this['optionsListView']=new Ls(_0x1955ac,_0x2525ec,this['_allSearchableItems']),this['optionsListView']['role']=Qs,this['optionsListView']['items']['addMany'](_0x2525ec),this['focusTracker']=new _0x5f2dfb(),this['keystrokes']=new _0x15425(),_0x4889a3&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x2525ec,this['focusCycler']=new _0x1af4a5({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x4889a3&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0xb7e9=_0x4889a3&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0xf5a45d(_0xb7e9),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x1955ac['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x56da7a(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 _0x213036=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x213036);}['_createListItems'](_0x1e3d4b,_0x41f0d4,_0x30e576){const _0x30bfab=new _0xf5a45d();return _0x41f0d4['forEach'](_0x506acd=>{if('actions'in _0x506acd){const {listItem:_0x59ad6e}=this['_createActionGroupButton'](_0x1e3d4b,_0x506acd,_0x30e576);_0x30bfab['add'](_0x59ad6e),_0x506acd['actions']['forEach'](_0x6db175=>{this['_createActionButton'](_0x1e3d4b,_0x6db175,_0x506acd['label'],_0x506acd['icon']);const {listItem:_0x19f4aa,highlightViews:_0x36f3e8}=this['_createSearchResultActionButton'](_0x1e3d4b,_0x6db175,_0x506acd['label'],_0x506acd['icon']);this['_allSearchableItems']['push']({'item':_0x19f4aa,'label':_0x6db175['displayedPrompt'],'groupLabel':_0x506acd['label'],'highlightViews':_0x36f3e8});});}else{const {listItem:_0x350128}=this['_createActionButton'](_0x1e3d4b,_0x506acd);_0x30bfab['add'](_0x350128);const _0x54d369=_0x350128['children']['first'];if(_0x54d369){const {listItem:_0x42319d,highlightViews:_0x3381ab}=this['_createSearchResultActionButton'](_0x1e3d4b,_0x506acd);this['_allSearchableItems']['push']({'item':_0x42319d,'label':_0x54d369['label']||'','highlightViews':_0x3381ab});}}}),_0x30bfab;}['_createActionButton'](_0xa5c8f3,_0x26f572,_0x808dc,_0x2c8ef4){const _0x763dd2=new _0x663ac1(this['locale']);if(_0x808dc&&_0x2c8ef4){const _0x452815=new _0x2cf640(this['locale']),_0xbdd418=_0x452815['bindTemplate'],_0x3e47d6=new _0x19afdf();_0x3e47d6['text']=_0x26f572['displayedPrompt'];const _0x3d43c1=new _0x19afdf();_0x3d43c1['text']=_0x808dc;const _0x5e23aa=new _0x59b3d9();_0x5e23aa['content']=_0x2c8ef4,_0x5e23aa['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x19521a=new _0xc3e5b1(this['locale']);_0x19521a['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x4f718f=new _0xc3e5b1(this['locale']);return _0x4f718f['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x452815['set']({'label':_0x26f572['displayedPrompt']+'\x20('+_0x808dc+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x452815['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':[_0x3e47d6,_0x19521a,_0x5e23aa,_0x3d43c1,_0x4f718f],'on':{'mouseenter':_0xbdd418['to'](()=>{this['_isSearchFocused']()||_0x452815['focus']();}),'click':_0xbdd418['to'](()=>{_0x452815['fire']('execute');})}}),_0x452815['on']('execute',()=>{_0xa5c8f3['editing']['view']['focus'](),_0xa5c8f3['commands']['execute']('aiQuickAction',_0x26f572);}),_0x763dd2['children']['add'](_0x452815),{'listItem':_0x763dd2,'highlightViews':[_0x3e47d6,_0x3d43c1]};}{const _0x4f00ef=new _0x49352c(),_0x25f354=new _0x2cf640(this['locale'],_0x4f00ef),_0x539849=_0x25f354['bindTemplate'],_0x4115e5=_0x26f572['icon']??_0x26f572['parent']?.['icon'],_0x553bc2=void 0x0!==_0x26f572['icon'];return _0x25f354['set']({'label':_0x26f572['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x553bc2?_0x4115e5??yt:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x25f354['extendTemplate']({'on':{'mouseenter':_0x539849['to'](()=>{this['_isSearchFocused']()||_0x25f354['focus']();})}}),_0x25f354['on']('execute',()=>{_0xa5c8f3['editing']['view']['focus'](),_0xa5c8f3['commands']['execute']('aiQuickAction',_0x26f572);}),_0x763dd2['children']['add'](_0x25f354),{'listItem':_0x763dd2,'highlightViews':[_0x4f00ef]};}}['_createSearchResultActionButton'](_0x4495ad,_0x35a78c,_0x42eb1e,_0x13031b){return _0x42eb1e&&_0x13031b?this['_createSearchResultGroupedActionButton'](_0x4495ad,_0x35a78c,_0x42eb1e,_0x13031b):this['_createSearchResultIndividualActionButton'](_0x4495ad,_0x35a78c);}['_createSearchResultGroupedActionButton'](_0x3270c6,_0x470f83,_0x293b95,_0x201a72){const _0x18782c=new _0x663ac1(this['locale']),_0x267d9e=new _0x2cf640(this['locale']),_0x11a5ea=_0x267d9e['bindTemplate'],{view:_0xc6109d,highlightView:_0x5527ac}=this['_createSearchResultGroupRow'](_0x293b95,_0x201a72),{view:_0x148700,highlightView:_0x534066}=this['_createSearchResultActionRow'](_0x470f83['displayedPrompt']),_0x5da2dc=this['_createSearchResultContentView'](_0xc6109d,_0x148700);return _0x267d9e['set']({'label':_0x470f83['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}),_0x267d9e['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':[_0x5da2dc],'on':{'mouseenter':_0x11a5ea['to'](()=>{this['_isSearchFocused']()||_0x267d9e['focus']();}),'click':_0x11a5ea['to'](()=>{this['_handleSearchResultButtonClick'](_0x267d9e);})}}),this['_setupActionButtonExecution'](_0x267d9e,_0x3270c6,_0x470f83),_0x18782c['children']['add'](_0x267d9e),{'listItem':_0x18782c,'highlightViews':[_0x5527ac,_0x534066]};}['_createSearchResultIndividualActionButton'](_0x158acc,_0x133cbd){const _0xdd610=new _0x663ac1(this['locale']),_0x5565c5=new _0x49352c(),_0x1e9d35=new _0x2cf640(this['locale'],_0x5565c5),_0x317233=_0x1e9d35['bindTemplate'];return _0x1e9d35['set']({'label':_0x133cbd['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x1e9d35['extendTemplate']({'on':{'mouseenter':_0x317233['to'](()=>{this['_isSearchFocused']()||_0x1e9d35['focus']();})}}),this['_setupActionButtonExecution'](_0x1e9d35,_0x158acc,_0x133cbd),_0xdd610['children']['add'](_0x1e9d35),{'listItem':_0xdd610,'highlightViews':[_0x5565c5]};}['_createSearchResultGroupRow'](_0x56fb92,_0x11f3c1){const _0x579709=new _0xc3e5b1(this['locale']),_0x33fcd5=new _0x59b3d9();_0x33fcd5['content']=_0x11f3c1,_0x33fcd5['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x25be7c=new _0x19afdf();return _0x25be7c['text']=_0x56fb92,_0x579709['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x33fcd5,_0x25be7c]}),{'view':_0x579709,'highlightView':_0x25be7c};}['_createSearchResultActionRow'](_0x18429e){const _0xf9c7eb=new _0xc3e5b1(this['locale']),_0x3a017f=new _0x19afdf();return _0x3a017f['text']=_0x18429e,_0xf9c7eb['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x3a017f]}),{'view':_0xf9c7eb,'highlightView':_0x3a017f};}['_createSearchResultContentView'](_0x525ae7,_0x8a9c15){const _0x3e3cf8=new _0xc3e5b1(this['locale']);return _0x3e3cf8['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x525ae7,_0x8a9c15]}),_0x3e3cf8;}['_setupActionButtonExecution'](_0x18d183,_0x5817cf,_0x3d7ca0){_0x18d183['on']('execute',()=>{_0x5817cf['editing']['view']['focus'](),_0x5817cf['commands']['execute']('aiQuickAction',_0x3d7ca0);});}['_createActionGroupButton'](_0x5b9471,_0x5a5f51,_0xa299c7){const _0x2922a7=new _0x663ac1(this['locale']),_0x57bf85=new _0x49352c(),_0x4971aa=new Ps(this['locale'],_0x57bf85),_0x233216=_0x4971aa['bindTemplate'],_0x5f47f3=this['_getPanelKeystroke'](_0xa299c7),_0x516cc3=this['_createGroupActionsList'](_0x5b9471,_0x5a5f51['actions'],_0xa299c7);_0x4971aa['set']({'label':_0x5a5f51['label'],'withText':!0x0,'role':Gs,'icon':_0x5a5f51['icon']??yt,'isEnabled':_0x5a5f51['actions']['some'](_0x586a30=>_0x586a30['isEnabled'])}),_0x4971aa['extendTemplate']({'on':{'mouseenter':_0x233216['to'](()=>{this['_isSearchFocused']()||_0x4971aa['focus']();})}});const _0x24416c=new _0x5442ef(this['locale']);return _0x24416c['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x233216['to'](_0x7758e3=>{this['_handlePanelKeydown'](_0x7758e3,_0x5f47f3,_0x4971aa,_0x24416c);})}}),_0x4971aa['bind']('isOn')['to'](_0x24416c,'isVisible'),this['_bodyCollection']['add'](_0x24416c),_0x24416c['content']['add'](_0x516cc3),this['_setupGroupMenuBehavior'](_0x4971aa,_0x24416c),_0x2922a7['children']['add'](_0x4971aa),{'listItem':_0x2922a7,'highlightView':_0x57bf85};}['_createGroupActionsList'](_0xa7c351,_0x5d7c9c,_0x241123){const _0x4690b0=new _0x163c9e(this['locale']);return _0x4690b0['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x5d7c9c['forEach'](_0x37dfaa=>{const _0x2b5921=new _0x663ac1(this['locale']),_0x41ad67=Zt({'editor':_0xa7c351,'action':_0x37dfaa,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x2b5921['children']['add'](_0x41ad67),_0x241123['focusTracker']['add'](_0x41ad67),_0x4690b0['items']['add'](_0x2b5921);}),_0x4690b0;}['_setupGroupMenuBehavior'](_0x6c065d,_0x242177){const _0x36db90=_0x6c065d['bindTemplate'],_0x38045e=this['_getButtonKeystroke'](_0x6c065d);_0x6c065d['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x36db90['to'](()=>{this['_showNestedPanel'](_0x242177,_0x6c065d);}),'mouseleave':_0x36db90['to'](_0x12ffdb=>{const _0xd364f1=_0x12ffdb['relatedTarget'];this['_isMovingToNestedMenu'](_0xd364f1,_0x242177)||this['_hideNestedPanel'](_0x242177);}),'keydown':_0x36db90['to'](_0x3f5b32=>{_0x3f5b32['key']==_0x38045e&&(this['_showNestedPanel'](_0x242177,_0x6c065d),_0x242177['content']['get'](0x0)['focus']());})}}),_0x242177['on']('render',()=>{_0x242177['element']?.['addEventListener']('mouseleave',_0x260204=>{const _0x3976bb=_0x260204['relatedTarget'];_0x6c065d['element']?.['contains'](_0x3976bb)||this['_isMovingToNestedMenu'](_0x3976bb,_0x242177)||this['_hideNestedPanel'](_0x242177);});});}['_showNestedPanel'](_0x4bb850,_0x45f4cf){this['_openNestedPanels']['forEach'](_0xc1da15=>{_0xc1da15!==_0x4bb850&&_0xc1da15['isVisible']&&_0xc1da15['hide']();}),_0x4bb850['show'](),_0x4bb850['pin']({'positions':[_0x3770f5['eastSouth']],'target':_0x45f4cf['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x4bb850);}['_hideNestedPanel'](_0x17240a){_0x17240a['hide'](),this['_openNestedPanels']['delete'](_0x17240a);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x79b9b9=>_0x79b9b9['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x46eca2,_0x1facf7){if(!_0x46eca2)return!0x1;if(_0x1facf7['element']?.['contains'](_0x46eca2))return!0x0;const _0x1c4eb8=_0x46eca2;return _0x1c4eb8['closest']&&(null!==_0x1c4eb8['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x1c4eb8['closest']('.ck-ai-quick-actions-group-list')||null!==_0x1c4eb8['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'](_0x3dc55e){return'rtl'===_0x3dc55e['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x4e2265){return'rtl'===_0x4e2265['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x21b517,_0x36e23f,_0x5e65f0,_0x30209c){_0x21b517['key']==_0x36e23f&&(_0x5e65f0['focus'](),this['_hideNestedPanel'](_0x30209c));}['_handleSearchResultButtonClick'](_0x46c3ce){_0x46c3ce['fire']('execute');}}function Xt(_0x2a2ee4){const {editor:_0x43ff24,content:_0x203d34,buttonDefinition:_0x56f59a,bodyCollection:_0x58c06c,hasSearch:_0xb071bb=!0x1}=_0x2a2ee4;return()=>{const _0x50decf=_0x43ff24['locale'],_0x4222be=_0x3e48f8(_0x50decf);_0x4222be['buttonView']['set']({'icon':_0x56f59a['icon']??yt,'label':_0x56f59a['label'],'tooltip':!0x0}),_0x4222be['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x4e59d1=new co(_0x43ff24,_0x203d34,_0x4222be,_0x58c06c,_0xb071bb);if(_0x4222be['panelView']['children']['add'](_0x4e59d1),_0xb071bb){const _0x32c25e='ai-quick-actions-dropdown-selection';_0x4222be['on']('change:isOpen',(_0x210ce7,_0x5a74fc,_0x2bd892)=>{if(_0x2bd892){if(_0x43ff24['plugins']['has']('AIEditing')){const _0x48101c=_0x43ff24['plugins']['get'](D),_0x4fa74c=_0x43ff24['model']['document']['selection'],_0xbc72b9=Array['from'](_0x4fa74c['getRanges']());_0xbc72b9['length']>0x0&&_0x48101c['showFakeVisualSelection'](_0xbc72b9,_0x32c25e,!0x1,!0x0);}}else _0x43ff24['plugins']['has']('AIEditing')&&_0x43ff24['plugins']['get'](D)['hideFakeVisualSelection'](_0x32c25e),_0x4e59d1['resetSearch']();});}return _0x4222be;};}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 Qt=function(_0xe40bcd){return _0xe40bcd['CHAT']='CHAT',_0xe40bcd['ACTION']='ACTION',_0xe40bcd['REVIEW']='REVIEW',_0xe40bcd;}({}),va=function(_0x2d8fb0){return _0x2d8fb0['CHAT']='AIChat',_0x2d8fb0['ACTION']='AIActions',_0x2d8fb0['REVIEW']='AIReviewMode',_0x2d8fb0;}({});class ii extends _0x361c0d{static get['requires'](){return[te,tt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x5f56a1=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x5f56a1),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x5e96fd){return function(_0x2696b3){const _0x307a29=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x2696b3['uiLanguage']),_0x16d77a=_0x307a29||'English',_0x10bcee=[{'id':'ask-ai','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Gt},{'id':'chat-commands','label':i(_0x2696b3,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Gt,'actions':[{'id':'explain','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ee['replace']('%0',_0x16d77a),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ie['replace']('%0',_0x16d77a),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ne['replace']('%0',_0x16d77a),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Bt},{'id':'continue','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Ft},{'id':'fix-grammar','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Wt},{'id':'adjust-length','label':i(_0x2696b3,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x2696b3,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Yt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Vt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x2696b3,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x2696b3,'AI_QUICK_ACTIONS_OTHER'),'icon':Jt,'actions':[]}];return _0x10bcee;}(_0x5e96fd);}async['_getDefaultAndCustomActions'](){const _0x32ff41=ii['getDefaultQuickActions'](this['editor']['locale']),_0x2db346=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x42d863=[];try{_0x42d863=await new et({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x173d6a){const _0xad54aa=new _0x563e6a('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x173d6a});_0x4e5dbd(_0xad54aa['message']);}finally{const _0xe191f4=_0x2db346['map'](_0xaef8bc=>({..._0xaef8bc,'icon':void 0x0}));_0x32ff41['find'](_0x528f7b=>'other'===_0x528f7b['id'])['actions']['push'](..._0xe191f4),_0x32ff41['forEach'](_0x1438b1=>{if('actions'in _0x1438b1)_0x1438b1['actions']['forEach'](_0x1fd2fd=>{if(_0x1fd2fd['isEnabled']=!!_0x42d863['find'](_0x17c046=>_0x17c046['id']===_0x1fd2fd['model'])||void 0x0===_0x1fd2fd['model'],!_0x1fd2fd['isEnabled']){const _0xe15711=new _0x563e6a('ai-quick-actions-unavailable-model',this,{'actionId':_0x1fd2fd['id'],'modelId':_0x1fd2fd['model']});_0x4e5dbd(_0xe15711['message']);}});else{if(_0x1438b1['isEnabled']=!!_0x42d863['find'](_0x2b4cb7=>_0x2b4cb7['id']===_0x1438b1['model'])||void 0x0===_0x1438b1['model'],!_0x1438b1['isEnabled']){const _0x4c63e1=new _0x563e6a('ai-quick-actions-unavailable-model',this,{'actionId':_0x1438b1['id'],'modelId':_0x1438b1['model']});_0x4e5dbd(_0x4c63e1['message']);}}});}return _0x32ff41;}['_initializeQuickActionsComponentsAndCommands'](){const _0x689a0=new _0x340c25(this['editor']['locale']);_0x689a0['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x689a0),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x689a0);}['_initializeQuickActionsDropdown'](_0x21e35f){const _0x43d17f=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Xt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':yt,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x21e35f,'hasSearch':_0x43d17f}));}['_prepareQuickActionsDefinition'](_0x3f7009){this['_quickActionsDefinition']=_0x3f7009['map'](_0x295004=>{if('actions'in _0x295004){const _0x395cd2=_0x295004;return{..._0x395cd2,'actions':_0x395cd2['actions']['map'](_0x1d5828=>{const {actions:_0x88eaf4,..._0x41cc81}=_0x395cd2;return{..._0x1d5828,'parent':_0x41cc81};})['filter'](_0xb1549d=>this['_shouldIncludeAction'](_0xb1549d))};}return _0x295004;})['filter'](_0x2de977=>'actions'in _0x2de977?_0x2de977['actions']['length']>0x0:this['_shouldIncludeAction'](_0x2de977));}['_shouldIncludeAction'](_0x1265eb){const _0xc21b=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](va[_0x1265eb['type']])&&!_0xc21b['includes'](_0x1265eb['id'])&&!('CHAT'===_0x1265eb['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x4d3361){this['_quickActionsDefinition']['forEach'](_0x2fb7aa=>{if('actions'in _0x2fb7aa){const _0x50692e=Xt({'editor':this['editor'],'content':_0x2fb7aa['actions'],'buttonDefinition':_0x2fb7aa,'bodyCollection':_0x4d3361});this['editor']['ui']['componentFactory']['add'](_0x2fb7aa['id'],_0x50692e),_0x2fb7aa['actions']['forEach'](_0x4572d2=>{const _0x36d179=Zt({'editor':this['editor'],'action':_0x4572d2});this['editor']['ui']['componentFactory']['add'](_0x4572d2['id'],_0x36d179);});}else{const _0x5d9c84=Zt({'editor':this['editor'],'action':_0x2fb7aa,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x2fb7aa['id'],_0x5d9c84);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x586367=>{const _0x37ef7b=new _0x580086(_0x586367),_0x4b2ac1=i(_0x586367,'AI_QUICK_ACTIONS_HEADING');_0x37ef7b['buttonView']['set']({'label':_0x4b2ac1,'icon':yt});const _0x171431=new _0x3dd394(_0x586367);_0x171431['set']({'ariaLabel':_0x4b2ac1,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x27653e=>{if('actions'in _0x27653e){const _0x426d0f=_0x27653e,_0x4f5ecf=new _0x30af6d(_0x586367,_0x37ef7b),_0x38ce47=new _0x580086(_0x586367),_0x285163=new _0x3dd394(_0x586367);_0x38ce47['buttonView']['set']({'label':_0x426d0f['label'],'icon':_0x426d0f['icon']}),_0x426d0f['actions']['forEach'](_0x2ad858=>{const _0x263384=new _0x30af6d(_0x586367,_0x38ce47),_0x3448b8=new _0x226c2e(_0x586367);_0x3448b8['set']({'label':_0x2ad858['displayedPrompt'],'icon':_0x2ad858['icon'],'role':'menuitem','isEnabled':_0x2ad858['isEnabled']}),_0x3448b8['on']('execute',()=>{this['_executeQuickAction'](_0x2ad858);}),_0x3448b8['delegate']('execute')['to'](_0x38ce47),_0x263384['children']['add'](_0x3448b8),_0x285163['items']['add'](_0x263384);}),_0x38ce47['panelView']['children']['add'](_0x285163),_0x4f5ecf['children']['add'](_0x38ce47),_0x171431['items']['add'](_0x4f5ecf);}else{const _0x60e745=_0x27653e,_0xf6397f=new _0x30af6d(_0x586367,_0x37ef7b),_0x23e568=new _0x226c2e(_0x586367);_0x23e568['set']({'label':_0x60e745['displayedPrompt'],'icon':_0x60e745['icon'],'role':'menuitem','isEnabled':_0x60e745['isEnabled']}),_0x23e568['on']('execute',()=>{this['_executeQuickAction'](_0x60e745);}),_0x23e568['delegate']('execute')['to'](_0x37ef7b),_0xf6397f['children']['add'](_0x23e568),_0x171431['items']['add'](_0xf6397f);}});const _0x4f95d1=Object['values'](va)['some'](_0x1a2514=>this['editor']['plugins']['has'](_0x1a2514));return _0x37ef7b['set']({'isEnabled':_0x4f95d1}),_0x37ef7b['panelView']['children']['add'](_0x171431),_0x37ef7b;});}['_executeQuickAction'](_0x5e4a8a){const _0x34930c=this['editor'];_0x34930c['editing']['view']['focus'](),_0x34930c['commands']['execute']('aiQuickAction',_0x5e4a8a);const _0x3f855a=_0x34930c['ui']['view']['menuBarView'];_0x3f855a&&_0x3f855a['close']&&_0x3f855a['close']();}}class ci extends Lt{['execute'](_0x43c141){switch(this['_expandSelectionIfCollapsed'](),_0x43c141['type']){case Qt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x5bf322=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x563e6a('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5bf322});}this['_handleAIChatAction'](_0x43c141);break;case Qt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x47e110=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x563e6a('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x47e110});}this['_handleAIActionsAction'](_0x43c141);break;case Qt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x6cb88e=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x563e6a('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x6cb88e});}this['_handleAIReviewAction'](_0x43c141);}}async['_handleAIChatAction'](_0x52ad2e){const _0x5e3c04=this['editor']['plugins']['get']('AIChat'),_0x2f5e10=this['editor']['plugins']['get']('AIChatController'),_0x557572=this['editor']['plugins']['get']('AITabs')['view'];if(_0x557572['isVisible']||(_0x557572['isVisible']=!0x0),'chat'!==_0x557572['activeTab']&&_0x557572['activateTab']('chat'),'ask-ai'===_0x52ad2e['id'])_0x2f5e10['removeSelectionFromChatContext'](),await _0x5e3c04['addSelectionToChatContext'](),_0x5e3c04['focusPromptInput']();else await _0x5e3c04['startConversation'](),_0x2f5e10['removeSelectionFromChatContext'](),await _0x5e3c04['addSelectionToChatContext'](),_0x5e3c04['focusPromptInput'](),await _0x5e3c04['sendMessage']({'message':_0x52ad2e['prompt']||_0x52ad2e['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x52ad2e['id']},'displayedPrompt':_0x52ad2e['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x2de3da=this['editor'],_0x135595=_0x2de3da['model']['document']['selection'];if(!_0x135595['isCollapsed'])return;const _0x74579c=_0x42aa06(_0x135595['getSelectedBlocks']())||_0x2de3da['model']['schema']['getLimitElement'](_0x135595);_0x2de3da['model']['change'](_0x5c8601=>{_0x5c8601['setSelection'](_0x74579c,'in');});}['_handleAIActionsActionLabel'](_0x59fbcb){return _0x59fbcb['parent']?.['label']&&'other'!==_0x59fbcb['parent']?.['id']?_0x59fbcb['parent']['label']+':\x20'+_0x59fbcb['displayedPrompt']:_0x59fbcb['displayedPrompt'];}async['_handleAIActionsAction'](_0x500d6e){const _0x487e64=this['editor']['plugins']['get']('AIActions'),_0xa1f8c3=_0x500d6e['prompt']?{'userMessage':_0x500d6e['prompt'],'model':_0x500d6e['model']}:{'actionName':_0x500d6e['actionName']||_0x500d6e['id'],'args':_0x500d6e['args']},_0x47e271=this['_handleAIActionsActionLabel'](_0x500d6e);await _0x487e64['executeAction'](_0xa1f8c3,_0x47e271,_0x500d6e['icon']);}async['_handleAIReviewAction'](_0x29ad2d){console['log']('handleAIReviewAction',_0x29ad2d);}}class ti extends _0x361c0d{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x327d7d=this['editor'],_0x17867f=new ci(this['editor']);if(_0x327d7d['commands']['add']('aiQuickAction',_0x17867f),_0x327d7d['plugins']['has']('AIChat')){const _0x1ad575=this['editor']['plugins']['get']('AIChat');_0x327d7d['model']['document']['selection']['on']('change:range',(_0x13fc09,_0x4e31f2)=>{_0x4e31f2['directChange']&&_0x1ad575['removeSelectionFromChatContext']();});}}}class gs extends xi{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x5ed329=this['documentContextContent']['children']['map'](_0x1e0138=>({'node':_0x1e0138,'id':ut(_0x1e0138,'data-id')})),_0x40f9bb=this['parsedMergedContent']['children']['map'](_0x13b29b=>({'node':_0x13b29b,'id':ut(_0x13b29b,'data-id')||_0x48eb5e()})),_0x1af15b=_0x411a1f(_0x5ed329,_0x40f9bb,{'comparator':(_0x59f3e5,_0x57072b)=>_0x59f3e5['id']==_0x57072b['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x1af15b['length']&&_0x1af15b[_0x1af15b['length']-0x1]['removed'];)_0x1af15b['pop']();}const _0x857260=_0x1af15b['map'](_0x5146bd=>{const _0x473733=_0x5146bd['added']?'new':_0x5146bd['removed']?'removed':'modified';return{'node':_0x5146bd['value'][0x0]['node'],'type':_0x473733,'id':_0x5146bd['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x857260,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x566509,_0x52a27c){return _0x52a27c;}}class ft extends os{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x2330d8){super(_0x2330d8),this['content']=_0x2330d8['content'],this['version']=_0x2330d8['version'],this['actionName']=_0x2330d8['actionName'],this['args']=_0x2330d8['args'],this['userMessage']=_0x2330d8['userMessage'],this['model']=_0x2330d8['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':xe['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x5a4959){const _0x93d611=new gs({'editor':this['editor'],'documentContextContent':this['content'],..._0x5a4959});return this['replies']['push'](_0x93d611),_0x93d611['delegate'](...De)['to'](this),this['fire']('replyCreated',_0x93d611),_0x93d611;}}class Bn extends _0x14c71e{constructor(_0x4b0f1a,_0x9ac714=!0x0,_0x2a6768=!0x0){super(_0x4b0f1a),this['set']('isEnabled',!0x1),_0x9ac714&&(this['applyButton']=this['_createButton'](i(_0x4b0f1a,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x2a6768&&(this['suggestButton']=this['_createButton'](i(_0x4b0f1a,'AI_BALLOON_SUGGEST_BUTTON'),_0x9ac714?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x9ac714,'showSuggestButton':_0x2a6768}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x3f0a4e,showSuggestButton:_0x3ff4fe}){this['applyButton']&&(this['applyButton']['isVisible']=_0x3f0a4e),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x3ff4fe);}['_createButton'](_0xd5209d,_0xd67b98){const _0x64226b=new _0x2cf640(this['locale']);return _0x64226b['set']({'label':_0xd5209d,'class':_0xd67b98,'isVisible':!0x0,'withText':!0x0}),_0x64226b;}}class yn extends _0xc3e5b1{constructor(_0x53d478){super(_0x53d478),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(_0x53d478,'AI_DISCLAIMER_TEXT')}]}]});}}class Nn extends _0xc3e5b1{constructor(_0x112b89){super(_0x112b89),this['set']('isVisible',!0x0);const _0x27ef00=new Ze('small');_0x27ef00['isVisible']=!0x0;const _0x12146c=new _0xc3e5b1(this['locale']);_0x12146c['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',_0x40efbb=>!_0x40efbb)]},'children':[_0x27ef00,_0x12146c]});}}class Tt extends pi{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0xf7bf0d,_0x384af7){super(_0xf7bf0d),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x384af7,this['_focusTracker']=new _0x5f2dfb(),this['_keystrokes']=new _0x15425(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x1af4a5({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0xf5a45d(),this['_addContentWrapper'](_0x384af7),this['_addDisclaimerView'](),this['_addToolbar'](_0x384af7),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'](_0x384af7);});}['render'](){super['render']();for(const _0x248ca2 of this['_focusables'])this['_focusTracker']['add'](_0x248ca2['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x140cab){-0x1===_0x140cab?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x20418b){this['_isLoading']=_0x20418b;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x130398){super['showError'](_0x130398),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x699e57){super['showBlockingError'](_0x699e57),this['setErrorState']();}['addMiniToolbarItem'](_0x59174c){this['_miniToolbarView']['items']['has'](_0x59174c)||this['_miniToolbarView']['items']['add'](_0x59174c);}['removeMiniToolbarItem'](_0x174d17){this['_miniToolbarView']['items']['has'](_0x174d17)&&this['_miniToolbarView']['items']['remove'](_0x174d17);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x46db8a,showSuggestButton:_0x2d797f}){_0x46db8a=_0x46db8a&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x2d797f=_0x2d797f&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x46db8a,'showSuggestButton':_0x2d797f});}async['updateContent'](_0x270ab4){await this['_streamableContentView']['update'](_0x270ab4);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x46c4d8){this['_contentWrapper']=new _0xc3e5b1(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'](_0x46c4d8['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new yn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x449065,showSuggestButton:_0x3abbfa}){this['_toolbarView']=new Bn(this['locale'],_0x449065,_0x3abbfa),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',(_0x2a7633,_0x161b62,_0x3b32e4)=>!(_0x2a7633||_0x161b62||_0x3b32e4)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x449065,'showSuggestButton':_0x3abbfa}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x91c38d){return this['_miniToolbarView']=new wi(this['locale'],_0x91c38d),this['_miniToolbarView']['delegate'](...W)['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',(_0x5e28e2,_0x211a1d)=>!(_0x5e28e2||_0x211a1d)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Nn(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new ui(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x5a3620=new _0x2cf640(this['locale']),_0x2480e8=new _0x2cf640(this['locale']),_0x2fdff9=new AIActionsBalloonNavigationCounterView(this['locale']),_0x3f564=new _0x2cf640(this['locale']);_0x5a3620['set']({'icon':_0x42e42d,'label':i(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x2480e8['set']({'icon':_0x5d4f8c,'tooltip':i(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x3f564['set']({'icon':_0x254ba8,'tooltip':i(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x5a3620['bind']('isEnabled')['to'](this,'isBusy',_0x37b23a=>!_0x37b23a),_0x5a3620['on']('execute',()=>{this['fire']('tryAgain');}),_0x2480e8['bind']('isEnabled')['to'](this,'isBusy',_0x36e150=>!_0x36e150),_0x2480e8['on']('execute',()=>{this['fire']('showPrevious');}),_0x3f564['bind']('isEnabled')['to'](this,'isBusy',_0x4c4f09=>!_0x4c4f09),_0x3f564['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x2480e8,this['_navigationCounter']=_0x2fdff9,this['_navigationNextButton']=_0x3f564,this['_navigationTryAgainButton']=_0x5a3620;}['updateMiniToolbarButtons'](_0x5af9c7,_0x17d5ba){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x40c8dd=_0x5af9c7>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x40c8dd){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x1d8e0f=_0x5af9c7-_0x17d5ba;this['_navigationCounter']['setInteractionCount'](_0x1d8e0f+'/'+_0x5af9c7),this['_navigationPreviousButton']['isEnabled']=_0x17d5ba<_0x5af9c7-0x1,this['_navigationNextButton']['isEnabled']=_0x17d5ba>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'](_0x1c1950){this['_isLoading']=_0x1c1950;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x24b7b4=this['_getScrollableElement']();_0x24b7b4&&!this['_scrollManager']&&(this['_scrollManager']=new Qe(_0x24b7b4));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class AIActionsBalloonNavigationCounterView extends _0xc3e5b1{constructor(_0x28280e){super(_0x28280e);const _0x1778aa=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x1778aa['to']('interactionCount')}]});}['setInteractionCount'](_0x6e8e99){this['set']('interactionCount',_0x6e8e99);}}class ri extends _0x361c0d{static get['requires'](){return[tt,_0x3a1450,D,H,ot];}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(_0x44927d){super(_0x44927d),this['_bodyCollection']=new _0x340c25(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new St();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x5ce5ad,_0x309b9c,_0x2175af){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x47d2a9,anchorData:_0x4e381f}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x5ce5ad,_0x47d2a9,_0x4e381f,_0x309b9c,_0x2175af);}}const {modelFragment:_0x349672,anchorData:_0x2fc015}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x5ce5ad,_0x349672,_0x2fc015,_0x309b9c,_0x2175af);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x2d909d=this['editor']['plugins']['has']('TrackChanges');let _0x1b2637=this['editor']['config']['get']('ai.availableReplyActions')||[...J];_0x2d909d||(_0x1b2637=_0x1b2637['filter'](_0x35865c=>'insertSuggestion'!=_0x35865c));const _0x147ca4=this['editor']['commands']['get']('trackChanges'),_0x5d3b38=new Tt(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x2d909d,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x1b2637});return _0x5d3b38['bind']('isBusy')['to'](this),_0x147ca4&&_0x5d3b38['bind']('isTrackChangesOn')['to'](_0x147ca4,'value'),_0x5d3b38['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x5d3b38['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x5d3b38['on']('showNext',()=>{this['_navigateToNext']();}),_0x5d3b38;}['_getExecuteDataRegular'](){const _0xcd128a=this['editor']['model']['document']['selection'];if(_0xcd128a['isCollapsed']){const _0x4ccfb7=_0x42aa06(_0xcd128a['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0xcd128a);this['editor']['model']['change'](_0x32a840=>{_0x32a840['setSelection'](_0x4ccfb7,'in');});}const _0x4f8228=_0xcd128a['getFirstRange'](),_0x3eb8fe=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0xcd128a),_0x4f8228['start'],_0x4f8228['end']);this['_copyMarkersToFragment'](_0x3eb8fe,_0xcd128a,{'isTableSelection':!0x1});const _0x5677dc=_0xcd128a['getFirstRange']()['start'],_0x4512ec=new Map();let _0x5a9cf7=_0x3eb8fe;for(let _0x445646=0x0;_0x445646<_0x5677dc['path']['length'];_0x445646++)_0x4512ec['set'](_0x5a9cf7,_0x5677dc['path'][_0x445646]),_0x5a9cf7=_0x5a9cf7['getChild'](0x0);return{'modelFragment':_0x3eb8fe,'anchorData':_0x4512ec};}['_getExecuteDataInTable'](){const _0x1e2d8c=this['editor']['model']['document']['selection'],_0x4fd866=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0xb7d20e=_0x1e2d8c['getFirstRange']()['start']['parent']['parent'],_0x59fa84=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0xb7d20e),this['editor']['model']['createPositionAfter'](_0xb7d20e)),_0x5779e9=this['_wrapWithCommonAncestors'](_0x4fd866,_0x59fa84['start'],_0x59fa84['end']);this['_copyMarkersToFragment'](_0x5779e9,_0x1e2d8c,{'isTableSelection':!0x0});const _0x402685=_0x1e2d8c['getFirstRange']()['start'],_0x22f60c=new Map();let _0x5e4ae2=_0x5779e9;for(let _0x12f94d=0x0;_0x12f94d<_0x402685['path']['length'];_0x12f94d++)if(_0x22f60c['set'](_0x5e4ae2,_0x402685['path'][_0x12f94d]),_0x12f94d<_0x402685['path']['length']-0x1)_0x5e4ae2=_0x5e4ae2['getChild'](0x0);else{let _0x5f4030=_0x5e4ae2['nextSibling'];for(;_0x5f4030;)_0x22f60c['set'](_0x5f4030,_0x402685['path'][_0x12f94d]),_0x5f4030=_0x5f4030['nextSibling'];}return{'modelFragment':_0x5779e9,'anchorData':_0x22f60c};}async['_executeAction'](_0x53c330,_0x11a0be,_0x27ea7c,_0x380795,_0x490d09){const _0x2aae89=this['editor']['plugins']['get'](D),_0x30df0d=this['editor']['plugins']['get'](H),_0xcf83c7=this['editor']['model']['document']['selection'],_0x25be3d=await _0x2aae89['modelToDataWithIds'](_0x11a0be),_0x311669=this['editor']['model']['document']['version'],_0x4f6906=[..._0xcf83c7['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0x30df0d['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x380795,'icon':_0x490d09||yt,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x4f6906,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x30df0d),this['_interactionParams']={'action':_0x53c330,'content':_0x25be3d,'version':_0x311669,'aiBalloon':_0x30df0d,'modelFragment':_0x11a0be,'anchorData':_0x27ea7c},this['_setupApplyListeners'](),this['listenTo'](_0x30df0d,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x30df0d,'dialogClosed',(_0x56c444,{id:_0x5bef28})=>{if('aiActionsBalloon'===_0x5bef28){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x427ef0=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x215ae6=_0x427ef0['changeGroups'][0x0];_0x215ae6&&'pending'===_0x215ae6['state']&&_0x427ef0['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x30df0d);}}),this['_createInteraction'](_0x25be3d,_0x311669,_0x30df0d,_0x53c330);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x2ac4f2,anchorData:_0x48b73c}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x2ac4f2,_0x48b73c,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x2ac4f2,_0x48b73c,!0x0);});}['_wrapWithCommonAncestors'](_0x5b08f6,_0x72d138,_0x48ae3a){const _0x19338d=this['editor']['model']['createRange'](_0x72d138,_0x48ae3a)['getCommonAncestor'](),_0xac423c=_0x19338d['is']('documentFragment')?[]:_0x19338d['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0xac423c['length']){const _0x4e5b13=_0xac423c['map'](_0x4819ec=>_0x4819ec['_clone'](!0x1));for(let _0x432e29=0x1;_0x432e29<_0x4e5b13['length'];_0x432e29++)_0x4e5b13[_0x432e29-0x1]['_appendChild'](_0x4e5b13[_0x432e29]);return _0x4e5b13[_0x4e5b13['length']-0x1]['_appendChild'](_0x5b08f6),new bt(_0x4e5b13[0x0]);}return _0x5b08f6;}['_copyMarkersToFragment'](_0x34352a,_0x3a5ace,_0x5b2609={'isTableSelection':!0x1}){const _0x3b9265=this['editor']['model'],_0x228775=Array['from'](_0x3a5ace['getRanges']()),_0x491e8f=_0x3a5ace['getFirstRange']()['start'];for(const _0x1c5a2b of _0x3b9265['markers']){if(_0x1c5a2b['name']['startsWith'](R)||!_0x1c5a2b['affectsData'])continue;const _0x4ff181=_0x1c5a2b['getRange']();if(!_0x228775['some'](_0x37fae0=>_0x37fae0['containsRange'](_0x4ff181,!0x0)))continue;const _0x174a37=this['_regularCalculateMarkerPath'](_0x4ff181['start'],_0x491e8f,_0x5b2609['isTableSelection']),_0x5b4f96=this['_regularCalculateMarkerPath'](_0x4ff181['end'],_0x491e8f,_0x5b2609['isTableSelection']),_0x2e5e4d=_0x3b9265['createPositionFromPath'](_0x34352a,_0x174a37),_0xfaaf61=_0x3b9265['createPositionFromPath'](_0x34352a,_0x5b4f96);if(!_0x2e5e4d['isEqual'](_0xfaaf61)){const _0x29bbf8=_0x3b9265['createRange'](_0x2e5e4d,_0xfaaf61);_0x34352a['markers']['set'](_0x1c5a2b['name'],_0x29bbf8);}}}['_regularCalculateMarkerPath'](_0x57a5bb,_0x146a4a,_0x20fb5e=!0x1){const _0x3e8d45=[..._0x57a5bb['path']['slice']()];for(let _0x571c8c=0x0;_0x571c8c<Math['max'](_0x146a4a['path']['length'],_0x57a5bb['path']['length']);_0x571c8c++){const _0x52f1f6=_0x146a4a['path'][_0x571c8c]||0x0,_0x2aed4c=(_0x57a5bb['path'][_0x571c8c]||0x0)-_0x52f1f6;if(_0x3e8d45[_0x571c8c]=_0x2aed4c,0x0!==_0x2aed4c&&!_0x20fb5e)break;}return _0x3e8d45;}async['_createInteraction'](_0x2c9739,_0x3a2b61,_0x535cf3,_0x267f6e){const _0x4f9c95=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x267f6e,'content':_0x2c9739,'version':_0x3a2b61,'aiBalloon':_0x535cf3,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x5ca080=new ft({'connector':this['_aiConnector'],'editor':_0x4f9c95,'content':_0x2c9739,'version':_0x3a2b61,..._0x267f6e});this['_interactions']['push'](_0x5ca080);const _0x23443c=(_0x4e65ce,_0x4d542d=!0x1,_0x3bdaa1='streaming')=>this['_promiseQueue']['enqueue'](async _0x4d8274=>{try{const _0xf7b426=wt({'editor':_0x4f9c95,'changeGroups':_0x4e65ce['changeGroups'],'documentContextContent':_0x4e65ce['documentContextContent'],'showDiff':_0x4d542d,'trimUnchanged':!0x1});_0xf7b426['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0xf7b426[0x0],'renderingStrategy':_0x3bdaa1,'abortSignal':_0x4d8274});}catch(_0x381fd2){if(this['_isAbortError'](_0x381fd2))return;throw _0x381fd2;}});this['_interaction']['on']('replyCreated',(_0x469806,_0x21af90)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x23443c(_0x21af90)['catch'](_0xad27a5=>{this['_isAbortError'](_0xad27a5)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0xad27a5),this['_setErrorState'](_0x5ca080));});}),this['_interaction']['on']('replyContentUpdated',(_0x222638,_0x541f39)=>{_0x23443c(_0x541f39)['catch'](_0x4f234a=>{this['_isAbortError'](_0x4f234a)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x4f234a),this['_setErrorState'](_0x5ca080));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x5d6861){this['_isAbortError'](_0x5d6861)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x5d6861),this['_setErrorState'](_0x5ca080));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x16434a,{showDiff:_0x462154})=>{try{this['_balloonShowDiff']=_0x462154;const _0x4e4476=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x4e4476&&await _0x23443c(_0x4e4476,_0x462154,'static');}catch(_0x2c23de){this['_isAbortError'](_0x2c23de)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x2c23de),this['_setErrorState'](_0x5ca080));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x133fa3,{reply:_0x3e8eb0})=>{const _0x3df1c2={'positiveCount':_0x3e8eb0['changeGroups']['filter'](_0x5ca5ae=>'accepted'===_0x5ca5ae['state'])['length'],'totalCount':_0x3e8eb0['changeGroups']['length']},_0x441ec4=this['_interaction']['actionCallId'],_0x234870=this['_interaction']['actionName'];_0x234870?this['_aiConnector']['upsertAIActionRating'](_0x234870,_0x441ec4,_0x3df1c2):this['_aiConnector']['upsertCustomAIActionRating'](_0x441ec4,_0x3df1c2);}),this['_setLoadingState']();try{const _0x522e75=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x522e75;}catch(_0x4d8d70){if(this['_isAbortError'](_0x4d8d70))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x5ca080);}}['_applyChanges'](_0x46fa4c,_0x418567,_0x4e4908){const _0x584e71=this['editor'];if(_0x4e4908&&!_0x584e71['plugins']['has']('TrackChanges'))throw new _0x563e6a('ai-no-track-changes',null);const _0x2511d1=this['editor']['plugins']['get'](ot),_0x4d5d3d=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x4d5d3d||!_0x4d5d3d['replies']['length'])return;const _0x38a9d5=_0x4d5d3d['replies'][_0x4d5d3d['replies']['length']-0x1],_0x5f2666=_0x38a9d5['changeGroups'];_0x38a9d5['setChangeGroupState'](0x0,'accepted');let _0x519df1=at({'editor':_0x584e71,'reply':_0x38a9d5,'interaction':_0x4d5d3d,'groups':_0x5f2666,'transform':!0x1,'documentCompare':_0x2511d1,'documentCompareOptions':{'anchor':_0x584e71['model']['createPositionAt'](_0x46fa4c,0x0),'markDeletions':_0x4e4908}});_0x519df1=this['_filterOperationsOutsideRange'](_0x519df1,_0x418567);for(const _0x1a6fc6 of _0x519df1)this['_anchorOperation'](_0x418567,_0x1a6fc6,_0x584e71['model']['document']['getRoot']());const _0x34ef35=_0x4d5d3d['getDocumentContext']()['version'],_0x190633=_0x584e71['model']['document']['history']['getOperations'](_0x34ef35),_0x45febd={'document':_0x584e71['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0xfd69c1=kt(_0x519df1,_0x190633,_0x45febd)['operationsA'];_0x584e71['model']['change'](_0x44739a=>{if(_0x44739a['setSelection'](_0x584e71['model']['document']['selection']['focus']),_0x4e4908)_0x584e71['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0xfd69c1);else{for(const _0x174842 of _0xfd69c1)_0x174842['baseVersion']=_0x584e71['model']['document']['version'],rt(_0x584e71,_0x174842),_0x44739a['batch']['addOperation'](_0x174842),_0x584e71['model']['applyOperation'](_0x174842);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x53c8b9,_0x483a58){return _0x53c8b9['filter'](_0x16fea7=>{if('rename'==_0x16fea7['type']){const _0x5c5a4e=_0x16fea7['position']['nodeAfter'];return!_0x483a58['has'](_0x5c5a4e);}if(_0x16fea7['type']['indexOf']('Attribute')>-0x1){const _0x60661e=_0x16fea7['range']['start']['nodeAfter'];return!_0x483a58['has'](_0x60661e);}return!0x0;});}['_anchorOperation'](_0x2258e5,_0x61d3b8,_0x32f2be){const _0x5a5443=_0x61d3b8['clone']();for(const _0x396151 in _0x61d3b8){const _0x56e8cb=_0x61d3b8[_0x396151];_0x56e8cb instanceof dt?_0x61d3b8[_0x396151]=new dt(_0x5d42bb(_0x56e8cb['start']),_0x5d42bb(_0x56e8cb['end'])):_0x56e8cb instanceof vt&&(_0x61d3b8[_0x396151]=_0x5d42bb(_0x56e8cb));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x5a5443['type'])){if(_0x5a5443['isDocumentOperation']=!0x1,_0x5a5443['baseVersion']=null,'remove'==_0x5a5443['type']){const _0x3aaabc=_0x5a5443['sourcePosition'],_0x4e96b9=_0x5a5443['howMany'];new lt(_0x3aaabc,_0x4e96b9)['_execute']();}else _0x5a5443['_execute']();}function _0x5d42bb(_0x26f033){if('$graveyard'==_0x26f033['root']['rootName'])return _0x26f033;const _0x1470b9=[];let _0x5ba2f3=_0x26f033['root'];for(let _0x3915a3=0x0;_0x3915a3<_0x26f033['path']['length'];_0x3915a3++){const _0x1f1c61=_0x2258e5['get'](_0x5ba2f3)||0x0;_0x1470b9[_0x3915a3]=_0x26f033['path'][_0x3915a3]+_0x1f1c61,_0x5ba2f3=_0x5ba2f3['getChildAtOffset'](_0x26f033['path'][_0x3915a3]);}return new vt(_0x32f2be,_0x1470b9,_0x26f033['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x4b70ae,content:_0xd89bda,version:_0x58fe8c,aiBalloon:_0x47080e}=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'](_0xd89bda,_0x58fe8c,_0x47080e,_0x4b70ae)['catch'](_0x5b96e8=>{this['_isAbortError'](_0x5b96e8)||console['error']('Error\x20refreshing\x20interaction:',_0x5b96e8);});}['_isAbortError'](_0x4af103){return!!_0x4af103['message']&&_0x4af103['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 _0x36f719=this['_interactions']['length'];this['_currentInteractionIndex']<_0x36f719-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x40464f){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x40464f;const _0x5284a7=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x5284a7)return;if(_0x5284a7['hasError'])return this['_setErrorState'](_0x5284a7),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x5284a7['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x10018f=_0x5284a7['replies'][_0x5284a7['replies']['length']-0x1];if(_0x10018f){const _0x28bb96=this['editor'];try{const _0x4a57d2=wt({'editor':_0x28bb96,'changeGroups':_0x10018f['changeGroups'],'documentContextContent':_0x10018f['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x3a7b13=>setTimeout(_0x3a7b13,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x4a57d2[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0xb1a739){this['_isAbortError'](_0xb1a739)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0xb1a739);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x572dff){const _0x183419=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x183419),_0x572dff['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 AIQuickActions extends _0x361c0d{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1771bc){super(_0x1771bc),_0x1771bc['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Ws extends _0xc3e5b1{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x9955c3,_0x4508a0){super(_0x9955c3),this['id']=_0x4508a0,this['set']('status','pending'),this['set']('changeId',_0x4508a0),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',(_0xd45693,_0xe44a6f)=>{_0xe44a6f&&_0xe44a6f['target']&&'A'===_0xe44a6f['target']['tagName']&&_0xe44a6f['preventDefault'](),this['fire']('activateChange',{'id':_0x4508a0,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x4508a0,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x4508a0,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x1b63c0=new _0xc3e5b1(this['locale']);return _0x1b63c0['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',_0x1d02c5=>!_0x1d02c5)]}}),_0x1b63c0;}['_createAcceptButtonView'](){const _0x3b3f73=new _0x2cf640(this['locale']);return _0x3b3f73['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x3b3f73['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x513494=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x513494['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x37c590=>'pending'!==_0x37c590&&'accepted'!==_0x37c590),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x5df6ec=>'pending'===_0x5df6ec),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x3f3675=>'accepted'===_0x3f3675)]}}),this['on']('change:status',(_0x17a0f6,_0x14fc0c,_0x497532)=>{_0x3b3f73['isEnabled']='pending'===_0x497532,'accepted'===_0x497532&&(_0x3b3f73['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x3b3f73['icon']=_0x24d29c);}),_0x3b3f73;}['_createDismissButtonView'](){const _0x8bc189=new _0x2cf640(this['locale']);return _0x8bc189['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x8bc189['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x21020a=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x21020a['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x599e14=>'pending'!==_0x599e14&&'rejected'!==_0x599e14),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x14fbc9=>'pending'===_0x14fbc9),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x42ee49=>'rejected'===_0x42ee49)]}}),this['on']('change:status',(_0x2ee46a,_0x41691e,_0x40369e)=>{_0x8bc189['isEnabled']='pending'===_0x40369e,'rejected'===_0x40369e&&(_0x8bc189['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x8bc189['icon']=_0x4718d2);}),_0x8bc189;}['_createInfoButtonView'](){const _0x7ca6ca=new _0x2cf640(this['locale']);return _0x7ca6ca['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x169d70,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x7ca6ca['bind']('isOn')['to'](this,'isInfoToggleOn',_0x372ab9=>_0x372ab9),_0x7ca6ca['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x7ca6ca;}['_createOutdatedButtonView'](){const _0x35d218=new _0x2cf640(this['locale']);return _0x35d218['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x42666d,'withText':!0x0,'isEnabled':!0x1}),_0x35d218['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x4c28d6=>'outdated'!==_0x4c28d6)],'disabled':'disabled'}}),_0x35d218;}}class me extends _0x5442ef{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x445864,_0x5b1b85){super(_0x445864),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']()),_0x5b1b85['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x409839){this['resultItemView']['changeId']=_0x409839['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x409839['contentDiffed'];}['showBalloon'](_0x27b679,_0x1b2b1d,_0x4a6ab8,_0x3b8760,_0x1ccb5b,_0x387cbd){const _0x5eab9a=_0x1b2b1d();if(!_0x5eab9a)return;this['updateContent'](_0x27b679),this['show']();const _0x276b39=Array['from'](_0x5eab9a['getClientRects']())['reverse'](),_0x4b9283=this['_getPointedRectIndexFromEvent'](_0x4a6ab8,_0x276b39),_0x3e6539=_0x276b39[_0x4b9283??0x0];'click'===_0x3b8760?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x1b2b1d(),_0x4b9283,_0x27b679['id'],_0x1ccb5b,_0x387cbd)||_0x3e6539})):'hover'===_0x3b8760&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x1b2b1d(),_0x4b9283,_0x27b679['id'])||_0x3e6539}));}['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'](){_0x1d212b({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x1bab4e=[this['element']];return this['_pinnedTargetElement']&&_0x1bab4e['push'](this['_pinnedTargetElement']),_0x1bab4e;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x46bb4b=new _0xc3e5b1();return this['resultItemView']=new Ws(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x46bb4b['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']]}]}),_0x46bb4b;}['_getBestRectPositionOnClick'](_0x54011a,_0x4e41e6,_0x49d815,_0x341c50,_0x30c860){if(!_0x54011a)return null;const _0x5d4195=this['position']['replace']('arrow_',''),_0x541f76=Array['from'](_0x54011a['getClientRects']());let _0x1c4cfa,_0x11a27e=_0x541f76['reverse']();return void 0x0!==_0x4e41e6&&this['_isPinnedRectVisible'](_0x11a27e[_0x4e41e6],_0x341c50,_0x30c860)?(_0x1c4cfa=_0x11a27e[_0x4e41e6],this['_pinnedRectIndex']=_0x4e41e6):this['_isPinnedRectVisible'](_0x11a27e[0x0],_0x341c50,_0x30c860)&&void 0x0===_0x4e41e6?_0x1c4cfa=_0x11a27e[0x0]:(_0x11a27e='s'==_0x5d4195[0x0]?[..._0x541f76]['reverse']():_0x541f76,_0x11a27e['forEach'](_0x1e0b4e=>{this['_isPinnedRectVisible'](_0x1e0b4e,_0x341c50,_0x30c860)&&(_0x1c4cfa=_0x1e0b4e);})),this['_pinnedTargetChangeId']=_0x49d815,this['_pinnedTargetElement']=_0x54011a,_0x1c4cfa||_0x54011a['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x35c6d6,_0x7fd629,_0x1c43ad){if(!_0x35c6d6)return null;const _0x3e287a=Array['from'](_0x35c6d6['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x7fd629&&this['_pinnedTargetChangeId']!==_0x1c43ad)return this['_pinnedRectIndex']=_0x7fd629,this['_pinnedTargetElement']=_0x35c6d6,this['_pinnedTargetChangeId']=_0x1c43ad,_0x3e287a[_0x7fd629];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x1c43ad){if(_0x35c6d6!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x3e287a[this['_pinnedRectIndex']];}return void 0x0!==_0x7fd629&&this['_pinnedTargetChangeId']!==_0x1c43ad?(this['_pinnedRectIndex']=_0x7fd629,this['_pinnedTargetElement']=_0x35c6d6,this['_pinnedTargetChangeId']=_0x1c43ad,_0x3e287a[_0x7fd629]):_0x35c6d6['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x171f9c,_0x19d418){if(_0x171f9c)for(let _0x398aae=0x0;_0x398aae<_0x19d418['length'];_0x398aae++){const _0x22c356=_0x19d418[_0x398aae];if(_0x171f9c['clientX']>=_0x22c356['left']-0x3&&_0x171f9c['clientX']<=_0x22c356['right']+0x3&&_0x171f9c['clientY']>=_0x22c356['top']-0x3&&_0x171f9c['clientY']<=_0x22c356['bottom']+0x3)return _0x398aae;}}['_isPinnedRectVisible'](_0x18aa90,_0x3e6d6d,_0x2f85b5){const _0xb7715=new _0x4b725e(_0x18aa90),_0x5a3a56=_0x3e6d6d||document['documentElement'],_0x359946=_0xb7715['getIntersection'](_0x117236(_0x2f85b5)),_0x794fb1=new _0x4b725e(_0x5a3a56)['getIntersection'](_0xb7715);return!!(_0x359946&&_0x794fb1&&_0xb7715['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Me extends _0x3a5602{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[it];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x30add6){super(_0x30add6),this['_bodyCollection']=new _0x340c25(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 _0x4d308f=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x4d308f);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0xd43695){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x399cba=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0xd43695,_0x399cba);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x59f013){_0x59f013&&('error-general'!==_0x59f013['status']?'error-chunk'!==_0x59f013['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x374d73){this['_mainView']['addCheckRunResult'](_0x374d73);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x2c4b40){this['_mainView']['showGeneralReviewCoreErrorView'](_0x2c4b40??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x19d4ac,_0x53c87f){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x19d4ac,_0x53c87f);}['setActiveStateInResults'](_0x58ddc2){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x1f61da=>{_0x1f61da['id']===_0x58ddc2&&_0x1f61da['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x4c8381=>_0x4c8381['setItemAsInactive']());}['updateChangeState'](_0x47f780,_0x371a44){'accepted'===_0x371a44||'rejected'===_0x371a44||'outdated'===_0x371a44?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x47f780,_0x371a44):this['_mainView']['reviewCheckResultsView']['showResult'](_0x47f780,_0x371a44);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x223196,_0x5a10f,_0x3c3906,_0x38c665,_0x2bf4c9,_0x26a534){this['_balloonSuggestionView']['showBalloon'](_0x223196,_0x5a10f,_0x3c3906,_0x38c665,_0x2bf4c9,_0x26a534);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x54e96c){const _0x46ab32=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x274198=>_0x274198['id']===_0x54e96c);return _0x46ab32?_0x46ab32['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0xc3e5b1{constructor(_0x40d4e6){super(_0x40d4e6),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x125219=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x125219['if']('isVisible','ck-hidden',_0x57f780=>!_0x57f780)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x125219['to']('errorMessage')}]}]});}}class Ae extends _0xc3e5b1{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x2c1ed3,_0x470a29){super(_0x2c1ed3),this['reviewCoreHeader']=_0x470a29['header'],this['generalErrorView']=new sh(_0x2c1ed3),this['reviewCheckListView']=_0x470a29['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0x470a29['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0x470a29['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'](_0x4baba7){this['reviewCheckResultsView']['addResult'](_0x4baba7),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'](_0x5d129c){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x5d129c;}['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 _0x2cf640{constructor(_0x381f58,_0x427530){super(_0x427530),this['set']({'label':_0x381f58,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ve extends _0x663ac1{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x1ea600,_0x1b5ad7){super(_0x1ea600),this['_contents']=_0x1b5ad7,this['_resultViews']=new _0xf5a45d(),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 vi(_0x1ea600),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 _0x49415a=this['_createCombinedSkeletonLoader'](),_0x28bf8b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x28bf8b['if']('isLoading','ck-ai_review__check-run_loading',_0x4e4228=>_0x4e4228),_0x28bf8b['if']('isResultReady','ck-ai_review__check-run_ready',_0x537021=>_0x537021),_0x28bf8b['if']('isVisible','ck-hidden',_0x31824b=>!_0x31824b)]},'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',_0x3b685f=>_0x3b685f)]},'children':this['_resultViews']},_0x49415a]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x2e5f3f){const _0x2c9a24=new Ws(this['locale'],_0x2e5f3f['id']);_0x2c9a24['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x2c9a24),_0x2c9a24['resultResponseView']['element']['innerHTML']=_0x2e5f3f['contentDiffed'];}['hideResult'](_0xe51d41,_0x2a924c){if('pending'===_0x2a924c)return;const _0x5ee87d=this['_resultViews']['find'](_0x2090f1=>_0x2090f1['id']===_0xe51d41);_0x5ee87d&&(_0x5ee87d['status']=_0x2a924c,_0x5ee87d['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x28f995,_0xc91c1){if('pending'!==_0xc91c1)return;const _0xb23ef9=this['_resultViews']['find'](_0x3f5e5d=>_0x3f5e5d['id']===_0x28f995);_0xb23ef9&&(_0xb23ef9['status']=_0xc91c1,_0xb23ef9['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x42de15,_0x2e9324){this['headerTitle']=_0x42de15,this['headerSubtitle']=_0x2e9324||'';}['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 Xe(this['locale'],Ye['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x3a8048=new _0xc3e5b1(this['locale']),_0x39fc10=[];for(let _0x149900=0x0;_0x149900<0x10;_0x149900++){const _0x5b5298=this['_createSkeletonLoader']();_0x5b5298['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x39fc10['push'](_0x5b5298);}return _0x3a8048['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x418f9a=>!_0x418f9a)]},'children':_0x39fc10}),_0x3a8048;}['_createErrorView'](){const _0x4c4996=new _0xc3e5b1(this['locale']),_0x271679=new _0x2cf640(this['locale']),t=this['locale']['t'];return _0x4c4996['delegate']('retryReview')['to'](this),_0x271679['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x271679['on']('execute',()=>{this['fire']('retryReview');}),_0x4c4996['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x51033b=>!_0x51033b),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x388c6f=>'chunk'===_0x388c6f)]},'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',_0x3fdc7f=>'chunk'===_0x3fdc7f)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x295bcd=>'general'!==_0x295bcd)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x4c3561=>'chunk'!==_0x4c3561)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x271679]}),_0x4c4996;}['_createCancelButtonView'](){const _0x2f27e4=new _0x2cf640(this['locale']);return _0x2f27e4['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x197784}),_0x2f27e4['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4674c0=>_0x4674c0),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x315905=>_0x315905)]}}),_0x2f27e4['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x2f27e4;}['_createToggleDiffButtonView'](){const _0x3a6b51=new _0x2cf640(this['locale']);_0x3a6b51['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x3a6b51['bind']('isEnabled')['to'](this,'isError',_0x242d59=>!_0x242d59),_0x3a6b51['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x332a9f=>!_0x332a9f),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3775c1=>_0x3775c1)]}});const _0x79717c=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x2856ec=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x3a6b51['bind']('isOn')['to'](this,'isToggleDiffOn',_0x27cc5d=>_0x27cc5d),_0x3a6b51['bind']('icon')['to'](this,'isToggleDiffOn',_0x384ad2=>_0x384ad2?_0x59f2c5:_0x359228),_0x3a6b51['bind']('label')['to'](this,'isToggleDiffOn',_0x131f2b=>_0x131f2b?_0x79717c:_0x2856ec),_0x3a6b51['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x3a6b51;}['_createAcceptAllButtonView'](){const _0x4a2025=new _0x2cf640(this['locale']);return _0x4a2025['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x4a2025['bind']('isEnabled')['to'](this,'isError',_0x1758c4=>!_0x1758c4),_0x4a2025['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x24f0a8=>!_0x24f0a8),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4e5f0d=>_0x4e5f0d)]}}),_0x4a2025['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x4a2025;}['_createExitReviewButtonView'](){const _0x4f1dd5=new _0x2cf640(this['locale']);return _0x4f1dd5['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x4f1dd5['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3cf9fc=>!_0x3cf9fc),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3b705f=>_0x3b705f)]}}),_0x4f1dd5['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x4f1dd5;}['_createResultHeaderView'](){const _0x6f2edf=new _0xc3e5b1(this['locale']),_0x5d190c=this['_createTitleView']();return _0x6f2edf['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x5d51d3=>_0x5d51d3)]},'children':[_0x5d190c,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x6f2edf;}['_createTitleView'](){const _0xa0da5b=new _0xc3e5b1(this['locale']),_0x2cc273=new Ze();return _0x2cc273['bind']('isVisible')['to'](this,'isResultReady',_0x114f17=>!_0x114f17),_0xa0da5b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x2cc273,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1f60da=>_0x1f60da)]},'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',_0x1638ab=>!_0x1638ab)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0xa0da5b;}['_createFinishReviewButtonView'](){const _0x3b99ab=new vr(i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x3b99ab['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2f32a2=>!_0x2f32a2)]}}),_0x3b99ab['delegate']('finishReview')['to'](this),_0x3b99ab;}}class be extends _0x663ac1{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x81aaa1,_0x9c482f){super(_0x81aaa1),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x9c482f['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x9c482f['headerText']);const _0x9a62b5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x9a62b5['if']('isVisible','ck-hidden',_0x55f576=>!_0x55f576)]},'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':_0x9c482f['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x3791de){const _0x33378c=new vr(_0x3791de,this['locale']);return _0x33378c['delegate']('finishReview')['to'](this),_0x33378c;}['_createResultHeaderView'](_0x51c95f){const _0x45ff60=new _0xc3e5b1(this['locale']);return _0x45ff60['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':_0x51c95f}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x45ff60;}}class Dr extends _0xc3e5b1{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x53b102,_0x345248){super(_0x53b102),this['_defaultValue']=_0x345248['default']||(_0x345248['data']['length']>0x0?_0x345248['data'][0x0]['id']:''),this['_defaultLabel']=_0x345248['data']['find'](_0x2920fe=>_0x2920fe['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x3e48f8(this['locale']);const _0x458bc6=this['_prepareListOptions'](_0x345248['data']);_0x5aa31c(this['_dropdownView'],_0x458bc6,{'role':'menu','ariaLabel':_0x345248['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x28bf2f=>{_0x28bf2f['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x4d863d=>{this['formValue']=_0x4d863d['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x4d863d['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'](_0x533a23=[]){const _0x2f3c09=new _0x7916ba();this['resetToDefault']();for(const _0x5e2d6e of _0x533a23){const _0x1fb2e4=new _0x201273({'label':_0x5e2d6e['label'],'withText':!0x0,'role':'menuitemradio','id':_0x5e2d6e['id'],'model':_0x5e2d6e});_0x1fb2e4['bind']('isOn')['to'](this,'formValue',_0x193c27=>_0x193c27===_0x1fb2e4['id']);const _0x5a7132={'type':'button','model':_0x1fb2e4};_0x2f3c09['add'](_0x5a7132);}return _0x2f3c09;}}class tc extends _0x663ac1{['_formItem']=null;constructor(_0x565811,_0x1847ae,_0x29909c){super(_0x565811),this['argsKey']=_0x1847ae?.['argsKey'];if('dropdown'===_0x1847ae['formType'])this['_formItem']=new Dr(this['locale'],_0x1847ae);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x28e5ff=new _0x42755e(this['locale'],{'children':[this['_formItem']],'class':[_0x29909c?'ck-form__row_with-submit':'']});_0x29909c&&_0x28e5ff['children']['add'](_0x29909c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x28e5ff]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class wo extends _0x2fe62a{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x2ca56e){super(_0x2ca56e),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x15425(),this['minRows']=wo['MIN_ROWS'],this['maxRows']=wo['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 _0xc3e5b1{['focusTracker']=new _0x5f2dfb();['keystrokes']=new _0x15425();['focusCycler'];['_focusables']=new _0xf5a45d();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x3a6030,_0xa59078,_0x22c2fd=!0x1){super(_0x3a6030),this['_check']=_0xa59078,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0xa59078['defaultModel']?_0xa59078['defaultModel']['id']:'',this['_defaultLabel']=_0xa59078['defaultModel']?_0xa59078['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x16298f(this['locale'],()=>new wo(_0x3a6030)),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 _0x7916ba(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x22c2fd),_0x5aa31c(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x42755e(this['locale'],{'children':[this['promptInputView']]}),new _0x42755e(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x16daa4,_0x408866)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x408866()):_0x408866();}),this['focusCycler']=new _0x1af4a5({'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'](_0x314834=>{this['_focusables']['add'](_0x314834),this['focusTracker']['add'](_0x314834['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 _0x2f1437 of this['_getFormValidators']()){const _0x48a5ae=_0x2f1437();if(_0x48a5ae)return this['promptInputView']['errorText']=_0x48a5ae,!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 _0x16e051=new _0x2cf640(this['locale']),t=this['locale']['t'];return _0x16e051['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x16e051['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x16e051;}['_createCancelButtonView'](){const _0x1901d3=new _0x2cf640(this['locale']),t=this['locale']['t'];return _0x1901d3['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0x1901d3['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x45c602=>{_0x45c602['stopPropagation']();})}}),_0x1901d3['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x1901d3;}['_setModelList'](_0x49b723){this['_modelSelectionDropdownItems']['clear']();const _0x28021a=this['_check']['models'];if(_0x49b723)this['set']('modelDisplayMode','hidden');else{const _0x5cdcf1=0x1===_0x28021a['length'];this['set']('modelDisplayMode',_0x5cdcf1?'name':'selector');}if(this['resetToDefault'](),_0x28021a?.['length']){0x1===_0x28021a['length']&&this['set']('activeModelName',_0x28021a[0x0]['name']||_0x28021a[0x0]['id']);for(const _0x591f2d of _0x28021a){const _0xe5db87=new _0x201273({'label':_0x591f2d['name'],'withText':!0x0,'role':'menuitemradio','id':_0x591f2d['id'],'model':_0x591f2d});_0xe5db87['bind']('isOn')['to'](this,'modelId',_0x5a48b0=>_0x5a48b0===_0x591f2d['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xe5db87,'labelView':new ModelButtonLabelView(this['locale'],_0x591f2d)});}}}['_createModelSelectionDropdown'](){const _0x6cc730=_0x3e48f8(this['locale']);return _0x6cc730['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x6cc730['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x6cc730['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x4f46ce=>'selector'===_0x4f46ce),this['listenTo'](_0x6cc730,'execute',_0x3aad2f=>{this['modelId']=_0x3aad2f['source']['model']['id'],_0x6cc730['buttonView']['label']=_0x3aad2f['source']['label'];}),_0x6cc730;}['_createModelNameView'](){const _0xca5d2c=new ModelNameView(this['locale']);return _0xca5d2c['bind']('text')['to'](this,'activeModelName',_0x1335c8=>_0x1335c8??''),_0xca5d2c['bind']('isVisible')['to'](this,'modelDisplayMode',_0x49fd5e=>'name'===_0x49fd5e),_0xca5d2c;}['_createActionsFooterView'](){const _0x3fadac=new _0xc3e5b1(this['locale']);return _0x3fadac['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']]}]}),_0x3fadac;}}class ModelNameView extends _0xc3e5b1{constructor(_0x45c91b){super(_0x45c91b),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x13b832=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x13b832['if']('isVisible','ck-hidden',_0x38ce37=>!_0x38ce37)]},'children':[{'text':_0x13b832['to']('text')}]});}}class ModelButtonLabelView extends _0x23a78e{constructor(_0x44bb35,_0x3efd7e){super();const _0x1bfd09=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1bfd09['to']('style'),'id':_0x1bfd09['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x1bfd09['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x3efd7e['description']||'']}]}]});}}class ec extends _0x663ac1{['_formItemsCollection']=new _0xf5a45d();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x55ba4f,_0x1d531e,_0x10b515,_0x4f52b5=!0x1){super(_0x55ba4f),this['_hideModels']=_0x4f52b5,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x1d531e['isParameterized']);const _0x422ad6=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',_0x2ab9bb=>_0x2ab9bb),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x515294=>_0x515294)],'style':{'--ck-ai-review-check-list-item-index':_0x10b515}},'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':_0x1d531e['title']}]},_0x422ad6]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x1d531e['description']?[{'text':_0x1d531e['description']}]:[]}]}]},..._0x1d531e['isParameterized']?[this['_createParameterizedView'](_0x1d531e)]:[],...'custom'===_0x1d531e['id']?[this['_createCustomView'](_0x1d531e,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x1d531e['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x1d531e['id'],'args':_0x1d531e['useArgs']?_0x1d531e['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x1d212b({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0xfefc0f=>{_0xfefc0f['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x493c3c=new _0x59b3d9();return _0x493c3c['content']=_0x215c94,_0x493c3c['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x493c3c;}['_createParameterizedView'](_0x42bfca){const _0x57d56e=new _0xc3e5b1(),_0x5ae5f4=this['_createFormView'](_0x42bfca);return _0x57d56e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x5ce014=>!_0x5ce014)]},'children':[_0x5ae5f4]}),_0x57d56e;}['_createFormView'](_0x57750d){const _0x50229b=new _0xc3e5b1(),_0x4179a1=Array['isArray'](_0x57750d['options'])?_0x57750d['options']:[],_0x18bbff=new _0x2cf640(this['locale']),t=this['locale']['t'];_0x18bbff['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x18bbff['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2b754c=>{_0x2b754c['stopPropagation']();})}}),_0x18bbff['on']('execute',()=>{const _0x3b8057=[],_0x597e78={};this['_formItemsCollection']['forEach'](_0x1c9292=>{_0x3b8057['push'](_0x1c9292['value']),_0x57750d['useArgs']&&_0x57750d['options']&&(_0x597e78[_0x1c9292['argsKey']]=_0x1c9292['value']);}),this['fire']('runReviewCheck',{'id':_0x57750d['id'],'params':_0x3b8057['length']?_0x3b8057:void 0x0,'args':Object['keys'](_0x597e78)['length']?_0x597e78:void 0x0});});const _0x18362f=_0x4179a1['length'];return _0x4179a1['forEach']((_0x50d469,_0x5038fa)=>{const _0x1ff311=_0x5038fa===_0x18362f-0x1;this['_formItemsCollection']['add'](new tc(this['locale'],_0x50d469,_0x1ff311?_0x18bbff:null));}),_0x50229b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x50229b;}['_createCustomView'](_0x2e4897,_0x479826=!0x1){return this['_customCheckView']=new sc(this['locale'],_0x2e4897,_0x479826),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',_0xbe2e6d=>!_0xbe2e6d)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x95e05f,_0x17e583,_0x57dcee)=>{_0x57dcee||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class je extends _0x663ac1{['_checkViews'];constructor(_0x27ec6f){super(_0x27ec6f),this['_checkViews']=new _0xf5a45d(),this['_setupTemplate']();}['setChecks'](_0x440de8,_0xe5be6d=!0x1){this['_checkViews']['clear']();for(const [_0x502d51,_0x2dadec]of _0x440de8['entries']()){const _0x5800cb=new ec(this['locale'],_0x2dadec,_0x502d51,_0xe5be6d);_0x5800cb['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x5800cb);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x32e3dc of this['_checkViews'])_0x32e3dc instanceof ec&&_0x32e3dc['resetToDefault']();}['_setupTemplate'](){const _0x4cb18e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x4cb18e['if']('isVisible','ck-hidden',_0x22e425=>!_0x22e425)]},'children':this['_checkViews']});}}class ge extends Me{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x28c302=this['context']['locale'],_0x48cc47=new _0x1e299f(_0x28c302,{'label':i(_0x28c302,'AI_REVIEW_MODE'),'icon':_0x4081d8,'class':'ck-ai-header\x20ck-ai-header_review'});return new Ae(this['context']['locale'],{'header':_0x48cc47,'list':new je(_0x28c302),'results':new Ve(_0x28c302,{'generalErrorText':i(_0x28c302,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x28c302,{'headerText':i(_0x28c302,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':i(_0x28c302,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x28c302,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x12f5dd=this['context']['plugins']['get']('AITabs');_0x12f5dd['view']['on']('activateTab',(_0x40e2c3,_0x291611)=>{'reviewMode'===_0x291611?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x12f5dd['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x4081d8,'order':0x0,'content':this['_mainView']});}}const fe='review-';class de extends _0x3a5602{static get['requires'](){return[ot,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(_0x5ca19c){super(_0x5ca19c),this['_domEmitter']=new(_0x3423db())(),this['_eventEmitter']=new(_0x5bd7c6())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0xbda1d2=T(this['context']);_0xbda1d2['conversion']['for']('editingDowncast')['markerToElement']({'model':fe+'insert','view':(_0x39ff71,{writer:_0x5b503c})=>{const _0x3b45c1=this['_markers']['get'](_0x39ff71['markerName']),_0x26c4d4={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x3b45c1?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x39ff71['markerName']};return _0x5b503c['createUIElement']('span',_0x26c4d4,function(_0x3067df){const _0x5d58e5=this['toDomElement'](_0x3067df);return _0x5d58e5['innerHTML']=_0x3b45c1?.['content']?.['asString']||'',_0x5d58e5;});}}),_0xbda1d2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-only','view':_0x1b0b24=>{const _0x3fcf97=this['_markers']['get'](_0x1b0b24['markerName']),_0x51f874=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x3fcf97?.['id']||'')&&_0x51f874['push']('ck-ai_review__change_active'),{'classes':_0x51f874,'attributes':{'data-marker-id':_0x1b0b24['markerName']}};}}),_0xbda1d2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-context','view':_0xed934e=>{const _0x5ebee6=this['_markers']['get'](_0xed934e['markerName']),_0x2c1ff3=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x5ebee6?.['id']||'')&&_0x2c1ff3['push']('ck-ai_review__change_active'),{'classes':_0x2c1ff3,'attributes':{'data-marker-id':_0xed934e['markerName']}};}}),_0xbda1d2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-text','view':_0x2d3c1b=>{const _0x29c2df=this['_markers']['get'](_0x2d3c1b['markerName']),_0xaae9d3=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x29c2df?.['id']||'')&&_0xaae9d3['push']('ck-ai_review__change_active'),{'classes':_0xaae9d3,'attributes':{'data-marker-id':_0x2d3c1b['markerName']}};}}),_0xbda1d2['conversion']['for']('dataDowncast')['markerToElement']({'model':fe+'suggestion-context','view':(_0x83c0ae,{writer:_0x22ec98})=>_0x22ec98['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x83c0ae['isOpening']?'start':'end')})}),_0xbda1d2['conversion']['for']('downcast')['attributeToAttribute']({'model':nt,'view':_0x5b56f8});const _0x23e5e0=_0xbda1d2['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x23e5e0,'mouseup',(_0x3fcda4,_0x1434da)=>{const _0x1c5ce1=_0x1434da['target'],_0x4be22f=this['_findMarkerElement'](_0x1c5ce1);if(!_0x4be22f)return;const _0x216ad3=_0x4be22f['getAttribute']('data-marker-id'),_0x2ec452=_0x216ad3['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x216ad3,'changeId':_0x2ec452,'markerElement':()=>this['_findMarkerElementById'](_0x216ad3),'domEvent':_0x1434da});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x23e5e0,'mouseover',(_0x53a328,_0x421fb0)=>{const _0x34e187=_0x421fb0['target'],_0x21d21a=_0x421fb0['relatedTarget'];let _0xe71331=this['_findMarkerElement'](_0x34e187);if(!_0xe71331&&_0x21d21a&&(_0xe71331=this['_findMarkerElement'](_0x21d21a)),!_0xe71331)return;const _0x57f325=_0xe71331['getAttribute']('data-marker-id'),_0x52d272=_0x57f325['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x52d272,'markerElement':()=>this['_findMarkerElementById'](_0x57f325),'domEvent':_0x421fb0});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x49634e((_0x3dda20,_0x316843)=>{const _0x24644c=_0x316843['target'];if(this['_findMarkerElement'](_0x24644c))return;_0x24644c['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0xbda1d2['model']['document']['registerPostFixer'](_0x567983=>this['_validateMarkers'](_0xbda1d2,_0x567983)),_0xbda1d2['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0xbda1d2));}['getDocumentData'](){const _0x229f00=this['context']['plugins']['get']('AIEditing'),_0x531437=T(this['context']),_0x31f385=_0x531437['model'],_0x1f82d8=new bt();for(const _0x8d0aaa of _0x31f385['document']['getRoot']()['getChildren']()){const _0x25ab32=_0x8d0aaa['_clone'](!0x0);_0x1f82d8['_appendChild'](_0x25ab32);}for(const _0x50c370 of _0x31f385['markers'])_0x1f82d8['markers']['set'](_0x50c370['name'],this['_changeRangeOwnerDocument'](_0x50c370['getRange']()['clone'](),_0x1f82d8));const _0x2bc3d5=new _0x1f3d99({'ignoreElementEnd':!0x0,'startPosition':_0x31f385['createPositionAt'](_0x1f82d8,0x0)}),_0x1331ac=new Set(),_0x568598=new Map();for(const {item:_0x4c840a}of _0x2bc3d5){if(!_0x4c840a['is']('$textProxy'))continue;const _0x3ac31d=_0x4c840a['parent'];if(_0x3ac31d&&_0x3ac31d['is']('element')){const _0x475ab8=this['_upsertDataId'](_0x3ac31d,()=>_0x229f00['_nextDataId'](_0x1331ac));_0x1331ac['add'](_0x475ab8);for(const _0x193943 of _0x3ac31d['getChildren']())_0x193943['is']('element')&&_0x1331ac['add'](this['_upsertDataId'](_0x193943,()=>_0x229f00['_nextDataId'](_0x1331ac)));let _0x2ed68f=_0x3ac31d;for(;_0x2ed68f['parent']&&!_0x2ed68f['parent']['is']('documentFragment');)_0x2ed68f=_0x2ed68f['parent'],_0x2ed68f['hasAttribute'](nt)&&_0x2ed68f['_removeAttribute'](nt);_0x568598['set'](_0x475ab8,{'path':_0x3ac31d['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x2ed68f['_clone'](!0x0),_0x475ab8,_0x531437['data'])}),_0x2bc3d5['jumpTo'](_0x31f385['createPositionAfter'](_0x3ac31d));}}return{'content':_0x531437['data']['processor']['toData'](_0x531437['data']['toView'](_0x1f82d8)),'version':_0x531437['model']['document']['version'],'elements':_0x568598};}['diffContent'](_0x5b9d90,_0x502630,_0x38ae07=!0x1){const _0x5883a8=[],_0x441157=T(this['context']),_0x4659cd=_0x441157['data']['parse'](_0x502630,'$documentFragment'),_0x5269b3=_0x441157['data']['parse'](_0x5b9d90,'$documentFragment'),_0x4c07cf=_0x441157['model']['createPositionAt'](_0x5269b3,0x0);if(this['_haveSingleTopLevelElement'](_0x4659cd)){if(!this['_hasSameTopLevelElement'](_0x5269b3,_0x4659cd))return _0x5883a8;}else{const _0x3cfacf=_0x441157['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x5269b3,_0x3cfacf)||!this['_haveOnlyInlineContent'](_0x4659cd,_0x3cfacf))return _0x5883a8;}const _0x522a3b=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x5b9d90,_0x502630,{'anchor':_0x4c07cf,'markDeletions':!0x0})['getOperations']()['filter'](_0x1fdc11=>'insert'===_0x1fdc11['type']||'marker'===_0x1fdc11['type']&&_0x1fdc11['name']['startsWith']('$markedRemove')),_0x38b62e=this['_groupAdjacentOperations'](_0x522a3b),_0x20935e=[];if(_0x38ae07){if(_0x38b62e['length']){const _0x43b6b5=_0x38b62e[0x0]['operations'][0x0],_0x128f37='insert'===_0x43b6b5['type']?_0x43b6b5['position']:_0x43b6b5['newRange']['start'],_0x42ebc6=this['_getPositionLimitingRange'](_0x128f37,_0x441157,'inside'),_0x2c0c56=_0x42ebc6?_0x4659cd['getChild'](0x0)['getChildren']():_0x4659cd['getChildren'](),_0x375e27=_0x42ebc6||_0x441157['model']['createRangeIn'](_0x5269b3),_0x2e5126=[new _0x2a897f('$markedRemove:synthetic'+_0x48eb5e(),null,_0x375e27,_0x441157['model']['document']['model']['markers'],!0x0,_0x441157['model']['document']['version']+0x1),new _0x4675cd(_0x375e27['end'],_0x2c0c56,_0x441157['model']['document']['version']+0x2)];_0x20935e['push']({'operations':_0x2e5126,'operationsIsolated':_0x2e5126,'groupOffset':0x0});}}else _0x20935e['push'](..._0x38b62e);let _0x3ab0a6=0x0;return _0x441157['model']['change'](_0x3b4bb1=>{for(let _0x460123=0x0;_0x460123<_0x20935e['length'];_0x460123++){const _0x3c2374=_0x20935e[_0x460123],_0x35a6b5=_0x3b4bb1['createDocumentFragment']();for(const _0x378dc0 of _0x5269b3['getChildren']())_0x3b4bb1['append'](_0x378dc0['_clone'](!0x0),_0x35a6b5);for(const _0x407a6f of _0x3c2374['operationsIsolated'])if('insert'===_0x407a6f['type']){const _0x436122=_0x407a6f;_0x436122['baseVersion']=null,_0x436122['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x436122,_0x35a6b5),_0x3b4bb1['batch']['addOperation'](_0x407a6f),_0x441157['model']['applyOperation'](_0x407a6f);const _0x4ec7f9='suggestion:insertion:id:authorId:'+_0x3ab0a6++,_0x5225a8=_0x441157['model']['createRange'](_0x436122['position'],_0x436122['position']['getShiftedBy'](_0x436122['howMany']));_0x35a6b5['markers']['set'](_0x4ec7f9,_0x5225a8);}else{if('marker'===_0x407a6f['type']&&_0x407a6f['name']['startsWith']('$markedRemove')){const _0x4dccaa=_0x407a6f,_0x344d22='suggestion:deletion:id:authorId:'+_0x3ab0a6++;this['_changeOperationOwnerDocument'](_0x4dccaa,_0x35a6b5),_0x35a6b5['markers']['set'](_0x344d22,_0x4dccaa['newRange']);}}if(_0x38ae07)_0x5883a8['push']({..._0x3c2374,'context':this['_createGetContentFn'](_0x5269b3,_0x441157['data']),'content':this['_createGetContentFn'](_0x5269b3,_0x441157['data'])});else{const _0x59aa60=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x3c2374['operationsIsolated'][0x0]),_0x35a6b5),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x3c2374['operationsIsolated'][_0x3c2374['operationsIsolated']['length']-0x1]),_0x35a6b5));_0x35a6b5['markers']['set'](fe+'suggestion-context',new dt(_0x59aa60['start'],_0x59aa60['end'])),_0x5883a8['push']({..._0x3c2374,'context':this['_createGetContextFn'](_0x35a6b5,_0x441157['data'],{'ellipsisBefore':_0x59aa60['hasContentBefore'],'ellipsisAfter':_0x59aa60['hasContentAfter']}),'content':this['_createGetContentFn'](_0x35a6b5,_0x441157['data'])});}}}),_0x5883a8;}['markChangePositionInEditorContent'](_0x5be518,_0x3a2c54){if(!_0x5be518['length'])return;const _0x14b491=_0x5be518[0x0]['parent']['id'],_0x4cba6c=_0x3a2c54['elements']['get'](_0x14b491);if(!_0x4cba6c)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x14b491);const _0x329548=_0x4cba6c['path'],_0x13ed3d=T(this['context']),_0x289ecc=_0x13ed3d['model']['document']['history']['getOperations'](_0x3a2c54['version']),_0x314b61=[];for(const _0x20ffa5 of _0x5be518){const _0x1c8ef7=_0x20ffa5['operationsIsolated']['map'](_0x44cc5d=>this['_translateOperationToEditorContent'](_0x44cc5d,_0x329548,_0x13ed3d['model']['document']['getRoots']()[0x0]));if(!_0x1c8ef7||!_0x1c8ef7['length'])continue;const _0x427d0e=_0x1c8ef7['every'](_0x356db2=>'marker'===_0x356db2['type']&&_0x356db2['name']['startsWith']('$markedRemove')),_0x3aefb2={'document':_0x13ed3d['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x236643=kt(_0x1c8ef7,_0x289ecc,_0x3aefb2)['operationsA'];for(const _0x1ad196 of _0x236643)if('insert'===_0x1ad196['type']){const _0x1934e5=_0x1ad196,_0x5afc3e=_0x1934e5['nodes'];_0x13ed3d['model']['change'](_0x5138dc=>{const _0x28fa68=_0x5138dc['createDocumentFragment']();for(const _0x34936a of _0x5afc3e)_0x5138dc['append'](_0x34936a['_clone'](!0x0),_0x28fa68);_0x314b61['push']({'start':_0x1934e5['position'],'end':_0x1934e5['position'],'type':'insert','groupId':_0x20ffa5['id'],'content':{'asString':this['_createGetContentFn'](_0x28fa68,_0x13ed3d['data'])(),'asFragment':_0x28fa68}});});}else{if('marker'===_0x1ad196['type']&&_0x1ad196['name']['startsWith']('$markedRemove')){const _0x28d463=_0x1ad196;let _0x5752c4='remove-text';if(_0x427d0e){const _0x5a12b9=this['_findAdjacentContextDistance'](_0x28d463['newRange']['start'],'backward',_0x13ed3d['model']['schema']),_0x236acd=this['_findAdjacentContextDistance'](_0x28d463['newRange']['end'],'forward',_0x13ed3d['model']['schema']);if(_0x5a12b9||_0x236acd){const _0x4d847b=_0x28d463['newRange']['start']['getShiftedBy'](-_0x5a12b9),_0x3c1419=_0x28d463['newRange']['end']['getShiftedBy'](_0x236acd);_0x314b61['push']({'start':_0x4d847b,'end':_0x3c1419,'groupId':_0x20ffa5['id'],'type':'remove-context'});}else _0x5752c4='remove-only';}_0x314b61['push']({'start':_0x28d463['newRange']['start'],'end':_0x28d463['newRange']['end'],'groupId':_0x20ffa5['id'],'type':_0x5752c4});}}}this['_insertMarkers'](_0x314b61);}['clearAllMarkers'](){const _0x528517=T(this['context']);_0x528517['model']['change'](_0x54147e=>{for(const _0x1f30d1 of this['_markers']['keys']())_0x528517['model']['markers']['get'](_0x1f30d1)&&_0x54147e['removeMarker'](_0x1f30d1);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){T(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){T(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x133e40){const _0x1a31e0=T(this['context']),_0x3240f9=_0x1a31e0['model'],_0x2805b1=_0x133e40['map'](_0x100c68=>this['_getMarkersDataForGroup'](_0x100c68))['flat']();_0x3240f9['change'](_0x21d31e=>{for(const _0x2ba3e9 of _0x2805b1){const _0x538204=_0x1a31e0['model']['markers']['get'](_0x2ba3e9['id']);if(_0x538204){if('insert'===_0x2ba3e9['type']){if(!_0x2ba3e9['content'])continue;_0x3240f9['insertContent'](_0x2ba3e9['content']['asFragment']||null,_0x538204['getRange']()['start']);}else'remove-text'!==_0x2ba3e9['type']&&'remove-only'!==_0x2ba3e9['type']||_0x3240f9['deleteContent'](_0x3240f9['createSelection'](_0x538204['getRange']()));_0x21d31e['removeMarker'](_0x2ba3e9['id']),this['_markers']['delete'](_0x2ba3e9['id']);}}});}['rejectChange'](_0x342f9e){const _0x2dd22d=T(this['context']),_0x1879ef=this['_getMarkersDataForGroup'](_0x342f9e);_0x2dd22d['model']['change'](_0x5cb9ca=>{for(const _0x27eb0e of _0x1879ef)_0x5cb9ca['removeMarker'](_0x27eb0e['id']),this['_markers']['delete'](_0x27eb0e['id']);});}['getEditor'](){return T(this['context']);}['getMarkerElementForChange'](_0x28e3f0){const _0x3c8e61=Array['from'](this['_markers']['values']())['filter'](_0x4baaa2=>_0x4baaa2['groupId']===_0x28e3f0);if(!_0x3c8e61['length'])return null;const _0x561218=0x1===_0x3c8e61['length']?_0x3c8e61[0x0]:this['_sortMarkers'](_0x3c8e61)[0x0],_0xd10a3a=T(this['context'])['model']['markers']['get'](_0x561218['id']);if(!_0xd10a3a)return null;return{'modelRange':_0xd10a3a['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x561218['id'])};}['getContentElementForChange'](_0x43a03f){const _0x1aa7cb=Array['from'](this['_markers']['values']())['filter'](_0x11b513=>_0x11b513['groupId']===_0x43a03f);if(!_0x1aa7cb['length'])return null;const _0x209226=0x1===_0x1aa7cb['length']?_0x1aa7cb[0x0]:this['_sortMarkers'](_0x1aa7cb)[0x0],_0x165816=T(this['context']),_0x76d05a=_0x165816['model']['markers']['get'](_0x209226['id']);if(!_0x76d05a)return null;const _0x314604=_0x76d05a['getRange'](),_0x327fe9=_0x165816['editing']['view']['getDomRoot']();if(!_0x327fe9||!_0x314604)return null;let _0x125be9=_0x314604['start']['parent'];for(;_0x125be9['parent']&&'$root'!==_0x125be9['parent']['name'];)_0x125be9=_0x125be9['parent'];if(!_0x125be9||!_0x125be9['name'])return null;const _0x110c78=_0x327fe9['querySelector']('[data-marker-id=\x22'+_0x209226['id']+'\x22]');if(!_0x110c78)return null;let _0x12ef88=null;_0x165816['model']['change'](_0xe8ec5=>{_0x12ef88=_0xe8ec5['createDocumentFragment'](),_0xe8ec5['append'](_0x125be9['_clone'](!0x0),_0x12ef88);});const _0x5a89da=_0x165816['data']['toView'](_0x12ef88)['getChild'](0x0);return _0x110c78['closest'](_0x5a89da['name']);}['reactivateMarkers'](_0x39182f){const _0x587f1f=this['_getMarkersDataForGroup'](_0x39182f);if(!_0x587f1f['length'])return;const _0x189a2e=Array['from'](this['_activeMarkers'])['sort'](),_0x748ad5=Array['from'](new Set(_0x587f1f['map'](_0x17168f=>_0x17168f['id'])))['sort']();_0x189a2e['join']('|')!==_0x748ad5['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x39182f));}['setMarkersInElementAsActive'](_0x204767){const _0x42843c=this['_getMarkersDataForGroup'](_0x204767);if(!_0x42843c['length'])return;const _0x3df55a=T(this['context']),_0x1f2bd1=new Set(_0x42843c['map'](_0x3280b5=>_0x3280b5['id'])),_0x5dcaff=Array['from'](_0x1f2bd1['values']())['map'](_0x3931fb=>_0x3df55a['model']['markers']['get'](_0x3931fb))['filter'](_0x9bc136=>!!_0x9bc136);_0x1f2bd1['forEach'](_0x5ec832=>{this['_activeMarkers']['add'](_0x5ec832);}),_0x3df55a['model']['change'](()=>{_0x5dcaff['forEach'](_0x30a4b8=>{_0x3df55a['editing']['reconvertMarker'](_0x30a4b8);});});}['setAllMarkersAsInactive'](){const _0xf4af1=Array['from'](this['_activeMarkers']);if(!_0xf4af1['length'])return;this['_activeMarkers']['clear']();const _0x201562=T(this['context']),_0x5b7649=_0xf4af1['map'](_0x5f3489=>_0x201562['model']['markers']['get'](_0x5f3489))['filter'](_0x40a23e=>!!_0x40a23e);_0x201562['model']['change'](()=>{_0x5b7649['forEach'](_0x96e86d=>{_0x201562['editing']['reconvertMarker'](_0x96e86d);});});}['_getPositionLimitingRange'](_0x429e79,_0x35322b,_0x373661='outside'){if(!_0x429e79)return null;let _0x3e37cd=_0x429e79['parent'];for(;_0x3e37cd&&_0x3e37cd['parent']&&'$root'!==_0x3e37cd['parent']['name']&&!_0x35322b['model']['schema']['isLimit'](_0x3e37cd)&&!_0x35322b['model']['schema']['isBlock'](_0x3e37cd);)_0x3e37cd=_0x3e37cd['parent'];if(!_0x3e37cd||!_0x3e37cd['name']||'$root'===_0x3e37cd['name'])return null;let _0x3cf867=null;return _0x35322b['model']['change'](_0x2bebd3=>{_0x3cf867='inside'===_0x373661?_0x2bebd3['createRangeIn'](_0x3e37cd):_0x2bebd3['createRangeOn'](_0x3e37cd);}),_0x3cf867;}['_validateMarkers'](_0x4d0e73,_0x3c9a47){const _0x823dc8=Array['from'](this['_markers']['keys']()),_0x3aba87=new Map();for(const _0x2533f4 of _0x823dc8){const _0x2c989d=_0x4d0e73['model']['markers']['get'](_0x2533f4);if(!_0x2c989d)continue;const _0xfd944c=_0x2c989d['getStart']()['path'][0x0];_0x3aba87['has'](_0xfd944c)||_0x3aba87['set'](_0xfd944c,[]),_0x3aba87['get'](_0xfd944c)['push'](_0x2c989d);}const _0xeb3f97=new Set();for(const _0x522833 of _0x4d0e73['model']['document']['differ']['getChanges']()){let _0xde98fe=-0x1,_0x1b6ea8=null;if('insert'===_0x522833['type'])_0x1b6ea8=new dt(_0x522833['position'],_0x522833['position']['getShiftedBy'](_0x522833['length'])),_0xde98fe=_0x522833['position']['path'][0x0];else{if('remove'!==_0x522833['type'])continue;_0x1b6ea8=new dt(_0x522833['position']),_0xde98fe=_0x522833['position']['path'][0x0];}const _0x152409=_0x3aba87['get'](_0xde98fe)||[];if(_0x152409['length']){for(const _0x468a39 of _0x152409)if(_0x1b6ea8['root']['rootName']===_0x468a39['getRange']()['root']['rootName']&&('insert'!==_0x522833['type']||!_0x1b6ea8['containsRange'](_0x468a39['getRange']()))&&(_0x1b6ea8['isIntersecting'](_0x468a39['getRange']())||_0x1b6ea8['start']['isTouching'](_0x468a39['getRange']()['end'])||_0x1b6ea8['end']['isTouching'](_0x468a39['getRange']()['start']))){const _0x452129=this['_parseMarkerName'](_0x468a39['name']);Array['from'](this['_markers']['values']())['filter'](_0x353781=>_0x353781['groupId']===_0x452129['groupId'])['forEach'](_0x294980=>_0xeb3f97['add'](_0x294980['id']));}}}if(_0xeb3f97['size']){for(const _0x255bf4 of _0xeb3f97)_0x3c9a47['removeMarker'](_0x255bf4);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x39130d){for(const {name:_0x148209,data:_0xbb8117}of _0x39130d['model']['document']['differ']['getChangedMarkers']()){if(!_0x148209['startsWith'](fe))continue;const _0x351e8e=_0xbb8117['oldRange'],_0x3e9756=_0xbb8117['newRange'],_0x18bca1=_0x351e8e&&'$graveyard'===_0x351e8e['root']['rootName'],_0x5bb75a=_0x3e9756&&'$graveyard'===_0x3e9756['root']['rootName'];if(_0x18bca1&&_0x5bb75a)continue;const _0x338fe6=this['_parseMarkerName'](_0x148209);this['_markers']['get'](_0x148209)&&(_0x5bb75a||!_0x3e9756?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x148209,'changeId':_0x338fe6['groupId']}):_0x18bca1&&_0x3e9756&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x148209,'changeId':_0x338fe6['groupId']}));}}['_parseMarkerName'](_0x2001ac){const _0x43a8b9=_0x2001ac['split'](':'),_0x39185c=(_0x43a8b9[0x1]||'')['split']('_');return{'prefix':_0x43a8b9[0x0],'groupId':_0x39185c[0x0],'suffix':_0x39185c[0x1]};}['_translateOperationToEditorContent'](_0x3a2101,_0x13ddbc,_0x38fba6){if('insert'===_0x3a2101['type']){const _0x56137c=_0x3a2101;return new _0x4675cd(this['_changePosition'](_0x13ddbc['concat'](_0x56137c['position']['offset']),_0x38fba6),_0x56137c['nodes'],_0x56137c['baseVersion']);}if('marker'===_0x3a2101['type']&&_0x3a2101['name']['startsWith']('$markedRemove')){const _0x5e4a40=_0x3a2101;return new _0x2a897f(_0x5e4a40['name'],_0x5e4a40['oldRange'],this['_changeRange'](_0x5e4a40['newRange'],_0x13ddbc['concat'](_0x5e4a40['newRange']['start']['offset']),_0x13ddbc['concat'](_0x5e4a40['newRange']['end']['offset']),_0x38fba6),_0x5e4a40['_markers'],_0x5e4a40['affectsData'],_0x5e4a40['baseVersion']);}return _0x3a2101;}['_groupAdjacentOperations'](_0x50702c){if(!_0x50702c['length'])return[];const _0xcea915=[];let _0x118105=0x0,_0x56fae0=0x0,_0x3fea21=[];for(let _0x25aec1=0x0;_0x25aec1<=_0x50702c['length'];_0x25aec1++){const _0x286f2c=_0x50702c[_0x25aec1],_0x3621ea=_0x50702c[_0x25aec1-0x1];!_0x286f2c||_0x3621ea&&!this['_getOperationEnd'](_0x3621ea)['isTouching'](this['_getOperationStart'](_0x286f2c))?(_0xcea915['push']({'operations':_0x3fea21,'operationsIsolated':_0x3fea21['map'](_0x1678d8=>this['_shiftOperation'](_0x1678d8['clone'](),-_0x56fae0)),'groupOffset':_0x118105}),_0x3fea21=_0x286f2c?[_0x286f2c]:[],_0x56fae0+=_0x118105,_0x118105=0x0):_0x3fea21['push'](_0x286f2c),_0x286f2c&&'insert'===_0x286f2c['type']&&(_0x118105+=_0x286f2c['howMany']);}return _0xcea915;}['_findAdjacentContextDistance'](_0x52acde,_0x14f496,_0x26a714,_0x396eb2=0x1){const _0x5e986a=new _0x1f3d99({'startPosition':_0x52acde,'direction':_0x14f496});let _0x126e11=0x0;for(let _0x3225eb=0x0;_0x3225eb<_0x396eb2;_0x3225eb++){let _0x5c9b33=0x0,_0x18fcbd=!0x1,_0x2f4f22='forward'===_0x14f496?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x240246}of _0x5e986a)if(_0x240246['is']('$textProxy')){const _0x5c04da=_0x2f4f22['exec'](_0x240246['data']);if(_0x5c04da&&_0x5c04da['length']){if(_0x5c9b33+='forward'===_0x14f496?_0x5c04da['index']+_0x5c04da[0x0]['length']:_0x240246['data']['length']-_0x5c04da['index'],_0x5c04da[0x0]['length']!==_0x240246['data']['length'])break;_0x18fcbd=!0x0,_0x2f4f22='forward'===_0x14f496?/^\w+/:/\w+$/;}else{if(_0x18fcbd)break;_0x5c9b33+=_0x240246['offsetSize'];}}else{if(_0x240246['is']('element')){_0x26a714['isInline'](_0x240246)&&!_0x18fcbd&&(_0x5c9b33+=0x1);break;}}_0x126e11+=_0x5c9b33,_0x5e986a['jumpTo'](_0x52acde['getShiftedBy']('forward'===_0x14f496?_0x126e11:-_0x126e11));}return _0x126e11;}['_getChangeContext'](_0x11189b,_0xc6b5ed){const _0x5b40a2=T(this['context'])['model']['schema'],_0x1681bb=this['_findAdjacentContextDistance'](_0x11189b,'backward',_0x5b40a2,0x6),_0x430f5f=this['_findAdjacentContextDistance'](_0xc6b5ed,'forward',_0x5b40a2,0x6),_0x1bf9a8=_0x11189b['getShiftedBy'](-_0x1681bb),_0x215894=_0xc6b5ed['getShiftedBy'](_0x430f5f);return{'start':_0x1bf9a8,'end':_0x215894,'hasContentBefore':!_0x1bf9a8['isAtStart'],'hasContentAfter':!_0x215894['isAtEnd']};}['_insertMarkers'](_0x2bda01){const _0x58337a=this['context']['plugins']['get']('AIEditing'),_0x221492=new Set();T(this['context'])['model']['change'](_0x537ff7=>{for(const _0x2cb3fe of _0x2bda01){const _0x52f2d9=''+fe+_0x2cb3fe['type']+':'+_0x2cb3fe['groupId']+'_'+_0x58337a['_nextDataId'](_0x221492);this['_markers']['set'](_0x52f2d9,{'id':_0x52f2d9,'groupId':_0x2cb3fe['groupId'],'type':_0x2cb3fe['type'],'content':_0x2cb3fe['content']}),_0x537ff7['addMarker'](_0x52f2d9,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x537ff7['createRange'](_0x2cb3fe['start'],_0x2cb3fe['end'])});}});}['_createGetContextFn'](_0x520038,_0xda4e9b,_0x233e1c){let _0x179c2d='';return()=>{if(!_0x179c2d){const _0x51a567=_0xda4e9b['toView'](_0x520038,{'showSuggestionHighlights':!0x0});let _0x67af03=_0x51a567['getChild'](0x0);if(_0x67af03['is']('containerElement')||(_0x67af03=_0x51a567),!_0x67af03)return'';let _0x11d55c=!0x1;const _0x476ff3=[];for(const _0x16b5bc of _0x67af03['getChildren']())_0x16b5bc['is']('element','span')&&_0x16b5bc['hasClass']('ck-ai_review-marker_context-end')&&(_0x11d55c=!0x1),_0x11d55c&&_0x476ff3['push'](_0x16b5bc),_0x16b5bc['is']('element','span')&&_0x16b5bc['hasClass']('ck-ai_review-marker_context-start')&&(_0x11d55c=!0x0);_0x67af03['_removeChildren'](0x0,_0x67af03['childCount']),_0x233e1c?.['ellipsisBefore']&&_0x67af03['_appendChild']('…'),_0x67af03['_appendChild'](_0x476ff3),_0x233e1c?.['ellipsisAfter']&&_0x67af03['_appendChild']('…');const _0x1ba116=_0xda4e9b['htmlProcessor']['domConverter']['viewToDom'](_0x51a567),_0x373936=_0xda4e9b['htmlProcessor']['htmlWriter']['getHtml'](_0x1ba116);_0x179c2d=_0x373936;}return _0x179c2d;};}['_createGetContentFn'](_0x1d913b,_0x13d411){let _0xecd8c5='';return()=>(_0xecd8c5||(_0xecd8c5=_0x13d411['stringify'](_0x1d913b,{'showSuggestionHighlights':!0x0})),_0xecd8c5);}['_createGetContentUsingDataIdFn'](_0xde4a46,_0x3460df,_0xf6b8ab){let _0x164373='';return()=>{if(!_0x164373){const _0x1e6574=_0xf6b8ab['toView'](new bt(_0xde4a46)),_0x371799=_0xf6b8ab['htmlProcessor']['domConverter']['viewToDom'](_0x1e6574)['querySelector']('[data-id=\x22'+_0x3460df+'\x22]');_0x164373=_0x371799?.['outerHTML']||'';}return _0x164373;};}['_findMarkerElement'](_0x4d530c,_0x258566=0x5){let _0x21c9e9=_0x4d530c,_0x3de4f3=null;for(let _0x2ab434=0x0;_0x2ab434<_0x258566&&_0x21c9e9;_0x2ab434++){if(!_0x21c9e9['className']){_0x21c9e9=_0x21c9e9['parentElement'];continue;}if(!(''+_0x21c9e9['className'])['includes']('ck-ai_review-marker_')){_0x21c9e9=_0x21c9e9['parentElement'];continue;}if(!_0x21c9e9['getAttribute']('data-marker-id'))break;_0x3de4f3=_0x21c9e9;break;}return _0x3de4f3;}['_findMarkerElementById'](_0x4353d9){const _0x11a196=T(this['context']),_0x50a0a2=_0x11a196['model']['markers']['get'](_0x4353d9);return _0x50a0a2?_0xce5e3b(_0x11a196['editing'],_0x50a0a2):null;}['_getMarkersDataForGroup'](_0x8e40f8){return Array['from'](this['_markers']['values']())['filter'](_0x4b4318=>_0x4b4318['groupId']===_0x8e40f8);}['_getOperationStart'](_0x195b74){return'insert'===_0x195b74['type']?_0x195b74['position']:_0x195b74['newRange']['start'];}['_getOperationEnd'](_0x310c92,_0x101561=!0x1){return'insert'===_0x310c92['type']?_0x101561?_0x310c92['position']:_0x310c92['position']['getShiftedBy'](_0x310c92['howMany']):_0x310c92['newRange']['end'];}['_shiftOperation'](_0x1bc0ef,_0x319d3f){return'insert'===_0x1bc0ef['type']?_0x1bc0ef['position']=_0x1bc0ef['position']['getShiftedBy'](_0x319d3f):'marker'===_0x1bc0ef['type']&&_0x1bc0ef['newRange']&&(_0x1bc0ef['newRange']=new dt(_0x1bc0ef['newRange']['start']['getShiftedBy'](_0x319d3f),_0x1bc0ef['newRange']['end']['getShiftedBy'](_0x319d3f))),_0x1bc0ef;}['_changeOperationOwnerDocument'](_0x820e4e,_0x3079f4){'insert'===_0x820e4e['type']?_0x820e4e['position']=this['_changePositionOwnerDocument'](_0x820e4e['position'],_0x3079f4):'marker'===_0x820e4e['type']&&_0x820e4e['newRange']&&(_0x820e4e['newRange']=this['_changeRangeOwnerDocument'](_0x820e4e['newRange'],_0x3079f4));}['_changePositionOwnerDocument'](_0x2b069e,_0x142ac7){return new vt(_0x142ac7,_0x2b069e['path']);}['_changeRangeOwnerDocument'](_0x10dbd9,_0x3633c5){return new dt(this['_changePositionOwnerDocument'](_0x10dbd9['start'],_0x3633c5),this['_changePositionOwnerDocument'](_0x10dbd9['end'],_0x3633c5));}['_changePosition'](_0x135ce0,_0x437840){return new vt(_0x437840,[..._0x135ce0]);}['_changeRange'](_0x195866,_0x525cd2,_0xff3fd0,_0x332086){return new dt(this['_changePosition'](_0x525cd2,_0x332086),this['_changePosition'](_0xff3fd0,_0x332086));}['_sortMarkers'](_0x1de88e){const _0x394651=_0x2ab5a0=>{switch(_0x2ab5a0){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x1de88e['sort']((_0xf21889,_0x1b6bd8)=>_0x394651(_0xf21889['type'])-_0x394651(_0x1b6bd8['type']));}['_hasSameTopLevelElement'](_0x4b7be0,_0x147c4d){const _0x403226=_0x4b7be0['getChild'](0x0),_0x2ca8dd=_0x147c4d['getChild'](0x0);return!(!_0x403226||!_0x2ca8dd)&&((!_0x403226['is']('element')||!_0x2ca8dd['is']('element')||_0x403226['name']===_0x2ca8dd['name'])&&!(_0x403226['is']('element')&&!_0x2ca8dd['is']('element')||!_0x403226['is']('element')&&_0x2ca8dd['is']('element')));}['_haveSingleTopLevelElement'](_0x2cafd8){return 0x1===_0x2cafd8['childCount'];}['_haveOnlyInlineContent'](_0xeff190,_0x12978b){for(const _0x101381 of _0xeff190['getChildren']())if(_0x101381['is']('element')&&!_0x12978b['isInline'](_0x101381))return!0x1;return!0x0;}['_upsertDataId'](_0x115a23,_0x28dc23){let _0x487618=_0x115a23['getAttribute'](nt);return _0x487618||(_0x487618=_0x28dc23(),_0x115a23['_setAttribute'](nt,_0x487618)),_0x487618;}}class Ms extends _0x5bd7c6(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0xe4c636,contentNew:_0x6428dd,contentInitial:_0x1b6ffc,documentVersion:_0x2f4a36}){super(),this['id']=_0xe4c636,this['contentNew']=_0x6428dd,this['contentInitial']=_0x1b6ffc,this['documentVersion']=_0x2f4a36;}}class Os extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x1d7cc9,_0x14baf1,_0x2c9f0a){super(),this['id']=_0x1d7cc9,this['parent']=_0x2c9f0a,this['_data']=_0x14baf1,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 Js extends ts(){['id']=_0x48eb5e();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x5e04ca,_0x52e982,_0x11e5e8,_0x3acd14,_0x5701f2){super(),this['_sourceCheck']=_0x52e982,this['_documentData']=_0x5e04ca,this['_aiConnector']=_0x11e5e8,this['_reviewParams']=_0x3acd14,this['_reviewArgs']=_0x5701f2,this['on']('change:status',(_0xd3b665,_0x285ef7,_0x5619d9)=>{'aborted'==_0x5619d9&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x5619d9,'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'](_0x5108dd=>'pending'===_0x5108dd['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x2d06bc){this['_documentData']=_0x2d06bc;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x4d4771=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x50169c of _0x4d4771)'unmodified'!==_0x50169c['data']['operation']&&('error'!==_0x50169c['data']['operation']?'review-metadata'!==_0x50169c['event']?this['_addReviewCheckResult'](_0x50169c['data']['dataId'],_0x50169c['data']['textDelta']):this['callId']=_0x50169c['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(_0x31e00f){this['_currentError']=_0x31e00f,_0x31e00f instanceof Error&&_0x31e00f['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'](_0x47733d,_0x51a746){const _0x58b678=this['_results']['get'](_0x47733d);if(!_0x58b678)return;if(0x0===_0x51a746['length'])return;const _0x26037e=[];_0x51a746['forEach']((_0x33d6e2,_0xeeb3cd)=>{const _0x41e7a9=new Os(_0x58b678['id']+'-'+_0xeeb3cd,_0x33d6e2,_0x58b678);_0x41e7a9['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x41e7a9,'status':_0x41e7a9['status']});}),_0x41e7a9['on']('change:isActivated',()=>{_0x41e7a9['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x41e7a9}):this['fire']('reviewCheckResultDeactivated',{'change':_0x41e7a9});}),this['_changes']['push'](_0x41e7a9),_0x26037e['push'](_0x41e7a9);}),this['fire']('reviewCheckResultReady',{'changes':_0x26037e,'result':_0x58b678,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x83c651){const _0xe65eba=this['_changes']['find'](_0x83be17=>_0x83be17['id']===_0x83c651);return!(!_0xe65eba||'pending'!==_0xe65eba['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x19162b=>!0x0===_0x19162b['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x52f4c6=>'pending'===_0x52f4c6['status']);}['getChangeById'](_0xddfddd){return this['_changes']['find'](_0x14dc01=>_0x14dc01['id']===_0xddfddd);}['markAllChangesAsAccepted'](){for(const _0x449ccf of this['_changes'])'pending'===_0x449ccf['status']&&(_0x449ccf['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x38c440){const _0x4445b2=this['_changes']['find'](_0x269b05=>_0x269b05['id']===_0x38c440);_0x4445b2&&'pending'===_0x4445b2['status']&&(_0x4445b2['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x16947b){const _0x4be4b8=this['_changes']['find'](_0x231c45=>_0x231c45['id']===_0x16947b);_0x4be4b8&&'pending'===_0x4be4b8['status']&&(_0x4be4b8['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x91082c){const _0x31089f=this['_changes']['find'](_0xffe695=>_0xffe695['id']===_0x91082c);_0x31089f&&'pending'===_0x31089f['status']&&(_0x31089f['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x379dbe){const _0x2cd9e9=this['_changes']['find'](_0x24dfbc=>_0x24dfbc['id']===_0x379dbe);_0x2cd9e9&&'outdated'===_0x2cd9e9['status']&&(_0x2cd9e9['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x26bfa1){this['_changes']['filter'](_0x2b3e9d=>_0x2b3e9d['isActivated']&&_0x2b3e9d['id']!==_0x26bfa1)['forEach'](_0xdd5160=>{_0xdd5160['isActivated']=!0x1;});const _0x4edb82=this['_changes']['find'](_0x4472f9=>_0x4472f9['id']===_0x26bfa1);_0x4edb82&&'pending'===_0x4edb82['status']&&(_0x4edb82['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x1b67b1=>_0x1b67b1['isActivated'])['forEach'](_0x128839=>{_0x128839['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x4bdd19){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x7309b8;if(_0x4bdd19){const _0x2f050b=this['_changes']['find'](_0x4e72e0=>_0x4e72e0['id']===_0x4bdd19);if(_0x2f050b&&_0x2f050b['isRated'])return;_0x2f050b&&(_0x7309b8=_0x2f050b['parent']['id'],_0x2f050b['isRated']=!0x0);}const _0x55b4f5={'positiveCount':this['_changes']['filter'](_0x5495a9=>'accepted'===_0x5495a9['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x55b4f5,this['callId'],_0x7309b8);}['_addReviewCheckResult'](_0x12b2ac,_0x54bac1){const _0x51713c=this['_documentData']['elements']['get'](_0x12b2ac);if(!_0x51713c)return;const _0x37d586=_0x51713c['getContent']();if(_0x37d586===_0x54bac1)return;const _0x1b7940=new Ms({'id':_0x12b2ac,'contentInitial':_0x37d586,'contentNew':_0x54bac1,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x1b7940['id'],_0x1b7940),this['fire']('reviewCheckResultAdded',{'result':_0x1b7940,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x574d8f=>'pending'===_0x574d8f['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x37ff5c=>'pending'===_0x37ff5c['status'])['length']&&(this['status']='finished'));}}class si extends Js{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0xe77f8c=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x172257=0x0;_0x172257<this['_reviewParams']['length'];_0x172257++){if(!this['_reviewParams'][_0x172257]||!this['_sourceCheck']['options'][_0x172257])continue;const _0xcb4ff4=this['_sourceCheck']['options'][_0x172257],_0x12d477=_0xcb4ff4['data']?.['find'](_0x21e5a5=>_0x21e5a5['id']===this['_reviewParams'][_0x172257]);_0x12d477&&_0xe77f8c['push'](_0x12d477['label']);}return _0xe77f8c['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x2f4dca,_0x149c14,_0x49e3f1){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x149c14,_0x2f4dca,_0x49e3f1);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ve extends _0x3a5602{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[tt];}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(_0x8f717d,_0x368ba3)=>{const _0x233b38=this['_aiReviewCheckList']['getCheckById'](_0x368ba3['id']);if(_0x233b38){this['_onReviewCheckRun'](_0x368ba3),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x368ba3,_0x233b38),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x49ca2b,_0xf9939)=>{switch(_0xf9939['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0xf9939);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 _0x563e6a('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x563e6a('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'!==_0xf9939['status']&&'error-chunk'!==_0xf9939['status']&&'error-general'!==_0xf9939['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x710dff,_0x43d28b)=>{if(!this['_currentReviewCheckRun'])throw new _0x563e6a('ai-review-mode-no-current-check-run',this);const _0x38d3a1=this['_diffContent'](_0x43d28b['result']['contentInitial'],_0x43d28b['result']['contentNew']);_0x43d28b['source']['addResultChanges'](_0x43d28b['result']['id'],_0x38d3a1);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x3bf9d6,_0x9b102d)=>{for(const _0xf565c2 of _0x9b102d['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0xf565c2);this['_markChangePositionInEditorContent'](_0x9b102d['changes'],_0x9b102d['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x127414,_0x7cb648)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x7cb648['change']['id'],_0x7cb648['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x37b5b4,_0x5485f3)=>{this['_onReviewCheckResultActivated'](_0x5485f3);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x4a7e81){_0x4a7e81 instanceof Error&&_0x4a7e81['message']['includes']('ai-request-aborted')||(_0x4a7e81 instanceof _0x563e6a?this['_logError'](_0x4a7e81):this['_logError'](new _0x563e6a('ai-review-mode-check-run-failed',this,void 0x0,_0x4a7e81)));}}else this['_logError'](new _0x563e6a('ai-review-mode-source-check-not-found',this,{'checkId':_0x368ba3['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 _0x1cda1b=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x1cda1b['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x1cda1b['map'](_0x7fb44e=>_0x7fb44e['id']));const _0x51d24f=this['_currentReviewCheckRun'];_0x51d24f['markAllChangesAsAccepted'](),_0x51d24f['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x14ece4,_0x38c6a3)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x38c6a3['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x38c6a3['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x38c6a3['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x38c6a3['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x47f046,_0x4c68af)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4c68af['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x4c68af['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x4c68af['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4c68af['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',(_0x5d6a48,_0x264368)=>{this['_onActivateChange'](_0x264368);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x89a650,_0x11c693)=>{this['_onDeactivateChange'](_0x11c693);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x376614,_0x5588c1)=>{this['_onChangeMarkerClicked'](_0x376614,_0x5588c1);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x4cdc77,_0x441a04)=>{this['_onChangeMarkerHovered'](_0x4cdc77,_0x441a04);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0xa00ce1,_0x3c787f)=>{this['_onChangeMarkerRemoved'](_0xa00ce1,_0x3c787f);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0xdf0f5e,_0x1746ab)=>{this['_onChangeMarkerRestored'](_0xdf0f5e,_0x1746ab);});}['_createReviewCheckRun'](_0x1d9345,_0x3b6394){return new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3b6394,this['_aiConnector'],_0x1d9345['params'],_0x1d9345['args']);}['_onChangeMarkerRemoved'](_0x547aed,_0x2fa5bc){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x2fa5bc['changeId']);}['_onChangeMarkerRestored'](_0x49acfb,_0x1c640f){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x1c640f['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x3799da=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x3799da&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x585abf=this['_aiReviewCoreEditing']['getEditor']();_0x585abf&&_0x585abf['editing']['view']['change'](_0x397f47=>{const _0x126b6b=_0x585abf['editing']['view']['document']['getRoot']();_0x397f47['removeClass']('ck-ai_review-diff',_0x126b6b),_0x397f47['removeClass']('ck-ai_review-highlights',_0x126b6b),_0x397f47['removeClass']('ck-ai-translate-mode-content',_0x126b6b);});}['_getTranslationWithDefault'](_0x282f88,_0x43bb35){const _0x58e076=i(this['context']['locale'],_0x282f88);return _0x58e076===_0x282f88?_0x43bb35:_0x58e076;}['_logError'](_0x31b711,_0x591ff6=!0x1){_0x4e5dbd(_0x31b711['message']),_0x591ff6||(_0x31b711['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x4cb74c){if('content'===this['_changeActivationSource']){const _0xfcc3d6=this['_aiReviewCoreUi']['getChangeElement'](_0x4cb74c);_0xfcc3d6&&_0x54a145(_0xfcc3d6['closest']('.ck-ai_review__check-run-result')||_0xfcc3d6);}else{if('panel'===this['_changeActivationSource']){const _0x45cd3d=this['_getChangeContentElement'](_0x4cb74c);if(!_0x45cd3d)return;_0x1fa956({'target':_0x45cd3d,'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(_0x8586ea){this['id']=_0x8586ea['id'],this['commandId']=_0x8586ea['commandId'],this['title']=_0x8586ea['title'],this['description']=_0x8586ea['description'],this['isParameterized']=_0x8586ea['isParameterized'],this['useArgs']=_0x8586ea['useArgs'],this['options']=_0x8586ea['options'],this['args']=_0x8586ea['args'];}}class po extends ts(){['_checks']=[];['setupChecks'](_0x1237ba){this['_checks']=_0x1237ba['map'](_0x599ca2=>new Ds(_0x599ca2));}get['checks'](){return this['_checks'];}['getCheckById'](_0x57b9c8){return this['checks']['find'](_0x12a742=>_0x12a742['id']===_0x57b9c8);}['removeCheckById'](_0x57b88c){this['_checks']=this['_checks']['filter'](_0x4302c2=>_0x4302c2['id']!==_0x57b88c);}}class ke extends Ds{['_models']=[];['_defaultModel']=null;constructor(_0x46f5d1,_0x4fb78b,_0x3c04cb){super(_0x46f5d1),this['_models']=_0x4fb78b,this['_defaultModel']=_0x3c04cb;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Ie extends Ds{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x4ffceb,_0x2ad203,_0x29567c){super(_0x4ffceb),this['prompt']=_0x4ffceb['prompt'],this['model']=_0x4ffceb['model'],this['model']?this['_defaultModel']=_0x2ad203['find'](_0xf2be51=>_0xf2be51['id']===this['model'])||null:this['_defaultModel']=_0x29567c;}get['defaultModel'](){return this['_defaultModel'];}}class _e extends po{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x28173c,_0xcdd2f0,_0x4342d2){super(),this['_allModels']=_0x28173c,this['_recommendedModels']=_0xcdd2f0,this['_defaultModel']=_0x4342d2;}['setupChecks'](_0x56ab64){this['_checks']=_0x56ab64['map'](_0x5a8cd6=>!0x0===_0x5a8cd6['isExtra']?new Ie(_0x5a8cd6,this['_allModels'],this['_defaultModel']):'custom'===_0x5a8cd6['id']?new ke(_0x5a8cd6,this['_recommendedModels'],this['_defaultModel']):new Ds(_0x5a8cd6));}}class Ce extends Js{['_prompt'];['_model'];constructor(_0x304524,_0x594f2d,_0x4b8660,_0x5161b0,_0x56c167){super(_0x4b8660,_0x5161b0,_0x56c167),this['_prompt']=_0x304524,this['_model']=_0x594f2d;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x224826,_0x1846e1,_0xfb980d){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x1846e1,_0x224826,_0xfb980d);}}class Re extends Ce{get['subTitle'](){return'';}set['prompt'](_0x4d32bf){this['_prompt']=_0x4d32bf;}set['model'](_0x2b1f6f){this['_model']=_0x2b1f6f;}}class pe extends ve{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x394279){super(_0x394279),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',we['map'](_0x46a402=>_0x46a402['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x798a96,_0x9e7858)=>{this['_isDiffOn']=_0x9e7858['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x308012,_0x5392d6){return _0x308012['isCustom']?new Ce(_0x308012['args']['prompt'],_0x308012['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x5392d6,this['_aiConnector']):_0x5392d6['isExtra']?new Re(_0x5392d6['prompt'],_0x5392d6['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x5392d6,this['_aiConnector']):new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x5392d6,this['_aiConnector'],_0x308012['params'],_0x308012['args']);}['_onReviewCheckResultActivated'](_0x297926){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x297926['change']['id']),this['_scrollToChange'](_0x297926['change']['id']);const _0x28d761=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x297926['change']['id']);if(!_0x28d761)return;const _0xe4199d=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x297926['change'],()=>_0x28d761['getElement'](),void 0x0,'click',_0xe4199d?.['editing']?.['view']?.['getDomRoot'](),_0xe4199d?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x297926['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x10603a){this['_currentReviewCheckRun']&&'click'===_0x10603a['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x10603a['id']));}['_onDeactivateChange'](_0x271d37){this['_currentReviewCheckRun']&&'balloon'===_0x271d37['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x11e906,_0x441404){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x441404['changeId']);const _0x18b226=this['_currentReviewCheckRun']['getChangeById'](_0x441404['changeId']);if(!_0x18b226)return;const _0x59db7f=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x18b226,_0x441404['markerElement'],_0x441404['domEvent'],'click',_0x59db7f?.['editing']?.['view']?.['getDomRoot'](),_0x59db7f?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x8995a0,_0x573a2b){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x415bf9=this['_currentReviewCheckRun']['getChangeById'](_0x573a2b['changeId']);if(!_0x415bf9)return;const _0x111326=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x415bf9,_0x573a2b['markerElement'],_0x573a2b['domEvent'],'hover',_0x111326?.['editing']?.['view']?.['getDomRoot'](),_0x111326?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x2e018f){const _0x40da54=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x2e018f);return _0x40da54?_0x40da54['getElement']():null;}['_markChangePositionInEditorContent'](_0x15eb24,_0x598933){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x15eb24,_0x598933);}['_diffContent'](_0x3afb1f,_0x4c1b3c){return this['_aiReviewCoreEditing']['diffContent'](_0x3afb1f,_0x4c1b3c);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x582c29){const _0x4a8196=this['_aiReviewCoreEditing']['getEditor']();_0x582c29?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x4a8196&&_0x4a8196['editing']['view']['change'](_0x56d74d=>{const _0x4f0131=_0x4a8196['editing']['view']['document']['getRoot']();for(const _0x3aa9f3 of _0x4f0131['getClassNames']())_0x3aa9f3['startsWith']('ck-ai_review-')&&_0x56d74d['removeClass'](_0x3aa9f3,_0x4f0131);_0x56d74d['addClass'](_0x582c29?'ck-ai_review-diff':'ck-ai_review-highlights',_0x4f0131);});}async['_getChecksList'](){const _0x408bf9=[...we,...this['_getExtraChecks']()],_0x2cce87=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x2cce87,_0x408bf9);let _0x17335d=_0x408bf9;this['_hasDefaultAvailableCommands']||(_0x17335d=_0x2cce87['map'](_0x5c9c11=>_0x408bf9['find'](_0x10d51a=>_0x10d51a['id']===_0x5c9c11))['filter'](_0x54745f=>!!_0x54745f)),_0x17335d=_0x17335d['map'](_0x312937=>_0x312937['isExtra']?_0x312937:this['_translateReviewCheck'](_0x312937));const _0x3aa875=_0x17335d['some'](_0x156b81=>_0x156b81['isExtra']||'custom'===_0x156b81['id']);let _0x367611=[],_0x2b28b4=[],_0x14be59=null;if(_0x3aa875){const _0x11c6b8=await this['_getModels']();_0x367611=_0x11c6b8['all'],_0x2b28b4=_0x11c6b8['recommended'],_0x14be59=_0x11c6b8['default'];}const _0x19067e=new _e(_0x367611,_0x2b28b4,_0x14be59);return _0x19067e['setupChecks'](_0x17335d),_0x3aa875&&this['_filterChecksWithMissingModel'](_0x19067e),_0x19067e;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x41805e=>({'id':_0x41805e['id'],'commandId':_0x41805e['id'],'title':_0x41805e['label'],'description':_0x41805e['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x41805e['prompt'],'model':_0x41805e['model']}));}['_logErrorForNonExistentChecks'](_0x3c8f6b,_0x565814){const _0x4ed4fb=_0x3c8f6b['filter'](_0x309d40=>!_0x565814['some'](_0x39143b=>_0x39143b['id']===_0x309d40));_0x4ed4fb['length']&&this['_logError'](new _0x563e6a('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x4ed4fb['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x3ff680=new et({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x3ff680['getAll'](),'recommended':await _0x3ff680['getAvailableModels'](),'default':await _0x3ff680['getDefault']()};}catch(_0x5c516c){return this['_logError'](new _0x563e6a('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x5c516c)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x2a8d10){const _0x339ce0='AI_REVIEW_CHECK_'+_0x2a8d10['id']['toUpperCase']()['replaceAll']('-','_'),_0x103f43={..._0x2a8d10,'title':this['_getTranslationWithDefault'](_0x339ce0+'_TITLE',_0x2a8d10['title']),'description':this['_getTranslationWithDefault'](_0x339ce0+'_DESCRIPTION',_0x2a8d10['description'])};return _0x2a8d10['options']&&(_0x103f43['options']=_0x2a8d10['options']['map'](_0xccf7c7=>({..._0xccf7c7,'label':this['_getTranslationWithDefault'](_0x339ce0+'_OPTIONS_LABEL',_0xccf7c7['label']||''),'data':_0xccf7c7['data']?_0xccf7c7['data']['map'](_0x446e19=>({..._0x446e19,'label':this['_getTranslationWithDefault'](_0x339ce0+'_OPTIONS_DATA_'+_0x446e19['id']['toUpperCase'](),_0x446e19['label'])})):void 0x0}))),_0x103f43;}['_filterChecksWithMissingModel'](_0x2b91d0){const _0x4f05ee=[];_0x2b91d0['checks']['forEach'](_0x152905=>{(_0x152905 instanceof Ie&&!_0x152905['defaultModel']||_0x152905 instanceof ke&&!_0x152905['models']['length'])&&_0x4f05ee['push'](_0x152905['id']);}),_0x4f05ee['length']&&_0x4f05ee['forEach'](_0x4e8685=>{_0x2b91d0['removeCheckById'](_0x4e8685),this['_logError'](new _0x563e6a('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x4e8685}),!0x0);});}}class AIReviewMode extends _0x3a5602{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 po{['setupChecks'](_0x159e82){this['_checks']=_0x159e82['map'](_0x5670e=>new jr(_0x5670e));}}class Se extends si{['_title'];constructor(_0x55e1e5,_0x554016,_0x36e9b7,_0x3a9394,_0x577479,_0x44ef87){super(_0x55e1e5,_0x554016,_0x36e9b7,_0x577479,_0x44ef87),this['_title']=_0x3a9394;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ve{static get['pluginName'](){return'AITranslateController';}constructor(_0x42083e){super(_0x42083e),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'](_0x282308,_0x3b3f05){return new Se(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3b3f05,this['_aiConnector'],i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x282308['params'],_0x282308['args']);}['_onReviewCheckResultActivated'](_0xb5bb5f){this['_aiReviewCoreUi']['setActiveStateInResults'](_0xb5bb5f['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0xb5bb5f['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x3dbffe){this['_currentReviewCheckRun']&&('hover'===_0x3dbffe['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x3dbffe['id'])),'click'===_0x3dbffe['uiInteraction']&&this['_scrollToChange'](_0x3dbffe['id']));}['_onDeactivateChange'](_0x4d2c21){this['_currentReviewCheckRun']&&'panel'===_0x4d2c21['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x190d74,_0x1fe837){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x1fe837['changeId']),this['_scrollToChange'](_0x1fe837['changeId']));}['_onChangeMarkerHovered'](_0xbb9df,_0x3ec9f1){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x3ec9f1['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x3ec9f1['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x51934b){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x51934b);}['_markChangePositionInEditorContent'](_0x3d5ecd,_0x9bab64){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x3d5ecd,_0x9bab64);}['_diffContent'](_0x5bfa4d,_0x3aec26){return this['_aiReviewCoreEditing']['diffContent'](_0x5bfa4d,_0x3aec26,!0x0);}['_onReviewCheckRun'](){const _0x148417=this['_aiReviewCoreEditing']['getEditor']();_0x148417&&_0x148417['editing']['view']['change'](_0xe4b745=>{const _0x3727f2=_0x148417['editing']['view']['document']['getRoot']();for(const _0x5152cb of _0x3727f2['getClassNames']())(_0x5152cb['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x5152cb)&&_0xe4b745['removeClass'](_0x5152cb,_0x3727f2);_0xe4b745['addClass']('ck-ai-translate-mode-content',_0x3727f2);});}async['_getChecksList'](){const _0x5a860b=[],_0x10c653=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x2be335 of _0x10c653)_0x5a860b['push']({'title':_0x2be335['label'],'id':_0x2be335['id'],'commandId':_0x2be335['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x2be335['id']}});const _0x2b6874=new Pe();return _0x2b6874['setupChecks'](this['_translateChecks'](_0x5a860b)),_0x2b6874;}['_translateChecks'](_0x3a8ea3){return _0x3a8ea3['map'](_0x383d03=>{const _0x70679e='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x383d03['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x383d03,'title':this['_getTranslationWithDefault'](_0x70679e,_0x383d03['title'])};});}}class Le extends Ve{constructor(_0x296769,_0x290d92){super(_0x296769,_0x290d92),this['on']('set:isLoading',(_0x5baaa5,_0x13c0f7,_0x27dcc7)=>{_0x27dcc7&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x2e4c25,_0x3fb283,_0x243509)=>{_0x243509&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x12b61c=super['_createAcceptAllButtonView']();return _0x12b61c['set']('label',i(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x12b61c;}['_createExitReviewButtonView'](){const _0x5baa50=super['_createExitReviewButtonView']();return _0x5baa50['set']('label',i(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x5baa50;}}class Ne extends je{['_setupTemplate'](){const _0x347623=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x347623['if']('isVisible','ck-hidden',_0x1bec6f=>!_0x1bec6f)]},'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',_0x347623['if']('isVisible','ck-hidden',_0x4651bf=>!_0x4651bf)]},'children':this['_checkViews']}]});}}class tr extends Me{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x213c13=this['context']['locale'],_0x55bb7d=new _0x1e299f(_0x213c13,{'label':i(_0x213c13,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x20e0a0,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x3ea4af=new Ae(_0x213c13,{'header':_0x55bb7d,'list':new Ne(_0x213c13),'results':new Le(_0x213c13,{'generalErrorText':i(_0x213c13,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x213c13,{'headerText':i(_0x213c13,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':i(_0x213c13,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x213c13,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x3ea4af['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x3ea4af;}['registerTab'](){const _0x268913=this['context']['plugins']['get']('AITabs');_0x268913['view']['on']('activateTab',(_0x5dc725,_0x5de284)=>{'translate'===_0x5de284?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x268913['view']['addTab']({'id':'translate','buttonLabel':i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x20e0a0,'order':0x0,'content':this['_mainView']});}}class AITranslate extends _0x3a5602{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,AIAssistant,n as AIAssistantUI,H as AIBalloon,AIChat,q as AIChatController,G as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,AIChatShortcuts,z as AIChatUI,tt as AIConnector,D as AIEditing,AIEditorIntegration,Qt as AIQuickActionType,AIQuickActions,ii as AIQuickActionsUI,er as AIRequestError,Ds as AIReviewCheck,Ms as AIReviewCheckResult,Js as AIReviewCheckRun,AIReviewMode,ve as AIReviewModeController,de as AIReviewModeEditing,ge as AIReviewModeUI,it as AITabs,ar as AITextAdapter,Pt as AIToggleButtonUI,AITranslate,rr as AITranslateController,tr as AITranslateUI,AWSTextAdapter,OpenAITextAdapter,E as ShowAIAssistantCommand,io as ToggleAICommand,us as createResizeButton,Wn as getDefaultAICommands};
23
+ import{Plugin as _0x33cb4d,Command as Lt,ContextPlugin as _0x4720c1,Editor as _0x2dbc4d}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x5b1621,IconCheck as _0x42b74e,IconError as _0x558167,IconSubmit as _0x28ab7c,IconAIHistory as Ht,IconMagicWand as _0x20365f,IconRobotPencil as _0x52b584,IconMaximize as _0x946806,IconMinimize as _0xb43bd2,IconShowChangesOn as _0xc46dd8,IconShowChangesOff as _0x19293e,IconDocument as _0x49fd6e,IconBoxWithCross as _0x14f1a0,IconBoxWithCheck as _0x54188d,IconBoxWithMarker as _0x6ba517,IconInfo as _0x401c5c,IconLoupe as _0x29b093,IconCancel as _0x3c6485,IconStop as _0x1051d5,IconAIChat as Et,IconPlus as _0x234230,IconPin as _0x26e317,IconThreeHorizontalDots as _0x4082a6,IconChevronDown as _0x3ca3c3,IconChevronUp as _0xd8dc93,IconOutdated as _0x29661b,IconEye as _0x53f82b,IconEyeCrossedOut as _0x5c1ece,IconChevronRight as _0x21fd87,IconAIReview as _0x1c850e,IconAITranslate as _0x45549a}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x41685d,CKEditorError as _0x465bb5,ObservableMixin as ts,global as _0x274357,isVisible as _0x37e114,Rect as _0x26a571,Collection as _0x2c18a8,FocusTracker as _0x1203ce,KeystrokeHandler as _0x2ac014,first as _0x586c33,logWarning as _0x227e3e,logError as _0x238b54,toArray as _0x31d1f9,EmitterMixin as _0x2eb18e,scrollViewportToShowTarget as _0x216c50,scrollAncestorsToShowTarget as _0x508662,ResizeObserver as _0x40b542,_isMotionReduced as mt,getConstrainedViewportRect as _0x287a04,DomEmitterMixin as _0x363382}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x5ec0fa,ButtonView as _0x33ce64,View as _0x26817f,SpinnerView as _0x344070,IconView as _0x3c69cf,AutocompleteView as _0x5bfc01,ListView as _0x41f1be,ListItemGroupView as _0x52bc35,ListItemView as _0x51dbe3,ButtonLabelView as _0x3eefdf,FocusCycler as _0x29c2cb,createLabeledTextarea as _0x16a940,Dialog as _0x33e5ba,createDropdown as _0x1fec03,addMenuToDropdown as _0xe40ea4,MenuBarMenuView as _0x96433a,MenuBarMenuListItemButtonView as _0x57ee28,DialogViewPosition as _0x1898af,MenuBarMenuListView as _0x1776b3,MenuBarMenuListItemView as _0x548f11,BodyCollection as _0x165cca,BalloonPanelView as _0x59db14,clickOutsideHandler as _0x38a160,addListToDropdown as _0x3b4b3d,UIModel as _0x4d3eeb,submitHandler as _0x4500a5,LabeledFieldView as _0xbe7541,createLabeledInputText as th,FormHeaderView as _0x473725,HighlightedTextView as _0x3a4df2,ViewCollection as _0x1024e9,FileDialogButtonView as _0xdd491,InputTextView as _0x7671ba,SearchTextView as _0x2111c6,ListItemButtonView as _0x3910d5,ButtonLabelWithHighlightView as _0x315151,DropdownMenuPanelPositioningFunctions as _0x560d02,BalloonToolbar as te,FormRowView as _0x584515,TextareaView as _0x17219f}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x3143e6,ClipboardMarkersUtils as _0xcedc94}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x1f0d6c,ViewDataTransfer as _0x58081b,ViewUpcastWriter as _0x52d8e0,Matcher as _0x3d5442,_DetachOperation as lt,_insertIntoModelNodeList as _0x1e6579,_removeFromModelNodeList as to,ModelRange as dt,transformOperationSets as xt,ViewDowncastWriter as Ot,ModelDocumentFragment as jt,ModelPosition as Dt,ModelTreeWalker as _0x5f12bc,MarkerOperation as _0x30f837,InsertOperation as _0x298e42}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0xe1320,escape as _0x1e51c4,escapeRegExp as _0x4b1b24,debounce as _0x418eec}from'es-toolkit/compat';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x394da0}from'htmlparser2';import{isTag as _0x3514bb,findOne as gt,getParent as _0x5b34f2,findAll as _0x16c5de,removeElement as _0x35ad72,replaceElement as _0xd026bc,prepend as _0x4f4de1,prependChild as _0x4803eb,appendChild as _0x4e905e,append as _0x4ef11d,find as _0x437245,isComment as _0x291049,getChildren as _0x34d137,textContent as _0x2ebfb5}from'domutils';import _0xdda3ad from'dom-serializer';import{Document as _t,Element as _0x4f7e65,Text as _0x417ece,cloneNode as _0x5f4115,isDocument as _0x9f87b6,isText as _0x59cfad,NodeWithChildren as _0x4ace11}from'domhandler';import{MarkdownGfmMdToHtml as _0x5e6152}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x365a20,DocumentCompare as ot,DATA_ID_MODEL_ATTRIBUTE as nt,ConfirmMixin as _0xee7119,LateFocusDropdownButtonView as _0x10270b,getAllMarkersDomElementsSorted as _0x5ef60e,SuggestionsConversion as Nt,DATA_ID_VIEW_ATTRIBUTE as _0x141dfb,getMarkerDomElement as _0x11336f}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x1cada5}from'es-toolkit';import _0x2aa16c from'morphdom';import{IconWeb as _0x36170b,IconClose as _0x938be8,IconDocument as _0x46c25f,IconSelection as _0x3a97c0,IconFileUpload as _0x1f8979,IconLink as _0x167706,IconBulb as _0x33027f,IconAI as _0x39c797,IconPreviousArrow as _0x2f6267,IconCheck as _0x3cd0e3,IconDocumentOutline as _0x2e914b,IconPaperClip as _0x134be5,IconBrowseFiles as _0x268afb,IconDropdownArrow as _0x31eb66,IconAIChat as _0x5110fd,IconAIReview as _0x2821c6,IconAITranslate as Vt,IconAIAskAI as _0x18dfc6,IconThumbUp as _0x18351,IconThumbDown as _0x184680,IconCopy as _0x32b45f,IconShowChangesOff as _0x46277c,IconShowChangesOn as _0x40cf68,IconAIQuickActions as bt,IconAIChatCommands as Gt,IconAIImproveWriting as Wt,IconAIContinueWriting as zt,IconAIGrammarCheck as Ft,IconAIAdjustLength as Kt,IconAIChangeTone as Yt,IconAIOther as Jt,IconRefresh as _0x3ac2b1,IconNextArrow as _0x58ad4b}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x2d2dbc}from'diff';const x='_ungrouppedCommands';function o(_0x57a6d6,_0x29d971){const _0x3f7129=(0x0,_0x29d971['t'])('Other');return _0x57a6d6['length']?'groupId'in _0x57a6d6[0x0]?_0x57a6d6:[{'groupId':x,'groupLabel':_0x3f7129,'order':0x1/0x0,'commands':_0x57a6d6}]:[{'groupId':x,'groupLabel':_0x3f7129,'order':0x1/0x0,'commands':[]}];}const Gn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x33cb4d{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x28e041}=this,_0x10352c=['ck-fake-ai-selection'];_0x28e041['config']['get']('ai.assistant.useTheme')&&_0x10352c['push']('ck-ai-assistant-ui_theme'),_0x28e041['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x10352c,'priority':0xc}}),_0x28e041['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x2cc7d0,{writer:_0x3ec098})=>{if(!_0x2cc7d0['markerRange']['isCollapsed'])return null;const _0x4d9a8a=_0x3ec098['createUIElement']('span');return _0x3ec098['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x4d9a8a),_0x4d9a8a;}});}['afterInit'](){!async function(_0xeff61d){const _0xec39de=_0x1f1c6e([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]),_0x1c8397=0x3dffc4e1,_0x3e55fb=0x3df84b21^_0x1c8397,_0x5edc70=window[_0x1f1c6e([0x44,0x61,0x74,0x65])][_0x1f1c6e([0x6e,0x6f,0x77])](),_0x2259d9=_0xeff61d[_0x1f1c6e([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x378627=new window[(_0x1f1c6e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2b3481=>{_0x2259d9[_0x1f1c6e([0x6f,0x6e,0x63,0x65])](_0x1f1c6e([0x72,0x65,0x61,0x64,0x79]),_0x2b3481);}),_0x37fb92={[_0x1f1c6e([0x6b,0x74,0x79])]:_0x1f1c6e([0x45,0x43]),[_0x1f1c6e([0x75,0x73,0x65])]:_0x1f1c6e([0x73,0x69,0x67]),[_0x1f1c6e([0x63,0x72,0x76])]:_0x1f1c6e([0x50,0x2d,0x32,0x35,0x36]),[_0x1f1c6e([0x78])]:_0x1f1c6e([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]),[_0x1f1c6e([0x79])]:_0x1f1c6e([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]),[_0x1f1c6e([0x61,0x6c,0x67])]:_0x1f1c6e([0x45,0x53,0x32,0x35,0x36])},_0x573335=_0x2259d9[_0x1f1c6e([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x1f1c6e([0x67,0x65,0x74])](_0x1f1c6e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x16d03c(){let _0x43f75f,_0x4a245a=null,_0x1aa470=null;try{if(_0x573335==_0x1f1c6e([0x47,0x50,0x4c]))return _0x1f1c6e([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x43f75f=_0x38668d(),!_0x43f75f)return _0x1f1c6e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x43f75f[_0x1f1c6e([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x1aa470=_0x485aa8(_0x43f75f[_0x1f1c6e([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x43f75f[_0x1f1c6e([0x6a,0x74,0x69])])),await _0x4ae450()?_0x45aaa1()?_0x468401()?_0x1f1c6e([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x1b28f6()?(_0x43f75f[_0x1f1c6e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1f1c6e([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4a245a=_0x37c7ac(_0x1f1c6e([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x2183fe()):_0x1f1c6e([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x1f1c6e([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x1f1c6e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x1f1c6e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x468401(){const _0x3650f6=[_0x1f1c6e([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x1f1c6e([0x74,0x72,0x69,0x61,0x6c])][_0x1f1c6e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x43f75f[_0x1f1c6e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5edc70/0x3e8:0xe10*_0x3e55fb;return _0x43f75f[_0x1f1c6e([0x65,0x78,0x70])]<_0x3650f6;}function _0x45aaa1(){const _0x1c4004=_0x43f75f[_0x1f1c6e([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x1c4004&&(!!_0x1c4004[_0x1f1c6e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1f1c6e([0x2a]))||!!_0x1c4004[_0x1f1c6e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1f1c6e([0x41,0x49])));}function _0x1b28f6(){const _0x4c130d=_0x43f75f[_0x1f1c6e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x4c130d||0x0==_0x4c130d[_0x1f1c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x3d2b08}=new URL(window[_0x1f1c6e([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x4c130d[_0x1f1c6e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3d2b08))return!0x0;const _0x4129a3=_0x3d2b08[_0x1f1c6e([0x73,0x70,0x6c,0x69,0x74])](_0x1f1c6e([0x2e]));return _0x4c130d[_0x1f1c6e([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x6f3cd4=>_0x6f3cd4[_0x1f1c6e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1f1c6e([0x2a])))[_0x1f1c6e([0x6d,0x61,0x70])](_0x4f6008=>_0x4f6008[_0x1f1c6e([0x73,0x70,0x6c,0x69,0x74])](_0x1f1c6e([0x2e])))[_0x1f1c6e([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2083fc=>_0x2083fc[_0x1f1c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x4129a3[_0x1f1c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x1f1c6e([0x6d,0x61,0x70])](_0x61fce2=>Array(_0x4129a3[_0x1f1c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x61fce2[_0x1f1c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x1f1c6e([0x66,0x69,0x6c,0x6c])](_0x61fce2[0x0]===_0x1f1c6e([0x2a])?_0x1f1c6e([0x2a]):'')[_0x1f1c6e([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x61fce2))[_0x1f1c6e([0x73,0x6f,0x6d,0x65])](_0x1c847d=>_0x4129a3[_0x1f1c6e([0x65,0x76,0x65,0x72,0x79])]((_0xaab9b6,_0x1afc57)=>_0x1c847d[_0x1afc57]===_0xaab9b6||_0x1c847d[_0x1afc57]===_0x1f1c6e([0x2a])));}function _0x2183fe(){return _0x4a245a&&_0x1aa470?new window[(_0x1f1c6e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x502cee,_0x53bfbb)=>{_0x4a245a[_0x1f1c6e([0x74,0x68,0x65,0x6e])](_0x502cee,_0x53bfbb),_0x1aa470[_0x1f1c6e([0x74,0x68,0x65,0x6e])](_0x5d4a71=>{_0x5d4a71!=_0x1f1c6e([0x56,0x61,0x6c,0x69,0x64])&&_0x502cee(_0x5d4a71);},_0x53bfbb);}):_0x4a245a||_0x1aa470||_0x1f1c6e([0x56,0x61,0x6c,0x69,0x64]);}}function _0x485aa8(_0x52bbda,_0x209ac2){return new window[(_0x1f1c6e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x46c954=>{if(_0x416762())return _0x46c954(_0x1f1c6e([0x56,0x61,0x6c,0x69,0x64]));_0x3c529(),_0x2259d9[_0x1f1c6e([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x1f1c6e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x4c7d1f=!0x1;const _0x2d4270=_0x41685d();function _0x52bf25(_0x2458be){return!!_0x2458be&&(typeof _0x2458be===_0x1f1c6e([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x2458be===_0x1f1c6e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x2458be[_0x1f1c6e([0x74,0x68,0x65,0x6e])]===_0x1f1c6e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x2458be[_0x1f1c6e([0x63,0x61,0x74,0x63,0x68])]===_0x1f1c6e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x14e73d(_0x383667){_0x5c7161(_0x383667)[_0x1f1c6e([0x74,0x68,0x65,0x6e])](_0x6598f1=>{if(!_0x6598f1||_0x6598f1[_0x1f1c6e([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x1f1c6e([0x6f,0x6b]))return _0x1f1c6e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x574d5(_0x240502(_0x2d4270+_0x209ac2))!=_0x6598f1[_0x1f1c6e([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x1f1c6e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x1f1c6e([0x56,0x61,0x6c,0x69,0x64]);})[_0x1f1c6e([0x74,0x68,0x65,0x6e])](_0x3df4dc=>(_0x242ca2(),_0x3df4dc),()=>{const _0x4c32fd=_0x34d6c1();return null==_0x4c32fd?(_0x242ca2(),_0x1f1c6e([0x56,0x61,0x6c,0x69,0x64])):_0x1f1c6e(_0x5edc70-_0x4c32fd>(0x19f340e1^_0x1c8397)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x1f1c6e([0x74,0x68,0x65,0x6e])](_0x46c954)[_0x1f1c6e([0x63,0x61,0x74,0x63,0x68])](()=>{_0x46c954(_0x1f1c6e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x161028=0x3dc92a61^_0x1c8397;function _0x242ca2(){const _0x2c68ef=_0x1f1c6e([0x6c,0x6c,0x63,0x74,0x2d])+_0x574d5(_0x240502(_0x52bbda)),_0x2bfcc8=_0x3517b5(_0x574d5(window[_0x1f1c6e([0x4d,0x61,0x74,0x68])][_0x1f1c6e([0x63,0x65,0x69,0x6c])](_0x5edc70/_0x161028)));window[_0x1f1c6e([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1f1c6e([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x2c68ef,_0x2bfcc8);}function _0x34d6c1(){const _0x3c97c4=_0x1f1c6e([0x6c,0x6c,0x63,0x74,0x2d])+_0x574d5(_0x240502(_0x52bbda)),_0xa73cfa=window[_0x1f1c6e([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1f1c6e([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3c97c4);return _0xa73cfa?window[_0x1f1c6e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3517b5(_0xa73cfa),0x10)*_0x161028:null;}function _0x5c7161(_0x59dab5){return new window[(_0x1f1c6e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x48c130,_0x27112d)=>{_0x59dab5[_0x1f1c6e([0x74,0x68,0x65,0x6e])](_0x48c130,_0x27112d),window[_0x1f1c6e([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x27112d,0x3dfe1021^_0x1c8397);});}}_0x2259d9[_0x1f1c6e([0x6f,0x6e])](_0x1f1c6e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1603de,_0x56f801)=>{if(_0x56f801[0x0]!=_0x52bbda)return _0x46c954(_0x1f1c6e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x56f801[0x1]={..._0x56f801[0x1],[_0x1f1c6e([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x2d4270};},{[_0x1f1c6e([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1f1c6e([0x68,0x69,0x67,0x68])}),_0x2259d9[_0x1f1c6e([0x6f,0x6e])](_0x1f1c6e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x17b037=>{_0x52bf25(_0x17b037[_0x1f1c6e([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x4c7d1f=!0x0,_0x14e73d(_0x17b037[_0x1f1c6e([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x1f1c6e([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1f1c6e([0x6c,0x6f,0x77])}),_0x378627[_0x1f1c6e([0x74,0x68,0x65,0x6e])](()=>{_0x4c7d1f||_0x46c954(_0x1f1c6e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x416762(){return _0x2259d9[_0x1f1c6e([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1f1c6e([0x76,0x69,0x65,0x77])][_0x1f1c6e([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x1f1c6e([0x61,0x75,0x74,0x6f]);}function _0x3c529(){_0x2259d9[_0x1f1c6e([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1f1c6e([0x76,0x69,0x65,0x77])][_0x1f1c6e([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x1f1c6e([0x61,0x75,0x74,0x6f]);}}function _0x37c7ac(_0x270dc7){const _0x3fda42=[new window[(_0x1f1c6e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3dab6e=>setTimeout(_0x3dab6e,0x3df6fa2d^_0x1c8397)),_0x378627[_0x1f1c6e([0x74,0x68,0x65,0x6e])](()=>new window[(_0x1f1c6e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3b5c4a=>{let _0x3374bb=0x0;_0x2259d9[_0x1f1c6e([0x6d,0x6f,0x64,0x65,0x6c])][_0x1f1c6e([0x6f,0x6e])](_0x1f1c6e([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x464166,_0x4170be)=>{_0x4170be[0x0][_0x1f1c6e([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x3374bb++,_0x3374bb==(0x3dffc109^_0x1c8397)&&(_0x3b5c4a(),_0x464166[_0x1f1c6e([0x6f,0x66,0x66])]());});}))];return window[_0x1f1c6e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x1f1c6e([0x72,0x61,0x63,0x65])](_0x3fda42)[_0x1f1c6e([0x74,0x68,0x65,0x6e])](()=>_0x270dc7);}async function _0x6efd92(){await _0x378627,_0x2259d9[_0x1f1c6e([0x6d,0x6f,0x64,0x65,0x6c])][_0x1f1c6e([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x30614d,_0x2259d9[_0x1f1c6e([0x6d,0x6f,0x64,0x65,0x6c])][_0x1f1c6e([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x30614d,_0x2259d9[_0x1f1c6e([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x1f1c6e([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x337143(_0x53d2c6){const _0x13f533=_0x27d1f5();_0x2259d9[_0x13f533]=_0x1f1c6e([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x53d2c6,_0x53d2c6!=_0x1f1c6e([0x56,0x61,0x6c,0x69,0x64])&&_0x6efd92();}function _0x27d1f5(){const _0x4fa5b7=window[_0x1f1c6e([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x1f1c6e([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x1f1c6e([0x6e,0x6f,0x77])]())[_0x1f1c6e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x1f1c6e([0x2e]),'');let _0x2b629c=_0x1f1c6e([0x6e]);for(let _0x13df99=0x0;_0x13df99<_0x4fa5b7[_0x1f1c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x13df99+=0x2){let _0x5f5759=window[_0x1f1c6e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4fa5b7[_0x1f1c6e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x13df99,_0x13df99+0x2));_0x5f5759>=_0xec39de[_0x1f1c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x5f5759-=_0xec39de[_0x1f1c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x2b629c+=_0xec39de[_0x5f5759];}return _0x2b629c;}function _0x38668d(){const _0x237795=_0x573335[_0x1f1c6e([0x73,0x70,0x6c,0x69,0x74])](_0x1f1c6e([0x2e]));if(0x3!=_0x237795[_0x1f1c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x22d15d(_0x237795[0x1]);function _0x22d15d(_0x2d18ae){const _0x875112=_0x3c94f2(_0x2d18ae);return _0x875112&&_0x3a941d()?_0x875112:null;function _0x3a941d(){const _0x2fab6e=_0x875112[_0x1f1c6e([0x6a,0x74,0x69])],_0x37628d=window[_0x1f1c6e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2fab6e[_0x1f1c6e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2fab6e[_0x1f1c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2b8586={..._0x875112,[_0x1f1c6e([0x6a,0x74,0x69])]:_0x2fab6e[_0x1f1c6e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x2fab6e[_0x1f1c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2b8586[_0x1f1c6e([0x76,0x63])],_0x240502(_0x2b8586)==_0x37628d;}}}async function _0x4ae450(){let _0x18e1e1=!0x0;try{const _0x5b454d=_0x573335[_0x1f1c6e([0x73,0x70,0x6c,0x69,0x74])](_0x1f1c6e([0x2e])),[_0x34822a,_0x193a7a,_0xc5445d]=_0x5b454d;return _0x2ead86(_0x34822a),await _0x2adbf4(_0x34822a,_0x193a7a,_0xc5445d),_0x18e1e1;}catch{return!0x1;}function _0x2ead86(_0x3872c1){const _0x4bb2c6=_0x3c94f2(_0x3872c1);_0x4bb2c6&&_0x4bb2c6[_0x1f1c6e([0x61,0x6c,0x67])]==_0x1f1c6e([0x45,0x53,0x32,0x35,0x36])||(_0x18e1e1=!0x1);}async function _0x2adbf4(_0x59e895,_0x595e7c,_0x327df4){const _0xfeefb5=window[_0x1f1c6e([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x1f1c6e([0x66,0x72,0x6f,0x6d])](_0x19b47d(_0x327df4),_0x4cfd49=>_0x4cfd49[_0x1f1c6e([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x1ad724=new window[(_0x1f1c6e([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x1f1c6e([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x59e895+_0x1f1c6e([0x2e])+_0x595e7c),_0x4030e2=window[_0x1f1c6e([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x1f1c6e([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x4030e2)return;const _0x1186f1=await _0x4030e2[_0x1f1c6e([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x1f1c6e([0x6a,0x77,0x6b]),_0x37fb92,{[_0x1f1c6e([0x6e,0x61,0x6d,0x65])]:_0x1f1c6e([0x45,0x43,0x44,0x53,0x41]),[_0x1f1c6e([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x1f1c6e([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x1f1c6e([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x4030e2[_0x1f1c6e([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x1f1c6e([0x6e,0x61,0x6d,0x65])]:_0x1f1c6e([0x45,0x43,0x44,0x53,0x41]),[_0x1f1c6e([0x68,0x61,0x73,0x68])]:{[_0x1f1c6e([0x6e,0x61,0x6d,0x65])]:_0x1f1c6e([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x1186f1,_0xfeefb5,_0x1ad724)||(_0x18e1e1=!0x1);}}function _0x3c94f2(_0x4cfeef){return _0x4cfeef[_0x1f1c6e([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x1f1c6e([0x65,0x79]))?JSON[_0x1f1c6e([0x70,0x61,0x72,0x73,0x65])](_0x19b47d(_0x4cfeef)):null;}function _0x19b47d(_0x4918eb){return window[_0x1f1c6e([0x61,0x74,0x6f,0x62])](_0x4918eb[_0x1f1c6e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x1f1c6e([0x2b]))[_0x1f1c6e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x1f1c6e([0x2f])));}function _0x240502(_0x4c6709){let _0x49c4a2=0x1505;function _0xa7e0ed(_0x56ff38){for(let _0x19c029=0x0;_0x19c029<_0x56ff38[_0x1f1c6e([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x19c029++){const _0xbde0a5=_0x56ff38[_0x1f1c6e([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x19c029);_0x49c4a2=(_0x49c4a2<<0x5)+_0x49c4a2+_0xbde0a5,_0x49c4a2&=_0x49c4a2;}}function _0x5a44aa(_0x5f685){Array[_0x1f1c6e([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x5f685)?_0x5f685[_0x1f1c6e([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x5a44aa):_0x5f685&&typeof _0x5f685==_0x1f1c6e([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x1f1c6e([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x5f685)[_0x1f1c6e([0x73,0x6f,0x72,0x74])]()[_0x1f1c6e([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x2a5e51,_0x363a57])=>{_0xa7e0ed(_0x2a5e51),_0x5a44aa(_0x363a57);}):_0xa7e0ed(window[_0x1f1c6e([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x5f685));}return _0x5a44aa(_0x4c6709),_0x49c4a2>>>0x0;}function _0x574d5(_0x5b3c48){return _0x5b3c48[_0x1f1c6e([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x1f1c6e([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x1f1c6e([0x30]));}function _0x3517b5(_0x12aba0){return _0x12aba0[_0x1f1c6e([0x73,0x70,0x6c,0x69,0x74])]('')[_0x1f1c6e([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x1f1c6e([0x6a,0x6f,0x69,0x6e])]('');}function _0x30614d(){}function _0x1f1c6e(_0x539c67){return _0x539c67['map'](_0x5c7bb1=>String['fromCharCode'](_0x5c7bb1))['join']('');}_0x337143(await _0x16d03c());}(this);}['showFakeVisualSelection'](){const _0x4bcc82=this['editor']['model'];_0x4bcc82['change'](_0x633f01=>{const _0x4b2598=_0x4bcc82['document']['selection']['getRanges']();let _0x1df653=0x0;for(const _0x4ca020 of _0x4b2598){const _0x2a0815=f+':'+_0x1df653;if(_0x4bcc82['markers']['has'](_0x2a0815))_0x633f01['updateMarker'](_0x2a0815,{'range':_0x4ca020});else{if(_0x4ca020['start']['isAtEnd']){const _0x3baeed=_0x4ca020['start']['getLastMatchingPosition'](({item:_0x47e518})=>!_0x4bcc82['schema']['isContent'](_0x47e518),{'boundaries':_0x4ca020});_0x633f01['addMarker'](_0x2a0815,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x633f01['createRange'](_0x3baeed,_0x4ca020['end'])});}else _0x633f01['addMarker'](_0x2a0815,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4ca020});}_0x1df653++;}});}['hideFakeVisualSelection'](){const _0x749565=this['editor']['model'],_0x40185e=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x40185e['length']&&_0x749565['change'](_0x1d75c3=>{_0x40185e['forEach'](_0x249575=>{_0x1d75c3['removeMarker'](_0x249575);});});}['insertContent'](_0x2dffea,_0x15513d){const _0x2241b2=this['_getAISelection'](),_0x2b7783=_0x15513d||_0x2241b2['getFirstRange']();this['editor']['model']['canEditAt'](_0x2b7783)&&this['editor']['model']['change'](_0x511338=>{this['hideFakeVisualSelection'](),_0x15513d||this['_resetContentOfSelectedTableCells'](_0x511338,_0x2241b2),this['_pasteHTMLUsingClipboard']({'insertAt':_0x2b7783,'writer':_0x511338,'html':_0x2dffea});});}['insertContentBelow'](_0x31f957){const {model:_0x274b80}=this['editor'],_0xa61a3c=this['_getAISelection']();_0x274b80['change'](()=>{const _0x33abe2=this['_prepareTableInsertBelowPosition'](_0x31f957,_0xa61a3c)||this['_getDefaultInsertBelowPosition'](_0xa61a3c);this['insertContent'](_0x31f957,_0x33abe2);});}['_getAISelection'](){const _0xa509be=this['editor']['model'],_0x320690=Array['from'](_0xa509be['markers']['getMarkersGroup'](f))['map'](_0x1c1914=>_0x1c1914['getRange']());return _0xa509be['createSelection'](_0x320690);}['_pasteHTMLUsingClipboard']({writer:_0x470c63,html:_0x1975e,insertAt:_0x57b340}){const {view:_0x5f483d}=this['editor']['editing'],_0x196e5b=this['editor']['plugins']['get'](_0x3143e6),_0x1ccf89=new Gn();_0x1ccf89['setData']('text/html',_0x1975e);const _0x8077c4=new ClipboardEvent('paste',{'clipboardData':_0x1ccf89}),_0x58430a=new _0x1f0d6c(_0x5f483d,_0x8077c4,{'dataTransfer':new _0x58081b(_0x1ccf89)});_0x470c63['setSelection'](_0x57b340);const _0x149bad=(_0x567d6e,_0x2ebe79)=>{_0x2ebe79['resultRange']&&_0x470c63['setSelection'](_0x2ebe79['resultRange']);};_0x196e5b['once']('contentInsertion',_0x149bad,{'priority':'lowest'}),_0x5f483d['document']['fire']('paste',_0x58430a),_0x196e5b['off']('contentInsertion',_0x149bad);}['_getDefaultInsertBelowPosition'](_0x32ea1c){const {model:_0x3d3127}=this['editor'],_0x54d863=Array['from'](_0x32ea1c['getSelectedBlocks']());return _0x54d863['length']?_0x3d3127['createPositionAfter'](_0x54d863['pop']()):_0x32ea1c['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x4bfead,_0x165658){const {model:_0x1e313c,plugins:_0x10043b}=this['editor'];if(_0x10043b['has']('TableUtils')){const _0x545f2e=_0x10043b['get']('TableUtils')['getSelectedTableCells'](_0x165658);if(_0x545f2e['length']){const _0x3fba50=this['_getTableRowCountFromContent'](_0x4bfead),_0x4eb619=this['_createEmptyTableRows'](_0x545f2e,_0x3fba50);return _0x1e313c['createPositionAt'](_0x4eb619,0x0);}}return null;}['_getTableRowCountFromContent'](_0x3bf79d){const _0x5f951a=this['editor']['plugins']['get']('TableUtils'),_0xba6267=this['editor']['data']['parse'](_0x3bf79d),_0x339b60=Array['from'](_0xba6267['getChildren']())['filter'](_0x4a8229=>_0x4a8229['is']('element','table'));let _0x227f02=0x0;return _0x339b60['forEach'](_0x5b59f7=>{_0x227f02+=_0x5f951a['getRows'](_0x5b59f7);}),_0x227f02;}['_createEmptyTableRows'](_0x5d3c52,_0x4f2dc2){const _0x59743e=this['editor']['plugins']['get']('TableUtils'),_0x1b3723=_0x59743e['getRowIndexes'](_0x5d3c52),_0x178306=_0x59743e['getColumnIndexes'](_0x5d3c52),_0x49600f=_0x1b3723['last']+0x1,_0x41add2=_0x178306['first'],_0x23ead3=_0x5d3c52[0x0]['findAncestor']('table');for(let _0x4d15af=0x0;_0x4d15af<_0x4f2dc2;_0x4d15af++)_0x59743e['insertRows'](_0x23ead3,{'at':_0x49600f});return _0x23ead3['getChild'](_0x49600f)['getChild'](_0x41add2);}['_resetContentOfSelectedTableCells'](_0x5547b7,_0x255f29){const {plugins:_0x3a2ce3}=this['editor'],{model:_0x1040d3}=_0x5547b7;if(!_0x3a2ce3['has']('TableUtils'))return;_0x3a2ce3['get']('TableUtils')['getSelectedTableCells'](_0x255f29)['length']&&_0x1040d3['deleteContent'](_0x255f29);}}class K extends _0x33cb4d{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x465bb5('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x1231fa){super(_0x1231fa),this['name']='AIRequestError';}}function Fn(_0xbb3d3a,_0x4aca01,_0x216ac2){const t=_0xbb3d3a['t'];switch(_0x4aca01){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',_0x216ac2);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x216ac2);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'},_0x216ac2);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 _0x4aca01;}}class E extends Lt{['_commandDefinitions'];constructor(_0x5f5636,_0x13c001){super(_0x5f5636),this['_commandDefinitions']=_0x13c001,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1361b3,_0x539548,_0x31bc26)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x31bc26));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x5c31f2,_0x2033a7,_0x3a0090)=>{this['enabledCommandsIds']=_0x3a0090?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x1337b7=this['editor']['model'];this['_hasContext']=function(_0x555d27){const _0x4b0bc0=_0x555d27['document']['selection'];return _0x4b0bc0['isCollapsed']?0x0!==[..._0x4b0bc0['getSelectedBlocks']()]['length']&&![..._0x4b0bc0['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x555d27['hasContent'](_0x4b0bc0['getFirstRange']());}(_0x1337b7);const _0x1289ca=_0x1337b7['document']['selection'],_0x5780ce=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x5c9e77 of _0x1289ca['getRanges']())for(const _0x200c8c of _0x5c9e77['getItems']())if(_0x200c8c['is']('element')&&_0x5780ce['includes'](_0x200c8c['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x2b0e40='',_0x5a787b='',_0x156890='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x2b0e40,_0x5a787b,_0x156890);}}function ns(_0x3b9267,_0x58b3b5){const _0x1dbcb9=new Set();for(const _0x3808de of _0x3b9267['values']())(_0x58b3b5||!0x1===_0x3808de['requiresContent'])&&_0x1dbcb9['add'](_0x3808de['id']);return Array['from'](_0x1dbcb9);}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(_0x53907e,_0x531c44,_0x1e628e){super(),this['editor']=_0x53907e,this['textAdapter']=_0x531c44,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x1e628e,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4c0cbf,_0x12e0cb,_0x276d0a)=>{this['view']['value']=this['_sanitizeHTML'](_0x276d0a);}),this['listenTo'](this['view'],'submitPrompt',(_0x25e075,_0x2bf10a)=>{const _0x1de251=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x2bf10a,_0x1de251,'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:_0x615034,query:_0x59f6d1,htmlContent:_0x1aeb3f,label:_0xf6a55b,mainActionLabel:_0x3d7b9f}){this['view']['prompt']=_0xf6a55b,this['view']['mainAction']=_0x3d7b9f,this['initialContext']=_0x1aeb3f,_0x59f6d1&&(this['view']['isRendered']?this['_handleQuery'](_0x59f6d1,_0x1aeb3f,_0x615034,_0xf6a55b):this['view']['once']('render',()=>{this['_handleQuery'](_0x59f6d1,_0x1aeb3f,_0x615034,_0xf6a55b);}));}['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'](_0x2af9ab,_0x5bd833,_0x707943,_0x4d7b45){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x5bd833,this['previousQuery']=_0x2af9ab,this['previousLabel']=_0x4d7b45||_0x2af9ab,this['previousActionId']=_0x707943,new Promise(_0xba8346=>{this['textAdapter']['makeRequest']({'query':_0x2af9ab,'context':_0x5bd833,'onData':_0x2fea59=>{this['currentResponse']=_0x2fea59,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x707943})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x3a3c1d=>{_0x3a3c1d instanceof er?this['view']['handleError'](_0x3a3c1d['message']):this['view']['handleError'](),_0xba8346();})['finally'](()=>{this['stopProcessing'](),_0xba8346();});});}['_parseAndNormalizeContent'](_0x40957b,_0x544e75=!0x1){const _0x29e706=hs['exec'](_0x40957b);_0x40957b=_0x29e706?_0x40957b['substring'](_0x29e706[0x1]['length']):_0x40957b['length']<0x64&&!_0x544e75?'':this['_stripMarkdownSyntax'](_0x40957b);const _0x1afbfc=this['_domParser']['parseFromString'](_0x40957b,'text/html');if(_0x29e706){const _0x1095b8=Array['from'](_0x1afbfc['body']['childNodes']);_0x1095b8['reverse']();for(const _0x133577 of _0x1095b8){if(_0x133577['nodeType']==Node['ELEMENT_NODE'])break;_0x133577['remove']();}}const _0x351245=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x1afbfc['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x351245);const _0x36d5a6=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x344e88=this['editor']['data']['toModel'](_0x351245);return _0x36d5a6||_0x344e88['markers']['clear'](),this['editor']['data']['stringify'](_0x344e88);}['_normalizeResponseHeadings'](_0x1e6d05){const _0x1b6a2d=new _0x52d8e0(this['editor']['editing']['view']['document']),_0x1f5786=new _0x3d5442({'name':/^h[1-5]$/}),_0x2c475f=[];let _0x2ce92c=!0x1;for(const _0x5845e5 of _0x1e6d05)_0x5845e5['is']('element')&&_0x1f5786['match'](_0x5845e5)&&(_0x2c475f['push'](_0x5845e5),'h1'==_0x5845e5['name']&&(_0x2ce92c=!0x0));if(_0x2ce92c){for(const _0x2be55a of _0x2c475f)_0x1b6a2d['rename']('h'+(parseInt(_0x2be55a['name'][0x1])+0x1),_0x2be55a);}}['_isH1TagSupportEnabled'](){const {data:_0x3e6948,editing:_0x191100}=this['editor'],_0x190ae4=_0x3e6948['htmlProcessor']['toView']('<h1></h1>'),_0x268561=_0x3e6948['toView'](_0x3e6948['toModel'](_0x190ae4));return!!_0x191100['view']['domConverter']['viewToDom'](_0x268561)['querySelector']('h1');}['_sanitizeHTML'](_0x4788e2){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x4788e2),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x4ca000){const _0x3ed797=_0x4ca000['trim']();return _0x3ed797['startsWith']('```html')?_0x3ed797['endsWith']('```')?_0x3ed797['substring'](0x7,_0x3ed797['length']-0x3):_0x3ed797['substring'](0x7):_0x4ca000;}}const _={'REPLACE':'replace','INSERT':'insert'};class Ar extends _0x5ec0fa{constructor(_0xb1856){super(_0xb1856),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x425577=>Fn(_0xb1856,'AI_'+_0x425577['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Fn(_0xb1856,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Fn(_0xb1856,'Try\x20again')),this['stopButton']=this['_createButton'](Fn(_0xb1856,'Stop'));const _0x34d99a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x34d99a['if']('isVisible','ck-hidden',_0x1a7a0e=>!_0x1a7a0e)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x5b29d5,_0x52ff01){const _0x3146ec=new _0x33ce64(this['locale']);return _0x3146ec['set']({'label':_0x5b29d5,'class':_0x52ff01||'','isVisible':!0x0,'withText':!0x0}),_0x3146ec;}}class Pr extends _0x26817f{['contentFieldView'];['copyButtonView'];constructor(_0x3dffc0,_0x492bec=''){super(_0x3dffc0),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x54d6e9=this['bindTemplate'];this['contentFieldView']=new ContentFieldView(_0x3dffc0,_0x492bec),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x54d6e9['if']('isVisible','ck-hidden',_0x497d48=>!_0x497d48)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x54d6e9['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 _0x2f778a=!0x1;this['on']('change:value',(_0x1e3f83,_0x30249b,_0x2cb220)=>{const _0x3f71f7=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2cb220),this['isProcessing']&&_0x3f71f7&&!_0x2f778a&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x15f93,_0x7b00a8,_0x37669b)=>{_0x2f778a=!0x1,_0x37669b?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x2f778a=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x2f778a=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1ebd89=this['locale'],_0xe604ca=new _0x33ce64(this['locale']),_0x3a117a='ck-ai-form__copy-button';return _0xe604ca['set']({'label':Fn(_0x1ebd89,'Copy'),'icon':_0x5b1621,'class':_0x3a117a,'tooltip':!0x0}),_0xe604ca['bind']('isVisible')['to'](this,'value',_0x505c57=>!!_0x505c57),_0xe604ca['bind']('isEnabled')['to'](this,'isProcessing',_0x568c2e=>!_0x568c2e),_0xe604ca['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0xe604ca['icon']=_0x42b74e,_0xe604ca['class']=_0x3a117a+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0xe604ca['icon']=_0x5b1621,_0xe604ca['class']=_0x3a117a;},0x3e8);}),_0xe604ca;}['_copyHTMLToClipboard'](_0x3b1df7){const {window:_0x4ea25d,document:_0x54f4f7}=_0x274357;if(_0x4ea25d['ClipboardItem']){const {Blob:_0x326cd1,ClipboardItem:_0x2f0866}=_0x4ea25d,_0x6edd86=[new _0x2f0866({'text/html':new _0x326cd1([_0x3b1df7['innerHTML']],{'type':'text/html'}),'text/plain':new _0x326cd1([_0x3b1df7['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x6edd86);}else{const _0x514212=_0x54f4f7['createElement']('div');_0x514212['style']['position']='absolute',_0x514212['style']['left']='-9999px',_0x514212['innerHTML']='<span>[</span>'+_0x3b1df7['innerHTML']+'<span>]</span>',_0x54f4f7['body']['appendChild'](_0x514212);const _0x755449=_0x54f4f7['createRange']();_0x755449['setStartAfter'](_0x514212['firstElementChild']),_0x755449['setEndBefore'](_0x514212['lastElementChild']);const _0x338e47=_0x4ea25d['getSelection']();_0x338e47['removeAllRanges'](),_0x338e47['addRange'](_0x755449),_0x54f4f7['execCommand']('copy'),_0x514212['remove']();}}}class ContentFieldView extends _0x26817f{constructor(_0x55e969,_0x108df1=''){super(_0x55e969),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x108df1,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x30b36a){this['element']['innerHTML']=_0x30b36a;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x61e147=new _0x26817f(),_0x480bd2=this['locale'],_0x27239f=new _0x344070();return _0x27239f['isVisible']=!0x0,_0x61e147['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x27239f,{'text':Fn(_0x480bd2,'AI\x20is\x20writing...')}]}),_0x61e147['render'](),_0x61e147;}}class Vr extends _0x26817f{constructor(_0x5c9137,_0x56187d=''){super(_0x5c9137);const _0x45bbed=new _0x3c69cf(),_0x538e11=this['bindTemplate'];this['set']('text',_0x56187d),_0x45bbed['content']=_0x558167,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x45bbed,{'text':_0x538e11['to']('text')}]});}}class Cr extends _0x5bfc01{['submitButtonView'];['showHistoryButtonView'];constructor(_0x246c40,_0x245fc8){super(_0x246c40,_0x245fc8),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',(_0x2f0f3a,_0x181171)=>{_0x2f0f3a['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x181171());});}['_createSubmitButton'](){const _0x9c6b77=new _0x33ce64(this['locale']),_0x20280f=this['locale'];return _0x9c6b77['set']({'icon':_0x28ab7c,'label':Fn(_0x20280f,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x9c6b77['on']('execute',()=>{this['submit']();}),_0x9c6b77['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x2f384d,_0x2acaf1)=>!_0x2f384d&&_0x2acaf1),_0x9c6b77;}['_createShowHistoryButton'](){const _0x217ef3=new _0x33ce64(this['locale']),_0x5e14ca=this['resultsView'],_0x233bd4=this['locale'];_0x217ef3['set']({'label':Fn(_0x233bd4,'History'),'withText':!0x1,'icon':Ht,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x217ef3['bind']('isOn')['to'](_0x5e14ca,'isVisible'),_0x217ef3['bind']('isEnabled')['to'](this,'isEnabled'),_0x217ef3['on']('execute',()=>{_0x5e14ca['isVisible']=!_0x5e14ca['isVisible'],_0x5e14ca['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x36b14=()=>{_0x274357['window']['requestAnimationFrame'](()=>{if(_0x37e114(this['element'])){const _0x75d53e=new _0x26a571(this['queryView']['fieldView']['element']),_0x37deeb=_0x75d53e['width'],_0x10f57f='rtl'===_0x233bd4['uiLanguageDirection']?'left':'right';_0x75d53e['excludeScrollbarsAndBorders'](),_0x217ef3['element']['style'][_0x10f57f]=_0x37deeb-_0x75d53e['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x36b14),this['on']('render',_0x36b14),_0x217ef3;}['submit'](){const _0xb4f926=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0xb4f926);}['focus'](_0x35c2f3){-0x1===_0x35c2f3?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Hr extends _0x41f1be{['historyGroupView'];['clearHistoryButton'];constructor(_0x507692){super(_0x507692),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x52bc35(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Fn(_0x507692,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x233f1c=0x0;for(const _0x399a5d of this['items'])_0x233f1c+=_0x399a5d['items']['length'];return{'resultsCount':_0x233f1c,'totalItemsCount':_0x233f1c};}['_createClearHistoryButton'](){const _0x31fdaf=this['locale'],_0x472a15=new _0x33ce64(this['locale']);return _0x472a15['set']({'label':'('+Fn(_0x31fdaf,'Clear')+')','withText':!0x0}),_0x472a15['on']('execute',()=>this['fire']('clearHistory')),_0x472a15;}}class Rr extends _0x51dbe3{constructor(_0x5222ef){super();const _0x55b947=new _0x3eefdf(),_0x3d78fc=new _0x33ce64(this['locale'],_0x55b947);this['children']['add'](_0x3d78fc),_0x3d78fc['set']({'label':_0x5222ef['prompt'],'withText':!0x0}),_0x3d78fc['on']('execute',()=>{this['fire']('execute',{'value':_0xe1320(_0x5222ef['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Br extends _0x2c18a8{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4f4f53,_0x5111a8)=>{const _0x2612cb=go(_0x5111a8['prompt']);for(const _0x581dda of this)if(_0x581dda!=_0x5111a8&&go(_0x581dda['prompt'])===_0x2612cb){this['remove'](_0x581dda);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x309ba5=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x309ba5));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x37f3bd=>_0x37f3bd)));}}function go(_0x22bb1f){return _0x22bb1f['toLowerCase']()['trim']();}class k extends _0x26817f{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x402529,_0x2f5367,_0x579c78=''){super(_0x402529),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(_0x402529),this['contentArea']=new Pr(_0x402529,_0x579c78),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 _0x1203ce(),this['keystrokes']=new _0x2ac014(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x29c2cb({'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 _0x2151ab=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x2f5367],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x2151ab['if']('isError','ck-hidden',_0x132297=>!_0x132297)]},'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'](_0x495cdb=0x1){-0x1===_0x495cdb?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 _0x514f41=this['locale'],_0x23f718=new Cr(_0x514f41,{'queryView':{'label':Fn(_0x514f41,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x16a940,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Fn(_0x514f41,'Empty\x20history'),'secondary':Fn(_0x514f41,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x23f718['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x27c929,_0x300b8e)=>_0x27c929&&!_0x300b8e),this['listenTo'](_0x23f718,'submit',(_0x25e5bf,_0x38bca3)=>{this['prompt']=_0x38bca3;const _0x35f116=_0x1e51c4(_0x38bca3);this['fire']('submitPrompt',_0x35f116),_0x38bca3['trim']()&&this['_promptHistory']['add']({'prompt':_0x35f116},0x0);},{'priority':'high'}),_0x23f718;}['_createHistoryView'](){const _0x2c6b6e=new Hr(this['locale']);return _0x2c6b6e['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Rr),_0x2c6b6e['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2c6b6e;}['_createToolbar'](){const _0x3abde4=new Ar(this['locale']);return _0x3abde4['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1a3554,_0x303854,_0x32d3dc)=>_0x1a3554&&!_0x303854&&!!_0x32d3dc),_0x3abde4['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x3abde4['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x14cb95,_0xb980cb,_0x35688b)=>_0x14cb95&&!_0xb980cb&&!!_0x35688b),_0x3abde4['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x3abde4['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x598c58,_0x2325f6)=>_0x598c58&&!_0x2325f6),_0x3abde4['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x3abde4['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x3abde4['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x3abde4;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x1bb5e2=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Fn(_0x1bb5e2,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x3781c2){const _0x15512d=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x3781c2||Fn(_0x15512d,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x33cb4d{['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[_0xcedc94,a,K,_0x33e5ba];}constructor(_0x57f9ef){super(_0x57f9ef),_0x57f9ef['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x57f9ef['config']['define']('ai.assistant.contentAreaCssClass',''),_0x57f9ef['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x57f9ef['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x2d6b4c}=this;this['_aiAdapter']=_0x2d6b4c['plugins']['get'](K),this['_dialog']=_0x2d6b4c['plugins']['get'](_0x33e5ba),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x5f3b4d=new E(_0x2d6b4c,Array['from'](this['_commandDefinitions']['values']()));_0x2d6b4c['commands']['add']('showAIAssistant',_0x5f3b4d),_0x2d6b4c['ui']['componentFactory']['add']('aiCommands',_0x13ac5d=>{const _0x41501d=_0x1fec03(_0x13ac5d);return _0x41501d['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x41501d['buttonView']['set']({'label':Fn(_0x13ac5d,'AI\x20Commands'),'icon':_0x20365f,'tooltip':!0x0}),_0x41501d['on']('execute',_0x57bec8=>this['_onExecute'](_0x57bec8['source']['id'])),_0xe40ea4(_0x41501d,_0x2d6b4c['ui']['view']['body'],function(_0x319bb0){const _0x1edb0c=o(_0x319bb0['config']['get']('ai.assistant.commands'),_0x319bb0['locale']),_0x5ce5f2=B(_0x319bb0,_0x1edb0c)['filter'](_0x38ac22=>_0x38ac22['commands']['length']);if(0x1===_0x5ce5f2['length'])return B(_0x319bb0,_0x5ce5f2[0x0]['commands'])['map'](_0x427d0e=>({'id':_0x427d0e['id'],'label':_0x427d0e['label']}));return _0x5ce5f2['map'](_0x23b253=>{const {groupId:_0x4e8209,groupLabel:_0x2a18c1,commands:_0x1c5015}=_0x23b253,_0x327223=B(_0x319bb0,_0x1c5015)['map'](_0xbc1e3f=>({'id':_0xbc1e3f['id'],'label':_0xbc1e3f['label']}));return{'id':_0x4e8209,'menu':_0x2a18c1||_0x4e8209,'children':_0x327223};});}(_0x2d6b4c),{'ariaLabel':Fn(_0x13ac5d,'AI\x20Commands')}),_0x41501d['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x5f3b4d['on']('change:enabledCommandsIds',_0xe6ac89),_0x41501d['menuView']['once']('render',_0xe6ac89),_0x41501d;function _0xe6ac89(){_0x41501d['isEnabled']=_0x5f3b4d['enabledCommandsIds']['length']>0x0;for(const _0x3c01f2 of _0x41501d['menuView']['buttons'])_0x3c01f2['isEnabled']=_0x5f3b4d['enabledCommandsIds']['includes'](_0x3c01f2['id']);}}),_0x2d6b4c['ui']['componentFactory']['add']('menuBar:aiCommands',_0x5b8ead=>{const _0x23f3ea=new _0x96433a(_0x5b8ead);_0x23f3ea['buttonView']['set']({'label':Fn(_0x5b8ead,'AI\x20Commands'),'icon':_0x20365f}),_0x23f3ea['bind']('isEnabled')['to'](_0x5f3b4d,'enabledCommandsIds',_0x26b695=>_0x26b695['length']>0x0);const _0x3be0dd=o(_0x2d6b4c['config']['get']('ai.assistant.commands'),_0x5b8ead);return this['_populateMenuBarMenu'](_0x5f3b4d,_0x23f3ea,_0x3be0dd,_0x507280=>this['_onExecute'](_0x507280)),_0x23f3ea;}),_0x2d6b4c['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x55d0f1=this['_createAIAssistantUIButton'](_0x33ce64);return _0x55d0f1['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x55d0f1;}),_0x2d6b4c['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x337f8c=this['_createAIAssistantUIButton'](_0x57ee28);return _0x337f8c['set']({'role':'menuitemcheckbox'}),_0x337f8c;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x1b97b2=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x27e180;for(const _0x2e9dd7 in _0x1b97b2){const _0x5ab2e0=_0x2e9dd7,_0x46d68b=_0x1b97b2[_0x5ab2e0];if('aiLicenseKeyValid'==_0x46d68b||'aiLicenseKeyInvalid'==_0x46d68b||'aiLicenseKeyExpired'==_0x46d68b||'aiLicenseKeyDomainLimit'==_0x46d68b||'aiLicenseKeyNotAllowed'==_0x46d68b||'aiLicenseKeyEvaluationLimit'==_0x46d68b||'aiLicenseKeyUsageLimit'==_0x46d68b){delete _0x1b97b2[_0x5ab2e0],_0x27e180=_0x46d68b,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x27e180&&_0x1b97b2['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x27e180&&_0x1b97b2['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x27e180&&_0x1b97b2['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x27e180&&_0x1b97b2['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x27e180&&_0x1b97b2['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x27e180&&_0x1b97b2['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x496833='',_0x3fcb7a='',_0x50281a='custom'){const _0x34db3d=this['editor'],_0x3e92f4=_0x34db3d['editing']['view'],_0x241aa1=_0x34db3d['plugins']['get'](a),_0x408980=_0x34db3d['plugins']['get'](_0xcedc94);_0x241aa1['showFakeVisualSelection']();const _0x1aa652=new w(),_0x9ac9ae=new ClipboardEvent('copy',{'clipboardData':_0x1aa652}),_0x2c54c3=new _0x58081b(_0x1aa652),_0x17f07c=new _0x1f0d6c(_0x3e92f4,_0x9ac9ae,{'dataTransfer':_0x2c54c3});_0x408980['_forceMarkersCopy']('comment',()=>{_0x3e92f4['document']['fire']('copy',_0x17f07c);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x34db3d,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x560572=_0x2c54c3['getData']('text/html');const _0x74d40b=_0x34db3d['model']['document']['selection'],_0x4e091a=Array['from'](_0x74d40b['getRanges']());0x1===_0x4e091a['length']&&_0x4e091a[0x0]['isFlat']&&!_0x74d40b['getSelectedElement']()&&''!==_0x560572['replace'](/&nbsp;/g,'')['trim']()&&(_0x560572='<p>'+_0x560572+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x50281a,'query':_0x496833,'htmlContent':_0x560572,'label':_0x3fcb7a,'mainActionLabel':_[_0x34db3d['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x52b584,'title':Fn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x1898af['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x241aa1['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x5623c8=new Map(),_0x42ebf8=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x59d81f of _0x42ebf8)for(const _0x363f25 of _0x59d81f['commands'])_0x5623c8['set'](_0x363f25['id'],{..._0x363f25,'groupId':_0x59d81f['groupId'],'groupLabel':_0x59d81f['groupLabel']||_0x59d81f['groupId']});return _0x5623c8;}['_createAIAssistantUIButton'](_0x549340){const _0x3a1971=this['editor'],_0x42a1a6=_0x3a1971['commands']['get']('showAIAssistant'),_0x2543c6=new _0x549340(_0x3a1971['locale']);return _0x2543c6['set']({'label':Fn(_0x3a1971['locale'],'AI\x20Assistant'),'icon':_0x52b584,'isToggleable':!0x0}),_0x2543c6['bind']('isEnabled')['to'](_0x42a1a6),_0x2543c6['bind']('isOn')['to'](this['_dialog'],'id',_0x5da732=>'aiAssistant'===_0x5da732),this['listenTo'](_0x2543c6,'execute',()=>{_0x2543c6['isOn']?this['hideUI']():_0x42a1a6['execute']();}),_0x2543c6;}['_initView'](){const _0x1fe208=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',()=>{_0x1fe208['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x1fe208['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x54191f,ui:{ariaLiveAnnouncer:_0x42075f}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x30100b,_0x183b08,_0x5e42fc)=>{const _0x4503c2=this['_aiAssistantController']['currentContext'];_0x5e42fc?_0x42075f['announce'](Fn(_0x54191f,'AI\x20is\x20writing')):_0x4503c2&&_0x42075f['announce'](Fn(_0x54191f,'Generated\x20content:\x20%0',_0x4503c2),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x8e4277,_0x2c8bbd,_0x4a0317)=>{if(_0x4a0317){const _0x201fb1=this['_formView']['errorView']['text'];_0x42075f['announce'](Fn(_0x54191f,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x201fb1));}});}['_onExecute'](_0x439d81){const _0x403810=this['_commandDefinitions']['get'](_0x439d81),_0x37e1a4=this['editor'],_0x53860a=_0x37e1a4['model']['document']['selection'],_0x141ac3=_0x37e1a4['commands']['get']('showAIAssistant'),_0x244a9d=_0x37e1a4['plugins']['get'](a),_0x122f5c=''+(_0x403810['groupId']!==x?_0x403810['groupLabel']+':\x20':'')+_0x403810['label'];if(!0x1!==_0x403810['requiresContent']&&_0x53860a['isCollapsed']){const _0x2e1e78=_0x586c33(_0x53860a['getSelectedBlocks']())||_0x37e1a4['model']['schema']['getLimitElement'](_0x53860a);_0x37e1a4['model']['change'](_0x34b636=>{_0x34b636['setSelection'](_0x2e1e78,'in');});}_0x244a9d['showFakeVisualSelection'](),_0x141ac3['execute'](_0x403810['prompt'],_0x122f5c,'command:'+_0x439d81);}['_populateMenuBarMenu'](_0x5eb65a,_0x30302f,_0x67344d,_0x1bf65a){const _0x3a6a4a=this['editor'],_0x534907=_0x3a6a4a['locale'],_0x1a7491=new _0x1776b3(_0x534907),_0x3c5a72=B(_0x3a6a4a,_0x67344d)['filter'](_0x767594=>_0x767594['commands']['length']);0x1===_0x3c5a72['length']?this['_getMenuBarGroupButtons']({'command':_0x5eb65a,'commands':_0x3c5a72[0x0]['commands'],'parentMenuView':_0x30302f,'onExecute':_0x1bf65a})['forEach'](_0x3b699c=>_0x1a7491['items']['add'](_0x3b699c)):_0x3c5a72['forEach'](({groupId:_0x1231da,groupLabel:_0x91325a,commands:_0x292e4b})=>{const _0x657532=new _0x548f11(_0x534907,_0x30302f),_0xa691f0=new _0x96433a(_0x534907),_0x65b754=new _0x1776b3(_0x534907),_0x106d93=this['_getMenuBarGroupButtons']({'command':_0x5eb65a,'commands':_0x292e4b,'parentMenuView':_0xa691f0,'onExecute':_0x1bf65a});_0xa691f0['buttonView']['set']({'label':_0x91325a||_0x1231da}),_0xa691f0['delegate']('execute')['to'](_0x30302f),_0x65b754['items']['addMany'](_0x106d93),_0xa691f0['panelView']['children']['add'](_0x65b754),_0x657532['children']['add'](_0xa691f0),_0x1a7491['items']['add'](_0x657532);}),_0x30302f['panelView']['children']['add'](_0x1a7491);}['_getMenuBarGroupButtons']({command:_0xeae5d1,commands:_0x25ca15,parentMenuView:_0x38a1d4,onExecute:_0x39b689}){const _0x5d6521=this['editor'],_0x5a7536=_0x5d6521['locale'];return B(_0x5d6521,_0x25ca15)['map'](_0x3811fa=>{const _0x57a076=new _0x548f11(_0x5a7536,_0x38a1d4),_0x7713d0=new _0x57ee28(_0x5a7536);return _0x7713d0['set']({'label':_0x3811fa['label']}),_0x7713d0['delegate']('execute')['to'](_0x38a1d4),_0x7713d0['on']('execute',()=>_0x39b689(_0x3811fa['id'])),_0x7713d0['bind']('isEnabled')['to'](_0xeae5d1,'enabledCommandsIds',_0x3eecaf=>_0x3eecaf['includes'](_0x3811fa['id'])),_0x57a076['children']['add'](_0x7713d0),_0x57a076;});}}function U(_0x3d231e,_0x448767){return void 0x0!==_0x3d231e['order']&&void 0x0===_0x448767['order']?0x1:void 0x0===_0x3d231e['order']&&void 0x0!==_0x448767['order']?-0x1:void 0x0!==_0x3d231e['order']&&void 0x0!==_0x448767['order']?_0x3d231e['order']-_0x448767['order']:0x0;}function B(_0x2bfc15,_0x4fe536){_0x4fe536['sort'](U);const _0x2c528a={},_0x5460f4=[];for(const _0x4a6078 of _0x4fe536)if(void 0x0!==_0x4a6078['order']){if(_0x4a6078['order']in _0x2c528a)throw new _0x465bb5('ai-commands-config-order-collision',_0x2bfc15,{'conflictingDefinitions':[_0x4a6078,_0x2c528a[_0x4a6078['order']]]});_0x2c528a[_0x4a6078['order']]=_0x4a6078,_0x5460f4['splice'](_0x4a6078['order'],0x0,_0x4a6078);}else _0x5460f4['push'](_0x4a6078);return _0x5460f4;}class AIAssistant extends _0x33cb4d{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x13dde0){super(_0x13dde0);const _0x2adeb8=_0x13dde0['config'],_0x1900e8=_0x13dde0['locale'];_0x2adeb8['define']('ai.assistant.preserveComments',!0x0),_0x2adeb8['define']('ai.assistant.commands',Wn(_0x1900e8)),_0x2adeb8['define']('ai.assistant.extraCommandGroups',[]),_0x2adeb8['define']('ai.assistant.removeCommands',[]);let _0x23a870=o(_0x2adeb8['get']('ai.assistant.commands'),_0x1900e8);const _0x57bc77=_0x2adeb8['get']('ai.assistant.extraCommandGroups'),_0x586bf5=_0x2adeb8['get']('ai.assistant.removeCommands');_0x57bc77['forEach'](_0x1b1504=>{const _0x39841f=_0x23a870['find'](_0x422056=>_0x422056['groupId']===_0x1b1504['groupId']);_0x39841f?_0x39841f['commands']=_0x39841f['commands']['concat'](_0x1b1504['commands']):_0x23a870['push'](_0x1b1504);}),_0x23a870=_0x23a870['filter'](_0xe14117=>!_0x586bf5['includes'](_0xe14117['groupId'])),_0x23a870['forEach'](_0x19773e=>{_0x19773e['commands']=_0x19773e['commands']['filter'](_0x2cc7e0=>!_0x586bf5['includes'](_0x2cc7e0['id']));}),_0x2adeb8['set']('ai.assistant.commands',_0x23a870);}}function Wn(_0x3a4480){return[{'groupId':'editOrReview','groupLabel':Fn(_0x3a4480,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Fn(_0x3a4480,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Fn(_0x3a4480,'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':Fn(_0x3a4480,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Fn(_0x3a4480,'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':Fn(_0x3a4480,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Fn(_0x3a4480,'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':Fn(_0x3a4480,'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':Fn(_0x3a4480,'Change\x20tone'),'commands':[{'id':'professional','label':Fn(_0x3a4480,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Fn(_0x3a4480,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Fn(_0x3a4480,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Fn(_0x3a4480,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Fn(_0x3a4480,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Fn(_0x3a4480,'Change\x20style'),'commands':[{'id':'business','label':Fn(_0x3a4480,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Fn(_0x3a4480,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Fn(_0x3a4480,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Fn(_0x3a4480,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Fn(_0x3a4480,'Translate'),'commands':[{'id':'translateEnglish','label':Fn(_0x3a4480,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Fn(_0x3a4480,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Fn(_0x3a4480,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Fn(_0x3a4480,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Fn(_0x3a4480,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Fn(_0x3a4480,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Fn(_0x3a4480,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Fn(_0x3a4480,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ar extends _0x33cb4d{['abortController'];static get['requires'](){return[K];}constructor(_0x51a988){super(_0x51a988),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'](_0x5db68c){return this['sendRequest'](_0x5db68c)['catch'](_0xc3a190=>{if(_0xc3a190 instanceof er)return Promise['reject'](_0xc3a190);if('AbortError'==_0xc3a190['name'])return Promise['resolve']();throw console['error'](_0xc3a190),new _0x465bb5('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x76d042,_0x4847c7){const _0x215fb6=this['editor']['locale'],_0x5b32f2={'Content-Type':'application/json'};if('object'==typeof _0x76d042)Object['assign'](_0x5b32f2,_0x76d042);else{if(_0x76d042)try{const _0x590bb3=await _0x76d042(_0x4847c7);Object['assign'](_0x5b32f2,_0x590bb3);}catch{return Promise['reject'](new er(Fn(_0x215fb6,'AI_ERROR_GET_HEADERS')));}}return _0x5b32f2;}async['_prepareRequestParameters'](_0x10d8c4,_0xebddef){const _0x5c8e90=this['editor']['locale'];if('object'==typeof _0x10d8c4)return _0x10d8c4;try{return await _0x10d8c4(_0xebddef);}catch{return Promise['reject'](new er(Fn(_0x5c8e90,'AI_ERROR_GET_PARAMETERS')));}}}class OpenAITextAdapter extends ar{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x2dad73){super(_0x2dad73),_0x2dad73['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x2dad73['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x2dad73['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x2dad73['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x2dad73['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x2dad73['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x135136,context:_0x53c321,onData:_0x1a0f78,actionId:_0x4ed7ed}){const _0x306abb=this['editor']['locale'],_0x53260d=await this['prepareMessages'](_0x135136,_0x53c321,_0x4ed7ed),_0x5a7dcb=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4ed7ed),_0x6bf193=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4ed7ed),_0x53c4bf={'messages':_0x53260d,..._0x6bf193},_0x5dfd9f={'method':'POST','headers':_0x5a7dcb,'body':JSON['stringify'](_0x53c4bf),'signal':this['abortController']['signal']},_0x1e867a=await fetch(this['_apiUrl'],_0x5dfd9f);if(_0x1e867a['ok'])return _0x6bf193['stream']?await this['_readStreamableResponse'](_0x1e867a,_0x1a0f78):await this['_readStaticResponse'](_0x1e867a,_0x1a0f78),Promise['resolve']();{const _0x2c8011=await _0x1e867a['text']();return _0x2c8011['includes']('context_length_exceeded')?Promise['reject'](new er(Fn(_0x306abb,'AI_ERROR_CONTEXT_LENGTH'))):_0x2c8011['includes']('Moderation')?Promise['reject'](new er(Fn(_0x306abb,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x2c8011));}}async['prepareMessages'](_0x56cc7f,_0x1b2d11,_0x388b50){let _0x22a1ca,_0x4daf86;return _0x1b2d11?(_0x22a1ca='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.',_0x4daf86='Instruction:\x0a'+_0x56cc7f+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1b2d11):(_0x22a1ca='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.',_0x4daf86=_0x56cc7f),[{'role':'system','content':_0x22a1ca},{'role':'user','content':_0x4daf86}];}async['_readStreamableResponse'](_0x130b26,_0xbf5732){const _0x457fd7=_0x130b26['body']['getReader'](),_0x5cf477=new TextDecoder();let _0x464651='',_0xa4bc05='',_0x13be90='',_0x57bcb1=!0x1;for(;!_0x57bcb1;){const {done:_0xa76127,value:_0x499b88}=await _0x457fd7['read'](),_0x161057=_0x464651+_0x5cf477['decode'](_0x499b88);let _0x5dbc57='';_0x57bcb1=_0xa76127;try{_0x5dbc57=this['_cleanUpData'](_0x161057),_0x464651='';}catch{_0x464651=_0x161057;continue;}_0xa4bc05+=_0x5dbc57,!_0x57bcb1&&this['_isBufferIncomplete'](_0xa4bc05)||_0xa4bc05&&(_0x13be90+=_0xa4bc05,_0xa4bc05='',_0xbf5732(_0x13be90));}return Promise['resolve']();}async['_readStaticResponse'](_0x2c94b3,_0xc55bc0){return _0xc55bc0((await _0x2c94b3['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x3d8200){const _0x160411=_0x3d8200['split']('<')['length']!==_0x3d8200['split']('>')['length'],_0x1707d3=_0x3d8200['length']<0x1e;return _0x160411&&_0x1707d3;}['_cleanUpData'](_0x221357){return _0x221357['split'](/\n(?![^{]*\})/g)['map'](_0x1bba86=>_0x1bba86['replace']('data:\x20',''))['filter'](_0x4dedea=>_0x4dedea&&_0x4dedea['length']>0x0&&'[DONE]'!==_0x4dedea)['map'](_0x41b802=>{const {choices:_0x12902f}=JSON['parse'](_0x41b802);if(_0x12902f[0x0]?.['delta']?.['content'])return _0x12902f[0x0]['delta']['content'];})['filter'](_0x55df40=>_0x55df40)['join']('');}}class AWSTextAdapter extends ar{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),_0x227e3e('ai-aws-adapter-not-supported');}async['sendRequest'](_0x8bb92b){throw _0x238b54('ai-aws-adapter-not-supported'),new er(Fn(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ia extends _0x33ce64{constructor(_0x2937ae,_0x1a5fd4={}){super(_0x2937ae),this['isToggleable']=!0x0,this['set']('side',_0x1a5fd4['side']||'top');const _0x4cba71=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x31d1f9(_0x1a5fd4['class']||[]),_0x4cba71['to']('side',_0x395dd7=>'ck-tab-button_'+_0x395dd7),_0x4cba71['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x26817f{['children'];constructor(_0x44932e,_0x4df2fe={}){super(_0x44932e);const _0x5bbeb8=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x31d1f9(_0x4df2fe['class']||[]),_0x5bbeb8['to']('class'),_0x5bbeb8['if']('isVisible','ck-hidden',_0x1ce2ce=>!_0x1ce2ce)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x26817f{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x243693,_0x5db33d={}){super(_0x243693),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x5db33d['side']||'top'),this['set']('isMaximized',!0x1);const _0x328cd1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x31d1f9(_0x5db33d['class']||[]),_0x328cd1['to']('side',_0x3be483=>'ck-tabs_'+_0x3be483),_0x328cd1['to']('class'),_0x328cd1['to']('isMaximized',_0x20a0a0=>_0x20a0a0?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x328cd1['to']('side',_0x36d243=>'ck-tabs__buttons-container_'+_0x36d243)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x328cd1['to']('side',_0x3c5bf6=>'ck-tabs__panels-container_'+_0x3c5bf6)]},'children':this['panelViews']},..._0x31d1f9(_0x5db33d['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x5f1e2f){const _0x3f632b=this['_tabs']['get'](_0x5f1e2f);return _0x3f632b||null;}['addTab'](_0x34bcc1){const _0x19d2fa=this['_setupButton']({'id':_0x34bcc1['id'],'label':_0x34bcc1['buttonLabel'],'icon':_0x34bcc1['buttonIcon'],'order':_0x34bcc1['order']}),_0x608ea9=new ea(this['locale']);return _0x608ea9['render'](),_0x34bcc1['content']&&_0x608ea9['children']['add'](_0x34bcc1['content']),this['panelViews']['add'](_0x608ea9),this['_tabs']['set'](_0x34bcc1['id'],{'button':_0x19d2fa,'panel':_0x608ea9,'order':void 0x0!==_0x34bcc1['order']?_0x34bcc1['order']:null}),this['fire']('addTab:'+_0x34bcc1['id'],{'id':_0x34bcc1['id'],'button':_0x19d2fa,'panel':_0x608ea9}),null===this['activeTab']?this['activateTab'](_0x34bcc1['id']):this['_hidePanel'](_0x34bcc1['id']),{'button':_0x19d2fa,'panel':_0x608ea9};}['activateTab'](_0x3c13ed){if(null!==_0x3c13ed&&!this['getTab'](_0x3c13ed))throw new _0x465bb5('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3c13ed});this['activeTab']!==_0x3c13ed&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x3c13ed,_0x3c13ed&&this['_showPanel'](_0x3c13ed),this['fire']('activateTab:'+_0x3c13ed,_0x3c13ed));}['showTab'](_0x36e0a8){if(!this['getTab'](_0x36e0a8))throw new _0x465bb5('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x36e0a8});this['_showPanel'](_0x36e0a8),this['_showButton'](_0x36e0a8),this['fire']('show:'+_0x36e0a8,_0x36e0a8);}['hideTab'](_0x551c0c){if(!this['getTab'](_0x551c0c))throw new _0x465bb5('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x551c0c});const _0x5ea51c=this['activeTab'];this['_hidePanel'](_0x551c0c),this['_hideButton'](_0x551c0c);const _0x51e8dc=this['getTabIds']();_0x5ea51c===_0x551c0c&&_0x51e8dc['length']>0x1&&this['activateTab'](_0x51e8dc['find'](_0xd15b18=>_0xd15b18!==_0x551c0c)),this['fire']('hide:'+_0x551c0c,_0x551c0c);}['_getPanel'](_0x1616b4){const _0x10829c=this['_tabs']['get'](_0x1616b4);return _0x10829c?_0x10829c['panel']:null;}['_showPanel'](_0x5a66cd){null!==this['activeTab']&&this['activeTab']!==_0x5a66cd||this['_getPanel'](_0x5a66cd)['show']();}['_hidePanel'](_0x13b655){const _0x1f8949=this['_getPanel'](_0x13b655);_0x1f8949['isVisible']&&(this['activeTab']===_0x13b655&&(this['activeTab']=null),_0x1f8949['hide']());}['_getButton'](_0x326d6e){const _0x406963=this['_tabs']['get'](_0x326d6e);return _0x406963?_0x406963['button']:null;}['_showButton'](_0x56cda0){this['_getButton'](_0x56cda0)['show']();}['_hideButton'](_0x2eee3a){this['_getButton'](_0x2eee3a)['hide']();}['_setupButton'](_0x386cd8){const _0x18ac74=new ia(this['locale'],{'side':this['side']}),_0x5e9276=this['buttonViews'];if(_0x18ac74['set']({'label':_0x386cd8['label'],'icon':_0x386cd8['icon'],'tooltip':!0x0,'withText':!0x0}),_0x18ac74['bind']('isOn')['to'](this,'activeTab',_0x5a743b=>_0x5a743b===_0x386cd8['id']),_0x18ac74['bind']('side')['to'](this,'side'),_0x386cd8['order']){const _0x1fd4c2=[...this['_tabs']]['reduce']((_0x1280b7,_0x9d5273)=>{const _0x37f3a0=_0x9d5273[0x0],{order:_0x51b094}=_0x9d5273[0x1];return!_0x51b094||_0x51b094>_0x386cd8['order']?_0x1280b7:_0x51b094>=_0x1280b7['order']?{'id':_0x37f3a0,'order':_0x51b094}:_0x1280b7;},{'id':'','order':0x0}),_0x23f8c6=_0x5e9276['getIndex'](this['_getButton'](_0x1fd4c2['id']));_0x5e9276['add'](_0x18ac74,_0x23f8c6+0x1);}else _0x5e9276['add'](_0x18ac74);return _0x18ac74['on']('execute',()=>{this['activateTab'](_0x386cd8['id']);}),_0x18ac74;}}const ni=['overlay','sidebar','custom'],oi=['left','right'];class hi extends ss{constructor(_0x558f43,_0x68d2d3={}){super(_0x558f43,_0x68d2d3),this['set']('type',_0x68d2d3['type']||'sidebar'),this['set']('side',_0x68d2d3['side']||'right'),this['set']('isVisible',_0x68d2d3['visibleByDefault']??!0x0);const _0x46223b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x46223b['if']('type','ck-ai-tabs__overlay',_0xc88ecd=>'overlay'===_0xc88ecd),_0x46223b['if']('type','ck-ai-tabs__sidebar',_0x242180=>'sidebar'===_0x242180),_0x46223b['if']('isVisible','ck-hidden',_0x314d4d=>!_0x314d4d)]}}),this['buttonViews']['on']('add',(_0x4cde39,_0x5c1c0a)=>{_0x5c1c0a['set']('withText',!0x1);});}}class it extends _0x4720c1{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3dc9bf){super(_0x3dc9bf);const _0x3a5a56=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x3a5a56)throw new _0x465bb5('ai-tabs-configuration-not-found');if(void 0x0!==_0x3a5a56['showResizeButton']&&(this['showResizeButton']=_0x3a5a56['showResizeButton']),'sidebar'!==_0x3a5a56['type']&&'overlay'!==_0x3a5a56['type']||_0x3a5a56['side']&&(this['side']=_0x3a5a56['side']),'sidebar'===_0x3a5a56['type']){if(this['container']=_0x3a5a56['element'],this['set']('type','sidebar'),!this['container'])throw new _0x465bb5('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x3a5a56['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===_0x3a5a56['visibleByDefault']||_0x3a5a56['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 _0x2dbc4d&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x3ee389){if(_0x3ee389&&this['type']!==_0x3ee389){if(!ni['includes'](_0x3ee389))throw new _0x465bb5('ai-tabs-unsupported-ui-type');this['type']=_0x3ee389;}}['switchSide'](_0x511378){if(_0x511378&&this['side']!==_0x511378){if(!oi['includes'](_0x511378))throw new _0x465bb5('ai-tabs-unsupported-ui-side');this['side']=_0x511378;}}['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 tt extends _0x4720c1{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x528d07){super(_0x528d07),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 _0x15853f=this['context']['plugins']['get']('CloudServices');if(!_0x15853f['token'])throw new _0x465bb5('ai-missing-token',this);this['_token']=_0x15853f['token'];}['startConversation'](_0x5e427e,_0x1ab7e1){const _0x12ae22=this['_sendApiRequest']('/conversations','POST',{'id':_0x5e427e,'group':_0x1ab7e1});return{'getConversation':async()=>(await _0x12ae22['request'])['json'](),'abortController':_0x12ae22['abortController']};}['queryAssistant']({message:_0xf5d8a7,conversationId:_0x4208a1,parts:_0xcf63ce,capabilities:_0x1eb998,model:_0x2e4602,attributes:_0x227889}){const _0x1304a1={'prompt':_0xf5d8a7,'content':_0xcf63ce,'model':_0x2e4602,..._0x1eb998&&{'capabilities':_0x1eb998},..._0x227889&&{'attributes':_0x227889}},_0x4ed283=this['_sendApiRequest']('/conversations/'+_0x4208a1+'/messages','POST',_0x1304a1);return{'getStream':async()=>{const _0x55bd67=(await _0x4ed283['request'])['body'];return this['_getStreamReader'](_0x55bd67);},'abortController':_0x4ed283['abortController']};}['executeCustomAction']({content:_0x4b8647,message:_0x3cd0ce,model:_0x58a6c3,outputFormat:_0x1c2f6b}){const _0x50776b={'content':[{'type':'text','content':_0x4b8647}],'prompt':_0x3cd0ce,'model':_0x58a6c3,'outputFormat':_0x1c2f6b},_0x4957d7=this['_sendApiRequest']('/actions/custom/calls','POST',_0x50776b);return{'getStream':async()=>{const _0x222ea6=(await _0x4957d7['request'])['body'];return this['_getStreamReader'](_0x222ea6);},'abortController':_0x4957d7['abortController']};}['executeAction']({actionName:_0xe45af1,content:_0x23cb98,args:_0x2ef8e3}){const _0x2f4929={'content':[{'type':'text','content':_0x23cb98}],'args':_0x2ef8e3},_0x1a86e0=this['_sendApiRequest']('/actions/system/'+_0xe45af1+'/calls','POST',_0x2f4929);return{'getStream':async()=>{const _0x13dc88=(await _0x1a86e0['request'])['body'];return this['_getStreamReader'](_0x13dc88);},'abortController':_0x1a86e0['abortController']};}['uploadFile'](_0x2b0448,_0x45b990,_0x1d6216){const _0x5d9aa8=new FormData();_0x5d9aa8['append']('file',_0x45b990,_0x45b990['name']),_0x1d6216&&_0x5d9aa8['append']('attributes',JSON['stringify'](_0x1d6216));const _0x3b5acd=this['_sendApiRequest']('/conversations/'+_0x2b0448+'/files','POST',_0x5d9aa8);return{'getId':async()=>(await _0x3b5acd['request'])['json'](),'abortController':_0x3b5acd['abortController']};}['fetchDocument'](_0x3eee8c,_0x26a5df){const _0x346a66=this['_sendApiRequest']('/conversations/'+_0x3eee8c+'/documents/'+_0x26a5df,'GET');return{'getDocument':async()=>(await _0x346a66['request'])['json'](),'abortController':_0x346a66['abortController']};}['uploadDocument'](_0x2fa508,_0x2c0a86,_0x394a9a){const _0x595c60={'content':_0x2c0a86};_0x394a9a&&(_0x595c60['attributes']=_0x394a9a);const _0xfa4bcd=this['_sendApiRequest']('/conversations/'+_0x2fa508+'/documents','POST',_0x595c60);return{'getId':async()=>(await _0xfa4bcd['request'])['json'](),'abortController':_0xfa4bcd['abortController']};}['fetchConversations'](_0x5a03fb,_0x28eafb={}){const _0x38d37b=new URLSearchParams();_0x38d37b['append']('group',_0x5a03fb),_0x38d37b['append']('excludeEmpty',!0x1!==_0x28eafb['excludeEmpty']?'true':'false'),_0x38d37b['append']('limit',_0x28eafb['limit']?_0x28eafb['limit']['toString']():'100'),_0x38d37b['append']('sortBy',_0x28eafb['sortBy']?_0x28eafb['sortBy']:'createdAt'),_0x38d37b['append']('order',_0x28eafb['order']?_0x28eafb['order']:'desc');const _0x545521=this['_sendApiRequest']('/conversations?'+_0x38d37b['toString'](),'GET');return{'getConversations':async()=>{const _0x5c6ad3=await _0x545521['request'];return(await _0x5c6ad3['json']())['items'];},'abortController':_0x545521['abortController']};}['deleteConversation'](_0x34df11){const _0x2e0001=this['_sendApiRequest']('/conversations/'+_0x34df11,'DELETE');return{'execute':async()=>{await _0x2e0001['request'];},'abortController':_0x2e0001['abortController']};}['updateConversation'](_0x5d163c,_0x161a2c){const _0x474318=this['_sendApiRequest']('/conversations/'+_0x5d163c,'PATCH',_0x161a2c);return{'getResult':async()=>(await _0x474318['request'],_0x161a2c),'abortController':_0x474318['abortController']};}['fetchConversation'](_0x515d87){const _0x6bd02=this['_sendApiRequest']('/conversations/'+_0x515d87,'GET');return{'getConversation':async()=>(await _0x6bd02['request'])['json'](),'abortController':_0x6bd02['abortController']};}['fetchConversationMessages'](_0x26efca){const _0x3d72a6=this['_sendApiRequest']('/conversations/'+_0x26efca+'/messages','GET');return{'getMessages':async()=>{const _0x2f6898=await _0x3d72a6['request'];return(await _0x2f6898['json']())['items'];},'abortController':_0x3d72a6['abortController']};}['uploadUrl'](_0x3a11c3,_0x241e60,_0x1dafd5){const _0x6d63e6=this['_sendApiRequest']('/conversations/'+_0x3a11c3+'/web-resources','POST',{'url':_0x241e60,'attributes':_0x1dafd5});return{'getId':async()=>(await _0x6d63e6['request'])['json'](),'abortController':_0x6d63e6['abortController']};}['getModels'](_0x10e31e='en'){const _0x258228=new URLSearchParams();_0x258228['append']('language',_0x10e31e);const _0x220b4c='/models/1?'+_0x258228['toString'](),_0x1b39c3=this['_sendApiRequest'](_0x220b4c,'GET');return{'list':async()=>await(await _0x1b39c3['request'])['json'](),'abortController':_0x1b39c3['abortController']};}['deleteFile'](_0x3614ca,_0x232443){const _0x5557c2=this['_sendApiRequest']('/conversations/'+_0x3614ca+'/files/'+_0x232443,'DELETE');return{'execute':async()=>{await _0x5557c2['request'];},'abortController':_0x5557c2['abortController']};}['deleteDocument'](_0x41bc96,_0x3d0eac){const _0x370433=this['_sendApiRequest']('/conversations/'+_0x41bc96+'/documents/'+_0x3d0eac,'DELETE');return{'execute':async()=>{await _0x370433['request'];},'abortController':_0x370433['abortController']};}['deleteWebResource'](_0x431b1a,_0xf04412){const _0x3dd13f=this['_sendApiRequest']('/conversations/'+_0x431b1a+'/web-resources/'+_0xf04412,'DELETE');return{'execute':async()=>{await _0x3dd13f['request'];},'abortController':_0x3dd13f['abortController']};}['callSystemReview']({reviewName:_0x5b3f7f,content:_0x3adae6,args:_0x4a2fdb}){const _0x12ba23=this['_sendApiRequest']('/reviews/system/'+_0x5b3f7f+'/calls','POST',{'content':[{'type':'text','content':_0x3adae6}],'args':_0x4a2fdb});return{'getStream':async()=>{const _0x247260=(await _0x12ba23['request'])['body'];return this['_getStreamReader'](_0x247260);},'abortController':_0x12ba23['abortController']};}['callCustomReview']({content:_0x29d20c,prompt:_0x1ed3dc,model:_0x4eed5f}){const _0x30919a=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x29d20c}],'prompt':_0x1ed3dc,'model':_0x4eed5f});return{'getStream':async()=>{const _0x1fc39e=(await _0x30919a['request'])['body'];return this['_getStreamReader'](_0x1fc39e);},'abortController':_0x30919a['abortController']};}['upsertAIChatRating'](_0x40f33c,_0x3deee2,_0x4b3041){const _0x36fd07=this['_sendApiRequest']('/conversations/'+_0x40f33c+'/messages/'+_0x3deee2+'/ratings','PUT',{'positiveCount':_0x4b3041['positiveCount'],'totalCount':_0x4b3041['totalCount'],'modificationId':_0x4b3041['modificationId']});return{'execute':async()=>{await _0x36fd07['request'];},'abortController':_0x36fd07['abortController']};}['upsertAIActionRating'](_0x49f102,_0x58e680,_0x3c1fb3){const _0x58fbaf=this['_sendApiRequest']('/actions/system/'+_0x49f102+'/calls/'+_0x58e680+'/ratings','PUT',{'positiveCount':_0x3c1fb3['positiveCount'],'totalCount':_0x3c1fb3['totalCount']});return{'execute':async()=>{await _0x58fbaf['request'];},'abortController':_0x58fbaf['abortController']};}['upsertCustomAIActionRating'](_0xe49394,_0x1e74cd){const _0x28b587=this['_sendApiRequest']('/actions/custom/calls/'+_0xe49394+'/ratings','PUT',{'positiveCount':_0x1e74cd['positiveCount'],'totalCount':_0x1e74cd['totalCount']});return{'execute':async()=>{await _0x28b587['request'];},'abortController':_0x28b587['abortController']};}['upsertAIReviewRating'](_0x1d814,_0x28d033,_0x12c07f,_0x26bc0d){const _0x265ea9=this['_sendApiRequest']('/reviews/system/'+_0x1d814+'/calls/'+_0x28d033+'/ratings','PUT',{'positiveCount':_0x12c07f['positiveCount'],'totalCount':_0x12c07f['totalCount'],'dataId':_0x26bc0d});return{'execute':async()=>{await _0x265ea9['request'];},'abortController':_0x265ea9['abortController']};}['upsertCustomAIReviewRating'](_0x1bbc04,_0x4af787,_0x5027bf){const _0x68cac0=this['_sendApiRequest']('/reviews/custom/calls/'+_0x1bbc04+'/ratings','PUT',{'positiveCount':_0x4af787['positiveCount'],'totalCount':_0x4af787['totalCount'],'dataId':_0x5027bf});return{'execute':async()=>{await _0x68cac0['request'];},'abortController':_0x68cac0['abortController']};}['_sendApiRequest'](_0xd5ada8,_0x40d034,_0x4ee81d){const _0xa3c6f4=new AbortController(),_0x4f5ac5=_0x4ee81d instanceof FormData,_0x7bb5d3={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x4ee81d&&!_0x4f5ac5&&(_0x7bb5d3['Content-Type']='application/json');const _0xa0b56a={'method':_0x40d034,'headers':_0x7bb5d3,'signal':_0xa3c6f4['signal']};return _0x4ee81d&&(_0xa0b56a['body']=_0x4f5ac5?_0x4ee81d:JSON['stringify'](_0x4ee81d)),{'request':fetch(''+this['_apiUrl']+_0xd5ada8,_0xa0b56a)['catch'](_0x4f1963=>{this['_handleError'](_0x4f1963);})['then'](_0x3b8123=>_0x3b8123['ok']?_0x3b8123:_0x3b8123['json']()['then'](_0x1aae02=>{throw{'url':this['_apiUrl'],'path':_0xd5ada8,'method':_0x40d034,'body':_0x4ee81d,'status':(_0x3b8123||{})['status'],'statusText':(_0x3b8123||{})['statusText'],'code':_0x1aae02['code'],'message':_0x1aae02['message'],'traceId':_0x1aae02['traceId']};})),'abortController':_0xa3c6f4};}async*['_getStreamReader'](_0x3033b7){const _0x48bcc2=[],_0xd6319d=_0x3033b7['getReader'](),_0x58634f=$t({'onError':_0x56b7ba=>{this['_handleError'](_0x56b7ba);},'onEvent':_0x4f77b6=>{_0x4f77b6['data']=JSON['parse'](_0x4f77b6['data']),_0x48bcc2['push'](_0x4f77b6);}});try{let _0x225776=!0x1;for(;!_0x225776;){const {done:_0x1307dc,value:_0x1585de}=await _0xd6319d['read']();_0x1307dc&&(_0x225776=!0x0),_0x58634f['feed'](this['_decoder']['decode'](_0x1585de,{'stream':!0x0})),yield*_0x48bcc2,_0x48bcc2['length']=0x0;}}catch(_0x226e4f){this['_handleError'](_0x226e4f);}finally{_0xd6319d['releaseLock'](),_0x58634f['reset']();}}['_handleError'](_0x288807){if(_0x288807 instanceof _0x465bb5)throw _0x288807;if(_0x288807 instanceof Error&&'AbortError'===_0x288807['name'])throw new _0x465bb5('ai-request-aborted',this,{'originalError':_0x288807});throw new _0x465bb5('ai-request-failed',this,{'originalError':_0x288807});}}function i(_0x9ca5ee,_0x1dbbac,_0x176e97){const t=_0x9ca5ee['t'];switch(_0x1dbbac){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'},_0x176e97);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.'},_0x176e97);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.'},_0x176e97);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.'},_0x176e97);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'},_0x176e97);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x176e97);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'},_0x176e97);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.'},_0x176e97);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.'},_0x176e97);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.'},_0x176e97);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.'},_0x176e97);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'},_0x176e97);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.'},_0x176e97);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 _0x1dbbac;}}function us(_0x2b076c,_0x57865c){const _0x34ae30=new _0x33ce64(_0x2b076c),_0x3ccb25=i(_0x2b076c,'AI_TABS_LABEL_MINIMIZE'),_0x4d5264=i(_0x2b076c,'AI_TABS_LABEL_MAXIMIZE');return _0x34ae30['set']({'withText':!0x1,'icon':_0x946806,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0x34ae30['bind']('label')['to'](_0x57865c,'isMaximized',_0xbf759c=>_0xbf759c?_0x3ccb25:_0x4d5264),_0x34ae30['bind']('icon')['to'](_0x57865c,'isMaximized',_0x338623=>_0x338623?_0xb43bd2:_0x946806),_0x34ae30['bind']('isOn')['to'](_0x57865c,'isMaximized'),_0x34ae30['on']('execute',()=>{_0x57865c['fire']('resizeTabs');}),_0x34ae30;}function qi(_0x557e74){return _0x394da0(_0x557e74);}function pt(_0x302b1c){return _0xdda3ad(_0x302b1c);}function It(_0x2e6ea7,_0x4fcf6b,_0x49e861){const _0x2903c1=null!==_0x4fcf6b?_0x3386f9=>_0x3386f9['attribs'][_0x2e6ea7]===_0x4fcf6b:_0x19030c=>Boolean(_0x19030c['attribs'][_0x2e6ea7]);return gt(_0x105e31=>_0x3514bb(_0x105e31)&&_0x2903c1(_0x105e31),_0x49e861);}function Qi(_0x2247ce,_0x1a0c9e,_0x57a547){const _0x27b105=null!==_0x1a0c9e?_0x1d836b=>_0x1d836b['attribs'][_0x2247ce]===_0x1a0c9e:_0x277d37=>Boolean(_0x277d37['attribs'][_0x2247ce]);return _0x16c5de(_0x5b1628=>_0x3514bb(_0x5b1628)&&_0x27b105(_0x5b1628),_0x57a547);}function ut(_0x20e7aa,_0x5ac742){return _0x20e7aa&&_0x3514bb(_0x20e7aa)?_0x20e7aa['attribs'][_0x5ac742]:null;}function Is(_0x4b2ef9,_0x54cb42,_0x1be9a3){_0x3514bb(_0x4b2ef9)&&(null===_0x1be9a3?delete _0x4b2ef9['attribs'][_0x54cb42]:_0x4b2ef9['attribs'][_0x54cb42]=_0x1be9a3);}function $i(_0x502a6d,_0x5886ec,_0x32ea77){const _0x3f8205=_0x5886ec['cloneNode'](!0x0);'beforebegin'===_0x32ea77?_0x4f4de1(_0x502a6d,_0x3f8205):'afterbegin'===_0x32ea77?_0x4803eb(_0x502a6d,_0x3f8205):'beforeend'===_0x32ea77?_0x4e905e(_0x502a6d,_0x3f8205):'afterend'===_0x32ea77&&_0x4ef11d(_0x502a6d,_0x3f8205);}function Wi(_0x5312b5){const _0x145bff=[];let _0x4faffe=_0x5312b5;for(;_0x4faffe;)_0x4faffe=_0x5b34f2(_0x4faffe),_0x4faffe&&_0x145bff['push'](_0x4faffe);return _0x145bff;}function Kn(_0x5cda1f){return _0x5cda1f['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function vs(_0x192301){let _0x560634=0x0;for(;_0x192301['parentNode'];)_0x192301=_0x192301['parentNode'],_0x560634++;return _0x560634;}function xs(_0x522f91){const _0x52292c=[];let _0x15492c=_0x522f91['nextSibling'];for(;_0x15492c;)_0x52292c['push'](_0x15492c),_0x15492c=_0x15492c['nextSibling'];_0x52292c['forEach'](_0x1d30ba=>{_0x35ad72(_0x1d30ba);});}class Fi extends/* #__PURE__ -- @preserve */
25
+ ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x5e6152();}['convertMarkdownToHTML'](_0x47967b){const _0x53391d=this['_m2html']['parse'](_0x47967b);return this['parseAndNormalizeHTML'](_0x53391d);}['parseAndNormalizeHTML'](_0x974402){return this['_parseHTML'](_0x974402);}['_parseHTML'](_0x15ea08){const _0x3d20b0=qi('<dummy>'+_0x15ea08['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x3d20b0['children']=_0x3d20b0['children'][0x0]['children'],_0x3d20b0;}}class Ji extends/* #__PURE__ -- @preserve */
26
+ ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x9d4158){super(),this['_generateUid']=_0x9d4158||_0x41685d;}['merge'](_0x35194d,_0x1ac13b,_0x5b7671){const _0x44fe13=_0x35194d['cloneNode'](!0x0);if(0x0===_0x1ac13b['childNodes']['length']){const _0x5773fc=[];return Qi('data-id','new-element',_0x44fe13)['forEach'](_0x293f27=>{const _0x17a2dc=this['_generateUid']();Is(_0x293f27,'data-id',_0x17a2dc),_0x5773fc['push'](_0x17a2dc);}),this['_removeSpecialComments'](_0x44fe13),{'parsedContent':_0x44fe13,'newNodeIds':_0x5773fc,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x5b7671&&_0x5b7671['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x44fe13),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Qi('data-id',null,_0x1ac13b)['map'](_0x41dc5a=>ut(_0x41dc5a,'data-id'))['filter'](_0x49287d=>!!_0x49287d));let _0x19628d=-0x1,_0x2326dc=!0x1;const _0x1017ef=_0x44fe13['childNodes'],_0x4b0faf=Array['from'](_0x1017ef)['filter'](_0x3cca23=>!(0x3===_0x3cca23['nodeType']&&''===pt(_0x3cca23)['trim']())),_0x59ed41=_0x4b0faf['length'];for(let _0x3a4c9c=0x0;_0x3a4c9c<_0x59ed41;_0x3a4c9c++){const _0x55a121=_0x4b0faf[_0x3a4c9c],_0x2048ae=_0x4b0faf[_0x3a4c9c+0x1];if(this['_isNewNode'](_0x55a121)){if(-0x1===_0x19628d&&(_0x19628d=_0x3a4c9c),this['_markWrappedElements'](_0x55a121),!this['_isNewNode'](_0x2048ae)){const [_0x2e31f6,_0x2ce591]=this['_findReferenceNode'](_0x55a121,_0x2326dc,_0x1ac13b);if(_0x2e31f6){const _0x36e492=Array['from'](_0x4b0faf)['slice'](_0x19628d,_0x3a4c9c+0x1);this['_insertNodes'](_0x2e31f6,_0x36e492,_0x2ce591),_0x19628d=-0x1;}}}else{if(this['_isExistingContentComment'](_0x55a121))_0x2326dc=!0x0;else{if(this['_isExistingNode'](_0x55a121)){const _0x15b393=ut(_0x55a121,'data-id');if(_0x15b393&&this['_existingDataIds']['has'](_0x15b393)){const _0x422bde=It('data-id',_0x15b393,_0x1ac13b);this['_replaceNode'](_0x422bde,_0x55a121);}if(this['_touchedNodesState']['removedIds']['includes'](_0x15b393)){const _0x511d88=this['_touchedNodesState']['removedIds']['indexOf'](_0x15b393);this['_touchedNodesState']['removedIds']['splice'](_0x511d88,0x1);}}else{if(this['_isDelNode'](_0x55a121)){const _0x4312e7=ut(_0x55a121,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x4312e7)||this['_storeDeletedElementIds'](_0x55a121);}}}}}for(const _0x349ffb of this['_touchedNodesState']['removedIds']){const _0x4fe7ac=It('data-id',_0x349ffb,_0x1ac13b);if(_0x4fe7ac){if(_0x5b7671&&_0x5b7671['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x349ffb;const _0x1226d4=_0x5b7671['replaceRemovedWith']['cloneNode'](!0x0);Is(_0x1226d4,'data-id',_0x349ffb),Is(_0x1226d4,'data-removed','true'),_0xd026bc(_0x4fe7ac,_0x1226d4);}else _0x35ad72(_0x4fe7ac);}}if(Qi('data-wrapped-id',null,_0x1ac13b)['forEach'](_0x44e557=>{const _0x55175c=It('data-id',ut(_0x44e557,'data-wrapped-id'),_0x1ac13b);var _0x56229a,_0x179761;_0x55175c&&(_0x179761=_0x44e557,_0x35ad72(_0x56229a=_0x55175c),_0xd026bc(_0x179761,_0x56229a));}),Qi('data-id','new-element',_0x1ac13b)['forEach'](_0x219719=>{const _0x483db1=this['_getUid'](_0x219719);Is(_0x219719,'data-id',_0x483db1),this['_touchedNodesState']['newIds']['push'](_0x483db1);}),this['_removeSpecialComments'](_0x1ac13b),_0x5b7671&&_0x5b7671['markUnstableElements']&&this['_markUnstableElements'](_0x1ac13b,_0x5b7671['markUnstableElementsDepth']||0x0),_0x5b7671&&_0x5b7671['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x41792d=It('data-id',this['_touchedNodesState']['lastTouchedId'],_0x1ac13b);for(;_0x41792d;)xs(_0x41792d),_0x41792d=_0x41792d['parentNode'];}return{'parsedContent':_0x1ac13b,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x28526b,_0xe9aed2,_0x270b1e){for(const _0x3092db of _0xe9aed2){const _0xcf0d78=this['_getUid'](_0x3092db);Is(_0x3092db,'data-id',_0xcf0d78),this['_touchedNodesState']['newIds']['push'](_0xcf0d78),this['_touchedNodesState']['lastTouchedId']=_0xcf0d78;}const _0x5f2c6e='afterbegin'===_0x270b1e||'afterend'===_0x270b1e?_0xe9aed2['reverse']():_0xe9aed2;for(const _0x1036c0 of _0x5f2c6e)$i(_0x28526b,_0x1036c0,_0x270b1e);}['_replaceNode'](_0x5581c1,_0x2b051c){if(!_0x5581c1)return;if(_0x413ce3=_0x2b051c,Kn(pt(_0x5581c1))===Kn(pt(_0x413ce3)))return;var _0x413ce3;const _0x4894b2=this['_getUid'](_0x5581c1);Is(_0x2b051c,'data-id',_0x4894b2),this['_touchedNodesState']['modifiedIds']['push'](_0x4894b2),this['_touchedNodesState']['lastTouchedId']=_0x4894b2,_0xd026bc(_0x5581c1,_0x2b051c['cloneNode'](!0x0));}['_findReferenceNode'](_0x124fc9,_0x2c5cab,_0x50b101){const _0x3fa7f5=this['_findPrevElementWithDataId'](_0x124fc9,!0x1);if(_0x3fa7f5){const _0x106e19=this['_getNodeDataId'](_0x3fa7f5),_0x4c8906=It('data-id',_0x106e19,_0x50b101);if(_0x4c8906)return[_0x4c8906,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x106e19);}const _0xff073d=this['_findNextElementWithDataId'](_0x124fc9,!0x1);if(_0xff073d){const _0x34107e=this['_getNodeDataId'](_0xff073d),_0x48e37b=It('data-id',_0x34107e,_0x50b101);if(_0x48e37b)return[_0x48e37b,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x34107e);}return _0x2c5cab?_0x124fc9['nextSibling']?this['_findFallbackReferenceNode'](_0x124fc9,_0x50b101):[_0x50b101['childNodes'][_0x50b101['childNodes']['length']-0x1],'afterend']:[_0x50b101['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x530715,_0x42cea3){const _0x1b3808=[],_0x13ee9d=this['_findPrevElementWithDataId'](_0x530715,!0x0);if(_0x13ee9d){const _0x193d0b=It('data-id',this['_getNodeDataId'](_0x13ee9d),_0x42cea3);_0x193d0b&&_0x1b3808['push']([_0x193d0b,'afterend']);}const _0x21853b=this['_findNextElementWithDataId'](_0x530715,!0x0);if(_0x21853b){const _0x516f8d=It('data-id',this['_getNodeDataId'](_0x21853b),_0x42cea3);_0x516f8d&&_0x1b3808['push']([_0x516f8d,'beforebegin']);}if(_0x1b3808['length']>0x1)return vs(_0x1b3808[0x0][0x0])<=vs(_0x1b3808[0x1][0x0])?_0x1b3808[0x0]:_0x1b3808[0x1];return 0x1===_0x1b3808['length']?_0x1b3808[0x0]:[_0x42cea3['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x59fa55,_0x46891b){let _0x2b8fee=_0x59fa55['nextSibling'],_0x2d1e2b=null,_0x45ac78=!0x1;for(;_0x2b8fee;){if(_0x291049(_0x2b8fee)){if(this['_isDelNode'](_0x2b8fee)&&(_0x2d1e2b=_0x2b8fee),this['_isExistingContentComment'](_0x2b8fee)&&_0x46891b&&!_0x45ac78){_0x45ac78=!0x0,_0x2b8fee=_0x2b8fee['nextSibling'];continue;}break;}const _0x51d654=ut(_0x2b8fee,'data-id');if(_0x51d654&&'new-element'!==_0x51d654&&this['_existingDataIds']['has'](_0x51d654)){_0x2d1e2b=_0x2b8fee;break;}_0x2b8fee=_0x2b8fee['nextSibling'];}return _0x2d1e2b;}['_findPrevElementWithDataId'](_0x10aa6b,_0x22b544){let _0x68cdc=_0x10aa6b['previousSibling'],_0x5920e6=null,_0xd1f7fe=!0x1;for(;_0x68cdc;){if(_0x291049(_0x68cdc)){if(this['_isDelNode'](_0x68cdc)&&(_0x5920e6=_0x68cdc),this['_isExistingContentComment'](_0x68cdc)&&_0x22b544&&!_0xd1f7fe){_0xd1f7fe=!0x0,_0x68cdc=_0x68cdc['previousSibling'];continue;}break;}const _0x2da5d9=ut(_0x68cdc,'data-id');if(_0x2da5d9&&'new-element'!==_0x2da5d9&&this['_existingDataIds']['has'](_0x2da5d9)){_0x5920e6=_0x68cdc;break;}_0x68cdc=_0x68cdc['previousSibling'];}return _0x5920e6;}['_markWrappedElements'](_0x2bb3f1){_0x3514bb(_0x2bb3f1)&&Qi('data-id',null,_0x2bb3f1)['forEach'](_0x14af49=>{this['_isExistingNode'](_0x14af49)&&!this['_hasWrappedParent'](_0x14af49)&&(Is(_0x14af49,'data-wrapped-id',ut(_0x14af49,'data-id')),Is(_0x14af49,'data-id',null));});}['_getNodeDataId'](_0x21e8b4){if(!_0x21e8b4)return null;if(_0x3514bb(_0x21e8b4))return ut(_0x21e8b4,'data-id');if(_0x291049(_0x21e8b4)){const _0x4635a0=pt(_0x21e8b4)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x4635a0&&_0x4635a0[0x1])return _0x4635a0[0x1];}return null;}['_storeDeletedElementIds'](_0x2aff7f){if(_0x291049(_0x2aff7f)){const _0x566473=pt(_0x2aff7f)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x566473&&_0x566473[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x566473[0x1]);}}['_getUid'](_0x2f2811){return this['_isExistingNode'](_0x2f2811)?ut(_0x2f2811,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x56c3ad){(function(_0x4b9ad3){return _0x437245(_0x294ec3=>_0x291049(_0x294ec3),_0x4b9ad3,!0x0,0x1/0x0);}(_0x56c3ad)['filter'](_0x9f2dc9=>this['_isDelNode'](_0x9f2dc9)||this['_isExistingContentComment'](_0x9f2dc9))['forEach'](_0x27ba5a=>{_0x35ad72(_0x27ba5a);}));}['_markLastTagElementUnstable'](_0xf21281){const _0x31d0fa=_0xf21281['childNodes'],_0x2bfd4e=_0x31d0fa[_0x31d0fa['length']-0x1];_0x2bfd4e&&_0x3514bb(_0x2bfd4e)&&Is(_0x2bfd4e,'data-unstable','true');}['_markUnstableElements'](_0x67161c,_0x5143a6){const _0x1f6732=It('data-unstable','true',_0x67161c);if(!_0x1f6732)return;const _0x5e0a25=Wi(_0x1f6732)['slice'](0x0,-0x1),_0x41ae49=_0x5e0a25['length'];let _0x5dd876=_0x1f6732;if(_0x41ae49>_0x5143a6){let _0x4ebf75=_0x41ae49,_0x168945=null;for(;_0x4ebf75>_0x5143a6&&_0x4ebf75>=0x0;)_0x4ebf75--,_0x168945=_0x5e0a25[_0x4ebf75];_0x168945&&(_0x5dd876=_0x168945,Is(_0x1f6732,'data-unstable',null),Is(_0x168945,'data-unstable','true'));}else{if(_0x41ae49<_0x5143a6){let _0x2a517d=_0x41ae49,_0x3dd57c=_0x1f6732;for(;_0x2a517d<_0x5143a6;){const _0x3e34d3=_0x3dd57c['childNodes']['filter'](_0x316751=>_0x3514bb(_0x316751));if(0x0===_0x3e34d3['length'])break;_0x2a517d++,_0x3dd57c=_0x3e34d3[_0x3e34d3['length']-0x1];}_0x3dd57c&&(_0x5dd876=_0x3dd57c,Is(_0x1f6732,'data-unstable',null),Is(_0x3dd57c,'data-unstable','true'));}}let _0x24da1c=_0x5dd876;for(;_0x24da1c;){for(;_0x24da1c['nextSibling'];)_0x24da1c=_0x24da1c['nextSibling'],_0x3514bb(_0x24da1c)&&Is(_0x24da1c,'data-unstable','true');_0x24da1c=_0x24da1c['parentNode'];}}['_isNewNode'](_0x4d1897){return Boolean('new-element'===ut(_0x4d1897,'data-id'));}['_isExistingNode'](_0x450a4b){return Boolean((ut(_0x450a4b,'data-id')||'')['length']>0x0&&'new-element'!==ut(_0x450a4b,'data-id'));}['_isDelNode'](_0x1110e0){return!!_0x1110e0&&Boolean(_0x291049(_0x1110e0)&&pt(_0x1110e0)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x59d52d){let _0x277c50=_0x59d52d['parentNode'];for(;_0x277c50;){if(ut(_0x277c50,'data-wrapped-id'))return!0x0;_0x277c50=_0x277c50['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x578c9c){return Boolean(_0x291049(_0x578c9c)&&pt(_0x578c9c)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function kt({editor:_0x41bedd,changeGroups:_0xe602f1,documentContextContent:_0x31950c,showDiff:_0xd8774,trimUnchanged:_0x3bfe08=!0x0}){return _0xe602f1['map'](_0x5b0a28=>{const _0x55f310=new _t([]),_0xc3eb5=new _t([]);for(const _0x3ee906 of _0x5b0a28['changes'])if(_0xd8774&&'removed'==_0x3ee906['type']||_0xc3eb5['children']['push'](_0x3ee906['node']['cloneNode'](!0x0)),'new'!=_0x3ee906['type']&&(_0xd8774||'removed'!=_0x3ee906['type'])){const _0x3ca2a5=gt(_0x9b2e8f=>ut(_0x9b2e8f,'data-id')==_0x3ee906['id'],_0x31950c,!0x0);_0x3ca2a5&&_0x55f310['children']['push'](_0x3ca2a5['cloneNode'](!0x0));}const {content:_0x23b8f5,hasChanges:_0x44a85a}=function(_0x1279a0,_0x57596c,_0x41ce92,_0x5c4cfa,_0x142c6a=!0x0){const _0x3cbeb4=_0x1279a0['plugins']['get']('DocumentCompare'),_0x1e069f=pt(_0x57596c),_0xb58e8e=pt(_0x41ce92),_0x3469fa=_0x1279a0['data']['parse'](_0x1e069f,'$root'),_0x4ad774=_0x1279a0['model']['createPositionAt'](_0x3469fa,0x0),_0x4ac91c=_0x3cbeb4['getDiff'](_0x1e069f,_0xb58e8e,{'anchor':_0x4ad774,'markDeletions':_0x5c4cfa}),_0x3454a8=_0x4ac91c['getOperations']();if(0x0==_0x3454a8['length'])return{'content':_0x57596c['cloneNode'](!0x0),'hasChanges':!0x1};_0x5c4cfa?function(_0x2e682e,_0x23f19d,_0x26cce5){if(0x0==_0x2e682e['length'])return;const _0x10f2ec=_0x26cce5['plugins']['get']('DocumentCompare'),_0x4a3ba6=_0x26cce5['plugins']['get']('SuggestionsConversion');_0x26cce5['model']['change'](_0x514558=>{const _0x4547e5=new Set();for(let _0x5a0ef9=0x0;_0x5a0ef9<_0x2e682e['length'];_0x5a0ef9++){const _0xc82166=_0x2e682e[_0x5a0ef9];if(_0xc82166['baseVersion']=null,_0xc82166['isDocumentOperation']=!0x1,_0x10f2ec['isMarkedRemoveOperation'](_0xc82166)){const _0x4c96f2=_0x365a20(_0xc82166['newRange'],_0x26cce5['model']),_0x3c7cfe='suggestion:deletion:'+_0x41685d()+':$aiSuggestion';_0x23f19d['markers']['set'](_0x3c7cfe,_0x4c96f2);}else switch(_0xc82166['type']){case'rename':{if(_0xc82166['oldName']==_0xc82166['newName'])break;_0x514558['batch']['addOperation'](_0xc82166),_0x26cce5['model']['applyOperation'](_0xc82166);const _0x39f4b0='$elementName',_0x17cd11=_0xc82166['position'],_0x52c28a=_0x26cce5['model']['createRange'](_0x17cd11,_0x26cce5['model']['createPositionAt'](_0x17cd11['nodeAfter'],'end')),_0x285773='suggestion:attribute:'+_0x39f4b0+':'+_0x41685d()+':$aiSuggestion';_0x23f19d['markers']['set'](_0x285773,_0x52c28a);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0xc82166['oldValue']==_0xc82166['newValue'])break;_0x514558['batch']['addOperation'](_0xc82166),_0x26cce5['model']['applyOperation'](_0xc82166);const _0x59eb51=_0xc82166['key'];if(!_0x4a3ba6['isRegisteredAttribute'](_0x59eb51))break;const _0x24804a=_0x365a20(_0xc82166['range'],_0x26cce5['model']),_0x4b42df='suggestion:attribute:'+_0x59eb51+':'+_0x41685d()+':$aiSuggestion';_0x23f19d['markers']['set'](_0x4b42df,_0x24804a);break;}case'insert':{_0x514558['batch']['addOperation'](_0xc82166),_0x26cce5['model']['applyOperation'](_0xc82166);if(_0x2e682e[_0x5a0ef9+0x1]&&'move'==_0x2e682e[_0x5a0ef9+0x1]['type']){no(_0x23f19d,_0xc82166);break;}const _0x35d4fc=_0xc82166['position'],_0x68d55b=_0xc82166['howMany'],_0x2b763d=_0x365a20(_0x26cce5['model']['createRange'](_0x35d4fc,_0x35d4fc['getShiftedBy'](_0x68d55b)),_0x26cce5['model']),_0x2ea031='suggestion:insertion:'+_0x41685d()+':$aiSuggestion';_0x23f19d['markers']['set'](_0x2ea031,_0x2b763d);break;}case'split':{_0x514558['batch']['addOperation'](_0xc82166),_0x26cce5['model']['applyOperation'](_0xc82166);const _0x1265eb=_0xc82166['splitPosition'],_0x3e4abf=_0xc82166['moveTargetPosition'],_0x347a43=_0x26cce5['model']['createRange'](_0x1265eb,_0x3e4abf),_0x3472fd='suggestion:insertion:'+_0x41685d()+':$aiSuggestion';_0x23f19d['markers']['set'](_0x3472fd,_0x347a43);break;}case'move':{_0x514558['batch']['addOperation'](_0xc82166),_0x26cce5['model']['applyOperation'](_0xc82166),_0x2e682e[_0x5a0ef9-0x1]&&'insert'==_0x2e682e[_0x5a0ef9-0x1]['type']&&no(_0x23f19d,_0xc82166);const _0xe8dc0b=_0xc82166['getMovedRangeStart'](),_0x33a2f8=_0xc82166['howMany'];for(let _0x1695df=0x0;_0x1695df<_0x33a2f8;_0x1695df++){const _0x338f45=_0xe8dc0b['getShiftedBy'](_0x1695df)['nodeAfter'];_0x4547e5['add'](_0x338f45);}break;}case'remove':{const _0x2b80a5=_0xc82166['sourcePosition'],_0x1eb791=_0xc82166['howMany'],_0x5b73fe=new lt(_0x2b80a5,_0x1eb791);_0x514558['batch']['addOperation'](_0x5b73fe),_0x26cce5['model']['applyOperation'](_0x5b73fe);break;}}}for(const _0x11b039 of _0x4547e5){const _0x2df536=_0x26cce5['model']['createRangeOn'](_0x11b039),_0x3f7ff1='suggestion:formatBlock:$fakeWrap:'+_0x41685d()+':$aiSuggestion';_0x23f19d['markers']['set'](_0x3f7ff1,_0x365a20(_0x2df536,_0x26cce5['model']));}});}(_0x3454a8,_0x3469fa,_0x1279a0):_0x1279a0['model']['change'](_0x1fc872=>{for(const _0x190c4d of _0x3454a8)if('remove'==_0x190c4d['type']){const _0x600ff8=_0x190c4d['sourcePosition'],_0x42ac21=_0x190c4d['howMany'],_0x563e6d=new lt(_0x600ff8,_0x42ac21);_0x1fc872['batch']['addOperation'](_0x563e6d),_0x1279a0['model']['applyOperation'](_0x563e6d);}else{if('marker'==_0x190c4d['type']){const _0x576d5f=_0x190c4d['name'],_0x188827=_0x190c4d['newRange'];null!==_0x188827?_0x3469fa['markers']['set'](_0x576d5f,_0x188827):_0x3469fa['markers']['delete'](_0x576d5f);}else _0x190c4d['baseVersion']=null,_0x190c4d['isDocumentOperation']=!0x1,_0x1fc872['batch']['addOperation'](_0x190c4d),_0x1279a0['model']['applyOperation'](_0x190c4d);}});if(_0x142c6a){const _0x387444=ct(_0x1279a0,_0x3454a8,_0x3469fa);ht(_0x1279a0['model'],_0x387444),function(_0xb35ae5,_0x59781f){const _0x24296f=_0x59781f['getFirstRange']()['start'];let _0x3cffd0=_0x59781f['getFirstRange']()['end'];const _0x3f9186=_0x24296f['root'];(_0x3cffd0['textNode']||_0x3cffd0['nodeAfter']&&_0x3cffd0['nodeAfter']['is']('$text'))&&(_0x1e6579(_0x3cffd0,'...'),_0x3cffd0=_0x3cffd0['getShiftedBy'](0x3)),(_0x24296f['textNode']||_0x24296f['nodeBefore']&&_0x24296f['nodeBefore']['is']('$text'))&&(_0x1e6579(_0x24296f,'...'),function(_0x308781,_0x16f22c,_0x139218){for(let [_0x250b22,_0x2a60d6]of _0x308781['markers']){const _0x326c2b=_0x2a60d6['_getTransformedByInsertion'](_0x16f22c,_0x139218,!0x1);_0x2a60d6=_0x326c2b[0x0],_0x308781['markers']['set'](_0x250b22,_0x2a60d6);}}(_0x3f9186,_0x24296f,0x3),_0x24296f['parent']==_0x3cffd0['parent']&&(_0x3cffd0=_0x3cffd0['getShiftedBy'](0x3)));const _0x2ea2b7=_0xb35ae5['createRange'](_0xb35ae5['createPositionAt'](_0x3f9186,0x0),_0x24296f),_0x27561e=_0xb35ae5['createRange'](_0x3cffd0,_0xb35ae5['createPositionAt'](_0x3f9186,'end')),_0x8a9dea=[..._0x2ea2b7['getMinimalFlatRanges'](),..._0x27561e['getMinimalFlatRanges']()];_0x8a9dea['reverse']();for(const _0x304eef of _0x8a9dea)to(_0x304eef),Yn(_0x3f9186,_0x304eef);}(_0x1279a0['model'],_0x387444);}const _0x36a483=_0x1279a0['data']['stringify'](_0x3469fa,{'showSuggestionHighlights':!0x0});return{'content':qi(_0x36a483),'hasChanges':!0x0};}(_0x41bedd,_0x55f310,_0xc3eb5,_0xd8774,_0x3bfe08);return{'type':_0x5b0a28['changes'][0x0]['type'],'index':_0x5b0a28['index'],'content':_0x23b8f5,'hasChanges':_0x44a85a};});}function no(_0x4f90ae,_0x466b0a){for(const [_0x34529d,_0x5e9a0a]of _0x4f90ae['markers']){const _0x1e7707=dt['_createFromRanges'](_0x5e9a0a['getTransformedByOperation'](_0x466b0a));_0x4f90ae['markers']['set'](_0x34529d,_0x1e7707);}}function ct(_0x2411a9,_0x1ecb48,_0x5754e5){const _0x84a91e=_0x2411a9['plugins']['get']('DocumentCompare');let _0x4225c1=_0x2411a9['model']['createPositionAt'](_0x5754e5,Number['POSITIVE_INFINITY']),_0x395d23=_0x2411a9['model']['createPositionAt'](_0x5754e5,0x0);for(const _0x3c3761 of _0x1ecb48){let _0x50c263,_0x3ace7a;if(_0x84a91e['isMarkedRemoveOperation'](_0x3c3761))_0x50c263=_0x3c3761['newRange']['start'],_0x3ace7a=_0x3c3761['newRange']['end'];else switch(_0x4225c1=_0x4225c1['getTransformedByOperation'](_0x3c3761),_0x395d23=_0x395d23['getTransformedByOperation'](_0x3c3761),_0x3c3761['type']){case'rename':_0x50c263=_0x3c3761['position'],_0x3ace7a=_0x50c263['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x50c263=_0x3c3761['range']['start'],_0x3ace7a=_0x3c3761['range']['end'];break;case'insert':_0x50c263=_0x3c3761['position'],_0x3ace7a=_0x50c263['getShiftedBy'](_0x3c3761['howMany']);break;case'split':_0x50c263=_0x3c3761['splitPosition'],_0x3ace7a=_0x3c3761['moveTargetPosition'];break;case'merge':{const _0x3af094=_0x3c3761['targetPosition']['path']['slice'](0x0,-0x1);_0x50c263=_0x2411a9['model']['createPositionFromPath'](_0x5754e5,_0x3af094),_0x3ace7a=_0x50c263['getShiftedBy'](0x1);break;}case'remove':{const _0x42c180=_0x3c3761['howMany'],_0x47b4ad=_0x3c3761['sourcePosition']['_getTransformedByInsertion'](_0x3c3761['targetPosition'],_0x42c180),_0x2e5ac3=_0x3c3761['getMovedRangeStart']();'remove'==_0x3c3761['type']?(_0x50c263=_0x47b4ad,_0x3ace7a=_0x47b4ad):(_0x50c263=_0x2e5ac3,_0x3ace7a=_0x2e5ac3['getShiftedBy'](_0x42c180));break;}}_0x50c263&&_0x50c263['isBefore'](_0x4225c1)&&(_0x4225c1=_0x50c263['clone'](),_0x4225c1['stickiness']='toNone'),_0x3ace7a&&_0x3ace7a['isAfter'](_0x395d23)&&(_0x395d23=_0x3ace7a['clone'](),_0x395d23['stickiness']='toNone');}return _0x2411a9['model']['createSelection'](_0x2411a9['model']['createRange'](_0x4225c1,_0x395d23));}function ht(_0x250702,_0xb74319){ro(_0x250702,_0xb74319,'forward');const _0x4208ce=_0xb74319['getFirstRange']();_0xb74319['setTo']([]),_0xb74319['setTo'](_0x4208ce,{'backward':!0x0}),ro(_0x250702,_0xb74319,'backward');}function ro(_0x67172c,_0x1f4158,_0x1bde8d){let _0x462d68=0x14;for(;_0x462d68;){_0x67172c['modifySelection'](_0x1f4158,{'unit':'word','direction':_0x1bde8d}),_0x462d68--;const _0x355495=_0x1f4158['focus']['forward'==_0x1bde8d?'nodeBefore':'nodeAfter'];if(_0x355495&&_0x355495['is']('element')&&_0x67172c['schema']['isBlock'](_0x355495)&&_0x67172c['schema']['isObject'](_0x355495))break;}}function Yn(_0x568a09,_0xd9d46c){for(const [_0x119be4,_0x3c4047]of _0x568a09['markers']){const _0x1edcfe=_0x3c4047['_getTransformedByDeletion'](_0xd9d46c['start'],_0xd9d46c['end']['offset']-_0xd9d46c['start']['offset']);null!=_0x1edcfe?_0x568a09['markers']['set'](_0x119be4,_0x1edcfe):_0x568a09['markers']['delete'](_0x119be4);}}class Gi extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _t([]);['parsedMergedContent']=new _t([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x26cf58,content:_0xa10410='',isDone:_0x2fb798=!0x1,interactionId:_0x53c032,areActionsDisabled:_0x490a4d,documentContextContent:_0x29d1c9,editor:_0x492397,id:_0x20e4bd}){super(),this['id']=_0x20e4bd||_0x41685d(),this['interactionId']=_0x53c032,this['type']=_0x26cf58,this['areActionsDisabled']=!!_0x490a4d,this['editor']=_0x492397,this['aiResponseParser']=new Fi(),this['aiResponseApplier']=new Ji(),this['documentContextContent']=qi(_0x29d1c9||''),this['set']('isDone',_0x2fb798),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0xa10410);}['appendContent'](_0x29a96f){this['set']('content',this['content']+_0x29a96f);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x53dad8,_0x5e39bd){this['changeGroups'][_0x53dad8]['state']=_0x5e39bd,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x53dad8,'state':_0x5e39bd});}['getContentParts']({showDiff:_0x300f7a,groupIndex:_0x42241c}){if(!this['editor'])throw new _0x465bb5('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x56057c=this['_getCachedContentParts'](_0x300f7a,_0x42241c);if(_0x56057c)return _0x56057c;let _0x42707e=[];if(void 0x0===_0x42241c)_0x42707e=this['changeGroups'];else{const _0x1c653c=this['changeGroups']['find'](({index:_0x37074c})=>_0x37074c===_0x42241c);if(!_0x1c653c)throw new _0x465bb5('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x42241c});_0x42707e=[_0x1c653c];}const _0xab5a66=kt({'editor':this['editor'],'showDiff':_0x300f7a,'changeGroups':_0x42707e,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x300f7a,_0xab5a66),_0xab5a66;}['_getCachedContentParts'](_0xb9679c,_0x5ca311){const _0x359623=_0xb9679c?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x359623]['length'])return null;const _0x1837d2=this['cachedSuggestionContentParts'][_0x359623];if(void 0x0===_0x5ca311)return _0x1837d2['length']>0x0&&_0x1837d2['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0xb9679c,null),null):_0x1cada5(_0x1837d2);{const _0x6f0f4c=_0x1837d2['find'](({index:_0x280b7f})=>_0x280b7f===_0x5ca311);if(_0x6f0f4c)return[_0x1cada5(_0x6f0f4c)];}return null;}['_setCachedContentParts'](_0x1a8993,_0x1725e1){const _0x39aeea=_0x1a8993?'withDiff':'withoutDiff';_0x1725e1?_0x1725e1['forEach'](_0x1546ae=>{const _0x454f88=this['cachedSuggestionContentParts'][_0x39aeea],_0x1ff524=_0x454f88['find'](({index:_0x517fd0})=>_0x517fd0===_0x1546ae['index']);if(_0x1ff524){const _0x34f983=_0x454f88['indexOf'](_0x1ff524);_0x454f88['splice'](_0x34f983,0x1,_0x1546ae);}else _0x454f88['push'](_0x1546ae);}):this['cachedSuggestionContentParts'][_0x39aeea]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x74379d=this['changeGroups'];this['updateChangeGroups']();const _0x5a45ae=this['_getDifferentChangeGroups'](_0x74379d,this['changeGroups']);(_0x5a45ae['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x5a45ae),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x4ab773,_0x3abea8){const _0x590b28=[];for(const _0x5ca47d of _0x3abea8){const _0x1e91d6=_0x4ab773[_0x5ca47d['index']];_0x1e91d6?_0x1e91d6['changes']['length']!==_0x5ca47d['changes']['length']?_0x590b28['push'](_0x5ca47d):_0x1e91d6['changes']['forEach']((_0x112d96,_0x101b64)=>{const _0x558d0e=_0x5ca47d['changes'][_0x101b64];_0x112d96['id']!==_0x558d0e['id']&&_0x590b28['push'](_0x5ca47d);}):_0x590b28['push'](_0x5ca47d);}return _0x590b28;}['updateChangeGroups'](){const _0x4aa2b2=new _0x4f7e65('p',{},[new _0x4f7e65('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x417ece(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x26523a=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x4aa2b2,'cutAfterLastChange':!this['isDone']});if(!_0x26523a['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x26523a['parsedContent'];let _0xcb1ac6=[];if(_0x16c5de(_0x4a37fc=>{const _0x58b984=ut(_0x4a37fc,'data-id');if(!_0x58b984||!_0x2f4517(_0x58b984))return!0x1;const _0xdb19cc=[_0x4a37fc,...Wi(_0x4a37fc)]['at'](-0x2);if(_0x4a37fc!=_0xdb19cc){const _0x3178d3=ut(_0xdb19cc,'data-id');_0x2f4517(_0x3178d3)||(_0xcb1ac6['push']({'node':_0xdb19cc,'id':_0x3178d3,'type':'modified'}),_0x26523a['modifiedNodeIds']['push'](_0x3178d3));}else _0x26523a['modifiedNodeIds']['includes'](_0x58b984)?_0xcb1ac6['push']({'node':_0x4a37fc,'type':'modified','id':_0x58b984}):_0x26523a['newNodeIds']['includes'](_0x58b984)?_0xcb1ac6['push']({'node':_0x4a37fc,'type':'new','id':_0x58b984,'anchorId':ut(_0x4a37fc['previousSibling'],'data-id')}):_0xcb1ac6['push']({'node':_0x4a37fc,'type':'removed','id':_0x58b984});return!0x0;},this['parsedMergedContent']),_0xcb1ac6=_0xcb1ac6['filter'](({node:_0x672122})=>[...Wi(_0x672122),_0x672122]['every'](_0x1b1875=>!ut(_0x1b1875,'data-unstable'))),0x0==_0xcb1ac6['length'])return;const _0x3fdacb=[[_0xcb1ac6[0x0]]];for(let _0x2ee9ff=0x1;_0x2ee9ff<_0xcb1ac6['length'];_0x2ee9ff++){const _0x1e802f=_0x3fdacb[_0x3fdacb['length']-0x1],_0x5b9296=_0x1e802f[_0x1e802f['length']-0x1];_0xcb1ac6[_0x2ee9ff]['node']['previousSibling']==_0x5b9296['node']&&'modified'!=_0xcb1ac6[_0x2ee9ff]['type']&&'modified'!=_0x5b9296['type']?_0x1e802f['push'](_0xcb1ac6[_0x2ee9ff]):_0x3fdacb['push']([_0xcb1ac6[_0x2ee9ff]]);}for(const _0x4d4e6e of _0x3fdacb){const _0x4d3287=_0x4d4e6e[0x0],_0x35d0b1=_0x4d4e6e[_0x4d4e6e['length']-0x1],_0x3ea44f=_0x1fe4ca(_0x4d3287['node']['previousSibling']);_0x3ea44f&&_0x4d4e6e['unshift'](_0x3ea44f);const _0x19e40a=_0x1fe4ca(_0x35d0b1['node']['nextSibling']);_0x19e40a&&_0x4d4e6e['push'](_0x19e40a);}function _0x2f4517(_0x5a5772){return _0x26523a['modifiedNodeIds']['includes'](_0x5a5772)||_0x26523a['newNodeIds']['includes'](_0x5a5772)||_0x26523a['removedNodeIds']['includes'](_0x5a5772);}function _0x1fe4ca(_0x37ca7c){if(_0x37ca7c&&ut(_0x37ca7c,'data-id')&&!ut(_0x37ca7c,'data-unstable')){const _0x438f19=ut(_0x37ca7c,'data-id');if(!_0x2f4517(_0x438f19))return{'node':_0x37ca7c,'type':'context','id':_0x438f19};}return null;}this['changeGroups']=_0x3fdacb['map']((_0x52f32b,_0x1af7f2)=>({'changes':_0x52f32b,'state':'pending','index':_0x1af7f2}));}}const De=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class os extends _0x2eb18e(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x4fc038,editor:_0x5040df}){super(),this['id']=_0x41685d(),this['connector']=_0x4fc038,this['isStopped']=!0x0,this['editor']=_0x5040df;}async['start'](){const _0x21d0e5=[];let _0x4b878b,_0x332e8b,_0x37d5b9;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x4f889e=await this['currentRequest']['getStream']();for await(const _0x57dddd of _0x4f889e){if(this['isStopped'])return;if('error'==_0x57dddd['event'])return void this['fire']('error',{'error':new _0x465bb5('ai-chat-interaction-error',this)});switch(_0x57dddd['event']){case'message-metadata':this['messageId']=_0x57dddd['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x57dddd['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x57dddd['data']['conversationTitle'],!0x0);break;case'source':_0x21d0e5['push'](_0x57dddd['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'](),_0x4b878b='modification-delta'==_0x57dddd['event']?'modification':'text',_0x332e8b='modification-delta'==_0x57dddd['event']?_0x57dddd['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x4b878b&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x4b878b,'interactionId':this['id'],'id':_0x332e8b}),'modification'==_0x4b878b&&(this['currentReply']['sources']=_0x21d0e5['splice'](0x0))),this['currentReply']['appendContent'](_0x57dddd['data']['textDelta']);break;case'mcp-tool-result':_0x37d5b9=JSON['parse'](_0x57dddd['data']['result']),this['_handleToolResultData']({'toolName':_0x57dddd['data']['toolName'],'data':_0x37d5b9['data'],'attributes':_0x37d5b9['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x57dddd['data']['toolName'],'data':_0x57dddd['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x21d0e5['length']>0x0&&(this['currentReply']['sources']=_0x21d0e5['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x24c452){return this['replies']['find'](_0x4200fd=>_0x4200fd['id']===_0x24c452);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x26f2c8=>_0x26f2c8['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x151358){const _0x5f2812=new Gi({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x151358});return this['replies']['push'](_0x5f2812),_0x5f2812['delegate'](...De)['to'](this),this['fire']('replyCreated',_0x5f2812),_0x5f2812;}['setConversationTitle'](_0x5d1fcb,_0x2a5220=!0x1){this['fire']('setConversationTitle',_0x5d1fcb,_0x2a5220);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x3a4e5e){this['fire']('toolDataReceived',{'type':'result','toolName':_0x3a4e5e['toolName'],'data':structuredClone(_0x3a4e5e['data']||{}),'attributes':structuredClone(_0x3a4e5e['attributes']||{})},this);}['_handleToolNotificationData'](_0x276692){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x276692['toolName'],'data':structuredClone(_0x276692['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var xe=function(_0x45ce63){return _0x45ce63['TOOL']='mcp-tool-context',_0x45ce63['FILE']='file',_0x45ce63['DOCUMENT']='document',_0x45ce63['URL']='web-resource',_0x45ce63['TEXT']='text',_0x45ce63['SELECTION']='selection',_0x45ce63;}({}),ye=function(_0x5b889c){return _0x5b889c['TEXT']='text',_0x5b889c['MARKDOWN']='markdown',_0x5b889c['HTML']='html',_0x5b889c;}({});const Oe=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']]),ze=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class We extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x43a272,config:_0x1a3eb1,ownerId:_0x3c6a3c}){super(),this['_connector']=_0x43a272,this['_config']=_0x1a3eb1,this['_ownerId']=_0x3c6a3c;}['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'](_0x5461c9){const _0x155969=await this['_createContextItemFromContent'](_0x5461c9);return this['_addToConversationContextItem'](_0x155969),'current-document'===_0x155969['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x155969;}async['_createContextItemFromContent'](_0x1f2211){if(_0x1f2211['type']===xe['DOCUMENT']){const _0x16c24a=await this['_connector']['fetchDocument'](this['_ownerId'],_0x1f2211['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x1f2211['type'],'content':_0x16c24a['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x16c24a['attributes']?.['version'],'sessionId':_0x16c24a['attributes']?.['sessionId']};}if(_0x1f2211['type']===xe['TOOL'])return{'id':_0x1f2211['id'],'uiId':_0x1f2211['id'],'label':_0x1f2211['data']?.['label']||_0x1f2211['id'],'type':xe['TOOL'],'mcpServerName':_0x1f2211['mcpServerName'],'toolName':_0x1f2211['toolName'],'data':_0x1f2211['data']||{}};return{'id':_0x1f2211['id'],'uiId':_0x1f2211['id'],'label':_0x1f2211['attributes']?.['label']||_0x1f2211['name']||_0x1f2211['url']||_0x1f2211['id'],'type':_0x1f2211['type'],..._0x1f2211?.['attributes']?.['resourceId']?{'resourceId':_0x1f2211['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x5cbf91){const _0x512677=this['_pendingContextItems']['get'](_0x5cbf91);_0x512677?.['isReadOnly']||this['_removeContextItem'](_0x5cbf91);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x29a10f of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x29a10f['uiId']);const _0x4cbc10=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x4cbc10&&this['_addContextItem']({..._0x4cbc10,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x50ea41){for(const _0x100d4f of _0x50ea41['values']())this['_addToConversationContextItem'](_0x100d4f);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'](_0x45b2f1){return Array['from'](_0x45b2f1['values']())['map'](_0x54264c=>this['_mapContextItemToRequestData'](_0x54264c))['filter'](_0xdb59e6=>null!==_0xdb59e6);}async['addFilesToContext'](_0x4a9145,_0x24e17a,_0xca0bba=xe['FILE']){const _0x2055e0='files-'+_0x41685d();this['_startUploadOperation'](_0x2055e0);try{await Promise['all'](_0x4a9145['map'](async _0x5d0671=>{const _0x1d3b6f='file-'+_0x41685d(),_0x56554d=_0x1e51c4(_0x5d0671['name']);try{this['_addContextItem']({'type':_0xca0bba,'label':_0x24e17a?.['label']||_0x56554d,'uiId':_0x1d3b6f,'resourceId':_0x24e17a?.['resourceId']},!0x0);const _0x1e4acf=this['_connector']['uploadFile'](this['_ownerId'],_0x5d0671,_0x24e17a);this['_ongoingUploads']['set'](_0x1d3b6f,_0x1e4acf['abortController']);const {id:_0xe4904b}=await _0x1e4acf['getId']();this['_ongoingUploads']['delete'](_0x1d3b6f),this['_finishContextItemLoading']({'type':_0xca0bba,'id':_0xe4904b,'label':_0x24e17a?.['label']||_0x56554d,'uiId':_0x1d3b6f,'resourceId':_0x24e17a?.['resourceId']},!0x1);}catch(_0x2af005){this['_ongoingUploads']['delete'](_0x1d3b6f);if(!(_0x2af005 instanceof _0x465bb5&&_0x2af005['message']['startsWith']('ai-request-aborted'))){const _0x10e565=Oe['get'](_0x2af005['code'])||'ai-chat-file-upload-failed',_0x4b8281=new _0x465bb5(_0x10e565,null,{'fileName':_0x56554d,..._0x2af005});_0x4b8281['stack']=_0x2af005['stack'],this['fire']('error',{'error':_0x4b8281});}this['_removeContextItem'](_0x1d3b6f);}}));}finally{this['_finishUploadOperation'](_0x2055e0);}}['addCurrentDocumentToContext'](_0x5510d0){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x415f47={'type':xe['DOCUMENT'],'uiId':'current-document','label':_0x5510d0,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x415f47);}async['updateCurrentDocument'](_0x27aba2,_0x51041f,_0x1aa044,_0x366edf){const _0x9a61ff=this['_pendingContextItems']['get']('current-document');if(_0x9a61ff&&_0x27aba2){_0x9a61ff['selection']=_0x366edf?_0x366edf['map'](_0xf1612c=>({'start':_0xf1612c['start'],'end':_0xf1612c['end']})):[];try{if(_0x9a61ff['version']===_0x51041f)return;const {id:_0x4c243f}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x27aba2,{'version':_0x51041f,'sessionId':_0x1aa044})['getId']();_0x9a61ff['id']=_0x4c243f,_0x9a61ff['content']=_0x27aba2,_0x9a61ff['version']=_0x51041f,_0x9a61ff['sessionId']=_0x1aa044;}catch(_0x429332){const _0x45b8cb=new _0x465bb5('ai-chat-document-upload-failed',null);_0x45b8cb['stack']=_0x429332['stack'],this['fire']('error',{'error':_0x45b8cb});}}}['addSelectionToContext'](_0x78ba00){this['_addContextItem']({'type':xe['SELECTION'],'label':_0x78ba00,'uiId':'selection','content':_0x78ba00});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x566704,_0x1d2223){const _0x13611e='url-'+_0x41685d();this['_startUploadOperation'](_0x13611e);const _0x152de3='url-'+_0x41685d();try{this['_addContextItem']({'type':xe['URL'],'label':_0x1d2223?.['label']||_0x566704,'uiId':_0x152de3,'resourceId':_0x1d2223?.['resourceId']},!0x0);const _0x523996=this['_connector']['uploadUrl'](this['_ownerId'],_0x566704,_0x1d2223);this['_ongoingUploads']['set'](_0x152de3,_0x523996['abortController']);const {id:_0x4be75b}=await _0x523996['getId']();this['_ongoingUploads']['delete'](_0x152de3),this['_finishContextItemLoading']({'type':xe['URL'],'id':_0x4be75b,'label':_0x1d2223?.['label']||_0x566704,'uiId':_0x152de3,'resourceId':_0x1d2223?.['resourceId']},!0x1);}catch(_0x2c54c0){this['_ongoingUploads']['delete'](_0x152de3),(_0x2c54c0['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x465bb5('ai-chat-url-upload-failed',this,{'url':_0x566704,'originalError':_0x2c54c0}),'url':_0x566704}),this['_removeContextItem'](_0x152de3));}finally{this['_finishUploadOperation'](_0x13611e);}}['addToolItemToContext'](_0x487d20){_0x487d20['id']=_0x487d20['id']??_0x41685d()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x487d20['uiId'],_0x487d20),this['fire']('contextItemAdded',{'contextItem':_0x487d20,'isLoading':!0x1});}async['loadSourceResources'](_0x1fe921,_0x4cd273,_0x25c0f4){const _0x1b8c2b=this['_addContextOptionsState']['sources']['find'](_0x3d495e=>_0x3d495e['id']===_0x1fe921);if(!_0x1b8c2b)return this['fire']('error',{'error':new _0x465bb5('ai-chat-source-not-found',this,{'sourceId':_0x1fe921}),'sourceId':_0x1fe921}),[];try{const _0x19eabc=(await _0x1b8c2b['getResources'](_0x4cd273))['map'](_0x3baad0=>{const _0x2f1bbf=this['_isResourceInContext'](_0x3baad0['id']);return{..._0x3baad0,'isInContext':_0x2f1bbf};});return _0x1b8c2b['resources']=_0x19eabc,this['fire']('sourceResourcesLoaded',{'sourceId':_0x1fe921,'source':_0x1b8c2b,'resources':_0x19eabc,'uid':_0x25c0f4}),_0x19eabc;}catch(_0x409d1b){return this['fire']('error',{'error':new _0x465bb5('ai-chat-source-resources-load-failed',this,{'sourceId':_0x1fe921,'originalError':_0x409d1b}),'sourceId':_0x1fe921,'sourceLabel':_0x1b8c2b['label']}),[];}}async['addResourceToContext'](_0x3191fe,_0x16d075){if(this['_isResourceInContext'](_0x16d075['id']))return;let _0x1776f9=_0x16d075['data'];if(!_0x1776f9&&_0x3191fe['getData'])try{_0x1776f9=await _0x3191fe['getData'](_0x16d075['id']);}catch(_0x164ad2){return void this['fire']('error',{'error':new _0x465bb5('ai-chat-resource-load-failed',this,{'resourceId':_0x16d075['id'],'sourceId':_0x3191fe['id'],'originalError':_0x164ad2}),'resourceId':_0x16d075['id'],'sourceId':_0x3191fe['id']});}if(_0x1776f9)switch(_0x16d075['type']){case xe['URL']:if('string'!=typeof _0x1776f9)return void this['fire']('error',{'error':new _0x465bb5('ai-chat-context-invalid-data',this,{'resourceId':_0x16d075['id'],'sourceId':_0x3191fe['id'],'expectedType':'string','actualType':typeof _0x1776f9}),'resourceId':_0x16d075['id'],'sourceId':_0x3191fe['id']});await this['addUrlToContext'](_0x1776f9,{'label':_0x16d075['label'],'resourceId':_0x16d075['id']});break;case xe['FILE']:if(!(_0x1776f9 instanceof File))return void this['fire']('error',{'error':new _0x465bb5('ai-chat-context-invalid-data',this,{'resourceId':_0x16d075['id'],'sourceId':_0x3191fe['id'],'expectedType':'File','actualType':typeof _0x1776f9}),'resourceId':_0x16d075['id'],'sourceId':_0x3191fe['id']});await this['addFilesToContext']([_0x1776f9],{'label':_0x16d075['label'],'resourceId':_0x16d075['id']});break;case xe['TEXT']:if('object'!=typeof _0x1776f9||!('content'in _0x1776f9)||!('type'in _0x1776f9))return void this['fire']('error',{'error':new _0x465bb5('ai-chat-context-invalid-data',this,{'resourceId':_0x16d075['id'],'sourceId':_0x3191fe['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x1776f9}),'resourceId':_0x16d075['id'],'sourceId':_0x3191fe['id']});_0x1776f9=We['_convertTextResourceToFile'](_0x1776f9,_0x16d075['label']),await this['addFilesToContext']([_0x1776f9],{'label':_0x16d075['label'],'resourceId':_0x16d075['id']},xe['TEXT']);break;case xe['TOOL']:break;default:this['fire']('error',{'error':new _0x465bb5('ai-chat-context-unsupported-type',this,{'resourceId':_0x16d075['id'],'sourceId':_0x3191fe['id'],'resourceType':_0x16d075['type']}),'resourceId':_0x16d075['id'],'sourceId':_0x3191fe['id']});}else this['fire']('error',{'error':new _0x465bb5('ai-chat-resource-no-data',this,{'resourceId':_0x16d075['id'],'sourceId':_0x3191fe['id']}),'resourceId':_0x16d075['id'],'sourceId':_0x3191fe['id']});}static['_convertTextResourceToFile'](_0x2b60ed,_0x1f4c91){switch(_0x2b60ed['type']){case ye['MARKDOWN']:return new File([_0x2b60ed['content']],_0x1f4c91,{'type':'text/markdown'});case ye['HTML']:return new File([_0x2b60ed['content']],_0x1f4c91,{'type':'text/html'});default:return new File([_0x2b60ed['content']],_0x1f4c91,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x599bd2){switch(_0x599bd2['type']){case xe['FILE']:return{'type':xe['FILE'],'id':_0x599bd2['id']};case xe['URL']:return{'type':xe['URL'],'id':_0x599bd2['id']};case xe['DOCUMENT']:return{'type':xe['DOCUMENT'],'id':_0x599bd2['id'],..._0x599bd2['selection']?.['length']&&{'selection':_0x599bd2['selection']}};case xe['TEXT']:return{'type':xe['FILE'],'id':_0x599bd2['id']};case xe['TOOL']:{const _0x172b79=_0x599bd2;return{'type':xe['TOOL'],'mcpServerName':_0x172b79['mcpServerName'],'toolName':_0x172b79['toolName'],'data':_0x172b79['data'],'id':_0x172b79['id']};}default:return null;}}['_addContextItem'](_0x1cbb8c,_0x1d1225=!0x1){if(this['_pendingContextItems']['set'](_0x1cbb8c['uiId'],_0x1cbb8c),_0x1cbb8c['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x1cbb8c,'isLoading':_0x1d1225}),'current-document'===_0x1cbb8c['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x1cbb8c['resourceId']){const _0x55193b=this['_findSourceIdsByResourceId'](_0x1cbb8c['resourceId']);_0x55193b&&_0x55193b['forEach'](_0x385808=>{this['_updateResourceInContextState'](_0x385808,_0x1cbb8c['resourceId'],!0x0);});}}['_removeContextItem'](_0x93ac75){const _0x475027=this['_pendingContextItems']['get'](_0x93ac75),_0x1b1395=this['_ongoingUploads']['get'](_0x93ac75);if(_0x1b1395&&(_0x1b1395['abort'](),this['_ongoingUploads']['delete'](_0x93ac75)),_0x475027?.['resourceId']){const _0x16b62f=this['_findSourceIdsByResourceId'](_0x475027['resourceId']);_0x16b62f&&_0x16b62f['forEach'](_0x20d05a=>{this['_updateResourceInContextState'](_0x20d05a,_0x475027['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x93ac75),this['fire']('contextItemRemoved',{'uiId':_0x93ac75,'type':_0x475027?.['type']}),'current-document'===_0x93ac75&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x2ea6b7,_0x329733){if(this['_pendingContextItems']['has'](_0x2ea6b7['uiId'])&&(this['_pendingContextItems']['set'](_0x2ea6b7['uiId'],_0x2ea6b7),this['fire']('contextItemLoadingEnded',{'contextItem':_0x2ea6b7,'isLoading':_0x329733}),_0x2ea6b7['resourceId'])){const _0x1e1108=this['_findSourceIdsByResourceId'](_0x2ea6b7['resourceId']);_0x1e1108&&_0x1e1108['forEach'](_0x593045=>{this['_updateResourceInContextState'](_0x593045,_0x2ea6b7['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x2973ac){this['_conversationContextItems']['set'](_0x2973ac['uiId'],_0x2973ac);}['_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'](_0x56c626=>({..._0x56c626,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x598afd=>({..._0x598afd,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x374fe3=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x374fe3,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x1ef02e){for(const _0x33cde3 of this['_pendingContextItems']['values']())if(_0x33cde3['resourceId']===_0x1ef02e)return!0x0;for(const _0x579196 of this['_conversationContextItems']['values']())if(_0x579196['resourceId']===_0x1ef02e)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x1c32b3){const _0x163f8e=[];for(const _0x46a450 of this['_addContextOptionsState']['sources']){_0x46a450['resources']['find'](_0x5cfd7a=>_0x5cfd7a['id']===_0x1c32b3)&&_0x163f8e['push'](_0x46a450['id']);}return 0x0===_0x163f8e['length']?null:_0x163f8e;}['_updateResourceInContextState'](_0x5a2609,_0x8de2b1,_0xd132ba){const _0x21deb0=this['_addContextOptionsState']['sources']['find'](_0x279623=>_0x279623['id']===_0x5a2609);if(!_0x21deb0)return;const _0x33020c=_0x21deb0['resources']['find'](_0x40bff8=>_0x40bff8['id']===_0x8de2b1);_0x33020c&&(_0x33020c['isInContext']=_0xd132ba,this['fire']('resourceStateChanged',{'sourceId':_0x5a2609,'resourceId':_0x8de2b1,'isInContext':_0xd132ba}));}['_startUploadOperation'](_0x3ee93c){this['_ongoingUploadOperations']['set'](_0x3ee93c,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x23f8a9){this['_ongoingUploadOperations']['delete'](_0x23f8a9),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const He=['capabilitiesUpdated'];class Ue extends _0x2eb18e(){['_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'](_0x356966){const _0x1090d6={};return _0x356966&&_0x356966['isWebSearchEnabled']&&(_0x1090d6['webSearch']={}),_0x356966&&_0x356966['isReasoningEnabled']&&(_0x1090d6['reasoning']={}),_0x1090d6;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x3ba566){_0x3ba566!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x3ba566,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x6c2997){_0x6c2997!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x6c2997,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Je extends os{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x5a0598){super(_0x5a0598),this['conversationId']=_0x5a0598['conversationId'],this['contextItems']=_0x5a0598['contextItems'],this['capabilities']=_0x5a0598['capabilities'],this['userMessage']=_0x5a0598['userMessage'],this['model']=_0x5a0598['model'],this['attributes']=_0x5a0598['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':We['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ue['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class st extends _0x2eb18e(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x53ff8d){super(),this['options']=_0x53ff8d,this['connector']=_0x53ff8d['connector'],this['chatModels']=_0x53ff8d['chatModels'],this['id']=_0x53ff8d['conversationId'],this['isFromHistory']=_0x53ff8d['isFromHistory'];}async['init'](_0x8bcd0b){try{this['chatContext']=new We({'connector':this['connector'],'config':_0x8bcd0b,'ownerId':this['id']}),this['chatContext']['delegate'](...ze)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ue(),this['chatCapabilities']['delegate'](...He)['to'](this),this['chatCapabilities']['init']();const _0x1bc187=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x1bc187});const _0x402763=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x402763&&await this['setModel'](_0x402763);}catch(_0x16f355){const _0xc26d65=new _0x465bb5('ai-chat-conversation-init-failed',null,{'message':_0x16f355['message']||_0x16f355});_0xc26d65['stack']=_0x16f355['stack'],this['fire']('error',{'error':_0xc26d65});}}async['start'](){if(this['isStarted'])throw new _0x465bb5('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x465bb5('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x3f13b7}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x3f13b7,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x167f6b){const _0x215ee5=new _0x465bb5('ai-chat-conversation-start-failed',null,{'message':_0x167f6b['message'],'conversationId':this['id']});throw _0x215ee5['stack']=_0x167f6b['stack'],this['fire']('error',{'error':_0x215ee5}),_0x215ee5;}}async['load'](_0x193d28,_0xdd2fa9){try{const _0x180c1d=await this['connector']['fetchConversation'](_0x193d28)['getConversation'](),_0x3031d8=await this['connector']['fetchConversationMessages'](_0x193d28)['getMessages'](),_0xdc49fb=_0x3031d8[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x180c1d['id'],'title'in _0x180c1d?this['fire']('setConversationTitle',_0x180c1d['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x2f3040=(await this['chatModels']['getAll']())['find'](_0x467e0d=>_0x467e0d['id']['toLowerCase']()===_0xdc49fb['toLowerCase']());return this['selectedModel']=_0x2f3040,this['fire']('modelSelected',{'selectedModel':_0x2f3040,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x3031d8,_0xdd2fa9,_0xdc49fb),this['currentInteraction']=void 0x0,this;}catch(_0x21a8b9){const _0x4de433=new _0x465bb5('ai-chat-conversation-init-from-id-failed',null,{'message':_0x21a8b9['message'],'conversationId':_0x193d28});throw _0x4de433['stack']=_0x21a8b9['stack'],this['fire']('error',{'error':_0x4de433}),_0x4de433;}}async['_processMessagesToInteractions'](_0x54d94b,_0x305979,_0x38f754){let _0x4bfaa8;for(const _0x5ca1c7 of _0x54d94b)if('user'===_0x5ca1c7['role']){const _0x2dd164=await this['_extractContextItems'](_0x5ca1c7),_0x4df14d={'isReasoningEnabled':Object['hasOwn'](_0x5ca1c7['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x5ca1c7['capabilities'],'webSearch')};_0x4bfaa8=this['createInteraction']({'userMessage':_0x5ca1c7['prompt'],'contextItems':_0x2dd164,'capabilities':_0x4df14d,'modelId':_0x38f754,'attributes':_0x5ca1c7['attributes']}),this['currentInteraction']=_0x4bfaa8,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x5ca1c7['role']&&_0x4bfaa8){const _0x4e4e37=[];for(const _0x3df85f of _0x5ca1c7['content'])switch(_0x3df85f['type']){case'text':case'modification':{const _0x2f0d09=_0x4bfaa8['getDocumentContext']()?.['sessionId']!==_0x305979;_0x4bfaa8['currentReply']=_0x4bfaa8['createReply']({'type':_0x3df85f['type'],'isDone':!0x0,'interactionId':_0x4bfaa8['id'],'areActionsDisabled':_0x2f0d09}),_0x4bfaa8['currentReply']['appendContent'](_0x3df85f['content']),_0x4e4e37['length']>0x0&&(_0x4bfaa8['currentReply']['sources']=_0x4e4e37['splice'](0x0));break;}case'url':_0x4e4e37['push'](_0x3df85f);break;case'mcp-tool-result':{const {data:_0x4ee286,attributes:_0x3c6aab}=JSON['parse'](_0x3df85f['content']);_0x4bfaa8['_handleToolResultData']({'toolName':_0x3df85f['toolName'],'data':_0x4ee286,'attributes':_0x3c6aab});break;}}}}}async['_extractContextItems'](_0x170e2f){const _0x2a35fe=new Map();if(!_0x170e2f['content'])return _0x2a35fe;for(const _0x2c85fa of _0x170e2f['content']){const _0x59767f=await this['chatContext']['populateFromMessage'](_0x2c85fa);_0x59767f&&_0x2a35fe['set'](_0x59767f['id'],_0x59767f);}return _0x2a35fe;}async['handleUserInteraction']({userMessage:_0x1be820,attributes:_0x4f9dc9}){if(!this['isStarted'])throw new _0x465bb5('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x465bb5('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x3fc31d=this['chatContext']['getPendingContextItems'](),_0x2d9f2e=this['chatCapabilities']['getCapabilitiesConfig'](),_0x5bbf65=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x1be820,'contextItems':_0x3fc31d,'capabilities':_0x2d9f2e,'modelId':_0x5bbf65,'attributes':_0x4f9dc9}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x388e02){if(_0x388e02 instanceof _0x465bb5)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x388e02});else{const _0xcfbf7e=Oe['get'](_0x388e02['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x465bb5(_0xcfbf7e,null,{'error':_0x388e02})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x3dd6c3,contextItems:_0x11dc98,capabilities:_0x36d4c5,modelId:_0x4eb5a7,attributes:_0x2077fb}){const _0x2d7d04=new Je({'userMessage':_0x3dd6c3,'contextItems':_0x11dc98,'capabilities':_0x36d4c5,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x4eb5a7,'attributes':_0x2077fb});return _0x2d7d04['delegate'](...De)['to'](this),this['interactions']['push'](_0x2d7d04),this['fire']('interactionCreated',_0x2d7d04),_0x2d7d04;}['getInteraction'](_0x256e3b){return this['interactions']['find'](_0x14bcdd=>_0x14bcdd['id']===_0x256e3b);}['removeInteraction'](_0x4f528c){const _0xb44b00=this['getInteraction'](_0x4f528c);_0xb44b00&&(_0xb44b00['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0xb44b00),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x2ff4c2){this['chatContext']['addCurrentDocumentToContext'](_0x2ff4c2);}async['updateCurrentDocumentInContext']({content:_0x2aa3c0,version:_0x462ed2,sessionId:_0x245e7e,selections:_0x21a498}){await this['chatContext']['updateCurrentDocument'](_0x2aa3c0,_0x462ed2,_0x245e7e,_0x21a498);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x395638){this['chatContext']['addSelectionToContext'](_0x395638);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x49f5c9){this['chatContext']['addFilesToContext'](_0x49f5c9);}['addUrlToContext'](_0x76574f){this['chatContext']['addUrlToContext'](_0x76574f);}['addToolItemToContext'](_0xe53e8c){this['chatContext']['addToolItemToContext'](_0xe53e8c);}['addResourceToContext'](_0x407a97,_0x1c63a3){this['chatContext']['addResourceToContext'](_0x407a97,_0x1c63a3);}['loadSourceResources'](_0x37d001,_0x54d2d3,_0x36a036){return this['chatContext']['loadSourceResources'](_0x37d001,_0x54d2d3,_0x36a036);}['removeFromContext'](_0x2bb044){this['chatContext']['removeFromContext'](_0x2bb044);}['setWebSearch'](_0x3d3fcd){this['chatCapabilities']['setWebSearch'](_0x3d3fcd);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x47bb45){this['chatCapabilities']['setReasoning'](_0x47bb45);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x596ff7){_0x596ff7?!0x1===await this['chatModels']['isAvailable'](_0x596ff7)&&(_0x227e3e('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x596ff7}),_0x596ff7=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x227e3e('ai-chat-conversation-set-model-null',{'conversation':this}),_0x596ff7=(await this['chatModels']['getAvailableModels']())[0x0]),_0x596ff7['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x596ff7,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x596ff7}));}}class et extends _0x2eb18e(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x50c3ad,config:_0x368c38,locale:_0x4c8af3}){super(),this['_connector']=_0x50c3ad,this['_config']=_0x368c38,this['_locale']=_0x4c8af3;}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 _0x4ff7d4=await this['getAll']();let _0x56c32f;return _0x56c32f=this['_availableModels']?this['_filterModels'](_0x4ff7d4,this['_availableModels']):_0x4ff7d4['filter'](_0x1a8186=>_0x1a8186['recommended']),_0x56c32f;}async['getModel'](_0x48e47e){const _0x3d4012=await this['getAll']();if(!_0x3d4012['length'])return null;if(_0x48e47e){const _0x535151=this['_getModelById'](_0x3d4012,_0x48e47e);if(_0x535151)return _0x535151;_0x227e3e('ai-chat-model-id-unrecognized',{'modelId':_0x48e47e,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x285a53=await this['getAvailableModels']();if(!_0x285a53['length'])return null;if(this['_defaultModelId']){const _0x252fe4=this['_getModelById'](_0x285a53,this['_defaultModelId']);if(_0x252fe4)return _0x252fe4;_0x227e3e('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x285a53[0x0]['id']});}return _0x285a53[0x0];}async['isAvailable'](_0x57eb1c){return(await this['getAvailableModels']())['some'](_0x364c9f=>_0x364c9f['name']===_0x57eb1c['name']&&_0x364c9f['provider']===_0x57eb1c['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x17e0ea=this['_locale']['uiLanguage']||'en',_0x4d25e8=this['_connector']['getModels'](_0x17e0ea),_0x351aaa=await _0x4d25e8['list']();this['_modelList']=_0x351aaa['items']['map'](_0x46b6e1=>Bi(_0x46b6e1)?{..._0x46b6e1,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x46b6e1);}catch(_0x536c9f){throw _0x238b54('ai-models-unable-to-retrieve',{'error':_0x536c9f}),_0x536c9f;}return[...this['_modelList']];}['_filterModels'](_0x180f64,_0x49ac42){let _0x2d1c01;if(_0x49ac42){_0x2d1c01=[];const _0x38428c=new Set(),_0x594a90='string'==typeof _0x49ac42?[_0x49ac42['toLocaleLowerCase']()]:_0x49ac42['map'](_0x1f3143=>_0x1f3143['toLocaleLowerCase']());for(const _0x494efe of _0x594a90)for(const _0x52e1cb of _0x180f64)!_0x38428c['has'](_0x52e1cb['id'])&&this['_isMatchingFilter'](_0x52e1cb,_0x494efe)&&(_0x2d1c01['push'](_0x52e1cb),_0x38428c['add'](_0x52e1cb['id']));}else _0x2d1c01=_0x180f64;return _0x2d1c01;}['_isMatchingFilter'](_0x3b5f1e,_0x1ac89a){const _0x380448=_0x3b5f1e['id']['toLocaleLowerCase'](),_0xf8dc=_0x3b5f1e['name']['toLocaleLowerCase'](),_0xd3273e=_0x3b5f1e['provider']['toLocaleLowerCase']();return _0x380448===_0x1ac89a||_0xf8dc===_0x1ac89a||Bi(_0x3b5f1e)&&'auto'===_0x1ac89a||_0xd3273e===_0x1ac89a||_0x380448['startsWith'](_0x1ac89a);}['_getModelById'](_0x4643dc,_0x34dba6){return _0x4643dc['find'](_0x13b99a=>Bi(_0x13b99a)&&'auto'===_0x34dba6?_0x13b99a:_0x13b99a['id']===_0x34dba6)||null;}}function Bi(_0x48382a){return _0x48382a['id']['startsWith']('agent');}function T(_0x1f8ced){if(_0x1f8ced instanceof _0x2dbc4d)return _0x1f8ced;if(_0x1f8ced?.['editors']&&_0x1f8ced['editors']['get'](0x0))return _0x1f8ced['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.'),_0x1f8ced['editors']['get'](0x0);throw new _0x465bb5('ai-get-editor-from-context-no-editor');}function at({editor:_0x2156c2,interaction:_0x45b411,reply:_0x29391f,groups:_0x39a2ad,transform:_0x5c30bb,documentCompare:_0x477ea5,documentCompareOptions:_0x361459}){const _0x1ae79e=_0x45b411['getDocumentContext']();if(!_0x1ae79e)return[];const _0x28f148=_0x1ae79e['content'],_0x87f7c2=_0x1ae79e['version'],_0x2691fb=_0x29391f['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x36b5f4}of _0x39a2ad){const _0x2f30e8=_0x36b5f4['filter'](_0x3cae6e=>'new'!=_0x3cae6e['type'])['map'](_0x1efbdc=>It('data-id',_0x1efbdc['id'],_0x2691fb)),_0x1e615d=_0x36b5f4['filter'](_0x422050=>'removed'!=_0x422050['type'])['map'](_0x29809f=>_0x29809f['node']['cloneNode'](!0x0));let _0x4dcce0=null;if(_0x2f30e8['length']){_0x4dcce0=_0x2f30e8[0x0]['previousSibling'];for(let _0x2a8658=0x0;_0x2a8658<_0x2f30e8['length'];_0x2a8658++)_0x35ad72(_0x2f30e8[_0x2a8658]);}if(_0x1e615d['length']){_0x4dcce0||(_0x36b5f4[0x0]['anchorId']?_0x4dcce0=It('data-id',_0x36b5f4[0x0]['anchorId'],_0x2691fb):(_0x4dcce0=_0x1e615d['shift'](),_0x4803eb(_0x2691fb,_0x4dcce0)));for(let _0x5d37ef=0x0;_0x5d37ef<_0x1e615d['length'];_0x5d37ef++)_0x4ef11d(_0x4dcce0,_0x1e615d[_0x5d37ef]),_0x4dcce0=_0x1e615d[_0x5d37ef];}}const _0x2bfa35=pt(_0x2691fb),_0x4691ef=_0x477ea5['getDiff'](_0x28f148,_0x2bfa35,_0x361459)['getOperations']();if(_0x5c30bb){const _0x167a0d=_0x2156c2['model']['document']['history']['getOperations'](_0x87f7c2),_0x37234b={'document':_0x2156c2['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return xt(_0x4691ef,_0x167a0d,_0x37234b)['operationsA'];}return _0x4691ef;}function rt(_0x22c028,_0x1bda95){if('marker'!=_0x1bda95['type'])return;const _0x39fc35=_0x22c028['model']['markers']['get'](_0x1bda95['name']);_0x39fc35&&(_0x1bda95['oldRange']=_0x39fc35['getRange']());}class q extends _0x4720c1{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[tt,ot];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x165cca(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 et({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x3a1341=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x6dc5fc,_0x4ca776)=>{this['_handleUIUserMessage']({'userMessage':_0x4ca776});}),this['listenTo'](_0x3a1341,'resizedTabs',(_0x4c1644,_0x2f218e)=>{this['_setIsMaximized'](_0x2f218e);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x3a1341['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',(_0x1a0454,_0x294b85)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x294b85));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x5ab869,_0x396fa6)=>{this['activeConversation']?.['addUrlToContext'](_0x396fa6);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x2c6db7,_0x2b03b4)=>{_0x2b03b4['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x827b42,_0x4209fa)=>{this['activeConversation']?.['addResourceToContext'](_0x4209fa['source'],_0x4209fa['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x411550,_0x57b900)=>{this['_removeFromContext'](_0x57b900);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x4f60f9,_0x4d5f64)=>{this['activeConversation']?.['loadSourceResources'](_0x4d5f64['sourceId'],_0x4d5f64['query'],_0x4d5f64['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0xd26697,_0x518ee8)=>{this['activeConversation']?.['setModel'](_0x518ee8);}),this['listenTo'](this['_aiChatUi'],'like',(_0x533103,{replyId:_0x3d469a})=>{console['log']('Liked\x20response',_0x3d469a);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x5a126c,{replyId:_0x14afc7})=>{console['log']('Disliked\x20response',_0x14afc7);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x1a804d,_0x232b7a)=>{this['_insertSuggestion'](_0x232b7a);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x38bf4b,{replyId:_0x4ca5e1,partIndex:_0x2673b8})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x4ca5e1,_0x2673b8);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x1b8399,{replyId:_0x44cea9,partIndex:_0x2461b2})=>{const _0xdce290=this['_getDocumentRangeForReplyChanges'](_0x44cea9,_0x2461b2);_0xdce290&&'$graveyard'!=_0xdce290['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0xdce290['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x48f399,_0x2e490e)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x2e490e);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x58cbf8,{replyId:_0x14a769,showDiff:_0x2c6b3b})=>{const {reply:_0x5b1129}=this['getInteractionAndReplyById'](_0x14a769),_0x395ade=_0x5b1129['getContentParts']({'showDiff':_0x2c6b3b});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x5b1129['id'],'parts':_0x395ade,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x29f7b8,{replyId:_0x24903f,partIndex:_0x54b3a1})=>{this['_rejectSuggestion']({'replyId':_0x24903f,'partIndex':_0x54b3a1}),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:_0xef5406,partIndex:_0x36d354}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0xe7d29c}=this['getInteractionAndReplyById'](_0xef5406),_0x46286a=_0xe7d29c['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x36d354});this['_aiChatBalloon']['updateContent']({'part':_0x46286a[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x32978b,partIndex:_0x2b587e}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x32978b,'partIndex':_0x2b587e}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x556a1c,partIndex:_0x1079b3}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x556a1c,'partIndex':_0x1079b3}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x5d208a,partIndex:_0x2c72b9}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x5d208a,'partIndex':_0x2c72b9}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x28c501,partIndex:_0x11ad83}=this['_currentPreviewedChangeGroup'],_0x4219e8=this['_getPresentableSiblingContentPartIndex'](_0x28c501,_0x11ad83,'next');null!==_0x4219e8&&this['_openBalloonFor'](_0x28c501,_0x4219e8);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x423005,partIndex:_0x2ac280}=this['_currentPreviewedChangeGroup'],_0x288190=this['_getPresentableSiblingContentPartIndex'](_0x423005,_0x2ac280,'previous');null!==_0x288190&&this['_openBalloonFor'](_0x423005,_0x288190);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x4f2a21,{id:_0x3fc477})=>{if('aiChatBalloon'!==_0x3fc477)return;const {replyId:_0x2eaf59,partIndex:_0x1f9a68}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x2eaf59,'index':_0x1f9a68,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof _0x2dbc4d?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2d056c,_0x372571)=>{_0x372571['on']('ready',()=>{this['_integrateEditor'](_0x372571);});});const _0x2aa245=this['context']['config']['get']('ai.chat.initialConversation');let _0x5c88f2=_0x2aa245;if('lastCreated'!=_0x2aa245||(_0x5c88f2=await this['_getLastCreatedConversationId'](),_0x5c88f2))return'new'==_0x5c88f2?this['_startConversationSafely']():this['loadConversation'](_0x5c88f2);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x47ab2f){const _0x41069a=T(this['context']);if(!_0x41069a['plugins']['has']('TrackChanges'))throw new _0x465bb5('ai-no-track-changes',null);const _0x3cb94f=this['context']['plugins']['get']('DocumentCompare'),{reply:_0xf8e9fe,interaction:_0x260caf}=this['getInteractionAndReplyById'](_0x47ab2f['replyId']),_0x11ff2a=this['_getDocumentRangeForReplyChanges'](_0x47ab2f['replyId'],_0x47ab2f['partIndex']),_0x2b0edc=void 0x0!==_0x47ab2f['partIndex']?[_0xf8e9fe['changeGroups'][_0x47ab2f['partIndex']]]:_0xf8e9fe['changeGroups']['filter'](_0x1fddbb=>'pending'==_0x1fddbb['state']),_0x5a830b=_0x2b0edc['map'](_0x32988c=>_0xf8e9fe['changeGroups']['indexOf'](_0x32988c));if(!_0x11ff2a||'$graveyard'==_0x11ff2a['range']['root']['rootName'])return void _0x5a830b['forEach'](_0x3eab5a=>_0xf8e9fe['setChangeGroupState'](_0x3eab5a,'outdated'));_0x5a830b['forEach'](_0x267366=>_0xf8e9fe['setChangeGroupState'](_0x267366,'accepted'));const _0x57c367=at({'editor':_0x41069a,'reply':_0xf8e9fe,'interaction':_0x260caf,'groups':_0x2b0edc,'transform':!0x0,'documentCompare':_0x3cb94f,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x221359;_0x11ff2a&&this['_scrollToSuggestionRange'](_0x11ff2a['range']),_0x41069a['model']['change'](_0x58c45d=>{_0x221359=_0x58c45d['batch'],_0x41069a['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x57c367),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x221359,{'interactionId':_0x260caf['id'],'replyId':_0xf8e9fe['id'],'indexes':_0x5a830b['slice']()}),this['_updateRatings'](_0xf8e9fe);}['_applySuggestion'](_0x3bbd51){const _0x81e9e6=T(this['context']),_0x2c21c2=this['context']['plugins']['get'](ot),{reply:_0x36febf,interaction:_0x2ae382}=this['getInteractionAndReplyById'](_0x3bbd51['replyId']),_0xcfd569=this['_getDocumentRangeForReplyChanges'](_0x3bbd51['replyId'],_0x3bbd51['partIndex']),_0x5d33f7=void 0x0!==_0x3bbd51['partIndex']?[_0x36febf['changeGroups'][_0x3bbd51['partIndex']]]:_0x36febf['changeGroups']['filter'](_0x52d48b=>'pending'==_0x52d48b['state']),_0xd707c2=_0x5d33f7['map'](_0x33a687=>_0x36febf['changeGroups']['indexOf'](_0x33a687));if(!_0xcfd569||'$graveyard'==_0xcfd569['range']['root']['rootName'])return void _0xd707c2['forEach'](_0x4254bf=>_0x36febf['setChangeGroupState'](_0x4254bf,'outdated'));_0xd707c2['forEach'](_0x8adc10=>_0x36febf['setChangeGroupState'](_0x8adc10,'accepted'));const _0x2cb14b=at({'editor':_0x81e9e6,'reply':_0x36febf,'interaction':_0x2ae382,'groups':_0x5d33f7,'transform':!0x0,'documentCompare':_0x2c21c2,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x362bcd;_0xcfd569&&this['_scrollToSuggestionRange'](_0xcfd569['range']),_0x81e9e6['model']['change'](_0x3bed7b=>{_0x362bcd=_0x3bed7b['batch'];for(const _0x34167b of _0x2cb14b)_0x34167b['baseVersion']=_0x81e9e6['model']['document']['version'],rt(_0x81e9e6,_0x34167b),_0x3bed7b['batch']['addOperation'](_0x34167b),_0x81e9e6['model']['applyOperation'](_0x34167b);}),this['_batchToChanges']['set'](_0x362bcd,{'interactionId':_0x2ae382['id'],'replyId':_0x36febf['id'],'indexes':_0xd707c2['slice']()}),this['_updateRatings'](_0x36febf);}['_rejectSuggestion'](_0x1f94f2){const {reply:_0x33953e}=this['getInteractionAndReplyById'](_0x1f94f2['replyId']);_0x33953e['setChangeGroupState'](_0x1f94f2['partIndex'],'rejected');}['_openBalloonFor'](_0x3510f0,_0x29d9af){if(!this['_aiChatBalloon'])return;const {reply:_0x20543c}=this['getInteractionAndReplyById'](_0x3510f0),_0xbdd948=_0x20543c['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x1e04ab,_0x265e59;if(void 0x0!==_0x29d9af?(_0x265e59=_0xbdd948['find'](_0x4f3716=>_0x4f3716['index']==_0x29d9af),_0x1e04ab=_0x265e59?.['index']):(_0x265e59=_0xbdd948[0x0],_0x1e04ab=_0x265e59['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x3510f0&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x1e04ab)return;const _0x498925=this['_getUserPresentableContentPartDocumentRange'](_0x3510f0,_0x20543c,_0x265e59);if(!_0x498925)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x3510f0,'partIndex':_0x1e04ab},this['_scrollToSuggestionRange'](_0x498925,!0x0);const _0x4c5da8=this['_getPresentableSiblingContentPartIndex'](_0x3510f0,_0x1e04ab,'next');this['_aiChatBalloon']['updateContent']({'part':_0x265e59,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x1e04ab,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x1e04ab+0x1)['toString']()),'showRotator':null!==_0x4c5da8,'ranges':[_0x498925],'areActionsDisabled':_0x20543c['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x3510f0,_0x1e04ab),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x3510f0,'index':_0x1e04ab,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x2d3a3c,_0x4b7368,_0x1da1ff){const {reply:_0xeb6c0b}=this['getInteractionAndReplyById'](_0x2d3a3c),_0x3f8f73=_0xeb6c0b['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x3f8f73['length'])return null;const _0x52446f=_0x3f8f73['findIndex'](_0x25ee6b=>_0x25ee6b['index']==_0x4b7368),_0xc6a51c='next'==_0x1da1ff?0x1:-0x1;let _0x5bfe5a=_0x3f8f73['at']((_0x52446f+_0xc6a51c)%_0x3f8f73['length'])['index'],_0x2d46ac=_0x3f8f73[_0x5bfe5a];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x2d3a3c,_0xeb6c0b,_0x2d46ac);){if(_0x5bfe5a=_0x3f8f73['at']((_0x5bfe5a+_0xc6a51c)%_0x3f8f73['length'])['index'],_0x5bfe5a===_0x52446f)return null;_0x2d46ac=_0x3f8f73[_0x5bfe5a];}return _0x5bfe5a;}['_getUserPresentableContentPartDocumentRange'](_0x4d1d18,_0xcea21,_0x45dc12){const _0x44916f=_0xcea21['changeGroups'];if(!_0x45dc12['hasChanges'])return null;const _0x195818=_0x44916f['find'](_0x10f062=>_0x10f062['index']==_0x45dc12['index']);if('pending'!==_0x195818?.['state'])return null;const _0x2ba262=this['_getDocumentRangeForReplyChanges'](_0x4d1d18,_0x45dc12['index']);if(!_0x2ba262)return null;const {range:_0x27e832,currentIndex:_0x41912a}=_0x2ba262;return'$graveyard'==_0x27e832['root']['rootName']?(_0xcea21['setChangeGroupState'](_0x41912a,'outdated'),null):_0x2ba262['range'];}['_getDocumentRangeForReplyChanges'](_0x5f30f0,_0x4b00fe){const _0x33559e=T(this['context']),{reply:_0x1517ca,interaction:_0x60fa7a}=this['getInteractionAndReplyById'](_0x5f30f0),_0x3eca68=_0x1517ca['changeGroups']['filter'](_0x1ac9ad=>'pending'==_0x1ac9ad['state']),_0x257da9=_0x3eca68['map'](_0x118ba8=>_0x1517ca['changeGroups']['indexOf'](_0x118ba8));void 0x0===_0x4b00fe&&(_0x4b00fe=_0x257da9[0x0]);const _0x1486a3=_0x257da9['indexOf'](_0x4b00fe);if(-0x1==_0x1486a3)return null;const _0x31e9b8=_0x3eca68[_0x1486a3],_0x2f83d9=new _t([]),_0x1b176a=new _t([]);for(const _0x3f1809 of _0x31e9b8['changes'])if('removed'!=_0x3f1809['type']&&_0x1b176a['children']['push'](_0x3f1809['node']['cloneNode'](!0x0)),'new'!=_0x3f1809['type']){const _0x329da5=gt(_0x4ddc4e=>ut(_0x4ddc4e,'data-id')==_0x3f1809['id'],_0x1517ca['documentContextContent'],!0x0);_0x2f83d9['children']['push'](_0x329da5['cloneNode'](!0x0));}if(0x0==_0x2f83d9['children']['length']){if(_0x31e9b8['changes'][0x0]['anchorId']){const _0x538ec1=It('data-id',_0x31e9b8['changes'][0x0]['anchorId'],_0x1517ca['documentContextContent']);_0x2f83d9['children']['unshift'](_0x538ec1['cloneNode'](!0x0)),_0x1b176a['children']['unshift'](_0x538ec1['cloneNode'](!0x0)),_0x538ec1['nextSibling']&&(_0x2f83d9['children']['push'](_0x538ec1['nextSibling']['cloneNode'](!0x0)),_0x1b176a['children']['push'](_0x538ec1['nextSibling']['cloneNode'](!0x0)));}else{const _0xe05e5d=_0x1517ca['documentContextContent']['children'][0x0];if(!_0xe05e5d)return null;_0x2f83d9['children']['push'](_0xe05e5d['cloneNode'](!0x0)),_0x1b176a['children']['push'](_0xe05e5d['cloneNode'](!0x0));}}const _0x3b9bb6=_0x60fa7a['getDocumentContext'](),_0x305b62=_0x33559e['data']['parse'](_0x3b9bb6['content']),_0x9abf1a=pt(_0x2f83d9),_0x59046e=_0x33559e['data']['parse'](_0x9abf1a),_0x8e520c=_0x33559e['data']['parse'](_0x9abf1a),_0x461d9c=_0x33559e['model']['createPositionAt'](_0x59046e,0x0),_0xed8692=pt(_0x1b176a),_0x9b50cf={'anchor':_0x461d9c,'markDeletions':!0x1},_0x318718=_0x33559e['plugins']['get'](ot)['getDiff'](_0x9abf1a,_0xed8692,_0x9b50cf)['getOperations']();if(!_0x318718['length'])return null;_0x33559e['model']['change'](_0x33fb70=>{for(const _0x2e4c58 of _0x318718)if('remove'==_0x2e4c58['type']){const _0x5e5b5b=_0x2e4c58['sourcePosition'],_0x43147c=_0x2e4c58['howMany'],_0x2c260a=new lt(_0x5e5b5b,_0x43147c);_0x33fb70['batch']['addOperation'](_0x2c260a),_0x33559e['model']['applyOperation'](_0x2c260a);}else'marker'!==_0x2e4c58['type']&&(_0x2e4c58['baseVersion']=null,_0x2e4c58['isDocumentOperation']=!0x1,_0x33fb70['batch']['addOperation'](_0x2e4c58),_0x33559e['model']['applyOperation'](_0x2e4c58));});const _0x526223=ct(_0x33559e,_0x318718,_0x59046e);ht(_0x33559e['model'],_0x526223);const _0x180239=_0x526223['getFirstRange']()['start']['path']['slice'](),_0x2e1e7e=_0x526223['getFirstRange']()['end']['path']['slice'](),_0x56ff8d=[];let _0x4cab97=_0x59046e,_0x42a7fe=_0x8e520c;for(let _0x439a36=0x0;_0x439a36<_0x2e1e7e['length'];_0x439a36++){const _0x1a901e=_0x4cab97['maxOffset']-_0x2e1e7e[_0x439a36];_0x56ff8d[_0x439a36]=_0x42a7fe['maxOffset']-_0x1a901e,_0x4cab97=_0x4cab97['getChildAtOffset'](_0x2e1e7e[_0x439a36]),_0x42a7fe=_0x42a7fe['getChildAtOffset'](_0x56ff8d[_0x439a36]);}const _0x53f462=_0x33559e['model']['createRange'](_0x33559e['model']['createPositionFromPath'](_0x8e520c,_0x180239),_0x33559e['model']['createPositionFromPath'](_0x8e520c,_0x56ff8d)),_0x5c0893=_0x8e520c['getChild'](0x0)['getAttribute'](nt),_0x334920=Array['from'](_0x305b62['getChildren']())['find'](_0x122173=>_0x122173['getAttribute'](nt)==_0x5c0893)['getPath'](),_0xdfcd19=_0x53f462['start']['path']['slice'](),_0x571bfa=_0x53f462['end']['path']['slice']();_0xdfcd19[0x0]=_0x334920[0x0]+_0xdfcd19[0x0],_0x571bfa[0x0]=_0x334920[0x0]+_0x571bfa[0x0];let _0x481bad=_0x33559e['model']['createRange'](_0x33559e['model']['createPositionFromPath'](_0x33559e['model']['document']['getRoot'](),_0xdfcd19),_0x33559e['model']['createPositionFromPath'](_0x33559e['model']['document']['getRoot'](),_0x571bfa));const _0x41cfed=_0x33559e['model']['document']['history']['getOperations'](_0x3b9bb6['version']);for(const _0x572f7b of _0x41cfed)_0x481bad=dt['_createFromRanges'](_0x481bad['getTransformedByOperation'](_0x572f7b));return{'range':_0x481bad,'currentIndex':_0x4b00fe};}['_integrateEditor'](_0x2ad296){if(!_0x2ad296['plugins']['has']('Undo'))return;const _0x452a99=_0x2ad296['commands']['get']('undo'),_0x33f46c=_0x2ad296['commands']['get']('redo');this['listenTo'](_0x452a99,'revert',(_0x3dda50,_0x24157e,_0x2e7bf9)=>{const _0x5d169d=this['_batchToChanges']['get'](_0x24157e);if(!_0x5d169d)return;const _0x54819e=this['activeConversation']['getInteraction'](_0x5d169d['interactionId'])['getReply'](_0x5d169d['replyId']);_0x5d169d['indexes']['forEach'](_0x207d80=>_0x54819e['setChangeGroupState'](_0x207d80,'pending')),this['_batchToChanges']['delete'](_0x24157e),this['_batchToChanges']['set'](_0x2e7bf9,_0x5d169d);}),this['listenTo'](_0x33f46c,'revert',(_0x1bb772,_0x55f88d,_0x4f50ab)=>{const _0x7e3d92=this['_batchToChanges']['get'](_0x55f88d);if(!_0x7e3d92)return;const _0x3ff23a=this['activeConversation']['getInteraction'](_0x7e3d92['interactionId'])['getReply'](_0x7e3d92['replyId']);_0x7e3d92['indexes']['forEach'](_0x622a00=>_0x3ff23a['setChangeGroupState'](_0x622a00,'accepted')),this['_batchToChanges']['delete'](_0x55f88d),this['_batchToChanges']['set'](_0x4f50ab,_0x7e3d92);});}async['loadConversation'](_0x2d8525){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](it)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x2d8525)['getConversation'](),await this['_startConversationSafely'](_0x2d8525),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x2d8525,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x45ac63){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x2d8525}),this['_logError'](new _0x465bb5('ai-chat-conversation-not-found',this,{'error':_0x45ac63}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0x307128=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x29d3b0=await _0x307128['getConversations']();return _0x29d3b0['length']?_0x29d3b0[0x0]['id']:'new';}catch(_0x1e785e){return this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x41685d()}),this['_logError'](new _0x465bb5('ai-chat-conversation-init-failed',this,{'error':_0x1e785e})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x40f0d0){this['activeConversation']['id']===_0x40f0d0&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x515421=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x515421),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x2cb7d3,attributes:_0x917d9a}){await this['_handleUIUserMessage']({'userMessage':_0x2cb7d3,'attributes':_0x917d9a});}['getGroupId'](){const _0x5e7aab=this['context']['config']['get']('collaboration.channelId');if(!_0x5e7aab)throw new _0x465bb5('ai-chat-missing-channel-id',this);return _0x5e7aab;}async['_startConversationSafely'](_0x1d3da9){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x1d3da9);}catch(_0x489f3d){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x1d3da9||_0x41685d()}),console['error'](_0x489f3d),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x28ba79){let _0x157f54;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x28ba79||!this['activeConversation']?_0x157f54=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x157f54=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x273f17=this['getGroupId'](),_0x2f9433=_0x28ba79||_0x41685d();this['activeConversation']=new st({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x157f54,'conversationId':_0x2f9433,'group':_0x273f17,'getEditor':()=>T(this['context']),'isFromHistory':!!_0x28ba79}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x6747ad,_0x1f6c7b)=>{this['_aiChatUi']['createConversation'](_0x1f6c7b),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x28ba79||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x53fab3,_0x3cda94)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x3cda94['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x1591c9,_0x16f5d6)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x16f5d6);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x3b0d8d=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x3b0d8d);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x42bc98=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x42bc98);}),this['activeConversation']['on']('webSearchFinished',(_0x3b285a,_0x1cd8fd)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x1cd8fd,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x1c5a51,_0x2ce3ac)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x2ce3ac,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x262927,_0x1c3f54)=>{this['_aiChatUi']['removeFeedInteraction'](_0x1c3f54['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x3bc35b,_0x5ab18d,_0x1444bc)=>{this['updateConversationTitle'](_0x5ab18d,_0x1444bc);}),this['activeConversation']['on']('replyCreated',(_0x360a45,_0x2ccad4)=>{'text'===_0x2ccad4['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x2ccad4):this['_aiChatUi']['addFeedItemAISuggestion'](_0x2ccad4);}),this['activeConversation']['on']('replyContentUpdated',async(_0x11e626,_0x5bc61c)=>{await this['_updateReplyContent']({'reply':_0x5bc61c});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x8d07b,{reply:_0x489bc0,index:_0x5b9a7e,state:_0x387412})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x489bc0['id'],'index':_0x5b9a7e,'state':_0x387412}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x489bc0['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x5b9a7e&&this['_aiChatBalloon']?.['setState'](_0x387412);}),this['activeConversation']['on']('contextItemAdded',(_0x2a6ffc,_0x16a90e)=>{if(this['_aiChatUi']['addContextItem'](_0x16a90e['contextItem'],_0x16a90e['isLoading']),'selection'===_0x16a90e['contextItem']['type']){const _0x867c68=[...T(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x867c68,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x59b452,_0x2e134e)=>{this['_aiChatUi']['removeContextItem'](_0x2e134e['uiId']),'current-document'==_0x2e134e['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x2e134e['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x4f31b7,_0x452bb4)=>{this['_aiChatUi']['setContextItemLoading'](_0x452bb4['contextItem']['uiId'],_0x452bb4['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x3eb1be,_0x429555)=>{this['_aiChatUi']['setConversationContext'](_0x429555['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x15f751,_0x2ccd7e)=>{this['_aiChatUi']['setAddContextOptions'](_0x2ccd7e['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0xae1d31,_0x1f3036)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x1f3036['sourceId'],_0x1f3036['source'],_0x1f3036['resources'],_0x1f3036['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x345eae,_0x563a26)=>{this['_aiChatUi']['updateResourceState'](_0x563a26['sourceId'],_0x563a26['resourceId'],_0x563a26['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x39bcc6,_0x19e93d)=>{this['_aiChatUi']['updateCapabilities'](_0x19e93d);}),this['activeConversation']['on']('modelSelected',async(_0x51313d,_0x26bf1b)=>{const _0x5883dc=(await this['_aiChatModels']['getAll']())['find'](_0x5bc2aa=>_0x5bc2aa['id']===_0x26bf1b['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x5883dc,_0x26bf1b['isDisabled']);}),this['activeConversation']['on']('error',(_0xd6c8cd,{error:_0x108b42,interactionId:_0x4b8029,fileName:_0x4cb689,url:_0x16f82a,sourceId:_0x56718e,sourceLabel:_0x34d540})=>{const _0x185fd9=_0x4b8029?_0x4b8029+':'+_0x41685d():_0x41685d();_0x108b42['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x185fd9}):_0x108b42['message']['startsWith']('ai-chat-conversation-init-failed')||_0x108b42['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x185fd9}),this['_logError'](_0x108b42)):_0x108b42['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x4cb689),'id':_0x185fd9}):_0x108b42['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x16f82a),'id':_0x185fd9}):_0x108b42['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x185fd9}):_0x108b42['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x185fd9}):_0x108b42['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x56718e&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x56718e),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x34d540||'source'),'id':_0x185fd9}),this['_logError'](_0x108b42)):_0x108b42['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x185fd9}),this['_logError'](_0x108b42)):_0x108b42['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x185fd9}),this['_logError'](_0x108b42)):_0x108b42['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x185fd9}),this['_logError'](_0x108b42)):_0x108b42['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x185fd9}),this['_logError'](_0x108b42)):_0x108b42['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':_0x185fd9}),this['_logError'](_0x108b42)):_0x108b42['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':_0x185fd9}),this['_logError'](_0x108b42)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x185fd9}),this['_logError'](_0x108b42));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x28ba79||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x3557ae,attributes:_0xbd5ae9}){if(!this['activeConversation'])throw new _0x465bb5('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x4762e4=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x4762e4);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x3557ae,'attributes':_0xbd5ae9});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x36b709){this['_aiChatUi']['setIsMaximized'](_0x36b709);}['_logError'](_0x4aa548){_0x238b54(_0x4aa548['message']);}['_removeFromContext'](_0x591e4a){this['activeConversation']?.['removeFromContext'](_0x591e4a);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0xdeee93){const [_0x4a87ab,_0x58d519]=_0xdeee93['split'](':'),_0x3e31a2=this['activeConversation']['getInteraction'](_0x4a87ab),_0x24ee4b=_0x3e31a2['getReply'](_0x58d519);return{'interaction':_0x3e31a2,'reply':_0x24ee4b};}['_scrollToSuggestionRange'](_0x5d8923,_0x400176=!0x1){const _0x5ea63b=T(this['context']),_0x2bec5e={'target':_0x5ea63b['editing']['view']['domConverter']['viewRangeToDom'](_0x5ea63b['editing']['mapper']['toViewRange'](_0x5d8923)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x400176};_0x400176&&(_0x2bec5e['alignToTop']=!0x0),_0x216c50(_0x2bec5e);}['updateConversationTitle'](_0x5f177a,_0x28a9e2=!0x1){this['_aiChatUi']['setConversationTitle'](_0x5f177a||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x28a9e2);}async['_updateReplyContent']({reply:_0x53f7c5,renderingStrategy:_0x2ca7be}){const {id:_0x1d6e11,interactionId:_0x188d3f,isDone:_0x4f89a6,type:_0x12ca54,parsedContent:_0x33b5b2}=_0x53f7c5,_0x2ddd9a=_0x188d3f+':'+_0x1d6e11;if('modification'===_0x12ca54){const _0x21b939=_0x53f7c5['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x2ddd9a,'parts':_0x21b939,'renderingStrategy':_0x2ca7be,'isDone':_0x4f89a6});}else'text'===_0x12ca54&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x2ddd9a,'parsedContent':_0x33b5b2,'renderingStrategy':_0x2ca7be,'isDone':_0x4f89a6});_0x4f89a6&&_0x53f7c5['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x2ddd9a,_0x53f7c5['sources']);}async['_stopLastInteraction'](){const _0x41ac57=this['activeConversation']?.['lastInteraction'];_0x41ac57&&(_0x41ac57['stop'](),this['_aiChatUi']['stopInteraction'](_0x41ac57));}async['_flushLastInteractionUI'](){const _0x56c2d9=this['activeConversation']?.['lastInteraction'];if(_0x56c2d9){for await(const _0x229fcc of _0x56c2d9['replies'])await this['_updateReplyContent']({'reply':_0x229fcc,'renderingStrategy':'static'});}}['_updateRatings'](_0x476801){const _0x39458b={'positiveCount':_0x476801['changeGroups']['filter'](_0x3f3bfd=>'accepted'===_0x3f3bfd['state'])['length'],'totalCount':_0x476801['changeGroups']['length'],'modificationId':_0x476801['id']},_0x37d7ad=this['activeConversation']['getInteraction'](_0x476801['interactionId'])['messageId'];_0x37d7ad&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x37d7ad,_0x39458b);}['_registerToolDataCallback'](_0x2fbf6e){let _0xc5611=null,_0x312e54=null;this['on']('toolDataReceived',(_0x2e2481,_0x2d91aa,_0x48f8e7)=>{_0x48f8e7['id']!==_0xc5611&&(_0xc5611=_0x48f8e7['id'],_0x312e54=this['_getAIChatInteractionAPI'](_0x48f8e7)),_0x2fbf6e(_0x2d91aa,_0x312e54);});}['_getAIChatInteractionAPI'](_0x28365e){const _0x6b7308=this['_aiChatUi'],_0x29c671=()=>{_0x28365e['resetWebSearchState'](),_0x28365e['resetReasoningState'](),_0x6b7308['clearLoadingMessage']();},_0x11846a=()=>{_0x28365e['currentReply']&&(_0x28365e['currentReply']['done'](),_0x28365e['currentReply']=void 0x0);};return{'insertTextReply':(_0x4f9630,_0x46e137)=>{_0x11846a(),_0x29c671();const _0x3755d9=_0x28365e['currentReply']=_0x28365e['createReply']({'type':'text','interactionId':_0x28365e['id'],'content':_0x4f9630,'id':_0x46e137||_0x41685d()});return _0x11846a(),_0x3755d9;},'insertCustomElement':async(_0x2f8e09,_0x1785a0)=>(_0x11846a(),_0x29c671(),_0x6b7308['addFeedItemCustomElement'](_0x2f8e09,_0x1785a0||_0x41685d())),'setLoadingMessage':_0x419cc0=>{_0x6b7308['setLoadingMessage'](_0x419cc0);},'clearLoadingMessage':()=>{_0x6b7308['clearLoadingMessage']();}};}}const R='ai-selection';class D extends _0x4720c1{constructor(_0x13e5fa){super(_0x13e5fa),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 _0x542b94=T(this['context']),_0x1c08c0=_0x542b94['plugins']['has']('RealTimeCollaborationClient')&&_0x542b94['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x1c08c0||_0x41685d();}return this['_sessionId'];}async['getDocumentData'](){const _0x1b7c74=T(this['context']),_0x1aab0d=_0x1b7c74['model'],_0x31d23e=_0x1b7c74['data']['toView'](_0x1aab0d['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x708b69=new Ot(_0x1b7c74['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x31d23e,_0x708b69);let _0x27a465=await this['_getDocumentDataStringFromView'](_0x31d23e);const _0x551ff4=this['_getMarkersInDocumentOrder'](),_0x3056bf=[];for(const _0x49a989 of _0x551ff4){const _0x3202d0='<'+_0x49a989['name']+':start></'+_0x49a989['name']+':start>',_0x43e245=_0x27a465['indexOf'](_0x3202d0);_0x27a465=_0x27a465['substring'](0x0,_0x43e245)+_0x27a465['substring'](_0x43e245+_0x3202d0['length']);const _0x2045b8='<'+_0x49a989['name']+':end></'+_0x49a989['name']+':end>',_0x3db35e=_0x27a465['indexOf'](_0x2045b8);_0x27a465=_0x27a465['substring'](0x0,_0x3db35e)+_0x27a465['substring'](_0x3db35e+_0x2045b8['length']),_0x3056bf['push']({'markerName':_0x49a989['name'],'start':_0x43e245,'end':_0x3db35e,'htmlFragment':_0x27a465['substring'](_0x43e245,_0x3db35e)});}return{'content':_0x27a465,'version':_0x1b7c74['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x3056bf};}async['afterInit'](){this['context']instanceof _0x2dbc4d?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2350ce,_0x1d2b37)=>{_0x1d2b37['on']('ready',()=>{this['_integrateEditor'](_0x1d2b37);});});}['_setOutputDataProcessor'](_0x211040){this['_outputDataProcessor']=_0x211040;}async['_getDocumentDataStringFromView'](_0x5e15c3){let _0xb87770;const _0x182729=T(this['context']);if(this['_outputDataProcessor']){const _0x2ba538=_0x182729['data']['processor']['domConverter']['viewToDom'](_0x5e15c3),_0x1f566a=await this['_outputDataProcessor'](_0x2ba538);_0xb87770=_0x182729['data']['processor']['htmlWriter']['getHtml'](_0x1f566a);}else _0xb87770=_0x182729['data']['processor']['toData'](_0x5e15c3);return _0xb87770;}['_integrateEditor'](_0x3ed618){_0x3ed618['conversion']['for']('editingDowncast')['markerToHighlight']({'model':R,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x3ed618['conversion']['for']('dataDowncast')['markerToElement']({'model':R,'view':(_0x1560ed,{writer:_0x12b48d,options:_0x3b13d8})=>_0x3b13d8['convertAiChatSelectionMarker']?_0x12b48d['createUIElement'](_0x1560ed['markerName']+':'+(_0x1560ed['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x370b21,_0x4e09a4,_0x5a728f=!0x1,_0x267242=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x267242)return!0x1;const _0x381f5e=T(this['context'])['model'];return _0x381f5e['change'](_0x1a94b7=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x4e09a4,this['_displayedFakeSelectionLocked']=_0x5a728f;let _0x360b5a=0x0;for(let _0x22c1ad of _0x370b21){const _0x4a9a17=R+':'+_0x360b5a;if(_0x22c1ad['start']['isAtEnd']){const _0x22c9c9=_0x22c1ad['start']['getLastMatchingPosition'](({item:_0xda93a5})=>!_0x381f5e['schema']['isContent'](_0xda93a5),{'boundaries':_0x22c1ad});_0x22c1ad=_0x1a94b7['createRange'](_0x22c9c9,_0x22c1ad['end']);}_0x1a94b7['addMarker'](_0x4a9a17,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x22c1ad}),_0x360b5a++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x2156ca){if(this['_displayedFakeSelectionId']!=_0x2156ca)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x142be5=T(this['context']),_0x46b24f=_0x142be5['model']['markers']['getMarkersGroup'](R);return _0x142be5['model']['change'](_0x54aef4=>{for(const _0x3b830b of _0x46b24f)_0x54aef4['removeMarker'](_0x3b830b);}),!0x0;}async['modelToDataWithIds'](_0x4b0410){const _0x3b9563=T(this['context']),_0xf29251=_0x3b9563['data']['toView'](_0x4b0410),_0x37d11e=new Ot(_0x3b9563['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0xf29251,_0x37d11e),this['_getDocumentDataStringFromView'](_0xf29251);}['_setDataIdsOnChildren'](_0x2648ff,_0x1b836e){let _0x17e954=!0x1;const _0x450855=new Set();for(const _0x12b1c0 of _0x2648ff['getChildren']()){const _0x2eb936=_0x12b1c0['is']('emptyElement')||_0x12b1c0['is']('containerElement');if(!_0x12b1c0['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x12b1c0,_0x1b836e)||_0x2eb936)&&(_0x1b836e['setAttribute']('data-id',this['_nextDataId'](_0x450855),_0x12b1c0),_0x17e954=!0x0);}return _0x17e954;}['_nextDataId'](_0x1a2669){let _0x24a297;do{_0x24a297='';for(let _0x17d0ca=0x0;_0x17d0ca<0x4;_0x17d0ca++)_0x24a297+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x1a2669['has'](_0x24a297));return _0x1a2669['add'](_0x24a297),_0x24a297;}['getSelectionText'](){const {model:_0x49f0dc}=T(this['context']),_0x25c05d=_0x49f0dc['document']['selection'],_0xd2bb6c=[];for(const _0x52fff7 of _0x25c05d['getRanges']())for(const _0x3f3bb6 of _0x52fff7['getItems']())_0x3f3bb6['is']('$textProxy')?_0xd2bb6c['push'](_0x3f3bb6['data']):_0x3f3bb6['is']('element')&&_0xd2bb6c['length']>0x0&&'\x20'!==_0xd2bb6c[_0xd2bb6c['length']-0x1]&&_0xd2bb6c['push']('\x20');return _0xd2bb6c['length']?'\x22'+_0xd2bb6c['join']('')['trim']()+'\x22':i(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0x45bdd8=T(this['context'])['model'];return Array['from'](_0x45bdd8['markers']['getMarkersGroup'](R))['sort']((_0x38d35b,_0x224c93)=>_0x38d35b['getStart']()['isBefore'](_0x224c93['getStart']())?-0x1:_0x38d35b['getStart']()['isAfter'](_0x224c93['getStart']())?0x1:0x0);}}const W=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Rt=[...W,'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(_0x4d93e7){this['options']={'delay':_0x4d93e7['delay']??0x14,'textNodeStyle':_0x4d93e7['textNodeStyle'],'onStreamUpdate':_0x4d93e7['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x4c0fe6,targetElement:_0xe5dbe8,abortSignal:_0x53539f}){this['isStreaming']&&this['stop'](),_0x53539f?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x5f4115(_0x4c0fe6,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x2463b1=0x0;_0x2463b1<this['currentIndex'];_0x2463b1++)this['nodesList'][_0x2463b1]['shouldBeStreamed']=!0x0;do{const _0x46346a=Date['now'](),_0x7f6d2c=this['nodesList'][this['currentIndex']],_0x4fb849=_0x46346a-this['lastUpdateTime'];if(_0x7f6d2c){_0x7f6d2c['shouldBeStreamed']=!0x0;let _0xeffc28=_0x7f6d2c['parent'];for(;_0xeffc28;)_0xeffc28['shouldBeStreamed']=!0x0,_0xeffc28=_0xeffc28['parent'];}if(_0x4fb849<this['options']['delay'])try{const {promise:_0x103e0d,abortController:_0x45a3e7}=Cs(this['options']['delay']-_0x4fb849);this['timeoutAbortController']=_0x45a3e7,await _0x103e0d;}catch(_0x16892d){return;}_0x2aa16c(_0xe5dbe8,'<'+_0xe5dbe8['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0xe5dbe8['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:_0x4437c5}){Array['from'](_0x4437c5['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0xbf9c41=>{_0xbf9c41['replaceWith'](_0xbf9c41['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x2543e3){let _0x4663a1='';if(function(_0x1785de){return _0x9f87b6(_0x1785de);}(_0x2543e3)){for(const _0x3927c6 of _0x2543e3['children'])_0x4663a1+=this['renderNode'](_0x3927c6);}else{if(Ts(_0x2543e3)){if(!_0x2543e3['shouldBeStreamed'])return'';const _0xd4b6e4=_0x2543e3,_0x554217=Object['entries'](_0xd4b6e4['attribs'])['map'](([_0x383fec,_0x3d4635])=>_0x383fec+'=\x22'+_0x3d4635+'\x22')['join']('\x20');_0x4663a1+='<'+_0xd4b6e4['tagName']+(_0x554217?'\x20'+_0x554217:'')+'>';for(const _0x5d6e8a of _0x34d137(_0xd4b6e4))_0x4663a1+=this['renderNode'](_0x5d6e8a);_0x4663a1+='</'+_0xd4b6e4['tagName']+'>';}else{if(!Ss(_0x2543e3))return'';if(!_0x2543e3['shouldBeStreamed'])return'';!function(_0xb2fda4){if(!_0xb2fda4['parent']||!Ts(_0xb2fda4['parent']))return!0x1;if(!ys['includes'](_0xb2fda4['parent']['tagName']))return!0x1;return!_0x2ebfb5(_0xb2fda4)['match'](/^\s*[<>]\s*$/);}(_0x2543e3)?_0x4663a1+=_0xdda3ad(_0x2543e3):_0x4663a1+=_0xdda3ad(new _0x4f7e65('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x2543e3]));}}return _0x4663a1;}['getParsedDocumentNodeList'](){const _0xc74570=[];return function(_0x243729,_0x44890f){const _0x3c43f5=_0x2c15eb=>{if(_0x44890f(_0x2c15eb),_0x2c15eb instanceof _0x4ace11)for(let _0x142338=0x0;_0x142338<_0x2c15eb['children']['length'];_0x142338++){const _0x56c78f=_0x2c15eb['children'][_0x142338];_0x3c43f5(_0x56c78f);}};for(let _0x5a0cc7=0x0;_0x5a0cc7<_0x243729['children']['length'];_0x5a0cc7++)_0x3c43f5(_0x243729['children'][_0x5a0cc7]);}(this['document'],_0x550665=>{if(Ss(_0x550665)){const _0xe2e9d7=this['splitTextNodeIntoWordNodes'](_0x550665);_0xe2e9d7['length']&&_0xc74570['push'](..._0xe2e9d7);}_0x550665['isWordSplitSource']||_0x550665['isWordSplitResult']||_0xc74570['push'](_0x550665);}),_0xc74570;}['splitTextNodeIntoWordNodes'](_0x54f53e){if(_0x54f53e['isWordSplitSource']||_0x54f53e['isWordSplitResult'])return[];const _0x52c657=_0x2ebfb5(_0x54f53e)['match'](/(?:\s*\S+\s*)/g),_0x3c985c=[];if(_0x52c657&&_0x52c657['length']>0x1){for(const _0x46d911 of _0x52c657){const _0x2e1407=new _0x417ece(_0x46d911);_0x2e1407['isWordSplitResult']=!0x0,_0x4f4de1(_0x54f53e,_0x2e1407),_0x3c985c['push'](_0x2e1407);}_0x54f53e['isWordSplitSource']=!0x0,_0x35ad72(_0x54f53e);}return _0x3c985c;}}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(_0x4d5c26){return _0x59cfad(_0x4d5c26);}function Ts(_0x5ac179){return _0x3514bb(_0x5ac179);}function Cs(_0x3ffa4f){const _0x234d3d=new AbortController();return{'promise':new Promise((_0x15140b,_0x5ba7dd)=>{const _0x57c1bc=setTimeout(_0x15140b,_0x3ffa4f);_0x234d3d['signal']['addEventListener']('abort',()=>{clearTimeout(_0x57c1bc),_0x5ba7dd();});}),'abortController':_0x234d3d};}class Fr extends _0x26817f{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0xa27018){super();const _0x3d5508=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']=_0xa27018,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x3d5508['if']('isDone','ck-ai-chat__feed__item_done'),_0x3d5508['if']('isVisible','ck-hidden',_0x3c7737=>!_0x3c7737),'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'](_0x2afb65=>{_0x2afb65['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x4cc0fe,_0x325fc7,_0x33a05f){await this['htmlStreamer']['stream']({'document':_0x4cc0fe,'targetElement':_0x325fc7,'abortSignal':_0x33a05f});}}class oa extends _0x26817f{['showChangesToggleView'];constructor(_0x3be01b,_0x109d70){super(_0x3be01b),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new ShowChangesToggleView(_0x3be01b),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x3be01b,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x109d70['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x4d4f07=>_0x4d4f07?_0xc46dd8:_0x19293e),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x41f8ca=new _0x3c69cf();_0x41f8ca['content']=_0x49fd6e,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x109d70['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x41f8ca,{'tag':'span','children':[i(_0x3be01b,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class ShowChangesToggleView extends _0x33ce64{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const $n={'accepted':_0x54188d,'rejected':_0x14f1a0,'outdated':_0x14f1a0};class mi extends _0x26817f{['stateIconView'];constructor(_0xc8757c){super(_0xc8757c);const _0x18ac0f=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new StateIconView(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x18ac0f['to']('state',_0x24f28a=>'ck-ai-suggestion__content-part-state_'+_0x24f28a),_0x18ac0f['if']('isVisible','ck-hidden',_0x219ef4=>!_0x219ef4)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x18ac0f['to']('state',_0xc3a335=>{switch(_0xc3a335){case'accepted':return i(_0xc8757c,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return i(_0xc8757c,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return i(_0xc8757c,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x2d7752){this['state']=_0x2d7752;}}class StateIconView extends _0x3c69cf{constructor(){super(),this['set']('state','accepted'),this['content']=$n[this['state']],this['on']('change:state',()=>{this['content']=$n[this['state']];});}}class gi extends _0x5ec0fa{['_applyButton'];['_suggestButton'];constructor(_0x2e48b9,_0x15d0ba,_0x50417b){super(_0x2e48b9);const _0xd79141=Boolean(_0x50417b);this['set']('isEnabled',!_0xd79141),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x981bcc=[];if(_0xd79141){const _0x58e2b0=new _0x33ce64(_0x2e48b9);_0x58e2b0['set']({'label':i(_0x2e48b9,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x401c5c}),_0x981bcc['push'](_0x58e2b0);}else{_0x15d0ba['includes']('applySuggestion')&&(this['_applyButton']=new _0x33ce64(_0x2e48b9),this['_applyButton']['set']({'label':i(_0x2e48b9,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x54188d}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x981bcc['push'](this['_applyButton'])),_0x15d0ba['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x33ce64(_0x2e48b9),this['_suggestButton']['set']({'label':i(_0x2e48b9,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x6ba517}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x981bcc['push'](this['_suggestButton']));const _0x526afc=new _0x33ce64(_0x2e48b9);_0x526afc['set']({'label':i(_0x2e48b9,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x14f1a0}),_0x526afc['bind']('isEnabled')['to'](this),_0x526afc['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x981bcc['push'](_0x526afc);}this['items']['addMany'](_0x981bcc);const _0x5e7182=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x5e7182['if']('isVisible','ck-hidden',_0xde7a3a=>!_0xde7a3a)]}});}['setButtonsVisibility']({showApplyButton:_0x28c902,showSuggestButton:_0x537a23}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x28c902),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x537a23);}}class vn extends _0x26817f{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x3d23e5,{part:_0x2fa4ed,uiIndex:_0x3850fd,availableActions:_0xedf8ab,areActionsDisabled:_0x5e4ff7}){super(_0x3d23e5),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new gi(_0x3d23e5,_0xedf8ab,_0x5e4ff7),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x2fa4ed['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x2fa4ed['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x2fa4ed['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new mi(_0x3d23e5),this['titleLabelView']=new AISuggestionBodyContentPartTitleLabelView(_0x3d23e5,_0x3850fd),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',(_0x9a8e25,_0x3443fc,_0x560116,_0x65bba9)=>{'pending'===_0x65bba9?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x560116?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x560116),this['children']['add'](this['stateView']));});}}class AISuggestionBodyContentPartTitleLabelView extends _0x26817f{constructor(_0x3f1242,_0x16fcf0){super(_0x3f1242),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x3f1242,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x16fcf0['toString']())]});}}class ui extends _0x26817f{['htmlStreamer'];constructor(_0x5816c3){super(_0x5816c3),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:_0x59fdfc,renderingStrategy:_0x16fb2b,abortSignal:_0x339e59}){'streaming'===_0x16fb2b?await this['htmlStreamer']['stream']({'document':_0x59fdfc['content'],'targetElement':this['element'],'abortSignal':_0x339e59}):this['element']['innerHTML']=pt(_0x59fdfc['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0x26817f{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x5c0e55,{part:_0x399c93,uiIndex:_0x7ef6b7,areActionsDisabled:_0x25c213,availableActions:_0x535d06}){super(_0x5c0e55);const _0x523b05=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x1ec3ea=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x25c213;};this['on']('change:state',_0x1ec3ea),this['on']('change:isDone',_0x1ec3ea),_0x1ec3ea(),this['_children']=this['createCollection'](),this['_headerView']=new vn(_0x5c0e55,{'part':_0x399c93,'uiIndex':_0x7ef6b7,'availableActions':_0x535d06,'areActionsDisabled':_0x25c213}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...W)['to'](this),this['_streamableContentView']=new ui(_0x5c0e55),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x523b05['to']('state',_0x374d00=>'ck-ai-suggestion__body__content-part_'+_0x374d00),_0x523b05['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x523b05['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x523b05['if']('isVisible','ck-hidden',_0x505631=>!_0x505631)]},'children':this['_children'],'on':{'mouseenter':_0x523b05['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x399c93['index']});}),'mouseleave':_0x523b05['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x399c93['index']});}),'click':_0x523b05['to'](_0x5e1623=>{const _0x1b8e7e=_0x5e1623['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x1b8e7e)&&this['fire']('showChangeInText',{'index':_0x399c93['index']});})}});}async['updateContent']({part:_0x4c7b99,renderingStrategy:_0x3a0bc0,showUnchangedParts:_0x432135=!0x1,abortSignal:_0x3c38ff}){this['partDefinition']=_0x4c7b99,this['isVisible']=this['partDefinition']['hasChanges']||_0x432135,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x4c7b99,'renderingStrategy':_0x3a0bc0,'abortSignal':_0x3c38ff});}['markAsDone'](){this['isDone']=!0x0;}}class St extends _0x2eb18e(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x1baabc){const _0x45829a=this['createTask'](_0x1baabc);return this['queue']['push'](_0x45829a),this['_processQueue'](),_0x45829a['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(_0x6fd569=>{this['once']('_queueEmpty',()=>{_0x6fd569();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x28add0=this['queue']['shift']();try{await _0x28add0['callback'](this['_abortController']['signal']),_0x28add0['resolve']();}catch(_0x4c14eb){_0x28add0['reject'](_0x4c14eb);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x34b13d){let _0x33fd82,_0x250154;const _0x135431=new Promise((_0xbebbe9,_0x4c2cd2)=>{_0x33fd82=_0xbebbe9,_0x250154=_0x4c2cd2;});return{'callback':_0x34b13d,'resolve':_0x33fd82,'reject':_0x250154,'completePromise':_0x135431};}}class Ke extends Fr{constructor(_0x5cac41){super(_0x5cac41),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x5cac41['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x248ab5){this['element']['innerHTML']=_0x248ab5;}}const J=['applySuggestion','insertSuggestion'];class ra extends _0x26817f{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x248fc2,_0x40eb60=[...J],_0xd618ab){super(_0x248fc2);const _0x244f25=this['bindTemplate'],_0x3ec588=Boolean(_0xd618ab);if(this['set']('isEnabled',!_0x3ec588),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x3ec588){const _0x4153bd=new _0x33ce64(_0x248fc2);_0x4153bd['set']({'label':i(_0x248fc2,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x401c5c});const _0x3874b6=new _0x26817f(_0x248fc2);_0x3874b6['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[i(_0x248fc2,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x4153bd]}]}),this['children']['add'](_0x3874b6);}else this['_applyChangesButton']=new _0x33ce64(_0x248fc2),this['_applyChangesButton']['set']({'label':i(_0x248fc2,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x40eb60['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x33ce64(_0x248fc2),this['_insertSuggestionsButton']['set']({'label':i(_0x248fc2,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x40eb60['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'](_0x24fdb7=>{_0x24fdb7['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',_0x244f25['if']('isVisible','ck-hidden',_0x36fdb6=>!_0x36fdb6)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0xcf9587){this['isVisible']=_0xcf9587;}['_switchButtonLabelsPlurality'](_0x3fd280){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x3fd280?(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 _0x26817f{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x39e03e,_0xa37be8){super(_0x39e03e),this['bodyCollection']=_0xa37be8,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',_0x1b7b97=>!_0x1b7b97)]},'children':this['children']});const _0x53f5d9=new _0x26817f(this['locale']),_0x2c87bb=new _0x3c69cf();_0x2c87bb['content']=_0x36170b,_0x53f5d9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x2c87bb,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x53f5d9),this['_setupBalloonPanel'](_0x39e03e);}['addSource'](_0x344bba){this['children']['add'](new qr(this['locale'],_0x344bba,this['balloonPanelView']));}['_setupBalloonPanel'](_0x4fae88){this['balloonPanelView']=new _0x59db14(_0x4fae88),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class qr extends _0x33ce64{['balloonPanelView'];['source'];constructor(_0x558725,_0x28d9ad,_0x77942b){super(_0x558725),this['source']=_0x28d9ad,this['balloonPanelView']=_0x77942b,this['set']({'label':_0x28d9ad['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x106c46=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x106c46['to'](()=>{window['open'](_0x28d9ad['url'],'_blank');}),'mouseenter':_0x106c46['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x106c46['to'](()=>{this['_hideTooltip']();})}}),_0x28d9ad['favicon']){const _0x4d6959=new _0x26817f(_0x558725);_0x4d6959['setTemplate']({'tag':'img','attributes':{'src':_0x28d9ad['favicon']||_0x36170b,'alt':_0x28d9ad['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x4d6959);}else this['set']('icon',_0x36170b);}['_createTooltipContentView'](_0x4df7c9,_0x484c57){const _0x4ceadd=new _0x26817f(_0x4df7c9),_0x114455=[];let _0x27f83b;_0x484c57?.['favicon']?(_0x27f83b=new _0x26817f(_0x4df7c9),_0x27f83b['setTemplate']({'tag':'img','attributes':{'src':_0x484c57['favicon'],'alt':_0x484c57['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x27f83b=new _0x3c69cf(),_0x27f83b['content']=_0x36170b,_0x27f83b['extendTemplate']({'attributes':{'alt':_0x484c57['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x114455['push'](_0x27f83b);const _0x4aa284=new _0x26817f(_0x4df7c9);_0x4aa284['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x484c57['url']},'children':[{'text':new URL(_0x484c57['url'])?.['hostname']}]}),_0x114455['push'](_0x4aa284);const _0x46de5f=new _0x26817f(_0x4df7c9);_0x46de5f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x114455});const _0x35fc4d=new _0x26817f(_0x4df7c9);return _0x35fc4d['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x484c57['title']['length']>0x190?_0x484c57['title']['substring'](0x0,0x190)+'...':_0x484c57['title']}]}),_0x4ceadd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x46de5f,_0x35fc4d]}),_0x4ceadd;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x59db14['defaultPositions']['northArrowSouth'],_0x59db14['defaultPositions']['northArrowSouthWest'],_0x59db14['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 _0x1c1d0b=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x1c1d0b);}}class ca extends _0x26817f{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x5a3727,_0x36c9c2){super(_0x5a3727);const {areActionsDisabled:_0x2d1277,showUnchangedParts:_0x1c02cf,availableActions:_0x5ebfd9}=_0x36c9c2;this['_areActionsDisabled']=_0x2d1277,this['_showUnchangedParts']=_0x1c02cf,this['_availableActions']=_0x5ebfd9,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new St(),this['_emptyPartsWarningView']=new Ke({'id':'empty-parts-warning','initialContent':i(_0x5a3727,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x5a3727,_0x36c9c2['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sr(this['locale'],_0x36c9c2['bodyCollection']),_0x36c9c2['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...W)['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:_0x626fa3,renderingStrategy:_0x518944,abortSignal:_0x130d2b}){this['_children']['length']?_0x626fa3['forEach'](_0x3cad82=>{const _0x4e9cd4=this['_cachedContentParts']['findIndex'](_0x414db2=>_0x414db2['index']==_0x3cad82['index']);-0x1===_0x4e9cd4?this['_cachedContentParts']['push'](_0x3cad82):this['_cachedContentParts'][_0x4e9cd4]=_0x3cad82;}):this['_cachedContentParts']=_0x626fa3;const _0x365f37=this['_showUnchangedParts']?_0x626fa3:_0x626fa3['filter'](_0x4e5597=>_0x4e5597['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x365f37['length']>0x1);for(const _0x3845ac of _0x365f37)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x19d94e=>{let _0x4aa86d=this['getPartView'](_0x3845ac['index']);_0x4aa86d||(_0x4aa86d=new na(this['locale'],{'part':_0x3845ac,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x4aa86d['delegate'](...W)['to'](this),this['_children']['add'](_0x4aa86d),this['hasPendingParts']=!0x0),await _0x4aa86d['updateContent']({'part':_0x3845ac,'renderingStrategy':_0x518944,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x19d94e}),_0x4aa86d['markAsDone']();});return _0x130d2b?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x353637,_0x3f4cc7){const _0x34682a=this['getPartView'](_0x353637);_0x34682a&&(_0x34682a['state']=_0x3f4cc7),this['hasPendingParts']='pending'==_0x3f4cc7||Array['from'](this['_children'])['some'](_0x3a09d5=>'pending'==_0x3a09d5['state']);}['setPartActive'](_0x280ec3,_0x1e404e){if(!0x1===_0x280ec3){for(const _0x2ea8af of this['_children'])_0x2ea8af['isActive']=!0x1;}else{const _0x37bdd2=this['getPartView'](_0x280ec3);_0x37bdd2&&(_0x37bdd2['isActive']=_0x1e404e);}}['updateSources'](_0x385671){_0x385671['forEach'](_0x5c49ec=>this['_sourcesView']['addSource'](_0x5c49ec)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x514a8b){return this['_children']['find'](_0x3c1434=>_0x3c1434['partDefinition']['index']==_0x514a8b)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x407e18=!this['_cachedContentParts']['find'](({hasChanges:_0x3667c4})=>_0x3667c4),_0x591eed=!!this['_cachedContentParts']['find'](({hasChanges:_0x1b3992})=>!_0x1b3992);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x591eed,_0x407e18?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'](_0x5c4369=>_0x5c4369['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x4ef94f=>_0x4ef94f['partDefinition']['hasChanges'])['length']>0x0;}}class gn extends _0x26817f{['bodyView'];['children'];['headerView'];constructor(_0x307dd2,_0x20970d,_0xa958a5){super(_0x307dd2);const {showDiff:_0x236d38,areActionsDisabled:_0xc4c79d,showUnchangedParts:_0x51d948,availableActions:_0x4f2772}=_0x20970d;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0x307dd2,{'showDiff':_0x236d38}),this['headerView']['on']('toggleShowChanges',(_0x361bc2,_0x1583eb)=>{this['areChangesVisible']=_0x1583eb['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x1583eb['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ca(_0x307dd2,{'areActionsDisabled':_0xc4c79d,'showUnchangedParts':!!_0x51d948,'availableActions':_0x4f2772,'bodyCollection':_0xa958a5}),this['bodyView']['delegate'](...W)['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'](_0x49e53a){await this['bodyView']['updateContentParts'](_0x49e53a);}['updateSources'](_0x359f3f){this['bodyView']['updateSources'](_0x359f3f);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Be extends Fr{['containerView'];constructor(_0x36f3ed,_0x40490c,_0x538e72){super(_0x40490c),this['set']('isTrackChangesOn',!0x1),this['containerView']=new gn(_0x36f3ed,{'showDiff':_0x40490c['showDiff'],'areActionsDisabled':_0x40490c['areActionsDisabled'],'availableActions':_0x40490c['availableActions']},_0x538e72),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x4f437d,_0x5b048b)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x5b048b['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',(_0x5a7a1c,{index:_0x62b10c})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x62b10c});}),this['containerView']['on']('applySuggestion',(_0xd647f6,{index:_0x4d8a6b}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x4d8a6b});}),this['containerView']['on']('insertSuggestion',(_0x4a072d,{index:_0x3e987f}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3e987f});}),this['containerView']['on']('rejectSuggestion',(_0x1d351a,{index:_0x273f7d})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x273f7d});}),this['containerView']['on']('mouseOverSuggestion',(_0x1ce227,{index:_0x3aa996})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3aa996});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x4db48a,{index:_0x39eb87})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x39eb87});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x4388ed){await this['containerView']['updateContent'](_0x4388ed);}['updatePartState'](_0x11f239,_0x81b298){this['containerView']['bodyView']['updatePartState'](_0x11f239,_0x81b298);}['setPartActive'](_0x4315b8,_0x39cf55){!0x1===_0x4315b8?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x4315b8,_0x39cf55);}['updateSources'](_0x32932f){this['containerView']['updateSources'](_0x32932f);}['getPartView'](_0x4be87e){return this['containerView']['bodyView']['getPartView'](_0x4be87e);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class qe extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x404699,_0x38a2b4,_0x5eed92){super(_0x38a2b4),this['_bodyCollection']=_0x5eed92,this['locale']=_0x404699,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x26817f(),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':qi(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x275fbe,renderingStrategy:_0x252f5a,abortSignal:_0x2d268c}){'streaming'===_0x252f5a?await this['streamIntoElement'](_0x275fbe,this['replyContainer']['element'],_0x2d268c):this['replyContainer']['element']['innerHTML']=_0xdda3ad(_0x275fbe);}['updateSources'](_0x2fcbd2){const _0x47d5d2=new Sr(this['locale'],this['_bodyCollection']);_0x47d5d2['children']['addMany'](_0x2fcbd2['map'](_0x114016=>new qr(this['locale'],_0x114016,_0x47d5d2['balloonPanelView']))),_0x47d5d2['isVisible']=!0x0,this['children']['add'](_0x47d5d2);}}class Ze extends _0x344070{constructor(_0x307760=void 0x0){super();const _0x9efe37=_0x307760?'ck-ai-spinner_'+_0x307760:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x9efe37]}});}}const xn={'file':_0x1f8979,'document':_0x46c25f,'web-resource':_0x167706,'text':_0x1f8979,'selection':_0x3a97c0,'mcp-tool-context':_0x46c25f},qn='ck-ai-chat-context-chip',Qn='ck-ai-chat-context-chip_wide',Xn='ck-ai-chat-context-chip_document',zn='ck-ai-chat-context-chip__label',Jn='ck-ai-chat-context-chip__type-icon',Zn='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class vo extends _0x33ce64{constructor(_0x246cfa,_0x36abe6,_0x1fee62,_0x109d5c,_0x25ad78=!0x1){super(_0x246cfa),this['_isAnimationOnEnterEnabled']=_0x109d5c,this['_initializeProperties'](_0x36abe6,_0x1fee62,_0x25ad78),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'](_0x47e81d,_0x10a031,_0x8cfa37){this['set']('label',_0x47e81d['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x47e81d['type']),this['set']('id',_0x47e81d['uiId']),this['set']('readonly',_0x10a031),this['set']('isLoading',_0x8cfa37);}['_setupTemplate'](){const _0x1aa693=this['_createIconView'](),_0x2f7dc5=this['_createRemoveButton'](),_0x160df5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x160df5),'children':this['_createTemplateChildren'](_0x1aa693,_0x2f7dc5,_0x160df5)});}['_createTemplateAttributes'](_0x28f379){return{'class':[qn,_0x28f379['if']('itemType',Xn,_0x991c0d=>'document'==_0x991c0d),_0x28f379['if']('itemType',Qn,_0x35eb8a=>'selection'==_0x35eb8a)],'data-cke-tooltip-text':_0x28f379['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':Zn};}['_createTemplateChildren'](_0x2f0e08,_0x5d3af3,_0x316084){const _0x5b9eca=this['_createLabelElement'](_0x316084),_0x331db1=this['_createLoaderIcon']();return this['readonly']?[_0x2f0e08,_0x5b9eca]:[_0x2f0e08,_0x331db1,_0x5b9eca,_0x5d3af3];}['_createLabelElement'](_0x12e760){return{'tag':'span','attributes':{'class':zn},'children':[{'text':_0x12e760['to']('label')}]};}['_createRemoveButton'](){const _0x42452a=new _0x33ce64(this['locale']);return _0x42452a['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x938be8}),this['_setupRemoveButtonEvent'](_0x42452a),_0x42452a;}['_setupRemoveButtonEvent'](_0x3c7825){_0x3c7825['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x591724=this['bindTemplate'],_0x3c60af=new _0x3c69cf();return _0x3c60af['content']=xn[this['itemType']],_0x3c60af['extendTemplate']({'attributes':{'class':[Jn,_0x591724['if']('isLoading','ck-hidden',_0x2336af=>_0x2336af)]}}),_0x3c60af;}['_handleAnimationEndOnce'](_0x59a251,_0x58319){if(!_0x59a251)return;const _0xd3c522=()=>{_0x58319(),_0x59a251['removeEventListener']('animationend',_0xd3c522),_0x59a251['removeEventListener']('webkitAnimationEnd',_0xd3c522);};_0x59a251['addEventListener']('animationend',_0xd3c522),_0x59a251['addEventListener']('webkitAnimationEnd',_0xd3c522);}['_createLoaderIcon'](){const _0x6ef10e=new Ze('small');return _0x6ef10e['bind']('isVisible')['to'](this,'isLoading',_0x450a57=>_0x450a57),_0x6ef10e;}}function In(_0x4a65d9){if(!_0x4a65d9)return _0x4a65d9;if(_0x4a65d9['length']<=0x78)return _0x4a65d9;const _0x5b3571=_0x4a65d9['slice'](0x0,0x78),_0x1f1701=_0x5b3571['lastIndexOf']('\x20');return(_0x1f1701>0x0?_0x5b3571['slice'](0x0,_0x1f1701):_0x5b3571)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Io{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x5392ad,_0x564843,_0x5b6415,_0x1e944e,_0x3a6e9e){this['_locale']=_0x5392ad,this['_visibleChips']=_0x564843,this['_config']={...hn,..._0x5b6415,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x5b6415['cssClasses']}},this['_overflowChips']=new _0x2c18a8(),this['_bodyCollection']=_0x1e944e,this['_parentView']=_0x3a6e9e||null;}['setContainerElement'](_0x21df84){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x21df84,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 _0x46ffcc=[...this['_visibleChips'],...this['_overflowChips']],_0x69dbe8=this['_createCalculationContainer'](),_0xd83217=this['_calculateOverflowInContainer'](_0x69dbe8,_0x46ffcc),_0xcd35b3=_0x69dbe8['_ancestorsToRestore'];_0xcd35b3&&this['_restoreAncestorVisibility'](_0xcd35b3),_0x69dbe8['remove'](),this['_applyOverflowResults'](_0x46ffcc,_0xd83217);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x38a160({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x3267f7=new _0x33ce64(this['_locale']);_0x3267f7['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x12992d=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x12992d['push'](this['_config']['cssClasses']['controlsButton']),_0x3267f7['extendTemplate']({'attributes':{'class':_0x12992d}}),_0x3267f7;}['_createShowMoreBalloonPanelView'](){const _0x1efa1b=new _0x59db14(this['_locale']);return _0x1efa1b['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x1efa1b),_0x1efa1b;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x3605b4=>{_0x3605b4['disableAnimationOnEnter']();});const _0x508a04=new _0x26817f(this['_locale']);_0x508a04['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x508a04);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x5cef3d=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x5cef3d?'':'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'](_0x432ae7){const _0x4bf27c=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x45b06a=this['_containerElement']?.['classList'];if(_0x45b06a){const _0x560cb7=_0x45b06a[0x0]||'',_0x346b10=_0x432ae7['querySelector']('.'+_0x560cb7),_0x3ed701=_0x432ae7['querySelector'](_0x4bf27c);return _0x346b10||_0x3ed701||_0x432ae7;}return _0x432ae7['querySelector'](_0x4bf27c)||_0x432ae7;}['_calculateContainerWidth'](){const _0x26e5fd=this['_parentView']?.['element']||this['_containerElement'];if(!_0x26e5fd)return an;const _0x29118e=window['getComputedStyle'](_0x26e5fd)['width'];if('auto'===_0x29118e||'0px'===_0x29118e||!_0x29118e){const _0x509a76=_0x26e5fd['parentElement'];if(_0x509a76){const _0x31c422=window['getComputedStyle'](_0x509a76);return'auto'!==_0x31c422['width']?_0x31c422['width']:an;}return an;}return _0x29118e;}['_applyCalculationStyles'](_0x38bd52,_0x52737f){this['_config']['cssClasses']['calculationContainer']&&_0x38bd52['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x38bd52['style']['width']=_0x52737f,_0x38bd52['style']['position']='absolute',_0x38bd52['style']['top']='-9999px',_0x38bd52['style']['left']='-9999px',_0x38bd52['style']['opacity']='0',_0x38bd52['style']['pointerEvents']='none',_0x38bd52['style']['zIndex']='-1',_0x38bd52['style']['visibility']='visible\x20!important',_0x38bd52['style']['display']='block\x20!important',_0x38bd52['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x4dad56){_0x4dad56['forEach'](({element:_0x2be5c4,originalDisplay:_0x110b49,originalVisibility:_0x444638})=>{_0x2be5c4['style']['display']=_0x110b49,_0x2be5c4['style']['visibility']=_0x444638;});}['_makeAncestorsVisible'](_0x49d034){const _0x4c0c58=[];let _0x457a4d=_0x49d034;for(;_0x457a4d&&_0x457a4d!==document['body'];){const _0xc4cefb=window['getComputedStyle'](_0x457a4d);'none'!==_0xc4cefb['display']&&'hidden'!==_0xc4cefb['visibility']||(_0x4c0c58['push']({'element':_0x457a4d,'originalDisplay':_0x457a4d['style']['display'],'originalVisibility':_0x457a4d['style']['visibility']}),_0x457a4d['style']['display']='block',_0x457a4d['style']['visibility']='visible'),_0x457a4d=_0x457a4d['parentElement'];}return _0x4c0c58;}['_createContainerElements'](){let _0x4cc76e,_0x5c3291;return this['_parentView']?.['element']?(_0x4cc76e=this['_parentView']['element']['cloneNode'](!0x0),_0x5c3291=this['_findTargetContainer'](_0x4cc76e)):(_0x4cc76e=document['createElement']('div'),_0x5c3291=_0x4cc76e),{'calculationContainer':_0x4cc76e,'targetContainer':_0x5c3291};}['_createCalculationContainer'](){const {calculationContainer:_0x3db526,targetContainer:_0x5b5309}=this['_createContainerElements'](),_0x43689c=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x3db526,_0x43689c);const _0x3614d4=this['_parentView']?.['element']||this['_containerElement'],_0x2a4847=_0x3614d4?.['parentElement'];_0x2a4847?_0x2a4847['appendChild'](_0x3db526):document['body']['appendChild'](_0x3db526),_0x3db526['_targetContainer']=_0x5b5309;const _0x33c404=this['_makeAncestorsVisible'](_0x2a4847||null);return _0x3db526['offsetWidth'],_0x3db526['_ancestorsToRestore']=_0x33c404,_0x3db526;}['_calculateOverflowInContainer'](_0x340005,_0xe36e65){const _0x5ae1b9=_0x340005['_targetContainer']||_0x340005,_0x404e7f=[],{rowCount:_0x1752a7}=this['_renderChipsAndCountRows'](_0x5ae1b9,_0xe36e65);if(_0x1752a7<=this['_config']['maxVisibleRows'])return _0x404e7f;const _0x4af06d=_0xe36e65['slice']();for(;_0x4af06d['length']>0x0;){if(this['_testButtonFit'](_0x340005,_0x5ae1b9,_0x4af06d)){const _0x184f20=_0xe36e65['filter'](_0x46d3f5=>!_0x4af06d['includes'](_0x46d3f5));_0x404e7f['push'](..._0x184f20);break;}if(!_0x4af06d['pop']())break;}return _0x404e7f;}['_renderChipsAndCountRows'](_0x1d8520,_0x49e5b4){_0x1d8520['innerHTML']='',_0x49e5b4['forEach'](_0x1326ab=>{if(_0x1326ab['element']){const _0x4ab4a6=_0x1326ab['element']['cloneNode'](!0x0);_0x1d8520['appendChild'](_0x4ab4a6);}}),_0x1d8520['offsetWidth'];const _0x27e1e1=_0x1d8520['children'],_0x575dec=[];return Array['from'](_0x27e1e1)['forEach'](_0x36a6f9=>{const _0x169533=_0x36a6f9['getBoundingClientRect']()['top'];_0x575dec['some'](_0x181d75=>Math['abs'](_0x181d75-_0x169533)<this['_config']['rowDetectionTolerance'])||_0x575dec['push'](_0x169533);}),{'rowCount':_0x575dec['length']};}['_createMockButton'](){const _0x2716ef=document['createElement']('button');return _0x2716ef['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x2716ef['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x2716ef['textContent']='+\x201',_0x2716ef;}['_testButtonFit'](_0x25d3a1,_0xa30ed1,_0x154b8b){this['_renderChipsAndCountRows'](_0xa30ed1,_0x154b8b);const _0x49c4d2=this['_createMockButton']();_0x25d3a1['appendChild'](_0x49c4d2),_0x25d3a1['offsetWidth'];const _0x422b96=[..._0xa30ed1['children'],_0x49c4d2],_0x3cc33d=[];_0x422b96['forEach'](_0x1ade1c=>{const _0xa0c022=_0x1ade1c['getBoundingClientRect']()['top'];_0x3cc33d['some'](_0x44e91c=>Math['abs'](_0x44e91c-_0xa0c022)<this['_config']['rowDetectionTolerance'])||_0x3cc33d['push'](_0xa0c022);});const _0x2ab236=_0x3cc33d['length'];return _0x49c4d2['remove'](),_0x2ab236<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x1751ee,_0x76c643){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x1751ee['forEach'](_0x27efeb=>{_0x76c643['includes'](_0x27efeb)?this['_overflowChips']['add'](_0x27efeb):this['_visibleChips']['add'](_0x27efeb);});}['_updateOverflowUI'](_0x574b9e){if(_0x574b9e>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x574b9e>0x0&&this['_showMoreButtonView']){const _0x310d0c=''+this['_config']['showMoreLabelPrefix']+(_0x574b9e<0x63?_0x574b9e:'99');this['_showMoreButtonView']['label']=_0x310d0c;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x44eed1,_0x8e053){this['_distributeChips'](_0x44eed1,_0x8e053),this['_updateOverflowUI'](_0x8e053['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x2aa3e2=>{_0x2aa3e2[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 _0x3269ec=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x3269ec['width']||0x0===_0x3269ec['height'])return!0x1;const _0x7e3e82=window['innerHeight']||document['documentElement']['clientHeight'],_0x574cd6=window['innerWidth']||document['documentElement']['clientWidth'],_0x124062=0xc8;return _0x3269ec['bottom']>=-0xc8&&_0x3269ec['top']<=_0x7e3e82+_0x124062&&_0x3269ec['right']>=-0xc8&&_0x3269ec['left']<=_0x574cd6+_0x124062;}}const Or='ck-ai-chat__feed__context-chips',Nr='ck-ai-chat-context-chips-wrapper',Ur='ck-ai-chat-context-chips-wrapper-balloon',Wr='ck-ai-chat-controls-button',Yr='ck-ai-chat-controls_context_show-more-button',$r='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0x26817f{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x2f1c4a,_0x4594a5,_0x5e71d4){super(_0x2f1c4a),this['_bodyCollection']=_0x5e71d4,this['_createContextChips'](_0x4594a5);const _0x33a138={'cssClasses':{'showMoreButton':Yr,'showMoreBalloon':$r,'overflowContainer':Ur,'controlsButton':Wr}};this['_overflowManager']=new Io(_0x2f1c4a,this['_contextChips'],_0x33a138,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Or,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Nr},'children':this['_contextChips']}]});}['render'](){super['render']();const _0xfeed2b=this['element']['querySelector']('.'+Nr);_0xfeed2b&&(this['_overflowManager']['setContainerElement'](_0xfeed2b),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x4257da){for(const _0x41c198 of _0x4257da){const _0x2c4cf2=new vo(this['locale'],_0x41c198,!0x0,!0x1);this['_contextChips']['add'](_0x2c4cf2);}}}class Ge extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x8e1479,_0x49da27,_0x51d9bb){super(_0x49da27),this['_locale']=_0x8e1479,this['_bodyCollection']=_0x51d9bb,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'](_0x29573c=>!_0x29573c['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x26817f(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 Ct extends Fr{['capabilities'];constructor(_0x2ebc2a,_0x2a81d3){super(_0x2a81d3);const {isWebSearchEnabled:_0xa6351b,isReasoningEnabled:_0x1b2b54}=_0x2a81d3['capabilities'],_0x3ce6db=[];let _0x300357='';_0xa6351b&&_0x1b2b54?(_0x300357=i(_0x2ebc2a,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x3ce6db['push'](aa(_0x36170b)),_0x3ce6db['push'](aa(_0x33027f))):_0xa6351b?(_0x300357=i(_0x2ebc2a,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x3ce6db['push'](aa(_0x36170b))):_0x1b2b54&&(_0x300357=i(_0x2ebc2a,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x3ce6db['push'](aa(_0x33027f))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x300357?'':'ck-hidden']}});const _0x1f4ed1=new _0x26817f();_0x1f4ed1['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x3ce6db,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x300357]}]}),this['children']['add'](_0x1f4ed1),this['capabilities']=_0x2a81d3['capabilities'];}}function aa(_0x3ecc66){const _0x5e4957=new _0x3c69cf();return _0x5e4957['content']=_0x3ecc66,_0x5e4957;}const Fs=['wheel','touchstart','pointerdown','keydown'],Us=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Qe{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x37cf09){this['element']=_0x37cf09,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0xfc846d of Fs){const _0x2db5b5='keydown'!==_0xfc846d;this['element']['addEventListener'](_0xfc846d,this['_onUserEvent']['bind'](this),{'passive':_0x2db5b5,'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'](_0x26488d){if(this['isRunning']){if('keydown'===_0x26488d['type']){const _0x28bb6d=_0x26488d['key'];if(!Us['includes'](_0x28bb6d))return;}_0x26488d instanceof WheelEvent?_0x26488d['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x4353bb,scrollHeight:_0x174341,clientHeight:_0x576677}=this['element'];return _0x174341-_0x4353bb-_0x576677<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class Xe extends _0x26817f{constructor(_0x8f002d,_0x5aebbe){super(_0x8f002d),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x5aebbe)});}['_createSkeletonItems'](_0x240bc7){const _0x28c5b5=['ck','ck-ai-skeleton__item'];return _0x240bc7['map'](_0x29b744=>{let _0x5afc98='';switch(_0x29b744['attributes']['align']){case'right':_0x5afc98='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x5afc98='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x5afc98='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x29b744['tag'],'attributes':{'class':[..._0x28c5b5,_0x29b744['attributes']['class']?_0x29b744['attributes']['class']:''],'style':'width:\x20'+_0x29b744['attributes']['width']+';\x20height:\x20'+_0x29b744['attributes']['height']+';'+_0x5afc98}};});}}const Ye={'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(_0x12d351,_0xfe25f4,_0x1b8ae7,_0x3ba40c){return new Array(_0x12d351)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0xfe25f4,'height':_0x1b8ae7,'align':_0x3ba40c}}));}class $e extends Fr{constructor(_0x50fd18){super(_0x50fd18),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 di extends _0x26817f{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x3fd56d,_0x1ce44c){super(_0x3fd56d),this['_bodyCollection']=_0x1ce44c,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Rt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Qe(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x3a6c0c,_0x55de8f){let _0x225841;return'ai-reply'===_0x3a6c0c?_0x225841=new qe(this['locale'],_0x55de8f,this['_bodyCollection']):'ai-suggestion-reply'===_0x3a6c0c?(_0x225841=new Be(this['locale'],_0x55de8f,this['_bodyCollection']),_0x225841['bind']('isTrackChangesOn')['to'](this)):_0x225841='user-message'===_0x3a6c0c?new Ge(this['locale'],_0x55de8f,this['_bodyCollection']):'interaction-header'===_0x3a6c0c?new Ct(this['locale'],_0x55de8f):'custom-element'===_0x3a6c0c?new $e(_0x55de8f):new Ke(_0x55de8f),this['children']['add'](_0x225841),_0x225841;}async['updateReplyItem']({id:_0x18558f,parsedContent:_0x272b95,renderingStrategy:_0x3e5a9f,abortSignal:_0x40ed53}){const _0x1a3801=this['getItemById'](_0x18558f);if(!(_0x1a3801 instanceof qe))throw new _0x465bb5('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x1a3801,'id':_0x18558f,'parsedContent':_0x272b95});await _0x1a3801['updateContent']({'parsedContent':_0x272b95,'renderingStrategy':_0x3e5a9f,'abortSignal':_0x40ed53});}async['updateWebSources'](_0x1921d6,_0x159777){const _0xd9aad6=this['getItemById'](_0x1921d6);if(_0xd9aad6 instanceof Be)_0xd9aad6['updateSources'](_0x159777);else{if(!(_0xd9aad6 instanceof qe))throw new _0x465bb5('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0xd9aad6,'id':_0x1921d6,'sources':_0x159777});_0xd9aad6['updateSources'](_0x159777);}}async['updateSuggestionItem']({id:_0x46dea1,parts:_0x3014e2,renderingStrategy:_0x26f6e6,abortSignal:_0x444c4d}){const _0x466879=this['getItemById'](_0x46dea1);if(!(_0x466879 instanceof Be))throw new _0x465bb5('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x466879,'id':_0x46dea1,'parts':_0x3014e2});await _0x466879['updateContent']({'parts':_0x3014e2,'renderingStrategy':_0x26f6e6,'abortSignal':_0x444c4d});}['updateSuggestionPartState']({id:_0x5a7b2a,index:_0x105700,state:_0x1e0472}){const _0x4fdc1b=this['getItemById'](_0x5a7b2a);if(!(_0x4fdc1b instanceof Be))throw new _0x465bb5('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x5a7b2a});_0x4fdc1b['updatePartState'](_0x105700,_0x1e0472);}['setSuggestionPartActive']({id:_0x430da7,index:_0x364f67,isActive:_0x39f94d}){const _0x59bb2c=this['getItemById'](_0x430da7);if(!(_0x59bb2c instanceof Be))throw new _0x465bb5('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x430da7});this['children']['filter'](_0x242d16=>_0x242d16 instanceof Be)['forEach'](_0xf63186=>{_0xf63186['setPartActive'](!0x1);}),_0x59bb2c['setPartActive'](_0x364f67,_0x39f94d);}['markItemAsDone'](_0x5c4a3b){this['getItemById'](_0x5c4a3b)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x1a118e=>_0x1a118e['options']['id']);}['removeItem'](_0x486368){this['children']['remove'](this['getItemById'](_0x486368));}['hasItem'](_0xea92b8){return!!this['children']['find'](_0x5e92d7=>_0x5e92d7['options']['id']['includes'](_0xea92b8));}['scrollToSuggestion'](_0x37f7cf,_0x248769){const _0x452a34=this['getItemById'](_0x37f7cf);if(!(_0x452a34 instanceof Be))return void _0x227e3e('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x37f7cf,'partIndex':_0x248769});const _0x2b6780=_0x452a34['getPartView'](_0x248769);_0x2b6780?_0x508662(_0x2b6780['element'],0x14,this['element']['parentElement'],!0x0,!0x0):_0x227e3e('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x37f7cf,'partIndex':_0x248769});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x256685=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x256685,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x52d4a5=new Xe(this['locale'],Ye['aiFeed']);return _0x52d4a5['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x70ee5b=>!_0x70ee5b)]}}),_0x52d4a5;}['_createFeedItems'](){const _0x10e4b6=new _0x26817f(this['locale']);return _0x10e4b6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x10e4b6;}['_createFeedLoader'](){const _0x131f69=new _0x26817f(this['locale']);return _0x131f69['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x199e57=>!_0x199e57)]},'children':this['_createLoaderChildren']()}),_0x131f69;}['_createLoaderChildren'](){const _0x451d19=new Ze();return _0x451d19['isVisible']=!0x0,[_0x451d19,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x4e83f5){const _0x3e81e8=this['children']['find'](_0x5047ec=>_0x5047ec['options']['id']['includes'](_0x4e83f5));if(!_0x3e81e8)throw new _0x465bb5('ai-chat-feed-view-item-not-found',this,{'id':_0x4e83f5});return _0x3e81e8;}['setLoadingMessage'](_0x58873f){this['set']('loadingMessage',_0x58873f);}['toggleLoadingSkeleton'](_0x357d25){this['set']('isLoadingSkeletonVisible',_0x357d25);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class nh extends _0x41f1be{['filter'](){let _0x4220ed=0x0;for(const _0x57f7ce of this['items'])_0x4220ed+=_0x57f7ce['items']['length'];return{'resultsCount':_0x4220ed,'totalItemsCount':_0x4220ed};}}const ah='ck-ai-chat__prompt-input_highlighted';class cs extends _0x5bfc01{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x5bee31,_0x37be2d){super(_0x5bee31,{'queryView':{'label':'','creator':_0x16a940,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new nh(_0x5bee31),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x37be2d,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=cs['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=cs['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',(_0x3b6534,_0x125fab)=>!_0x3b6534&&!_0x125fab),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x31cab9,_0x3c6637)=>{this['isUploadInProgress']||this['isEmpty']||_0x31cab9['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3c6637());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x4aca39=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x4aca39)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x3eb62b=_0x1e51c4(_0x4aca39);this['fire']('sendUserMessage',_0x3eb62b),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x55f02a){this['queryView']['fieldView']['set']('placeholder',_0x55f02a);}['focus'](_0x3742b5=!0x1){super['focus'](),_0x3742b5&&(this['element']['classList']['contains'](ah)||(this['element']['classList']['add'](ah),setTimeout(()=>{this['element']['classList']['remove'](ah);},0x320)));}['_createSubmitButton'](){const _0x4f6314=new _0x33ce64(this['locale']);return _0x4f6314['set']({'icon':_0x28ab7c,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x4f6314['on']('execute',()=>{this['submit']();}),_0x4f6314;}['setIsUploadInProgress'](_0x11fc7b){this['isUploadInProgress']=_0x11fc7b;}['_setUpAddContextButtonPositioning'](){const _0x42be64=this['locale'],_0x5196f3=()=>{_0x274357['window']['requestAnimationFrame'](()=>{if(_0x37e114(this['element'])){const _0x577821=new _0x26a571(this['queryView']['fieldView']['element']),_0x2090a0=new _0x26a571(this['_addContextButtonView']['element']),_0x458569=_0x577821['width'],_0x15fd12='rtl'===_0x42be64['uiLanguageDirection']?'right':'left';_0x577821['excludeScrollbarsAndBorders']();const _0xee9bdd=_0x458569-_0x577821['width']+0x1;this['_addContextButtonView']['element']['style'][_0x15fd12]='calc('+(_0x458569-_0x2090a0['width']-_0xee9bdd)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x5196f3),this['on']('render',()=>{_0x5196f3(),this['_queryViewResizeObserver']=new _0x40b542(this['queryView']['fieldView']['element'],()=>{_0x5196f3();});});}}const Qr='ck-ai-chat__prompt-capabilities',Xr='ck-ai-chat-controls-button',Zr='ck-ai-chat-controls-button--commands',la='ck-ai-button-tertiary',ua='ck-ai-chat-controls__model-selection',da='ck-ai-chat-controls__model-selection__item-name',_a='ck-ai-chat-controls__model-selection__item-description',Aa='ck-ai-chat-controls__model-selection__item-capabilities',Ia='n';class rs extends _0x26817f{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x26917c){super(_0x26917c),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',_0x1b445e=>'selector'===_0x1b445e),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x37ee92=>_0x37ee92?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x5aa1a4=>_0x5aa1a4),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x1239ce=>_0x1239ce),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x4de8ea=>i(this['locale'],_0x4de8ea?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x12aa0e=>_0x12aa0e),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x2d458f=>i(this['locale'],_0x2d458f?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Qr]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x2c18a8(),_0x3b4b3d(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0xb70a77,_0x288c23){if(_0x288c23)this['set']('modelDisplayMode','hidden');else{const _0x497dec=0x1===_0xb70a77['length'];this['set']('modelDisplayMode',_0x497dec?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0xb70a77?.['length'])for(const _0x3db4d0 of _0xb70a77){const _0x1bc538=new _0x4d3eeb({'label':_0x3db4d0['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3db4d0['id'],'model':_0x3db4d0});_0x1bc538['bind']('isOn')['to'](this,'activeModelId',_0x1e8866=>_0x1e8866===_0x3db4d0['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x1bc538,'labelView':new ga(this['locale'],_0x3db4d0)});}}['setWebSearch'](_0x494308){this['set']('webSearchActive',_0x494308);}['setReasoning'](_0x4750d3){this['set']('reasoningActive',_0x4750d3);}['setModel'](_0x282782){if(!_0x282782)return;this['activeModelId']=_0x282782['id'],this['activeModelName']=_0x282782['name']||_0x282782['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x282782['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x282782['name']);const _0x1b341e=_0x282782['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x1b341e),this['_webSearchButton']['set']('isVisible',_0x1b341e);const _0x4dd0f1=_0x282782['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x4dd0f1),this['_reasoningButton']['set']('isVisible',_0x4dd0f1);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x499871){this['set']('modelSelectorEnabled',!0x1),_0x499871&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x401da6=new _0x33ce64();return _0x401da6['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x36170b,'class':Xr,'isToggleable':!0x0,'tooltipPosition':Ia}),_0x401da6['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x401da6;}['_createReasoningButton'](){const _0x240061=new _0x33ce64();return _0x240061['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x33027f,'class':Xr,'isToggleable':!0x0,'tooltipPosition':Ia}),_0x240061['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x240061;}['_createCommandsButton'](){const _0x535728=new _0x33ce64();return _0x535728['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x39c797,'withText':!0x0,'class':Xr,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ia}),_0x535728['extendTemplate']({'attributes':{'class':[Zr]}}),_0x535728['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x535728;}['_createModelSelectionDropdown'](){const _0x3e9464=_0x1fec03(this['locale']);return _0x3e9464['set']({'panelPosition':'ne','class':[ua]}),_0x3e9464['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ia,'class':la}),this['listenTo'](_0x3e9464,'execute',_0x594f99=>{this['fire']('selectModel',_0x594f99['source']['model']);}),_0x3e9464;}['_createModelNameView'](){const _0x3830d7=new Ca(this['locale']);return _0x3830d7['bind']('text')['to'](this,'activeModelName',_0x4ae794=>_0x4ae794??''),_0x3830d7['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5b3d47=>'name'===_0x5b3d47),_0x3830d7;}}let ga=class ModelButtonLabelView extends _0x3eefdf{constructor(_0xe6ed03,_0x53548d){super();const _0x34c952=this['bindTemplate'],_0x1fa250=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x34c952['to']('style'),'id':_0x34c952['to']('id')},'children':[{'tag':'div','attributes':{'class':[da]},'children':[{'text':_0x34c952['to']('text')}]},{'tag':'div','attributes':{'class':[_a]},'children':[{'tag':'span','children':[{'text':_0x53548d['description']}]}]},{'tag':'div','attributes':{'class':[Aa]},'children':_0x1fa250}]}),_0x1fa250['addMany'](this['_getCapabilityParts'](_0xe6ed03,_0x36170b,'AI_CHAT_SEARCH_WEB',_0x53548d['capabilities']['webSearch']?.['enabled']??!0x1)),_0x1fa250['addMany'](this['_getCapabilityParts'](_0xe6ed03,_0x33027f,'AI_CHAT_REASONING',_0x53548d['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x58f5e9,_0x259741,_0x51ddef,_0x36c10d){const _0x280ba8=new _0x3c69cf();_0x280ba8['content']=_0x259741;const _0x35ee23=new _0x26817f(_0x58f5e9);_0x35ee23['setTemplate']({'tag':'span','children':[{'text':i(_0x58f5e9,_0x51ddef)+':\x20'}]});const _0x400ebe=new _0x26817f(_0x58f5e9);return _0x400ebe['setTemplate']({'tag':'span','children':[{'text':i(_0x58f5e9,_0x36c10d?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x280ba8,_0x35ee23,_0x400ebe];}},Ca=class ModelNameView extends _0x26817f{constructor(_0x474619){super(_0x474619),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x501213=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x501213['if']('isVisible','ck-hidden',_0x3194d6=>!_0x3194d6)]},'children':[{'text':_0x501213['to']('text')}]});}};const Ea='ck-ai-chat-context-controls__url-form',pa='ck-ai-chat-context-controls__url-input-section';class Vo extends _0x26817f{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x43f2e9){super(_0x43f2e9),this['focusTracker']=new _0x1203ce(),this['keystrokes']=new _0x2ac014(),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 _0x29c2cb({'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'](_0x4f93c9=>{this['focusTracker']['add'](_0x4f93c9['element']),this['keystrokes']['listenTo'](_0x4f93c9['element']);}),_0x4500a5({'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'](_0x3ce781){this['urlInputField']['errorText']=_0x3ce781,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x212caa=new _0x33ce64(this['locale']);return _0x212caa['set']({'icon':_0x2f6267,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x5aa0fd,_0x6e556c,_0x3ca049)=>{_0x212caa['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x3ca049?'':'\x20ck-hidden')]});}),_0x212caa;}['_createUrlInputField'](){const _0x79d468=new _0xbe7541(this['locale'],th);return _0x79d468['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x79d468['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x79d468;}['_createConfirmButton'](){const _0x545ef3=new _0x33ce64(this['locale']);return _0x545ef3['set']({'icon':_0x3cd0e3,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x545ef3;}['_setupTemplate'](){const _0x299605=new _0x473725(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'});_0x299605['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Ea,'tabindex':'-1'},'children':[_0x299605,{'tag':'div','attributes':{'class':pa},'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',_0x3fff13=>{_0x3fff13['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x45cdd7,_0x3f30ff)=>{this['clear'](),this['fire']('cancel'),_0x3f30ff();});}['_handleSubmit'](){const _0xc85714=this['getValue']()['trim']();_0xc85714?this['_isValidUrl'](_0xc85714)?(this['clearError'](),this['fire']('submitUrl',_0xc85714)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x212ea2=this['getValue']()['trim'](),_0xf188f5=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x212ea2['length']>0x0&&!_0xf188f5;}['_isValidUrl'](_0x2c51a6){try{return!!new URL(_0x2c51a6);}catch{return!0x1;}}}const Ta='ck-ai-chat-resources__item',ma='ck-ai-chat-resources__item--in-context',wa='ck-ai-chat-resources__item-title',fa='ck-ai-chat-resources__item__icon';class hc extends _0x51dbe3{['resource'];['_titleView'];['_iconView'];constructor(_0x383d9f,_0x239b52){super(_0x383d9f),this['resource']=_0x239b52,this['set']('isInContext',!!_0x239b52['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x4bcde1){if(_0x4bcde1['isInContext'])return _0x3cd0e3;switch(_0x4bcde1['type']){case xe['DOCUMENT']:return _0x46c25f;case xe['URL']:return _0x167706;case xe['FILE']:case xe['TEXT']:return _0x1f8979;default:return _0x2e914b;}}['highlightText'](_0x60cc00){if(!_0x60cc00||''===_0x60cc00['trim']())return void this['_titleView']['highlightText'](null);const _0x159b2e=new RegExp(_0x4b1b24(_0x60cc00),'gi');this['_titleView']['highlightText'](_0x159b2e);}['updateResourceState'](_0x44f3d6){this['resource']['isInContext']=_0x44f3d6,this['isInContext']=_0x44f3d6,this['_updateIcon']();}['_createTitleView'](){const _0x1845bc=new _0x3a4df2();return _0x1845bc['text']=this['resource']['label'],_0x1845bc['extendTemplate']({'tag':'span','attributes':{'class':[wa]}}),_0x1845bc;}['_createIconView'](){const _0x16f528=new _0x3c69cf();return _0x16f528['content']=this['getResourceIcon'](this['resource']),_0x16f528;}['_setupTemplate'](){const _0x48d7cc=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Ta,_0x48d7cc['if']('isVisible','ck-hidden',_0x3c935c=>!_0x3c935c),_0x48d7cc['if']('isInContext',ma)]},'children':[{'tag':'div','attributes':{'class':[fa]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x48d7cc['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const Sa='ck-ai-chat-resources__list';class Lr extends _0x41f1be{['_source'];constructor(_0x150b14,_0x4e6b42){super(_0x150b14),this['_source']=_0x4e6b42,this['extendTemplate']({'attributes':{'class':[Sa]}});}['setResources'](_0xe3d7b6,_0x1bcb6b){this['items']['clear']();let _0x18c352=_0xe3d7b6;if(this['_source']['useDefaultFiltering']&&_0x1bcb6b&&''!==_0x1bcb6b['trim']()){const _0x24a503=new RegExp(_0x1bcb6b['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x18c352=_0xe3d7b6['filter'](_0x56a5f6=>_0x24a503['test'](_0x56a5f6['label']));}for(const _0x4aee72 of _0x18c352){const _0x18711e=new hc(this['locale'],_0x4aee72);_0x18711e['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x4aee72);}),this['items']['add'](_0x18711e);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x1bcb6b);}['highlightText'](_0x4279ac){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x5e57ec=>{_0x5e57ec['highlightText'](_0x4279ac);});}['updateResourceState'](_0x5b1dff,_0x12e24f){for(const _0x5ad0af of this['items']){const _0x4961c2=_0x5ad0af;_0x4961c2['resource']['id']===_0x5b1dff&&_0x4961c2['updateResourceState'](_0x12e24f);}}['_handleResourceSelection'](_0x13a378,_0x3abd6a){this['fire']('addResourceToContext',{'source':_0x13a378,'resource':_0x3abd6a});}}class Tr extends _0xbe7541{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x4bffca){const t=_0x4bffca['t'],_0x1854b3={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':i(_0x4bffca,'AI_CHAT_SEARCH_RESOURCES')};super(_0x4bffca,_0x1854b3['creator']),this['label']=_0x1854b3['label'],this['_viewConfig']=_0x1854b3,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x4bffca,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x181f73){this['fire']('search',_0x181f73);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x3c69cf(),this['iconView']['content']=_0x29b093,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x59e735,t){this['resetButtonView']=new _0x33ce64(_0x59e735),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x3c6485,'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',_0x566757=>!_0x566757),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 _0x26817f{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x10ac96,_0x74e263){super(_0x10ac96),this['_source']=_0x74e263['source'],this['_searchInputVisibleFrom']=_0x74e263['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 _0x1024e9([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 _0x309214=new _0x26817f(this['locale']);return _0x309214['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x35ba16,_0x20ec77)=>{this['loadResources'](_0x20ec77),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x20ec77);}),_0x309214;}['_createResourcesListView'](){const _0x273c55=new Lr(this['locale'],this['_source']);return _0x273c55['delegate']('addResourceToContext')['to'](this),_0x273c55['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x273c55;}['_createSkeletonView'](){const _0x235bd9=new Xe(this['locale'],Ye['aiChatResources']);return _0x235bd9['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x1d45cf=>!_0x1d45cf)]}}),_0x235bd9;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x28bf3c){const _0xca718b=_0x41685d();this['_latestLoadResourcesUid']=_0xca718b,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x28bf3c,'uid':_0xca718b}),this['isLoading']=!0x0;}['setResources'](_0x5757c1,_0x501fde){if(_0x501fde&&_0x501fde!==this['_latestLoadResourcesUid'])return;const _0x993d45=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x5757c1,_0x993d45),_0x5757c1['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x25f6c0,_0x435f83){this['_resourcesListView']['updateResourceState'](_0x25f6c0,_0x435f83);}}const Ra='ck-ai-chat-context-controls__source-balloon-panel',ba='ck-button-icon\x20ck-button-back',Oa='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Po{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x4ae298,_0x5d8cc0,_0x491221){this['_locale']=_0x4ae298,this['_bodyCollection']=_0x5d8cc0,this['_config']=_0x491221;}['showSourceResourcesBalloon']({source:_0x406c64,withBackButton:_0x513847}){let _0x4928f6=this['_sourceResourceBalloons']['get'](_0x406c64['id']);_0x4928f6||(_0x4928f6=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x406c64['id'],_0x4928f6),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x4928f6)),this['_addSourceResourceContent']({'balloonPanel':_0x4928f6,'source':_0x406c64,'withBackButton':_0x513847}),_0x4928f6['show']();const _0x31f099=this['_config']['getTargetElement']();_0x31f099&&_0x4928f6['pin']({'target':_0x31f099,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x15ed49,_0x27f729,_0x5f98ce){const _0x11d094=this['_sourceResourceBalloons']['get'](_0x15ed49);if(!_0x11d094)return;const _0x26745e=this['_getResourcesViewFromBalloon'](_0x11d094);_0x26745e&&(_0x26745e['setResources'](_0x27f729,_0x5f98ce),_0x26745e['once']('change:isLoading',()=>{_0x11d094['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x157ee1){const _0x1f7061=this['_sourceResourceBalloons']['get'](_0x157ee1);_0x1f7061&&requestAnimationFrame(()=>{_0x1f7061['hide'](),this['_sourceResourceBalloons']['delete'](_0x157ee1),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x3140c3 of this['_sourceResourceBalloons']['values']())if(_0x3140c3['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x34cf99,_0xda59f9,_0x537eef){const _0x2ecd06=this['_sourceResourceBalloons']['get'](_0x34cf99);if(!_0x2ecd06||!_0x2ecd06['isVisible'])return;const _0x5af570=this['_config']['getTargetElement']();if(!_0x5af570)return;_0x2ecd06['pin']({'target':_0x5af570,'limiter':this['_config']['getLimiterElement']()});const _0x1a7750=this['_getResourcesViewFromBalloon'](_0x2ecd06);_0x1a7750&&_0x1a7750['updateResourceState'](_0xda59f9,_0x537eef);}['destroy'](){for(const _0x32f265 of this['_sourceResourceBalloons']['values']())_0x32f265['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x252b39=new _0x59db14(this['_locale']);return _0x252b39['extendTemplate']({'attributes':{'class':Ra}}),this['_bodyCollection']['add'](_0x252b39),_0x252b39;}['_addSourceResourceContent']({balloonPanel:_0xec67d9,source:_0x46bad9,withBackButton:_0x34d362}){_0xec67d9['content']['clear']();const _0x26ac50=this['_createBalloonHeader']({'balloonPanel':_0xec67d9,'source':_0x46bad9,'withBackButton':_0x34d362});_0xec67d9['content']['add'](_0x26ac50);const _0x4d56f0=this['_createBalloonResourcesView'](_0x46bad9);_0xec67d9['content']['add'](_0x4d56f0);}['_createBalloonHeader']({balloonPanel:_0x14a7a6,source:_0x5837ed,withBackButton:_0x51da37}){const _0x5399a7=new _0x473725(this['_locale'],{'label':_0x5837ed['label'],'class':Oa});return _0x51da37&&_0x5399a7['children']['add'](this['_createBackButton'](_0x14a7a6),0x0),_0x5399a7;}['_createBackButton'](_0x5d1a47){const _0x198eae=new _0x33ce64(this['_locale']);return _0x198eae['set']({'icon':_0x2f6267,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':ba}),_0x198eae['on']('execute',()=>{_0x5d1a47['hide'](),this['_config']['onBackToContext']();}),_0x198eae;}['_createBalloonResourcesView'](_0x3d89b5){const _0x38955e=new lc(this['_locale'],{'source':_0x3d89b5,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x38955e['on']('loadSourceResources',(_0x247f01,_0x46ca6)=>{this['_config']['onLoadSourceResources'](_0x46ca6);}),_0x38955e['on']('addResourceToContext',(_0x3e879d,_0x2053aa)=>{this['_config']['onResourceSelected'](_0x2053aa['source'],_0x2053aa['resource']),this['closeSourceResourceBalloon'](_0x3d89b5['id']);}),_0x38955e;}['_getResourcesViewFromBalloon'](_0x2f28f6){const _0x3c44e0=_0x2f28f6['content']['get'](0x1);return _0x3c44e0 instanceof lc?_0x3c44e0:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x130887){_0x38a160({'emitter':_0x130887,'contextElements':[_0x130887['element']],'callback':()=>{_0x130887['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x130887['isVisible']});}}const ps=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Ro='ck-ai-chat-context-controls',Oo='ck-ai-chat-context-controls__pending-contexts',Uo='ck-ai-chat-context-controls__add-context-balloon-panel',Lo='ck-ai-chat-context-controls__add-context-button',No='ck-ai-chat-context-controls__url-balloon-panel',Mo='ck-ai-chat-context-controls__balloon-button',Ho='ck-ai-chat-context-controls__balloon-button-source',jo='ck-ai-chat-controls-button',Fo='ck-ai-chat-context-chips-wrapper-balloon',Xo='ck-ai-chat-controls_context_show-more-button',yo='ck-ai-chat-context-controls__show-more-balloon-panel',Do='ck-ai-chat',$o=[_0x59db14['defaultPositions']['northArrowSouthWest'],_0x59db14['defaultPositions']['northArrowSouth'],_0x59db14['defaultPositions']['northArrowSouthEast'],_0x59db14['defaultPositions']['southArrowNorthWest'],_0x59db14['defaultPositions']['southArrowNorth'],_0x59db14['defaultPositions']['southArrowNorthEast']];class ls extends _0x26817f{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x5b9092,_0x4d3e6b){super(_0x5b9092),this['bodyCollection']=_0x4d3e6b['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x5b9092),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x5b9092),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x5b9092),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x5b9092,_0x4d3e6b);const _0x298791={'cssClasses':{'showMoreButton':Xo,'showMoreBalloon':yo,'overflowContainer':Fo,'controlsButton':jo}};this['_overflowManager']=new Io(_0x5b9092,this['_currentContextsChips'],_0x298791,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'](_0xce6669,_0x218ea7){const _0x84c6dd=this['_createContextButton'](_0xce6669,'current',!0x0,_0x218ea7);this['_addContextToCollection'](_0x84c6dd,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x56d07f){this['_removeContextFromCollection'](_0x56d07f,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x56d07f,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x1cc4c4,_0x390b6e){let _0x222e39=this['_currentContextsChips']['find'](_0x15b07c=>_0x15b07c['id']===_0x1cc4c4);_0x222e39||(_0x222e39=this['_overflowManager']['overflowChips']['find'](_0x2c3392=>_0x2c3392['id']===_0x1cc4c4)),_0x222e39&&(_0x222e39['isLoading']=_0x390b6e);}['setConversationContext'](_0x424415){this['_conversationContextsChips']['clear']();for(const _0x16321e of _0x424415){const _0x4e33af=this['_createContextButton'](_0x16321e,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x4e33af,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x2a16ee,_0x1eff20,_0x369345){this['_resourcesBalloonView']['updateResourceState'](_0x2a16ee,_0x1eff20,_0x369345);}['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:_0x5857be,withBackButton:_0x3bb353}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x5857be,'withBackButton':_0x3bb353}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x5211c4,_0x5333ca,_0x420147,_0x51634a){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x5211c4,_0x420147,_0x51634a);}['closeSourceResourceBalloon'](_0x22dc2a){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x22dc2a),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x63cd4a){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x63cd4a),this['_setAddContextButtonEnabled'](_0x63cd4a);}['_setAddContextButtonEnabled'](_0x4f0f2b){const _0x44d05a=!_0x4f0f2b['document']['isHidden']&&_0x4f0f2b['document']['enabled'],_0x619b3c=_0x4f0f2b['urls']['enabled'],_0x4647f5=_0x4f0f2b['files']['enabled'],_0xb48821=_0x4f0f2b['sources']['length']>0x0,_0x32f276=_0x4f0f2b['customItems']&&_0x4f0f2b['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x44d05a||_0x619b3c||_0x4647f5||_0xb48821||_0x32f276;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Ro,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Oo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x27ff4e){const _0x1bca6a=new _0x33ce64(_0x27ff4e);return _0x1bca6a['set']({'label':i(_0x27ff4e,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':jo+'\x20'+Lo,'icon':_0x134be5,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x1bca6a;}['_createAddContextBalloonPanelView'](_0x125d58){return this['_createBaseBalloonPanel'](_0x125d58,Uo);}['_createUrlBalloonPanelView'](_0x320ccf){const _0x774ba7=this['_createBaseBalloonPanel'](_0x320ccf,No);return this['_addUrlContent'](_0x774ba7,_0x320ccf),_0x774ba7;}['_createResourcesBalloonView'](_0x29e257,_0x5c0636){const _0x3f02f2={'searchInputVisibleFrom':_0x5c0636['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o});},'onResourceSelected':(_0xa9a3e1,_0x4aeb08)=>{this['fire']('addResourceToContext',{'source':_0xa9a3e1,'resource':_0x4aeb08});},'onLoadSourceResources':_0x138cd2=>{this['fire']('loadSourceResources',_0x138cd2);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Po(_0x29e257,_0x5c0636['bodyCollection'],_0x3f02f2);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Do)||document['body'];}['_createBaseBalloonPanel'](_0x58e6bd,_0x56eced){const _0x57bfc9=new _0x59db14(_0x58e6bd);return _0x57bfc9['extendTemplate']({'attributes':{'class':_0x56eced}}),this['bodyCollection']['add'](_0x57bfc9),_0x57bfc9;}['_setBalloonPanelContent'](_0x44ed06,_0x580eb4,_0x57e939){if(_0x44ed06['content']['clear'](),!_0x57e939['document']['isHidden']&&_0x57e939['document']['enabled']){const _0x2159e2=this['_createBalloonButton'](_0x580eb4,{'label':i(_0x580eb4,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x46c25f});_0x2159e2['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x44ed06['content']['add'](_0x2159e2);}if(_0x57e939['urls']['enabled']){const _0x809d33=this['_createBalloonButton'](_0x580eb4,{'label':i(_0x580eb4,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x167706});_0x809d33['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o}),this['_urlInputView']['focus']();}),_0x44ed06['content']['add'](_0x809d33);}if(_0x57e939['files']['enabled']){const _0x22d03b=new _0xdd491(_0x580eb4);_0x22d03b['set']({'label':i(_0x580eb4,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x268afb,'withText':!0x0,'tooltip':!0x0,'class':Mo,'allowMultipleFiles':!0x0}),_0x22d03b['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x22d03b['on']('done',(_0x3c270c,_0x568fa3)=>{this['fire']('addFileToContext',_0x568fa3);}),_0x22d03b['tooltip']=!0x0,_0x44ed06['content']['add'](_0x22d03b);}for(const _0x1f0f1d of _0x57e939['sources']){const _0x52a1d4=this['_createBalloonButton'](_0x580eb4,{'label':_0x1f0f1d['label'],'icon':_0x1f0f1d['icon']||_0x2e914b,'type':'source'});_0x44ed06['content']['add'](_0x52a1d4),_0x52a1d4['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x1f0f1d,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x5b6acf of _0x57e939['customItems']||[]){const _0x53e6f9=this['_createBalloonButton'](_0x580eb4,{'label':_0x5b6acf['label'],'icon':_0x5b6acf['icon']||_0x2e914b,'type':'customItem'});_0x44ed06['content']['add'](_0x53e6f9),_0x53e6f9['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x5b6acf);});}this['_hasExactlyOneSource']=0x1===_0x44ed06['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x180602,_0x44d27a){this['_urlInputView']=new Vo(_0x44d27a),this['_urlInputView']['on']('submitUrl',(_0x390374,_0x1e077a)=>{this['_handleUrlSubmit'](_0x1e077a);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o});}),_0x180602['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x1e7f46,_0x377ddb){const _0x3b8915='source'===_0x377ddb['type']?new SourcesBalloonButtonView(_0x1e7f46):new _0x33ce64(_0x1e7f46);return _0x3b8915['set']({'label':_0x377ddb['label'],'icon':_0x377ddb['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Mo}),_0x3b8915;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x38a160({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x51c8bc){const _0x470168=this['_addContextBalloonConfig'];_0x470168['buttonView']['isOn']=_0x51c8bc,_0x51c8bc?_0x470168['balloonView']['show']():_0x470168['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x211e55,buttonView:_0x152302,hideMethod:_0x654c6a}=this['_addContextBalloonConfig'];_0x38a160({'emitter':_0x211e55,'contextElements':[_0x211e55['element'],_0x152302['element']],'callback':()=>{_0x654c6a();},'activator':()=>_0x152302['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x4669e3,_0x57bc60,_0x3af719=!0x1,_0x528b8e=!0x1){const _0x2182bb='conversation'===_0x57bc60||!0x0===_0x4669e3['isReadOnly'],_0x3451da=new vo(this['locale'],_0x4669e3,_0x2182bb,_0x3af719,_0x528b8e);return _0x2182bb||_0x3451da['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x3451da['id']);}),_0x3451da;}['_addContextToCollection'](_0xc5267d,_0x2b19ef){_0x2b19ef['add'](_0xc5267d,0x0);}['_removeContextFromCollection'](_0xa02c1b,_0x3488cb){const _0x1f3de6=_0x3488cb['find'](_0x23bd77=>_0x23bd77['id']===_0xa02c1b);_0x1f3de6&&_0x3488cb['remove'](_0x1f3de6);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':$o}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x4ba3fd){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x4ba3fd);}}class SourcesBalloonButtonView extends _0x33ce64{['arrowView'];constructor(_0x159a13){super(_0x159a13),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ho]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0xa5ea3d=new _0x3c69cf();return _0xa5ea3d['content']=_0x31eb66,_0xa5ea3d['extendTemplate']({'attributes':{'class':Ho+'__arrow'}}),_0xa5ea3d;}}class ds extends _0x26817f{['_cancelButtonView'];['_loaderView'];constructor(_0x42eaa2){super(_0x42eaa2),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 _0x51d65e=new _0x33ce64(this['locale']);return _0x51d65e['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x1051d5}),_0x51d65e['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x51d65e;}['_createLoaderView'](){const _0x572e2b=new _0x26817f(this['locale']);return _0x572e2b['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')}]}),_0x572e2b;}}class ji extends _0x26817f{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x393445,_0x478469){super(_0x393445),this['_contextPanelView']=this['_createContextPanelView'](_0x393445,{'bodyCollection':_0x478469['bodyCollection'],'searchInputVisibleFrom':_0x478469['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x393445),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x393445),this['_loaderView']=this['_createLoaderView'](_0x393445),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x393445),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'](...ps)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x134217=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x134217['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x134217['if']('isLoading','ck-hidden',_0x144450=>_0x144450||!this['isModelAvailable']),_0x134217['if']('isModelAvailable','ck-hidden',_0x16d7dd=>!_0x16d7dd||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x134217['if']('isLoading','ck-hidden',_0x51add0=>!_0x51add0)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x134217['if']('isModelAvailable','ck-hidden',_0x30e196=>_0x30e196)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x38a160({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x1325aa,_0x596670){return new ls(_0x1325aa,_0x596670);}['_createPromptInputView'](_0x15ab38){return new cs(_0x15ab38,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x3022c9){return new rs(_0x3022c9);}['_createLoaderView'](_0x5d5058){return new ds(_0x5d5058);}['_createModelUnavailableMessageView'](_0x55cdbd){const _0x516c64=new AIChatModelUnavailableMessageView(_0x55cdbd);return _0x516c64['delegate']('startConversation')['to'](this),_0x516c64;}['_handlePromptInputFocus'](_0x21f318,_0x471922,_0xa3e0df){_0xa3e0df?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x5a3d7a,_0x127a70){this['_contextPanelView']['addContextItem'](_0x5a3d7a,_0x127a70);}['removeContextItem'](_0x4ffa74){this['_contextPanelView']['removeContextItem'](_0x4ffa74);}['setContextItemLoading'](_0x3a1306,_0x196634){this['_contextPanelView']['setContextItemLoading'](_0x3a1306,_0x196634);}['setIsUploadInProgress'](_0x3a92c5){this['_promptInputView']['setIsUploadInProgress'](_0x3a92c5);}['setConversationContext'](_0x2c06f7){this['_contextPanelView']['setConversationContext'](_0x2c06f7);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x23cb4c,_0x59f3f5,_0x20ce93){this['_contextPanelView']['updateResourceState'](_0x23cb4c,_0x59f3f5,_0x20ce93);}['setWebSearch'](_0x1c1efe){this['_promptCapabilitiesView']['setWebSearch'](_0x1c1efe);}['setReasoning'](_0x1d43f4){this['_promptCapabilitiesView']['setReasoning'](_0x1d43f4);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x232c5e){this['_contextPanelView']['setAddContextOptions'](_0x232c5e);}['setInputPlaceholder'](_0x4b5593){this['_promptInputView']['setPlaceholderText'](_0x4b5593);}['setModelList'](_0x464bac,_0x207d81){this['_promptCapabilitiesView']['setModelList'](_0x464bac,_0x207d81);}['setModel'](_0x599cf8){_0x599cf8?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x599cf8)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x406a2a){this['_promptCapabilitiesView']['disableModelSelector'](_0x406a2a);}['populateSourceResourceBalloon'](_0x24bf44,_0x166590,_0x4bb8e4,_0x5f57c3){this['_contextPanelView']['populateSourceResourceBalloon'](_0x24bf44,_0x166590,_0x4bb8e4,_0x5f57c3);}['closeSourceResourceBalloon'](_0x3992c0){this['_contextPanelView']['closeSourceResourceBalloon'](_0x3992c0);}['focusPromptInput'](_0x5d825d=!0x1){this['_promptInputView']['focus'](_0x5d825d);}['setPromptInputValue'](_0x2bd82a){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x2bd82a;}}class AIChatModelUnavailableMessageView extends _0x26817f{constructor(_0x2a66e9){super(_0x2a66e9);const _0x5d1a4f=new _0x33ce64(_0x2a66e9);_0x5d1a4f['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x5d1a4f['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'},_0x5d1a4f]}]});}}class ki extends _0x473725{['conversationStartButton'];['resizeButton'];constructor(_0x257c62,_0x26dde2){super(_0x257c62,{'label':i(_0x257c62,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Et}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x257c62),this['children']['add'](this['conversationStartButton']),_0x26dde2&&(this['resizeButton']=us(_0x257c62,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x5e0ae3){const _0x4f8348=new _0x33ce64(_0x5e0ae3);return _0x4f8348['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x234230,'class':'ck-ai-chat__start-conversation'}),_0x4f8348['on']('execute',()=>{this['fire']('startConversation');}),_0x4f8348;}}class vi extends _0x26817f{constructor(_0x1e71c8){super(_0x1e71c8),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x1e71c8,'AI_DISCLAIMER_TEXT')}]}]});}}class At extends _0x26817f{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x2dc345,_0x2f02db){super(_0x2dc345),this['_bodyCollection']=new _0x165cca(_0x2dc345),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new ki(_0x2dc345,_0x2f02db['showResizeButton']),this['chatHeader']['delegate'](...Rt)['to'](this),this['chatFeed']=new di(_0x2dc345,this['_bodyCollection']),this['chatFeed']['delegate'](...Rt)['to'](this),this['chatControls']=new ji(_0x2dc345,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x2f02db['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Rt)['to'](this),this['chatDisclaimer']=new vi(_0x2dc345),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x2dc345['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x1050cf,_0x66397e,_0x173b26,_0x24f05f){this['chatControls']['populateSourceResourceBalloon'](_0x1050cf,_0x66397e,_0x173b26,_0x24f05f);}['closeSourceResourceBalloon'](_0x1b3129){this['chatControls']['closeSourceResourceBalloon'](_0x1b3129);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class z extends _0x4720c1{static get['requires'](){return[it];}['_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(_0x97cead){super(_0x97cead);const _0x1034d8=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new St(),this['_view']=new At(this['context']['locale'],{'showResizeButton':_0x1034d8['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Rt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x108faa,{showDiff:_0x454266})=>{this['showDiff']=_0x454266;}),_0x1034d8['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':Et,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x10953f=>_0x10953f),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x2210ab=>_0x2210ab),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x1168a7){const _0x4992be=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'](_0x1168a7['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x4992be}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0x358697,staticMessage:_0x138dc2}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x358697,'initialContent':'<p>'+_0x138dc2+'</p>'});}['addFeedItemUserMessage'](_0x3df1f4){const _0x5b9e1c=_0x3df1f4['attributes']?.['displayedPrompt']||_0x3df1f4['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x3df1f4['contextItems']['values']()),'initialContent':'<p>'+_0x5b9e1c+'</p>','id':_0x3df1f4['id']});}['addFeedItemError']({errorMessage:_0x978055,id:_0x15b25e}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x978055+'</p>','id':_0x15b25e});}['addFeedItemAIReply'](_0x7f566d){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x7f566d['interactionId']+':'+_0x7f566d['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x7237d6){const _0x13040f=T(this['context']);let _0x1fb7fb=_0x13040f['config']['get']('ai.availableReplyActions')||[...J];if(_0x13040f['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x570f63=_0x13040f['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x570f63,'value');}}else _0x1fb7fb=_0x1fb7fb['filter'](_0x348a7e=>'insertSuggestion'!=_0x348a7e);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x7237d6['interactionId']+':'+_0x7237d6['id'],'areActionsDisabled':_0x7237d6['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x1fb7fb}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x51ff00,_0x3649b4){const _0x4ca5a3=this['_view']['chatFeed']['children']['last'];if(_0x4ca5a3 instanceof Ct)return this['_view']['chatFeed']['children']['remove'](_0x4ca5a3),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x51ff00['id'],'capabilities':{'isWebSearchEnabled':_0x4ca5a3['capabilities']['isWebSearchEnabled']||_0x3649b4['isWebSearchEnabled'],'isReasoningEnabled':_0x4ca5a3['capabilities']['isReasoningEnabled']||_0x3649b4['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x51ff00['id'],'capabilities':_0x3649b4});}async['addFeedItemCustomElement'](_0x381bf1,_0x3cccf6){let _0x551b8c;return await this['_promiseQueue']['enqueue'](async()=>{_0x551b8c=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x381bf1,'id':_0x3cccf6});}),_0x551b8c;}['removeFeedItem'](_0x535fed){this['_view']['chatFeed']['removeItem'](_0x535fed);}['hasFeedItem'](_0x248ff5){return this['_view']['chatFeed']['hasItem'](_0x248ff5);}['updateFeedInteractionHeader'](_0x4e9f81){const _0x4a326c=this['_view']['chatFeed']['children']['find'](_0x456741=>_0x456741['options']['id']==_0x4e9f81['id']&&_0x456741 instanceof Ct);_0x4a326c&&_0x4a326c['set']('isVisible',_0x4e9f81['isVisible']);}async['updateFeedItemAIReplyContent'](_0x5c4518){const _0x5e4153=_0x5c4518['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x1ead2e=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x5c4518,'abortSignal':_0x1ead2e,'renderingStrategy':_0x5e4153}),_0x5c4518['isDone']&&this['markFeedItemAsDone'](_0x5c4518['id']);});}['updateFeedItemAIReplySources'](_0x20e5da,_0x477f53){this['_view']['chatFeed']['updateWebSources'](_0x20e5da,_0x477f53);}async['updateFeedItemAIReplySuggestionContent'](_0x45440c){const _0x3e91a0=_0x45440c['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x4e5c66=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x45440c,'abortSignal':_0x4e5c66,'renderingStrategy':_0x3e91a0}),_0x45440c['isDone']&&this['markFeedItemAsDone'](_0x45440c['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x4d6ef9){this['_view']['chatFeed']['updateSuggestionPartState'](_0x4d6ef9);}['setFeedItemAIReplySuggestionPartActive'](_0x5c27a0){this['_view']['chatFeed']['setSuggestionPartActive'](_0x5c27a0);}['markFeedItemAsDone'](_0x4a7b3a){this['_view']['chatFeed']['markItemAsDone'](_0x4a7b3a);}['removeFeedInteraction'](_0x24dd79){this['_view']['chatFeed']['getItemIds']()['filter'](_0x3f9487=>_0x3f9487['startsWith'](_0x24dd79))['forEach'](_0x3b1f97=>this['_view']['chatFeed']['removeItem'](_0x3b1f97));}['startInteraction'](){const _0x1c49c6=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x1c49c6),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x4f040c){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x1f7721=>_0x1f7721['startsWith'](_0x4f040c['id']))['forEach'](_0x1e5813=>this['markFeedItemAsDone'](_0x1e5813)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x5ba1dd,_0x55c038){this['_view']['chatControls']['addContextItem'](_0x5ba1dd,_0x55c038);}['removeContextItem'](_0x3418e5){this['_view']['chatControls']['removeContextItem'](_0x3418e5);}['setContextItemLoading'](_0x9020e8,_0x11dfb9){this['_view']['chatControls']['setContextItemLoading'](_0x9020e8,_0x11dfb9);}['setIsUploadInProgress'](_0x36989a){this['_view']['chatControls']['setIsUploadInProgress'](_0x36989a);}['setConversationContext'](_0x368688){this['_view']['chatControls']['setConversationContext'](_0x368688);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x2735e9,_0x3dcffe,_0x403b62){this['_view']['chatControls']['updateResourceState'](_0x2735e9,_0x3dcffe,_0x403b62);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x494836){this['_view']['chatControls']['setAddContextOptions'](_0x494836);}['updateCapabilities'](_0x257b30){this['_view']['chatControls']['setWebSearch'](_0x257b30['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x257b30['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x257b30));}['setSelectedModel'](_0xf411e,_0x24e563){this['_view']['chatControls']['setModel'](_0xf411e),_0x24e563&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x1e5a14){this['feedItemRenderingStrategy']=_0x1e5a14;}['toggleLoadingSkeleton'](_0x58e96f){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x58e96f);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x56562b,_0x3a5634=!0x1){if(_0x3a5634&&!mt()&&_0x56562b['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x56562b);this['_view']['chatHeader']['label']=_0x56562b;}['setLoadingMessage'](_0x506a81){this['_view']['chatFeed']['setLoadingMessage'](_0x506a81);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x111ff1){let _0x2a2f6b=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x111ff1[_0x2a2f6b],_0x2a2f6b++,_0x2a2f6b===_0x111ff1['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x27e226){this['_view']['chatHeader']['isMaximized']=_0x27e226;}['prepareLoadingMessage'](_0xde5062){return _0xde5062['isWebSearchEnabled']&&_0xde5062['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0xde5062['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0xde5062['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x54aa37){return _0x54aa37?_0x54aa37['isWebSearchEnabled']&&_0x54aa37['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x54aa37['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x54aa37['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'](_0x8c8417,_0x4ecf53,_0x1ff557,_0x26f75d){this['_view']['populateSourceResourceBalloon'](_0x8c8417,_0x4ecf53,_0x1ff557,_0x26f75d);}['closeSourceResourceBalloon'](_0xb70910){this['_view']['closeSourceResourceBalloon'](_0xb70910);}['setPromptInputValue'](_0x29d0cd){this['_view']['chatControls']['setPromptInputValue'](_0x29d0cd);}['focusPromptInput'](_0x584e69=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x584e69);}['scrollFeedToSuggestion'](_0x2d7745,_0x412600){this['_view']['chatFeed']['scrollToSuggestion'](_0x2d7745,_0x412600);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Mi extends _0x41f1be{['sections'];constructor(_0x4f1ca0,_0x9f126f){super(_0x4f1ca0),this['sections']=_0x9f126f,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x5d10a7){let _0x23d943=0x0,_0x2dba97=0x0;for(const _0x43ce9e of this['sections']){const {resultsCount:_0x324609,totalItemsCount:_0x5e5e4e}=_0x43ce9e['filter'](_0x5d10a7);_0x23d943+=_0x324609,_0x2dba97+=_0x5e5e4e;}return{'resultsCount':_0x23d943,'totalItemsCount':_0x2dba97};}}class xi extends _0x51dbe3{['title'];['itemsViews'];['_itemsListView'];constructor(_0x5e664f,{title:_0x644161,items:_0x198842}){super(_0x5e664f);const _0x5df30a=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x644161,this['itemsViews']=_0x198842;const _0x2574b5=new _0x26817f(_0x5e664f);_0x2574b5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x41f1be(_0x5e664f),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x5df30a['if']('isVisible','ck-hidden',_0x5dcde5=>!_0x5dcde5)]},'children':[_0x2574b5,this['_itemsListView']]});}['filter'](_0xebcc7){const _0x21f6a4=this['itemsViews']['length'];let _0x4cdaf6=0x0;for(const _0x10daed of this['itemsViews']){if(_0xebcc7){const _0x3c7647=_0x10daed['isMatching'](_0xebcc7);_0x10daed['isVisible']=!!_0x3c7647,_0x10daed['highlightText'](_0xebcc7);}else _0x10daed['isVisible']=!0x0,_0x10daed['highlightText'](null);_0x10daed['isVisible']&&_0x4cdaf6++;}return this['isVisible']=_0x4cdaf6>0x0,{'resultsCount':_0x4cdaf6,'totalItemsCount':_0x21f6a4};}['getItem'](_0x32606a){return this['itemsViews']['find'](_0x586971=>_0x586971['id']===_0x32606a);}['removeItem'](_0xed4e8b){const _0x4d82ce=this['itemsViews']['indexOf'](_0xed4e8b);-0x1!==_0x4d82ce&&(this['itemsViews']['splice'](_0x4d82ce,0x1),this['_itemsListView']['items']['remove'](_0xed4e8b));}}class Li extends/* #__PURE__ -- @preserve */
27
+ _0xee7119(_0x51dbe3){['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(_0x2652d2,_0x4cb17b){super(_0x2652d2);const _0x38cf50=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x4cb17b['pinned']),this['set']('loadingState',null),this['id']=_0x4cb17b['id'];const {title:_0x49dbfc,createdAt:_0xbe565b,active:_0x4f67b0=!0x1}=_0x4cb17b;this['_titleView']=new _0x3a4df2(),this['_titleView']['text']=_0x49dbfc,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x10917b=this['_createCheckView'](),_0x3ea238=this['_createPinButtonView'](_0x2652d2),_0x39563b=this['_createMenuDropdownView'](),_0x163da8=this['_createEditInputView'](_0x2652d2,_0x49dbfc),_0x1ffee6=this['_createAcceptEditButtonView'](_0x2652d2,_0x163da8),_0xb4df43=this['_createCancelEditButtonView'](_0x2652d2,_0x163da8);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x3ea238),this['actions']['add'](_0x39563b),this['on']('change:isEdit',(_0xa2ce0b,_0x5d349e,_0x560ab6)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x560ab6?(this['actions']['add'](_0x1ffee6),this['actions']['add'](_0xb4df43),this['mainContent']['add'](_0x163da8),_0x163da8['element']['focus']()):(this['actions']['add'](_0x3ea238),this['actions']['add'](_0x39563b),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x4f67b0?'ck-ai-chat-history__item--active':'',_0x38cf50['if']('isVisible','ck-hidden',_0x245d24=>!_0x245d24),_0x38cf50['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',_0x38cf50['if']('loadingState','ck-hidden',_0x556bf9=>!!_0x556bf9)]},'children':_0x4f67b0?[_0x10917b]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x38cf50['if']('loadingState','ck-hidden',_0x4aee14=>!_0x4aee14)]},'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',_0x38cf50['if']('loadingState','ck-hidden',_0xd003ff=>!!_0xd003ff)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x38cf50['if']('loadingState','ck-hidden',_0x242bf8=>!_0x242bf8)]},'children':[{'text':_0x38cf50['to']('loadingState',_0xfd4e99=>_0xfd4e99?i(this['locale'],Li['LOADING_LABELS'][_0xfd4e99]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0xbe565b]}]},{'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'](_0x3fdd92){this['_titleView']['text']=_0x1e51c4(_0x3fdd92);}['updateLoadingState'](_0x2cee95,_0x1df850){this['set']('loadingState',_0x1df850?_0x2cee95:null);}['_createCheckView'](){const _0x4fc754=new _0x3c69cf();return _0x4fc754['set']({'content':_0x42b74e}),_0x4fc754;}['_createPinButtonView'](_0x511a6c){const _0x3c1ed4=new _0x33ce64(_0x511a6c);return _0x3c1ed4['set']({'label':i(_0x511a6c,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x26e317,'withText':!0x1,'tooltip':!0x0}),_0x3c1ed4['bind']('isOn')['to'](this,'pinned'),_0x3c1ed4['on']('execute',()=>{const _0x4a4480=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x4a4480});}),_0x3c1ed4;}['_createMenuDropdownView'](){const _0x4c0138=_0x1fec03(this['locale'],_0x10270b),_0x3d8ce3=_0x4c0138['panelView']['children'];_0x4c0138['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x4082a6}),_0x4c0138['panelPosition']='sw';const _0x2f6c60=new _0x33ce64(this['locale']);_0x2f6c60['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x2f6c60['withText']=!0x0,_0x2f6c60['on']('execute',()=>{this['isEdit']=!0x0;});const _0x80bedc=new _0x33ce64(this['locale']);_0x80bedc['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x80bedc['withText']=!0x0,_0x80bedc['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x26f858=new _0x41f1be(this['locale']),_0x184cca=new _0x51dbe3(this['locale']);_0x184cca['children']['add'](_0x2f6c60);const _0x12fb09=new _0x51dbe3(this['locale']);return _0x12fb09['children']['add'](_0x80bedc),_0x26f858['items']['addMany']([_0x184cca,_0x12fb09]),_0x3d8ce3['add'](_0x26f858),_0x4c0138;}['_createEditInputView'](_0x369c3d,_0x309df6){const _0x238394=new _0x7671ba(_0x369c3d),_0x4bf08a=_0x238394['bindTemplate'];return _0x238394['value']=_0x309df6,_0x238394['extendTemplate']({'on':{'keydown':_0x4bf08a['to'](_0x346add=>{'Enter'==_0x346add['key']&&this['_commitEditInputValue'](_0x238394);})}}),_0x238394;}['_createAcceptEditButtonView'](_0xe13718,_0x45d707){const _0x3d3b30=new _0x33ce64(_0xe13718);return _0x3d3b30['set']({'icon':_0x42b74e,'withText':!0x1,'tooltip':i(_0xe13718,'AI_CHAT_HISTORY_ACCEPT')}),_0x3d3b30['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x3d3b30['on']('execute',()=>{this['_commitEditInputValue'](_0x45d707);}),_0x3d3b30;}['_commitEditInputValue'](_0x13b468){const _0x5cd4b6=_0x13b468['element']['value']||'';this['_titleView']['text']=_0x5cd4b6,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x5cd4b6});}['_createCancelEditButtonView'](_0x3466e1,_0x240a90){const _0x4789cf=new _0x33ce64(_0x3466e1);return _0x4789cf['set']({'icon':_0x3c6485,'withText':!0x1,'tooltip':i(_0x3466e1,'AI_CHAT_HISTORY_CANCEL')}),_0x4789cf['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x4789cf['on']('execute',()=>{this['isEdit']=!0x1,_0x240a90['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x4789cf;}['_createSpinnerView'](){const _0x5669ad=new Ze('tiny');return _0x5669ad['isVisible']=!0x0,_0x5669ad;}['isMatching'](_0x56a0c1){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x56a0c1)?{'title':!0x0}:null;}['highlightText'](_0xbd789d){this['_titleView']['highlightText'](_0xbd789d);}}class vt extends _0x26817f{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x310a0b,_0x566846){super(_0x310a0b),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 _0x7b54b7=new _0x473725(_0x310a0b,{'label':i(_0x310a0b,'AI_CHAT_HISTORY_HEADING'),'icon':Ht,'class':'ck-ai-header\x20ck-ai-header_history'});_0x566846&&(this['resizeButton']=us(_0x310a0b,this),_0x7b54b7['children']['add'](this['resizeButton'])),this['sectionsView']=new Mi(_0x310a0b,[]),this['sectionsView']['delegate'](...Yi)['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',_0x53705a=>!_0x53705a)]}}),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':[_0x7b54b7,{'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 _0x5ec2bd=new _0x2111c6(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x360874=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x360874),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x43b96b=this['_createErrorView']();return _0x43b96b['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x46eecb=>!_0x46eecb)]}}),_0x5ec2bd['on']('render',()=>{_0x5ec2bd['children']['add'](_0x43b96b,0x1);}),_0x5ec2bd['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x90079e=>!_0x90079e)]}}),_0x5ec2bd;}['_createSkeletonView'](){const _0xe371d=new Xe(this['locale'],Ye['aiHistory']);return _0xe371d['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x324f07=>!_0x324f07)]}}),_0xe371d;}['_createErrorView'](){const _0x4f7201=new _0x26817f(this['locale']),_0x53ee25=new _0x33ce64(this['locale']);_0x53ee25['set']({'withText':!0x1,'icon':_0x3c6485,'class':'ck-ai-notification_error__dismiss-button'}),_0x53ee25['bind']('isVisible')['to'](this,'hasItems',_0x58af06=>!!_0x58af06),_0x53ee25['on']('execute',()=>{this['errorMessage']='';});const _0xaea67f=this['bindTemplate'];return _0x4f7201['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0xaea67f['to']('errorMessage')}]},_0x53ee25]}),_0x4f7201;}['_createEmptyStateView'](){const _0x4b234d=new _0x33ce64(this['locale']);_0x4b234d['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x234230,'class':'ck-ai-chat__start-conversation'}),_0x4b234d['on']('execute',()=>{this['fire']('openChat');});const _0x2efd56=new _0x26817f(this['locale']);return _0x2efd56['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x24ff34=>!_0x24ff34)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x4b234d]}),_0x2efd56;}['_createListItemViews'](_0x4cd31e,_0x4a1c41){const _0x590eb0=[];for(const _0x14ea42 of _0x4cd31e){const _0x2bfb2e=new Li(_0x4a1c41,_0x14ea42);_0x2bfb2e['delegate'](...Yi)['to'](this),_0x590eb0['push'](_0x2bfb2e);}return _0x590eb0;}['updateHistoryItemsWithCategories'](_0x4f5e6a){const _0x2cdc93=this['locale']||'en',_0x2f7baa=[];for(const _0x54ab6a of _0x4f5e6a){const _0x53f21c=this['_createListItemViews'](_0x54ab6a['items'],_0x2cdc93);_0x2f7baa['push'](new xi(_0x2cdc93,{'title':_0x54ab6a['title'],'items':_0x53f21c}));}this['sectionsView']['sections']=_0x2f7baa,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x2f7baa),this['hasItems']=_0x4f5e6a['some'](_0x1827ab=>_0x1827ab['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x6fd26a){for(const _0x6f5ec4 of this['sectionsView']['sections']){const _0x209cd0=_0x6f5ec4['getItem'](_0x6fd26a);if(_0x209cd0){if(_0x6f5ec4['removeItem'](_0x209cd0),0x0===_0x6f5ec4['itemsViews']['length']){const _0x4cfe1e=this['sectionsView']['sections']['indexOf'](_0x6f5ec4);-0x1!==_0x4cfe1e&&(this['sectionsView']['sections']['splice'](_0x4cfe1e,0x1),this['sectionsView']['items']['remove'](_0x6f5ec4));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x1bc63c,_0x5b0b95){for(const _0x15eecb of this['sectionsView']['sections']){const _0x5ea056=_0x15eecb['getItem'](_0x1bc63c);if(_0x5ea056){_0x5ea056['updateTitle'](_0x5b0b95);break;}}}['updateItemLoadingState'](_0x3ec2c2,_0xaa23d6,_0x59c9cc){for(const _0x5054f6 of this['sectionsView']['sections']){const _0xc47d43=_0x5054f6['getItem'](_0x3ec2c2);if(_0xc47d43){_0xc47d43['updateLoadingState'](_0xaa23d6,_0x59c9cc);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0xcf74fa=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0xcf74fa);}}}const Yi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class yt extends _0x4720c1{static get['requires'](){return[it];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xf0061e){super(_0xf0061e);const _0x59f7a8=this['context']['plugins']['get']('AITabs');this['_historyView']=new vt(this['context']['locale'],_0x59f7a8['showResizeButton']),this['_historyView']['delegate'](...Yi)['to'](this),_0x59f7a8['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x2c01c3){this['_historyView']['removeHistoryItem'](_0x2c01c3);}['updateItems'](_0x491305){this['_historyView']['updateHistoryItemsWithCategories'](_0x491305);}['updateItemTitle'](_0x1a9fad,_0x1527d9){this['_historyView']['updateItemTitle'](_0x1a9fad,_0x1527d9);}['updateItemLoadingState'](_0x589e0c,_0x5b80b7,_0x16d0a3){this['_historyView']['updateItemLoadingState'](_0x589e0c,_0x5b80b7,_0x16d0a3);}['setLoadingSkeleton'](_0x2a26e9){this['_historyView']['isLoading']=_0x2a26e9;}['showError'](_0x2789ee){this['_historyView']['errorMessage']=_0x2789ee;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x36f1a5){this['_historyView']['isMaximized']=_0x36f1a5;}}class nr extends ts(){['id'];['createdAt'];constructor({id:_0x404208,title:_0x1c84f9,createdAt:_0x315bb5,updatedAt:_0x54a960,pinned:_0x190f42}){super(),this['id']=_0x404208,this['createdAt']=new Date(_0x315bb5),this['set']('title',_0x1c84f9),this['set']('updatedAt',_0x54a960?new Date(_0x54a960):null),this['set']('pinned',_0x190f42||!0x1);}['updateTitle'](_0x3704eb){this['set']('title',_0x1e51c4(_0x3704eb)),this['updatedAt']=new Date();}['updatePinned'](_0xb6caaa){this['set']('pinned',_0xb6caaa),this['updatedAt']=new Date();}}class Tt extends _0x2eb18e(){['items']=[];['connector'];['group'];constructor({connector:_0x5bbe7d,group:_0x2fc5e0}){super(),this['connector']=_0x5bbe7d,this['group']=_0x2fc5e0;}async['init'](){try{const _0x5df02b=this['connector']['fetchConversations'](this['group']),_0x2dae29=await _0x5df02b['getConversations']();this['loadItems'](_0x2dae29);}catch(_0x2e9b31){this['fire']('error',{'error':_0x2e9b31,'operation':'init'});}}['addItem'](_0x36c4d1){this['items']['push'](_0x36c4d1);}async['removeItem'](_0x43ba77){const _0x5ba466=this['items']['findIndex'](_0x787515=>_0x787515['id']===_0x43ba77);if(-0x1===_0x5ba466)return!0x1;try{return await this['connector']['deleteConversation'](_0x43ba77)['execute'](),this['items']['splice'](_0x5ba466,0x1),this['fire']('itemRemoved',{'itemId':_0x43ba77}),!0x0;}catch(_0x1ac469){return this['fire']('error',{'error':_0x1ac469,'operation':'removeItem','itemId':_0x43ba77}),!0x1;}}['getItem'](_0x2568a4){return this['items']['find'](_0x5619ee=>_0x5619ee['id']===_0x2568a4);}async['updateItemTitle'](_0x36f7bd,_0x2f718b){const _0x26e485=this['getItem'](_0x36f7bd);if(!_0x26e485)return!0x1;try{return await this['connector']['updateConversation'](_0x36f7bd,{'title':_0x2f718b})['getResult'](),_0x26e485['updateTitle'](_0x2f718b),this['fire']('itemUpdated',{'itemId':_0x36f7bd,'updates':{'title':_0x2f718b}}),!0x0;}catch(_0x297d21){return this['fire']('error',{'error':_0x297d21,'operation':'updateItemTitle','itemId':_0x36f7bd}),!0x1;}}async['updateItemPinned'](_0x37250a,_0x51c492){const _0x31ee60=this['getItem'](_0x37250a);if(!_0x31ee60)return!0x1;try{return await this['connector']['updateConversation'](_0x37250a,{'pinned':_0x51c492})['getResult'](),_0x31ee60['updatePinned'](_0x51c492),this['fire']('itemUpdated',{'itemId':_0x37250a,'updates':{'pinned':_0x51c492}}),!0x0;}catch(_0x157ff6){return this['fire']('error',{'error':_0x157ff6,'operation':'updateItemPinned','itemId':_0x37250a}),!0x1;}}['loadItems'](_0x25f932){try{this['items']=[],_0x25f932['map'](_0x488c9e=>{this['addItem'](new nr(_0x488c9e));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x237b65){this['fire']('error',{'error':_0x237b65,'operation':'loadItems'});}}['getItems'](_0x13f654={}){const _0x264ad7=void 0x0!==_0x13f654['pinned']&&_0x13f654['pinned'],_0x4ec713=_0x13f654['from']?new Date(_0x13f654['from']['getFullYear'](),_0x13f654['from']['getMonth'](),_0x13f654['from']['getDate']()):null,_0x5dfea8=_0x13f654['to']?new Date(_0x13f654['to']['getFullYear'](),_0x13f654['to']['getMonth'](),_0x13f654['to']['getDate']()):null;return this['items']['filter'](_0x2109b1=>{if(_0x2109b1['pinned']!==_0x264ad7)return!0x1;if(_0x5dfea8){const _0x2873a8=new Date(_0x2109b1['createdAt']['getFullYear'](),_0x2109b1['createdAt']['getMonth'](),_0x2109b1['createdAt']['getDate']());return _0x4ec713?_0x4ec713['getTime']()===_0x5dfea8['getTime']()?_0x2873a8['getTime']()===_0x4ec713['getTime']():_0x2873a8<_0x5dfea8&&_0x2873a8>=_0x4ec713:_0x2873a8<_0x5dfea8;}return!0x0;});}}class ft extends _0x4720c1{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[tt,q,yt,it];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](tt),this['_aiChatHistoryUi']=this['context']['plugins']['get'](yt),this['_aiChatController']=this['context']['plugins']['get'](q);const _0x573f87=this['context']['plugins']['get'](it);try{const _0x484557=this['_aiChatController']['getGroupId']();this['history']=new Tt({'connector':this['_aiConnector'],'group':_0x484557}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x527e03,_0xc0b239)=>{this['_setItemLoading'](_0xc0b239['id'],'remove'),this['_handleRemove'](_0xc0b239['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x209df9,_0x1da994)=>{this['_setItemLoading'](_0x1da994['id'],'rename'),this['_handleEditTitle'](_0x1da994['id'],_0x1da994['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x6e07f8,_0x5d1ad8)=>{void 0x0!==_0x5d1ad8['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x5d1ad8['itemId'],_0x5d1ad8['updates']['title']),void 0x0!==_0x5d1ad8['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x5d1ad8['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x4a683c,_0x21a660)=>{this['_aiChatController']['handleRemovedConversation'](_0x21a660['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x21a660['itemId']),this['_clearItemLoading'](_0x21a660['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x8a0ab6,_0x3b54a2)=>{this['_handleHistoryErrorUI'](_0x3b54a2['error'],_0x3b54a2['operation'],_0x3b54a2['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x3560a4,_0x1c673a)=>{this['_handleSelectConversation'](_0x1c673a['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x290ab6,_0x3e8738)=>{const _0x10f783=_0x3e8738['pinned']?'pin':'unpin';this['_setItemLoading'](_0x3e8738['id'],_0x10f783),this['_handleTogglePin'](_0x3e8738['id'],_0x3e8738['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x573f87['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x573f87['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x573f87,'resizedTabs',(_0x15bc6d,_0x5e4963)=>{this['_setIsMaximized'](_0x5e4963);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x573f87['resize']();});}catch(_0x42389b){this['_handleHistoryErrorUI'](_0x42389b,'init');}}async['_handleEditTitle'](_0x53facb,_0x34b63c){await this['history']['updateItemTitle'](_0x53facb,_0x34b63c);}async['_handleTogglePin'](_0x55f8b3,_0x4bb1af){await this['history']['updateItemPinned'](_0x55f8b3,_0x4bb1af);}async['_handleRemove'](_0x324aa5){await this['history']['removeItem'](_0x324aa5);}async['_handleSelectConversation'](_0x4bbc8c){await this['_aiChatController']['loadConversation'](_0x4bbc8c);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x2ff395=this['_aiChatController']['activeConversation']?.['id'],_0x30125f=this['_getCategorizedItems']()['map'](_0x344b04=>({'title':_0x344b04['title'],'items':_0x344b04['items']['map'](_0x1d97d3=>({'id':_0x1d97d3['id'],'title':_0x1d97d3['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x1d97d3['createdAt'])['toLocaleDateString'](),'active':_0x1d97d3['id']===_0x2ff395,'pinned':_0x1d97d3['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x30125f);}['_setItemLoading'](_0x271b35,_0x549a3f){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x271b35,_0x549a3f,!0x0);}['_clearItemLoading'](_0x4731b4){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x4731b4,null,!0x1);}['_handleHistoryErrorUI'](_0x38701a,_0x29fdc,_0x167eb9){const _0x222926=this['_generateErrorMessage'](_0x29fdc,_0x167eb9);this['_aiChatHistoryUi']['showError'](_0x222926),_0x167eb9&&this['_clearItemLoading'](_0x167eb9),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x504e8b,_0x54f745){const _0x4add2c=_0x54f745?this['history']['getItem'](_0x54f745):null,_0x3a6c8b=_0x4add2c?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x504e8b){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x3a6c8b);case'updateItemPinned':{const _0x507416=i(this['context']['locale'],_0x4add2c?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x507416,_0x3a6c8b]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x3a6c8b);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 _0x237508=new Date(),_0x314843=new Date(_0x237508['getFullYear'](),_0x237508['getMonth'](),_0x237508['getDate']()),_0x395fbf=new Date(_0x314843);_0x395fbf['setDate'](_0x395fbf['getDate']()-0x1);const _0x25d500=new Date(_0x314843);_0x25d500['setDate'](_0x25d500['getDate']()-0xe);const _0x1f3188=this['history']['getItems']({'pinned':!0x0}),_0x26c6ac=this['history']['getItems']({'from':_0x314843,'to':_0x314843}),_0x1a0523=this['history']['getItems']({'from':_0x395fbf,'to':_0x395fbf}),_0x232366=this['history']['getItems']({'from':_0x25d500,'to':_0x395fbf}),_0x36f386=this['history']['getItems']({'to':_0x25d500}),_0x3e721d=[];return _0x1f3188['length']>0x0&&_0x3e721d['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x1f3188}),_0x26c6ac['length']>0x0&&_0x3e721d['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x26c6ac}),_0x1a0523['length']>0x0&&_0x3e721d['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x1a0523}),_0x232366['length']>0x0&&_0x3e721d['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x232366}),_0x36f386['length']>0x0&&_0x3e721d['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x36f386}),_0x3e721d;}['_setIsMaximized'](_0x3c2388){this['_aiChatHistoryUi']['setIsMaximized'](_0x3c2388);}}class G extends _0x4720c1{static get['requires'](){return[ft,yt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class AIChat extends _0x4720c1{static get['requires'](){return[q,D,z,G];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x24e01a){super(_0x24e01a),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'](q)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](q)['startConversation']();}async['sendMessage']({message:_0x596896,attributes:_0x1bf408}){await this['context']['plugins']['get'](q)['sendMessage']({'message':_0x596896,'attributes':_0x1bf408});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](q)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](q)['focusPromptInput']();}['registerToolDataCallback'](_0xfcb249){this['context']['plugins']['get'](q)['_registerToolDataCallback'](_0xfcb249);}}class ws extends _0x33ce64{['id'];constructor(_0x2c35b7,_0x1801ac){super(_0x2c35b7);const {id:_0xc61f50,type:_0xacaf7f,icon:_0x533e3d}=_0x1801ac;this['id']=_0xc61f50,this['set']({'label':_0x1801ac['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x1801ac['id']}}),_0x533e3d?this['icon']=_0x533e3d:'chat'===_0xacaf7f?this['icon']=_0x5110fd:'review'===_0xacaf7f?this['icon']=_0x2821c6:'translate'===_0xacaf7f&&(this['icon']=Vt);}}class Mt extends _0x26817f{['listView'];constructor(_0x58795d,_0x1df3ee){super(_0x58795d);const _0x65a10d=_0x1df3ee['map'](_0x242f7c=>{const _0x2bfe11=new _0x51dbe3(this['locale']),_0x23be8e=new ws(this['locale'],_0x242f7c);return _0x2bfe11['children']['add'](_0x23be8e),_0x23be8e['delegate']('execute')['to'](this),_0x2bfe11;});this['listView']=new _0x41f1be(this['locale']),this['listView']['items']['addMany'](_0x65a10d),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const Ut='chat-shortcuts';var ka=function(_0x31af6b){return _0x31af6b['CHAT']='chat',_0x31af6b['REVIEW']='review',_0x31af6b['TRANSLATE']='translate',_0x31af6b;}({});class AIChatShortcuts extends _0x4720c1{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[z];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](z),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x2ca8f0=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x2ca8f0['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x2ca8f0,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x17edfe=Object['values'](ka);this['_shortcuts']['forEach'](_0x28686c=>{let _0x1036f8=!0x0;if(_0x28686c['id']&&_0x28686c['label']&&_0x17edfe['includes'](_0x28686c['type'])?'chat'===_0x28686c['type']&&(_0x1036f8='string'==typeof _0x28686c['prompt']):_0x1036f8=!0x1,!_0x1036f8)throw new _0x465bb5('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x28686c});});}['_injectShortcuts'](){const _0x5b6b9a=this['context']['plugins']['get'](z);this['_shortcutsView']=new Mt(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x5b6b9a['addFeedItemCustomElement'](this['_shortcutsView']['element'],Ut),this['_shortcutsView']['on']('execute',_0x2b9624=>{const _0x263777=_0x2b9624['source']['id'];this['_executeShortcut'](_0x263777);});}['_removeShortcuts'](){const _0x28fb36=this['context']['plugins']['get'](z);_0x28fb36['hasFeedItem'](Ut)&&_0x28fb36['removeFeedItem'](Ut),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x3d9d7a){const _0x502be3=this['_shortcuts']['find'](_0x5e3a45=>_0x5e3a45['id']===_0x3d9d7a),_0x3400ff=_0x502be3['type'];'chat'===_0x3400ff?this['_runChatShortcut'](_0x502be3):'review'===_0x3400ff?_0x502be3['check']?this['_runReviewShortcut'](_0x502be3):this['_switchTab']('reviewMode'):'translate'===_0x3400ff&&(_0x502be3['language']?this['_runTranslateShortcut'](_0x502be3):this['_switchTab']('translate'));}['_switchTab'](_0x47518f){if(!this['context']['plugins']['has']('AITabs'))throw new _0x465bb5('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x47518f});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x47518f);}async['_runChatShortcut']({prompt:_0x264aa9,draftMode:_0x5754b8,useWebSearch:_0x1be392=!0x1,useReasoning:_0x9034f8=!0x1,model:_0x4b67da}){const _0x28d692=this['context']['plugins']['get']('AIChat'),_0x2958da=this['context']['plugins']['get']('AIChatController'),_0x1678cd=_0x2958da['activeConversation'];let _0x1c6105;_0x1c6105=_0x4b67da?await _0x1678cd['chatModels']['getModel'](_0x4b67da):await _0x1678cd['chatModels']['getDefault'](),_0x1c6105&&await _0x1678cd['setModel'](_0x1c6105),_0x1678cd['setWebSearch'](_0x1be392),_0x1678cd['setReasoning'](_0x9034f8),_0x2958da['addCurrentDocumentToChatContext'](),_0x5754b8?(this['_aiChatUI']['setPromptInputValue'](_0x264aa9),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x28d692['sendMessage']({'message':_0x264aa9});}['_runReviewShortcut']({check:_0x554d80,model:_0x48d1a9,prompt:_0x1cc0c2,params:_0x48220a}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0x465bb5('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x32236c={'id':_0x554d80,'isCustom':'custom'===_0x554d80};_0x48d1a9&&_0x1cc0c2&&(_0x32236c['args']={'model':_0x48d1a9,'prompt':_0x1cc0c2}),_0x48220a&&(_0x32236c['params']=_0x48220a),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x32236c);}['_runTranslateShortcut']({language:_0x558237}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0x465bb5('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x558237,'args':{'language':_0x558237}});}}class io extends Lt{constructor(_0x91a590){super(_0x91a590);const _0x15f263=_0x91a590['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x15f263,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x8b4eb=this['editor']['plugins']['get']('AITabs')['view'];_0x8b4eb['isVisible']=!_0x8b4eb['isVisible'];}}class Pt extends _0x33cb4d{static get['requires'](){return[it];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x274b08=this['editor'];_0x274b08['commands']['add']('toggleAi',new io(_0x274b08)),_0x274b08['ui']['componentFactory']['add']('toggleAi',()=>{const _0x1e9794=this['_createAIUIButton'](_0x33ce64);return _0x1e9794['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x1e9794;}),_0x274b08['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x291f8f=this['_createAIUIButton'](_0x57ee28);return _0x291f8f['set']({'role':'menuitemcheckbox'}),_0x291f8f;});}['_createAIUIButton'](_0x493d9d){const _0x4bc0bf=this['editor'],_0x31873c=_0x4bc0bf['commands']['get']('toggleAi'),_0x3d951d=new _0x493d9d(_0x4bc0bf['locale']);return _0x3d951d['set']({'label':i(_0x4bc0bf['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x18dfc6,'isToggleable':!0x0}),_0x3d951d['bind']('isEnabled')['to'](_0x31873c),_0x3d951d['bind']('isOn')['to'](_0x31873c,'value',_0x593430=>!!_0x593430),this['listenTo'](_0x3d951d,'execute',()=>{_0x31873c['execute']();}),_0x3d951d;}}const F=['applySuggestion','insertSuggestion','showNext','showPrevious'];class pi extends _0x26817f{['_errorView'];constructor(_0x1b8a1f){super(_0x1b8a1f),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x4342ba){this['showError'](_0x4342ba);}['showError'](_0x2abc56){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x2abc56,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x45443e=new _0x26817f(this['locale']),_0x41f386=new _0x26817f(this['locale']);return _0x41f386['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x45443e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x5f82b1=>!_0x5f82b1)]},'children':[_0x41f386]}),_0x45443e;}}const $=0xa;class H extends _0x4720c1{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'](_0x38c332){const {id:_0x164aea}=this['_currentConfig']??{};this['_currentConfig']=_0x38c332;const {id:_0x135505}=this['_currentConfig'];this['isOpen']&&_0x164aea===_0x135505?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x38e766=T(this['context'])['plugins']['get']('Dialog');_0x38e766['isOpen']&&this['_currentConfig']&&_0x38e766['id']===this['_currentConfig']['id']&&_0x38e766['hide']();}['_updateDialog'](){const _0x261df3=T(this['context'])['plugins']['get']('Dialog'),{icon:_0x24b4ff,title:_0xcd9b1a}=this['_currentConfig'];_0x261df3['view']?.['headerView']&&(_0x261df3['view']['headerView']['label']=_0xcd9b1a,_0x261df3['view']['headerView']['iconView']&&_0x24b4ff&&(_0x261df3['view']['headerView']['iconView']['content']=_0x24b4ff)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x261df3['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](D)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x30605c){this['context']['plugins']['get'](D)['hideFakeVisualSelection']('ai-balloon-'+_0x30605c);}['_showDialog'](){const _0x543a20=T(this['context'])['plugins']['get']('Dialog'),{id:_0xa99d9e,title:_0x83e2dc,icon:_0x32e9b9,class:_0x230247,mainView:_0xff6479}=this['_currentConfig'];_0xff6479['delegate'](...F)['to'](this),_0x543a20['show']({'title':_0x83e2dc,'icon':_0x32e9b9,'hasCloseButton':!0x0,'id':_0xa99d9e,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x230247||''),'content':_0xff6479,'onShow':_0x3ca46f=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x23cefc=this['_getSelectionElements']();_0x23cefc&&_0x23cefc[0x0]&&_0x216c50({'target':_0x23cefc[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x3ca46f['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0xa99d9e});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0xa99d9e}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x37faf0,_0x574029){if(!_0x574029)return null;const _0x15045c=this['_getSelectionElements']();if(!_0x15045c||0x0===_0x15045c['length'])return{'left':Math['round'](_0x574029['left']+_0x574029['width']/0x2-_0x37faf0['width']/0x2),'top':Math['round'](_0x574029['top']+_0x574029['height']/0x2-_0x37faf0['height']/0x2)};const _0x423091=Math['round'](_0x574029['left']+_0x574029['width']/0x2-_0x37faf0['width']/0x2),_0xae5d5b=_0x15045c['map'](_0x2e1951=>new _0x26a571(_0x2e1951)),_0xcfaed6=_0x37faf0['height'];return{'left':_0x423091,'top':this['_calculateOptimalTopPosition'](_0xae5d5b,_0xcfaed6,_0x574029)};}['_calculateOptimalTopPosition'](_0x650c8,_0x553548,_0x4d5a6e){const _0x39de56=new _0x26a571(_0x274357['window']),_0x4d7d07=_0x650c8['map'](_0x3630ed=>_0x3630ed['getVisible']())['filter'](_0x262c9d=>_0x262c9d),_0x5c33ad=_0x26a571['getBoundingRect'](_0x4d7d07);if(!_0x5c33ad)return Math['round'](_0x4d5a6e['top']+_0x4d5a6e['height']/0x2);const _0x495ae1=_0x39de56['getIntersection'](_0x5c33ad);if(!_0x495ae1)return Math['round'](_0x4d5a6e['top']+_0x4d5a6e['height']/0x2);const _0x33c200=_0x4d5a6e['getVisible'](),_0x3fb134=_0x33c200&&_0x5c33ad['height']>_0x33c200['height'],_0x30b09c=_0x495ae1['top'],_0x1e96ab=_0x495ae1['bottom'];if(_0x3fb134){const _0x2233da=(_0x33c200||_0x39de56)['height']/0x2-_0x553548/0x2,_0x463e6f=_0x30b09c-$-_0x4d5a6e['top'],_0x2cfdea=_0x4d5a6e['bottom']-_0x1e96ab-$;return _0x463e6f>=_0x553548?Math['max']($,_0x30b09c-_0x553548-$):_0x2cfdea>=_0x553548?_0x1e96ab+$:Math['max']($,_0x2233da);}const _0x59276b=_0x30b09c-_0x553548,_0x12df22=_0x4d5a6e['bottom']-_0x1e96ab-$,_0x5dd487=_0x30b09c-$-_0x4d5a6e['top'];let _0x150d2a;if(_0x12df22>=_0x553548)_0x150d2a=_0x1e96ab+$;else{if(_0x5dd487>=_0x553548)_0x150d2a=_0x59276b-$;else _0x150d2a=_0x30b09c+_0x5c33ad['height']/0x2-_0x553548/0x2;}return _0x150d2a;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x447f13=T(this['context']);this['listenTo'](_0x447f13['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x348241,data:{newRange:_0x31dd2e}}of _0x447f13['model']['document']['differ']['getChangedMarkers']())if(_0x348241['startsWith'](R+':')&&(_0x31dd2e&&(_0x31dd2e['start']['isEqual'](_0x31dd2e['end'])||'$graveyard'==_0x31dd2e['root']['rootName'])||null==_0x31dd2e)){const _0x2559ff=i(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x2559ff),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x4edb78=T(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x4edb78['model']['document']);}['_getSelectionElements'](){const _0x53599d=T(this['context']);return _0x5ef60e(_0x53599d['editing'],[..._0x53599d['model']['markers']['getMarkersGroup']('ai-selection'),..._0x53599d['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class wi extends _0x5ec0fa{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x9c5b51,_0x3360ea={}){super(_0x9c5b51),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x3360ea};const _0x2ff7ef=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x2ff7ef?'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'](_0x178946){this['showChangesButton']['isEnabled']=_0x178946;}['_setupRatingButtons'](){this['likeButton']=new _0x33ce64(this['locale']),this['likeButton']['set']({'icon':_0x18351,'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 _0x33ce64(this['locale']),this['dislikeButton']['set']({'icon':_0x184680,'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 _0x33ce64(this['locale']),this['copyButton']['set']({'icon':_0x32b45f,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x442fc5=new _0x3c69cf();_0x442fc5['set']({'content':_0x3cd0e3}),_0x442fc5['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'](_0x442fc5);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x33ce64(this['locale']),this['showChangesButton']['set']({'icon':_0x46277c,'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',_0x341ffd=>_0x341ffd?_0x40cf68:_0x46277c),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class Q extends pi{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x3e5afa,_0x242983){super(_0x3e5afa);const _0x43492f=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _0x1203ce(),this['_keystrokes']=new _0x2ac014(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x29c2cb({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x242983,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new ui(_0x3e5afa),this['_partToolbarView']=new gi(_0x3e5afa,_0x242983['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x242983),this['_stateView']=new mi(_0x3e5afa),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new wi(_0x3e5afa,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new AIChatBalloonToolbarContainerView(_0x3e5afa,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x559986,_0x41ef2f,_0x5dfa5d,_0x4c6bce)=>{let _0x2572cb,_0x221178;'pending'===_0x4c6bce?(_0x2572cb=this['_partToolbarView'],_0x221178=this['_stateView']):(_0x2572cb=this['_stateView'],_0x221178=this['_partToolbarView']),this['_stateView']['setState'](_0x5dfa5d),_0x2572cb['isVisible']=!0x1,_0x221178['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x43492f['to']('_state',_0x5a7579=>'ck-ai-chat-balloon-main_state_'+_0x5a7579)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x242983);});}['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'](_0x23aa91){_0x23aa91?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x23aa91);}['setState'](_0x1e6491){this['_state']=_0x1e6491;}['showError'](_0xd3a0d2){super['showError'](_0xd3a0d2),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0xf8c5ef){super['showBlockingError'](_0xf8c5ef),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x551828){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x551828;}['togglePartToolbarEnabled'](_0x17a119){this['_partToolbarView']['isEnabled']=_0x17a119;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x5bfb49,showSuggestButton:_0x249713}){_0x5bfb49=_0x5bfb49&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x249713=_0x249713&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x5bfb49,'showSuggestButton':_0x249713});}['_createNextButtonView'](){const _0x5cbdf1=new _0x33ce64(this['locale']);return _0x5cbdf1['set']({'icon':_0x3ca3c3,'label':i(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x5cbdf1['on']('execute',()=>{this['fire']('showNext');}),_0x5cbdf1;}['_createPreviousButtonView'](){const _0x1787a4=new _0x33ce64(this['locale']);return _0x1787a4['set']({'icon':_0xd8dc93,'label':i(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x1787a4['on']('execute',()=>{this['fire']('showPrevious');}),_0x1787a4;}}class AIChatBalloonToolbarContainerView extends _0x26817f{constructor(_0x345851,_0x36bfe5){super(_0x345851),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x36bfe5});}}class qt extends _0x33cb4d{static get['requires'](){return[_0x33e5ba,H];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x4510d9){super(_0x4510d9),this['set']('showDiff',!0x1);}['open'](_0x51b5c3){const _0x46e575=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x46e575['plugins']['get']('AIBalloon')['open']({..._0x51b5c3,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x51b5c3['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x51b5c3['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x3cc72b){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x3cc72b);}['setState'](_0x8cb116){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x8cb116);}['_createChatBalloonView'](){const _0x2c6077=this['editor'],_0x5e9050=_0x2c6077['plugins']['get']('AIBalloon'),_0x1592d4=_0x2c6077['commands']['get']('trackChanges');let _0x279ad1=_0x2c6077['config']['get']('ai.availableReplyActions')||[...J];_0x2c6077['plugins']['has']('TrackChanges')||(_0x279ad1=_0x279ad1['filter'](_0x38c874=>'insertSuggestion'!=_0x38c874));const _0x2df770=new Q(_0x2c6077['locale'],{'availableActions':_0x279ad1,'showApplyButton':!0x0,'showSuggestButton':!!_0x1592d4});return _0x2df770['bind']('showDiff')['to'](this),_0x2df770['delegate'](...W)['to'](this),_0x2df770['delegate']('showPrevious','showNext')['to'](this),_0x5e9050['delegate']('dialogClosed')['to'](this),_0x2df770['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x2df770['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x2df770['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x1592d4&&_0x2df770['bind']('isTrackChangesOn')['to'](_0x1592d4,'value'),_0x2df770['render'](),_0x2df770;}['_toggleRotatorButtonsInDialogHeader'](_0x3b0db0){const _0x2fd6df=this['editor'],_0x7eb4c0=_0x2fd6df['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x3b0db0),_0x7eb4c0['has'](this['_chatBalloonView']['previousButtonView'])||(_0x7eb4c0['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x2fd6df['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x7eb4c0['remove'](this['_chatBalloonView']['previousButtonView']),_0x7eb4c0['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class AIEditorIntegration extends _0x33cb4d{static get['requires'](){return[Pt,qt,Nt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Zt(_0x6de77){const {editor:_0x268421,action:_0x48bebd,withText:_0x4480de=!0x1,withIcon:_0x5a87c2=!0x0,isInDropdown:_0x27d7fc=!0x0,shouldPreventFocus:_0x3347f6=!0x1}=_0x6de77;return()=>{const _0x4bc6de=_0x268421['locale'],_0x2062dd=new _0x33ce64(_0x4bc6de),_0x1e453d=_0x2062dd['bindTemplate'];_0x27d7fc&&_0x2062dd['extendTemplate']({'on':{'mouseenter':_0x1e453d['to'](()=>{_0x3347f6&&_0x3347f6()||_0x2062dd['focus']();})}});const _0x2b5efe=_0x48bebd['icon']??_0x48bebd['parent']?.['icon'];return _0x2062dd['set']({'label':_0x48bebd['displayedPrompt'],'withText':_0x4480de,'role':'menuitem','icon':_0x5a87c2?_0x2b5efe??bt:void 0x0,'tooltip':!_0x4480de,'class':'ck-ai-quick-actions-button','isEnabled':_0x48bebd['isEnabled']}),_0x2062dd['on']('execute',()=>{_0x268421['editing']['view']['focus'](),_0x268421['commands']['execute']('aiQuickAction',_0x48bebd);}),_0x2062dd;};}class Ps extends _0x3910d5{['arrowView'];constructor(_0x2f7298,_0x3dab42){super(_0x2f7298,_0x3dab42);const _0x3995e4=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',_0xe1a161=>String(_0xe1a161)),'data-cke-tooltip-disabled':_0x3995e4['to']('isOn')},'on':{'mouseenter':_0x3995e4['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x455491=new _0x3c69cf();return _0x455491['content']=_0x31eb66,_0x455491['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x455491;}}class Ls extends _0x41f1be{['_allListItems'];['_allSearchableItems'];constructor(_0x5671fb,_0x251fb0,_0x2a5ea3){super(_0x5671fb),this['_allListItems']=_0x251fb0,this['_allSearchableItems']=_0x2a5ea3;}['filter'](_0x4c1416){if(!_0x4c1416)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x39711a=_0x4c1416['source']['toLowerCase']()['trim'](),_0x5b4925=this['_allSearchableItems']['filter'](_0x682d8a=>(_0x682d8a['groupLabel']?_0x682d8a['label']+'\x20('+_0x682d8a['groupLabel']+')':_0x682d8a['label'])['toLowerCase']()['includes'](_0x39711a));return this['items']['clear'](),this['items']['addMany'](_0x5b4925['sort']((_0x3bf347,_0x15a393)=>{const _0x41d5a7=_0x3bf347['groupLabel'],_0x22dd0b=_0x15a393['groupLabel'];return _0x41d5a7||_0x22dd0b?_0x41d5a7?0x1:-0x1:0x0;})['map'](_0x5293f7=>_0x5293f7['item'])),this['_highlightQuery'](_0x39711a,_0x5b4925),{'resultsCount':_0x5b4925['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x427127,_0x5847f0){if(!_0x427127)return;const _0x2fece6=new RegExp(_0x4b1b24(_0x427127),'gi');_0x5847f0['forEach'](_0x3dc863=>{_0x3dc863['highlightViews']&&_0x3dc863['highlightViews']['forEach'](_0xd30745=>{'function'==typeof _0xd30745['highlightText']&&_0xd30745['highlightText'](_0x2fece6);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x3bfe62=>{_0x3bfe62['highlightViews']&&_0x3bfe62['highlightViews']['forEach'](_0x54c90f=>{'function'==typeof _0x54c90f['highlightText']&&_0x54c90f['highlightText'](null);});});}}const Qs='menu',Gs='menuitem';class co extends _0x26817f{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x30f446,_0x31d834,_0x2226ca,_0x261eaf,_0x36438a=!0x1){const _0x39891d=_0x30f446['locale'];super(_0x39891d),this['_bodyCollection']=_0x261eaf,this['_hasSearch']=_0x36438a;const _0x4fe6e8=this['_createListItems'](_0x30f446,_0x31d834,_0x2226ca);this['optionsListView']=new Ls(_0x39891d,_0x4fe6e8,this['_allSearchableItems']),this['optionsListView']['role']=Qs,this['optionsListView']['items']['addMany'](_0x4fe6e8),this['focusTracker']=new _0x1203ce(),this['keystrokes']=new _0x2ac014(),_0x36438a&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x4fe6e8,this['focusCycler']=new _0x29c2cb({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x36438a&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x5a51cf=_0x36438a&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x1024e9(_0x5a51cf),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x39891d['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x2111c6(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 _0x219287=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x219287);}['_createListItems'](_0x1f93d1,_0x1732aa,_0x1d0183){const _0x561b92=new _0x1024e9();return _0x1732aa['forEach'](_0x587210=>{if('actions'in _0x587210){const {listItem:_0x393261}=this['_createActionGroupButton'](_0x1f93d1,_0x587210,_0x1d0183);_0x561b92['add'](_0x393261),_0x587210['actions']['forEach'](_0x329ad2=>{this['_createActionButton'](_0x1f93d1,_0x329ad2,_0x587210['label'],_0x587210['icon']);const {listItem:_0x5696a5,highlightViews:_0x2f746a}=this['_createSearchResultActionButton'](_0x1f93d1,_0x329ad2,_0x587210['label'],_0x587210['icon']);this['_allSearchableItems']['push']({'item':_0x5696a5,'label':_0x329ad2['displayedPrompt'],'groupLabel':_0x587210['label'],'highlightViews':_0x2f746a});});}else{const {listItem:_0x1619e2}=this['_createActionButton'](_0x1f93d1,_0x587210);_0x561b92['add'](_0x1619e2);const _0x151588=_0x1619e2['children']['first'];if(_0x151588){const {listItem:_0x10f560,highlightViews:_0x4d082f}=this['_createSearchResultActionButton'](_0x1f93d1,_0x587210);this['_allSearchableItems']['push']({'item':_0x10f560,'label':_0x151588['label']||'','highlightViews':_0x4d082f});}}}),_0x561b92;}['_createActionButton'](_0x552180,_0x2e4e7f,_0x430b4f,_0x1549eb){const _0xbd4217=new _0x51dbe3(this['locale']);if(_0x430b4f&&_0x1549eb){const _0x1c5f4f=new _0x33ce64(this['locale']),_0x1c23fa=_0x1c5f4f['bindTemplate'],_0x462f0b=new _0x3a4df2();_0x462f0b['text']=_0x2e4e7f['displayedPrompt'];const _0x68275=new _0x3a4df2();_0x68275['text']=_0x430b4f;const _0x4c8280=new _0x3c69cf();_0x4c8280['content']=_0x1549eb,_0x4c8280['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x8b4695=new _0x26817f(this['locale']);_0x8b4695['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x35a571=new _0x26817f(this['locale']);return _0x35a571['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x1c5f4f['set']({'label':_0x2e4e7f['displayedPrompt']+'\x20('+_0x430b4f+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x1c5f4f['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':[_0x462f0b,_0x8b4695,_0x4c8280,_0x68275,_0x35a571],'on':{'mouseenter':_0x1c23fa['to'](()=>{this['_isSearchFocused']()||_0x1c5f4f['focus']();}),'click':_0x1c23fa['to'](()=>{_0x1c5f4f['fire']('execute');})}}),_0x1c5f4f['on']('execute',()=>{_0x552180['editing']['view']['focus'](),_0x552180['commands']['execute']('aiQuickAction',_0x2e4e7f);}),_0xbd4217['children']['add'](_0x1c5f4f),{'listItem':_0xbd4217,'highlightViews':[_0x462f0b,_0x68275]};}{const _0x19ff4a=new _0x315151(),_0x312831=new _0x33ce64(this['locale'],_0x19ff4a),_0x22598d=_0x312831['bindTemplate'],_0x1c5d16=_0x2e4e7f['icon']??_0x2e4e7f['parent']?.['icon'],_0x1f4c57=void 0x0!==_0x2e4e7f['icon'];return _0x312831['set']({'label':_0x2e4e7f['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x1f4c57?_0x1c5d16??bt:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x312831['extendTemplate']({'on':{'mouseenter':_0x22598d['to'](()=>{this['_isSearchFocused']()||_0x312831['focus']();})}}),_0x312831['on']('execute',()=>{_0x552180['editing']['view']['focus'](),_0x552180['commands']['execute']('aiQuickAction',_0x2e4e7f);}),_0xbd4217['children']['add'](_0x312831),{'listItem':_0xbd4217,'highlightViews':[_0x19ff4a]};}}['_createSearchResultActionButton'](_0x33865e,_0x49a17e,_0x3e4250,_0x2ab7e7){return _0x3e4250&&_0x2ab7e7?this['_createSearchResultGroupedActionButton'](_0x33865e,_0x49a17e,_0x3e4250,_0x2ab7e7):this['_createSearchResultIndividualActionButton'](_0x33865e,_0x49a17e);}['_createSearchResultGroupedActionButton'](_0x5bfe23,_0xb071ef,_0x3d16c1,_0x5a65fc){const _0x1254be=new _0x51dbe3(this['locale']),_0x58b1fb=new _0x33ce64(this['locale']),_0x40ebdd=_0x58b1fb['bindTemplate'],{view:_0x26fb30,highlightView:_0x10b177}=this['_createSearchResultGroupRow'](_0x3d16c1,_0x5a65fc),{view:_0x1c0fae,highlightView:_0x5b8bf6}=this['_createSearchResultActionRow'](_0xb071ef['displayedPrompt']),_0x17862e=this['_createSearchResultContentView'](_0x26fb30,_0x1c0fae);return _0x58b1fb['set']({'label':_0xb071ef['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}),_0x58b1fb['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':[_0x17862e],'on':{'mouseenter':_0x40ebdd['to'](()=>{this['_isSearchFocused']()||_0x58b1fb['focus']();}),'click':_0x40ebdd['to'](()=>{this['_handleSearchResultButtonClick'](_0x58b1fb);})}}),this['_setupActionButtonExecution'](_0x58b1fb,_0x5bfe23,_0xb071ef),_0x1254be['children']['add'](_0x58b1fb),{'listItem':_0x1254be,'highlightViews':[_0x10b177,_0x5b8bf6]};}['_createSearchResultIndividualActionButton'](_0x1fc7a0,_0x19aa8c){const _0x4dbf4f=new _0x51dbe3(this['locale']),_0x1ebb5b=new _0x315151(),_0x137682=new _0x33ce64(this['locale'],_0x1ebb5b),_0x23b87a=_0x137682['bindTemplate'];return _0x137682['set']({'label':_0x19aa8c['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x137682['extendTemplate']({'on':{'mouseenter':_0x23b87a['to'](()=>{this['_isSearchFocused']()||_0x137682['focus']();})}}),this['_setupActionButtonExecution'](_0x137682,_0x1fc7a0,_0x19aa8c),_0x4dbf4f['children']['add'](_0x137682),{'listItem':_0x4dbf4f,'highlightViews':[_0x1ebb5b]};}['_createSearchResultGroupRow'](_0x385260,_0xe2850c){const _0x371833=new _0x26817f(this['locale']),_0x1727c8=new _0x3c69cf();_0x1727c8['content']=_0xe2850c,_0x1727c8['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x46d311=new _0x3a4df2();return _0x46d311['text']=_0x385260,_0x371833['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x1727c8,_0x46d311]}),{'view':_0x371833,'highlightView':_0x46d311};}['_createSearchResultActionRow'](_0x54e443){const _0xfc5381=new _0x26817f(this['locale']),_0x104161=new _0x3a4df2();return _0x104161['text']=_0x54e443,_0xfc5381['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x104161]}),{'view':_0xfc5381,'highlightView':_0x104161};}['_createSearchResultContentView'](_0x54bec4,_0xba48a5){const _0x52e426=new _0x26817f(this['locale']);return _0x52e426['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x54bec4,_0xba48a5]}),_0x52e426;}['_setupActionButtonExecution'](_0x408912,_0x493e6d,_0x44cdc9){_0x408912['on']('execute',()=>{_0x493e6d['editing']['view']['focus'](),_0x493e6d['commands']['execute']('aiQuickAction',_0x44cdc9);});}['_createActionGroupButton'](_0x170b6b,_0x592af1,_0x4f5c56){const _0x45b71b=new _0x51dbe3(this['locale']),_0xd98013=new _0x315151(),_0x5de27c=new Ps(this['locale'],_0xd98013),_0xc508f1=_0x5de27c['bindTemplate'],_0xe51b7a=this['_getPanelKeystroke'](_0x4f5c56),_0x3f8672=this['_createGroupActionsList'](_0x170b6b,_0x592af1['actions'],_0x4f5c56);_0x5de27c['set']({'label':_0x592af1['label'],'withText':!0x0,'role':Gs,'icon':_0x592af1['icon']??bt,'isEnabled':_0x592af1['actions']['some'](_0x123eb1=>_0x123eb1['isEnabled'])}),_0x5de27c['extendTemplate']({'on':{'mouseenter':_0xc508f1['to'](()=>{this['_isSearchFocused']()||_0x5de27c['focus']();})}});const _0x5e6041=new _0x59db14(this['locale']);return _0x5e6041['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0xc508f1['to'](_0x26bbb3=>{this['_handlePanelKeydown'](_0x26bbb3,_0xe51b7a,_0x5de27c,_0x5e6041);})}}),_0x5de27c['bind']('isOn')['to'](_0x5e6041,'isVisible'),this['_bodyCollection']['add'](_0x5e6041),_0x5e6041['content']['add'](_0x3f8672),this['_setupGroupMenuBehavior'](_0x5de27c,_0x5e6041),_0x45b71b['children']['add'](_0x5de27c),{'listItem':_0x45b71b,'highlightView':_0xd98013};}['_createGroupActionsList'](_0x3bd7d0,_0x3cd977,_0xcf3444){const _0x3bf08d=new _0x41f1be(this['locale']);return _0x3bf08d['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x3cd977['forEach'](_0x329f3a=>{const _0x22721c=new _0x51dbe3(this['locale']),_0x5675a2=Zt({'editor':_0x3bd7d0,'action':_0x329f3a,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x22721c['children']['add'](_0x5675a2),_0xcf3444['focusTracker']['add'](_0x5675a2),_0x3bf08d['items']['add'](_0x22721c);}),_0x3bf08d;}['_setupGroupMenuBehavior'](_0x158b26,_0x398860){const _0x36b498=_0x158b26['bindTemplate'],_0xe1d1a=this['_getButtonKeystroke'](_0x158b26);_0x158b26['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x36b498['to'](()=>{this['_showNestedPanel'](_0x398860,_0x158b26);}),'mouseleave':_0x36b498['to'](_0x3d021d=>{const _0x5d07c2=_0x3d021d['relatedTarget'];this['_isMovingToNestedMenu'](_0x5d07c2,_0x398860)||this['_hideNestedPanel'](_0x398860);}),'keydown':_0x36b498['to'](_0x289cdd=>{_0x289cdd['key']==_0xe1d1a&&(this['_showNestedPanel'](_0x398860,_0x158b26),_0x398860['content']['get'](0x0)['focus']());})}}),_0x398860['on']('render',()=>{_0x398860['element']?.['addEventListener']('mouseleave',_0x5790fe=>{const _0x16fee3=_0x5790fe['relatedTarget'];_0x158b26['element']?.['contains'](_0x16fee3)||this['_isMovingToNestedMenu'](_0x16fee3,_0x398860)||this['_hideNestedPanel'](_0x398860);});});}['_showNestedPanel'](_0x1ce3f2,_0x1bcc83){this['_openNestedPanels']['forEach'](_0x1b57f6=>{_0x1b57f6!==_0x1ce3f2&&_0x1b57f6['isVisible']&&_0x1b57f6['hide']();}),_0x1ce3f2['show'](),_0x1ce3f2['pin']({'positions':[_0x560d02['eastSouth']],'target':_0x1bcc83['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x1ce3f2);}['_hideNestedPanel'](_0x526b6d){_0x526b6d['hide'](),this['_openNestedPanels']['delete'](_0x526b6d);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x1ced5c=>_0x1ced5c['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x57fff9,_0x466478){if(!_0x57fff9)return!0x1;if(_0x466478['element']?.['contains'](_0x57fff9))return!0x0;const _0x2c5b61=_0x57fff9;return _0x2c5b61['closest']&&(null!==_0x2c5b61['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x2c5b61['closest']('.ck-ai-quick-actions-group-list')||null!==_0x2c5b61['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'](_0x201a1d){return'rtl'===_0x201a1d['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x51dd6a){return'rtl'===_0x51dd6a['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x383f7b,_0x246ef6,_0x17e842,_0x5a03b7){_0x383f7b['key']==_0x246ef6&&(_0x17e842['focus'](),this['_hideNestedPanel'](_0x5a03b7));}['_handleSearchResultButtonClick'](_0x4b050a){_0x4b050a['fire']('execute');}}function Xt(_0x5cd013){const {editor:_0x225244,content:_0x2c307a,buttonDefinition:_0x3e20b2,bodyCollection:_0x58cb74,hasSearch:_0x11fe58=!0x1}=_0x5cd013;return()=>{const _0xbe273f=_0x225244['locale'],_0x31bbe8=_0x1fec03(_0xbe273f);_0x31bbe8['buttonView']['set']({'icon':_0x3e20b2['icon']??bt,'label':_0x3e20b2['label'],'tooltip':!0x0}),_0x31bbe8['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x5c9471=new co(_0x225244,_0x2c307a,_0x31bbe8,_0x58cb74,_0x11fe58);if(_0x31bbe8['panelView']['children']['add'](_0x5c9471),_0x11fe58){const _0x48b0be='ai-quick-actions-dropdown-selection';_0x31bbe8['on']('change:isOpen',(_0x2d998f,_0x26a624,_0x3ceb77)=>{if(_0x3ceb77){if(_0x225244['plugins']['has']('AIEditing')){const _0x56737e=_0x225244['plugins']['get'](D),_0x4bc35c=_0x225244['model']['document']['selection'],_0x449834=Array['from'](_0x4bc35c['getRanges']());_0x449834['length']>0x0&&_0x56737e['showFakeVisualSelection'](_0x449834,_0x48b0be,!0x1,!0x0);}}else _0x225244['plugins']['has']('AIEditing')&&_0x225244['plugins']['get'](D)['hideFakeVisualSelection'](_0x48b0be),_0x5c9471['resetSearch']();});}return _0x31bbe8;};}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 Qt=function(_0x2dee12){return _0x2dee12['CHAT']='CHAT',_0x2dee12['ACTION']='ACTION',_0x2dee12['REVIEW']='REVIEW',_0x2dee12;}({}),va=function(_0x20be59){return _0x20be59['CHAT']='AIChat',_0x20be59['ACTION']='AIActions',_0x20be59['REVIEW']='AIReviewMode',_0x20be59;}({});class ii extends _0x33cb4d{static get['requires'](){return[te,tt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x38aae5=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x38aae5),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0xb8481){return function(_0x51cbbb){const _0x12ccb2=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x51cbbb['uiLanguage']),_0x141260=_0x12ccb2||'English',_0x2b1cfb=[{'id':'ask-ai','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Gt},{'id':'chat-commands','label':i(_0x51cbbb,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Gt,'actions':[{'id':'explain','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ee['replace']('%0',_0x141260),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ie['replace']('%0',_0x141260),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ne['replace']('%0',_0x141260),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Wt},{'id':'continue','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':zt},{'id':'fix-grammar','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Ft},{'id':'adjust-length','label':i(_0x51cbbb,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x51cbbb,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Yt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x51cbbb,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Vt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x51cbbb,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x51cbbb,'AI_QUICK_ACTIONS_OTHER'),'icon':Jt,'actions':[]}];return _0x2b1cfb;}(_0xb8481);}async['_getDefaultAndCustomActions'](){const _0x3a3e8c=ii['getDefaultQuickActions'](this['editor']['locale']),_0x47751c=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x2eb3ad=[];try{_0x2eb3ad=await new et({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x5ca143){const _0x3bc82d=new _0x465bb5('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x5ca143});_0x238b54(_0x3bc82d['message']);}finally{const _0x24c82b=_0x47751c['map'](_0x93c0d9=>({..._0x93c0d9,'icon':void 0x0}));_0x3a3e8c['find'](_0x49a0e8=>'other'===_0x49a0e8['id'])['actions']['push'](..._0x24c82b),_0x3a3e8c['forEach'](_0x1eb784=>{if('actions'in _0x1eb784)_0x1eb784['actions']['forEach'](_0x1a41ec=>{if(_0x1a41ec['isEnabled']=!!_0x2eb3ad['find'](_0x83418c=>_0x83418c['id']===_0x1a41ec['model'])||void 0x0===_0x1a41ec['model'],!_0x1a41ec['isEnabled']){const _0x281a20=new _0x465bb5('ai-quick-actions-unavailable-model',this,{'actionId':_0x1a41ec['id'],'modelId':_0x1a41ec['model']});_0x238b54(_0x281a20['message']);}});else{if(_0x1eb784['isEnabled']=!!_0x2eb3ad['find'](_0x1949d6=>_0x1949d6['id']===_0x1eb784['model'])||void 0x0===_0x1eb784['model'],!_0x1eb784['isEnabled']){const _0x32a96f=new _0x465bb5('ai-quick-actions-unavailable-model',this,{'actionId':_0x1eb784['id'],'modelId':_0x1eb784['model']});_0x238b54(_0x32a96f['message']);}}});}return _0x3a3e8c;}['_initializeQuickActionsComponentsAndCommands'](){const _0x568d0f=new _0x165cca(this['editor']['locale']);_0x568d0f['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x568d0f),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x568d0f);}['_initializeQuickActionsDropdown'](_0x1b902a){const _0x14f399=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Xt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':bt,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x1b902a,'hasSearch':_0x14f399}));}['_prepareQuickActionsDefinition'](_0x197e17){this['_quickActionsDefinition']=_0x197e17['map'](_0x51ff23=>{if('actions'in _0x51ff23){const _0x571027=_0x51ff23;return{..._0x571027,'actions':_0x571027['actions']['map'](_0x55eaca=>{const {actions:_0x5278f9,..._0x56fe8e}=_0x571027;return{..._0x55eaca,'parent':_0x56fe8e};})['filter'](_0x3fa8b2=>this['_shouldIncludeAction'](_0x3fa8b2))};}return _0x51ff23;})['filter'](_0x9ee07f=>'actions'in _0x9ee07f?_0x9ee07f['actions']['length']>0x0:this['_shouldIncludeAction'](_0x9ee07f));}['_shouldIncludeAction'](_0x130fd7){const _0x543d55=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](va[_0x130fd7['type']])&&!_0x543d55['includes'](_0x130fd7['id'])&&!('CHAT'===_0x130fd7['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x2d7c9a){this['_quickActionsDefinition']['forEach'](_0x18540d=>{if('actions'in _0x18540d){const _0x58e36f=Xt({'editor':this['editor'],'content':_0x18540d['actions'],'buttonDefinition':_0x18540d,'bodyCollection':_0x2d7c9a});this['editor']['ui']['componentFactory']['add'](_0x18540d['id'],_0x58e36f),_0x18540d['actions']['forEach'](_0x25fdfe=>{const _0x49fa1f=Zt({'editor':this['editor'],'action':_0x25fdfe});this['editor']['ui']['componentFactory']['add'](_0x25fdfe['id'],_0x49fa1f);});}else{const _0xcde8d6=Zt({'editor':this['editor'],'action':_0x18540d,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x18540d['id'],_0xcde8d6);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x3e079b=>{const _0x1381c1=new _0x96433a(_0x3e079b),_0x2375a2=i(_0x3e079b,'AI_QUICK_ACTIONS_HEADING');_0x1381c1['buttonView']['set']({'label':_0x2375a2,'icon':bt});const _0x574d11=new _0x1776b3(_0x3e079b);_0x574d11['set']({'ariaLabel':_0x2375a2,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x3d5d2b=>{if('actions'in _0x3d5d2b){const _0x366044=_0x3d5d2b,_0x3f1fdb=new _0x548f11(_0x3e079b,_0x1381c1),_0x4ab91e=new _0x96433a(_0x3e079b),_0x4a8d2f=new _0x1776b3(_0x3e079b);_0x4ab91e['buttonView']['set']({'label':_0x366044['label'],'icon':_0x366044['icon']}),_0x366044['actions']['forEach'](_0x152162=>{const _0x349049=new _0x548f11(_0x3e079b,_0x4ab91e),_0x1be1f7=new _0x57ee28(_0x3e079b);_0x1be1f7['set']({'label':_0x152162['displayedPrompt'],'icon':_0x152162['icon'],'role':'menuitem','isEnabled':_0x152162['isEnabled']}),_0x1be1f7['on']('execute',()=>{this['_executeQuickAction'](_0x152162);}),_0x1be1f7['delegate']('execute')['to'](_0x4ab91e),_0x349049['children']['add'](_0x1be1f7),_0x4a8d2f['items']['add'](_0x349049);}),_0x4ab91e['panelView']['children']['add'](_0x4a8d2f),_0x3f1fdb['children']['add'](_0x4ab91e),_0x574d11['items']['add'](_0x3f1fdb);}else{const _0x57d4c5=_0x3d5d2b,_0xd2fc99=new _0x548f11(_0x3e079b,_0x1381c1),_0x3bc55c=new _0x57ee28(_0x3e079b);_0x3bc55c['set']({'label':_0x57d4c5['displayedPrompt'],'icon':_0x57d4c5['icon'],'role':'menuitem','isEnabled':_0x57d4c5['isEnabled']}),_0x3bc55c['on']('execute',()=>{this['_executeQuickAction'](_0x57d4c5);}),_0x3bc55c['delegate']('execute')['to'](_0x1381c1),_0xd2fc99['children']['add'](_0x3bc55c),_0x574d11['items']['add'](_0xd2fc99);}});const _0x4d7ada=Object['values'](va)['some'](_0x5313ff=>this['editor']['plugins']['has'](_0x5313ff));return _0x1381c1['set']({'isEnabled':_0x4d7ada}),_0x1381c1['panelView']['children']['add'](_0x574d11),_0x1381c1;});}['_executeQuickAction'](_0x7c7d00){const _0x36adeb=this['editor'];_0x36adeb['editing']['view']['focus'](),_0x36adeb['commands']['execute']('aiQuickAction',_0x7c7d00);const _0x22aac3=_0x36adeb['ui']['view']['menuBarView'];_0x22aac3&&_0x22aac3['close']&&_0x22aac3['close']();}}class ci extends Lt{['execute'](_0x35b42a){switch(this['_expandSelectionIfCollapsed'](),_0x35b42a['type']){case Qt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x6a9a2a=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x465bb5('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x6a9a2a});}this['_handleAIChatAction'](_0x35b42a);break;case Qt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x22be94=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x465bb5('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x22be94});}this['_handleAIActionsAction'](_0x35b42a);break;case Qt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x638a82=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x465bb5('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x638a82});}this['_handleAIReviewAction'](_0x35b42a);}}async['_handleAIChatAction'](_0x4db5cf){const _0x51aaf8=this['editor']['plugins']['get']('AIChat'),_0x333d1e=this['editor']['plugins']['get']('AIChatController'),_0x4a6ce2=this['editor']['plugins']['get']('AITabs')['view'];if(_0x4a6ce2['isVisible']||(_0x4a6ce2['isVisible']=!0x0),'chat'!==_0x4a6ce2['activeTab']&&_0x4a6ce2['activateTab']('chat'),'ask-ai'===_0x4db5cf['id'])_0x333d1e['removeSelectionFromChatContext'](),await _0x51aaf8['addSelectionToChatContext'](),_0x51aaf8['focusPromptInput']();else await _0x51aaf8['startConversation'](),_0x333d1e['removeSelectionFromChatContext'](),await _0x51aaf8['addSelectionToChatContext'](),_0x51aaf8['focusPromptInput'](),await _0x51aaf8['sendMessage']({'message':_0x4db5cf['prompt']||_0x4db5cf['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x4db5cf['id']},'displayedPrompt':_0x4db5cf['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x3e4f51=this['editor'],_0x2b5547=_0x3e4f51['model']['document']['selection'];if(!_0x2b5547['isCollapsed'])return;const _0x1ad9fa=_0x586c33(_0x2b5547['getSelectedBlocks']())||_0x3e4f51['model']['schema']['getLimitElement'](_0x2b5547);_0x3e4f51['model']['change'](_0x785682=>{_0x785682['setSelection'](_0x1ad9fa,'in');});}['_handleAIActionsActionLabel'](_0x46ae7b){return _0x46ae7b['parent']?.['label']&&'other'!==_0x46ae7b['parent']?.['id']?_0x46ae7b['parent']['label']+':\x20'+_0x46ae7b['displayedPrompt']:_0x46ae7b['displayedPrompt'];}async['_handleAIActionsAction'](_0x52987f){const _0x53c040=this['editor']['plugins']['get']('AIActions'),_0x2ad312=_0x52987f['prompt']?{'userMessage':_0x52987f['prompt'],'model':_0x52987f['model']}:{'actionName':_0x52987f['actionName']||_0x52987f['id'],'args':_0x52987f['args']},_0xd725a6=this['_handleAIActionsActionLabel'](_0x52987f);await _0x53c040['executeAction'](_0x2ad312,_0xd725a6,_0x52987f['icon']);}async['_handleAIReviewAction'](_0x578f31){console['log']('handleAIReviewAction',_0x578f31);}}class ti extends _0x33cb4d{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x65b39e=this['editor'],_0x190136=new ci(this['editor']);if(_0x65b39e['commands']['add']('aiQuickAction',_0x190136),_0x65b39e['plugins']['has']('AIChat')){const _0x376899=this['editor']['plugins']['get']('AIChat');_0x65b39e['model']['document']['selection']['on']('change:range',(_0x538241,_0x4f7f22)=>{_0x4f7f22['directChange']&&_0x376899['removeSelectionFromChatContext']();});}}}class gs extends Gi{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x156a5a=this['documentContextContent']['children']['map'](_0x3ecdd1=>({'node':_0x3ecdd1,'id':ut(_0x3ecdd1,'data-id')})),_0x47e9a7=this['parsedMergedContent']['children']['map'](_0x404869=>({'node':_0x404869,'id':ut(_0x404869,'data-id')||_0x41685d()})),_0x5a3f4b=_0x2d2dbc(_0x156a5a,_0x47e9a7,{'comparator':(_0x33a9a1,_0x255507)=>_0x33a9a1['id']==_0x255507['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x5a3f4b['length']&&_0x5a3f4b[_0x5a3f4b['length']-0x1]['removed'];)_0x5a3f4b['pop']();}const _0x5a7454=_0x5a3f4b['map'](_0x167441=>{const _0x125062=_0x167441['added']?'new':_0x167441['removed']?'removed':'modified';return{'node':_0x167441['value'][0x0]['node'],'type':_0x125062,'id':_0x167441['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x5a7454,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x5273ee,_0x12bf9b){return _0x12bf9b;}}class wt extends os{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x40ab58){super(_0x40ab58),this['content']=_0x40ab58['content'],this['version']=_0x40ab58['version'],this['actionName']=_0x40ab58['actionName'],this['args']=_0x40ab58['args'],this['userMessage']=_0x40ab58['userMessage'],this['model']=_0x40ab58['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':xe['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x1cecef){const _0x2d4516=new gs({'editor':this['editor'],'documentContextContent':this['content'],..._0x1cecef});return this['replies']['push'](_0x2d4516),_0x2d4516['delegate'](...De)['to'](this),this['fire']('replyCreated',_0x2d4516),_0x2d4516;}}class Bn extends _0x5ec0fa{constructor(_0x215e97,_0x54c389=!0x0,_0x3c3b46=!0x0){super(_0x215e97),this['set']('isEnabled',!0x1),_0x54c389&&(this['applyButton']=this['_createButton'](i(_0x215e97,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x3c3b46&&(this['suggestButton']=this['_createButton'](i(_0x215e97,'AI_BALLOON_SUGGEST_BUTTON'),_0x54c389?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x54c389,'showSuggestButton':_0x3c3b46}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x22511f,showSuggestButton:_0x1d641a}){this['applyButton']&&(this['applyButton']['isVisible']=_0x22511f),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x1d641a);}['_createButton'](_0x4f7a8b,_0x425291){const _0x39842a=new _0x33ce64(this['locale']);return _0x39842a['set']({'label':_0x4f7a8b,'class':_0x425291,'isVisible':!0x0,'withText':!0x0}),_0x39842a;}}class yn extends _0x26817f{constructor(_0x396eb3){super(_0x396eb3),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(_0x396eb3,'AI_DISCLAIMER_TEXT')}]}]});}}class Nn extends _0x26817f{constructor(_0x201e93){super(_0x201e93),this['set']('isVisible',!0x0);const _0x21cc7c=new Ze('small');_0x21cc7c['isVisible']=!0x0;const _0x212730=new _0x26817f(this['locale']);_0x212730['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',_0x2605a7=>!_0x2605a7)]},'children':[_0x21cc7c,_0x212730]});}}class Bt extends pi{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x260115,_0x3ff47d){super(_0x260115),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x3ff47d,this['_focusTracker']=new _0x1203ce(),this['_keystrokes']=new _0x2ac014(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x29c2cb({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x1024e9(),this['_addContentWrapper'](_0x3ff47d),this['_addDisclaimerView'](),this['_addToolbar'](_0x3ff47d),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'](_0x3ff47d);});}['render'](){super['render']();for(const _0x196025 of this['_focusables'])this['_focusTracker']['add'](_0x196025['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x56fd1d){-0x1===_0x56fd1d?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x50ece1){this['_isLoading']=_0x50ece1;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x5d99d0){super['showError'](_0x5d99d0),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x57656d){super['showBlockingError'](_0x57656d),this['setErrorState']();}['addMiniToolbarItem'](_0x363151){this['_miniToolbarView']['items']['has'](_0x363151)||this['_miniToolbarView']['items']['add'](_0x363151);}['removeMiniToolbarItem'](_0x51d3ff){this['_miniToolbarView']['items']['has'](_0x51d3ff)&&this['_miniToolbarView']['items']['remove'](_0x51d3ff);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x1f3260,showSuggestButton:_0x35412c}){_0x1f3260=_0x1f3260&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x35412c=_0x35412c&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x1f3260,'showSuggestButton':_0x35412c});}async['updateContent'](_0x38e5d3){await this['_streamableContentView']['update'](_0x38e5d3);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x1c37a4){this['_contentWrapper']=new _0x26817f(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'](_0x1c37a4['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new yn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x559edd,showSuggestButton:_0x195085}){this['_toolbarView']=new Bn(this['locale'],_0x559edd,_0x195085),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',(_0x284868,_0x5e7678,_0x1df343)=>!(_0x284868||_0x5e7678||_0x1df343)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x559edd,'showSuggestButton':_0x195085}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x185e77){return this['_miniToolbarView']=new wi(this['locale'],_0x185e77),this['_miniToolbarView']['delegate'](...W)['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',(_0x1d0107,_0x3f57fc)=>!(_0x1d0107||_0x3f57fc)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Nn(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new ui(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x5a5ffb=new _0x33ce64(this['locale']),_0x1c6acb=new _0x33ce64(this['locale']),_0x31580f=new AIActionsBalloonNavigationCounterView(this['locale']),_0x39009b=new _0x33ce64(this['locale']);_0x5a5ffb['set']({'icon':_0x3ac2b1,'label':i(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x1c6acb['set']({'icon':_0x2f6267,'tooltip':i(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x39009b['set']({'icon':_0x58ad4b,'tooltip':i(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x5a5ffb['bind']('isEnabled')['to'](this,'isBusy',_0x4ecc3a=>!_0x4ecc3a),_0x5a5ffb['on']('execute',()=>{this['fire']('tryAgain');}),_0x1c6acb['bind']('isEnabled')['to'](this,'isBusy',_0x4930d1=>!_0x4930d1),_0x1c6acb['on']('execute',()=>{this['fire']('showPrevious');}),_0x39009b['bind']('isEnabled')['to'](this,'isBusy',_0x363559=>!_0x363559),_0x39009b['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x1c6acb,this['_navigationCounter']=_0x31580f,this['_navigationNextButton']=_0x39009b,this['_navigationTryAgainButton']=_0x5a5ffb;}['updateMiniToolbarButtons'](_0x2a5dbb,_0x4f6a48){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x108524=_0x2a5dbb>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x108524){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x3689cf=_0x2a5dbb-_0x4f6a48;this['_navigationCounter']['setInteractionCount'](_0x3689cf+'/'+_0x2a5dbb),this['_navigationPreviousButton']['isEnabled']=_0x4f6a48<_0x2a5dbb-0x1,this['_navigationNextButton']['isEnabled']=_0x4f6a48>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'](_0x2667d2){this['_isLoading']=_0x2667d2;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x13d7e3=this['_getScrollableElement']();_0x13d7e3&&!this['_scrollManager']&&(this['_scrollManager']=new Qe(_0x13d7e3));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class AIActionsBalloonNavigationCounterView extends _0x26817f{constructor(_0x392cfd){super(_0x392cfd);const _0x229a07=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x229a07['to']('interactionCount')}]});}['setInteractionCount'](_0x2e7f62){this['set']('interactionCount',_0x2e7f62);}}class ri extends _0x33cb4d{static get['requires'](){return[tt,_0x33e5ba,D,H,ot];}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(_0x4366a8){super(_0x4366a8),this['_bodyCollection']=new _0x165cca(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new St();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x14c309,_0x2b8f20,_0x3407e8){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0xb3ba83,anchorData:_0x355810}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x14c309,_0xb3ba83,_0x355810,_0x2b8f20,_0x3407e8);}}const {modelFragment:_0x31423a,anchorData:_0x1c2cfc}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x14c309,_0x31423a,_0x1c2cfc,_0x2b8f20,_0x3407e8);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x2dd4ff=this['editor']['plugins']['has']('TrackChanges');let _0x4a117f=this['editor']['config']['get']('ai.availableReplyActions')||[...J];_0x2dd4ff||(_0x4a117f=_0x4a117f['filter'](_0x20243b=>'insertSuggestion'!=_0x20243b));const _0x5de381=this['editor']['commands']['get']('trackChanges'),_0x7f8835=new Bt(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x2dd4ff,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x4a117f});return _0x7f8835['bind']('isBusy')['to'](this),_0x5de381&&_0x7f8835['bind']('isTrackChangesOn')['to'](_0x5de381,'value'),_0x7f8835['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x7f8835['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x7f8835['on']('showNext',()=>{this['_navigateToNext']();}),_0x7f8835;}['_getExecuteDataRegular'](){const _0x474abb=this['editor']['model']['document']['selection'];if(_0x474abb['isCollapsed']){const _0x3c4d00=_0x586c33(_0x474abb['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x474abb);this['editor']['model']['change'](_0xafb77d=>{_0xafb77d['setSelection'](_0x3c4d00,'in');});}const _0x1bf32a=_0x474abb['getFirstRange'](),_0x4c7fda=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x474abb),_0x1bf32a['start'],_0x1bf32a['end']);this['_copyMarkersToFragment'](_0x4c7fda,_0x474abb,{'isTableSelection':!0x1});const _0x433033=_0x474abb['getFirstRange']()['start'],_0x23f0a4=new Map();let _0x1112a3=_0x4c7fda;for(let _0x117227=0x0;_0x117227<_0x433033['path']['length'];_0x117227++)_0x23f0a4['set'](_0x1112a3,_0x433033['path'][_0x117227]),_0x1112a3=_0x1112a3['getChild'](0x0);return{'modelFragment':_0x4c7fda,'anchorData':_0x23f0a4};}['_getExecuteDataInTable'](){const _0x5aa6a4=this['editor']['model']['document']['selection'],_0x322ddb=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x4d1d6e=_0x5aa6a4['getFirstRange']()['start']['parent']['parent'],_0x3b86d4=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x4d1d6e),this['editor']['model']['createPositionAfter'](_0x4d1d6e)),_0x52d5da=this['_wrapWithCommonAncestors'](_0x322ddb,_0x3b86d4['start'],_0x3b86d4['end']);this['_copyMarkersToFragment'](_0x52d5da,_0x5aa6a4,{'isTableSelection':!0x0});const _0x411ad3=_0x5aa6a4['getFirstRange']()['start'],_0xf8c77e=new Map();let _0x311875=_0x52d5da;for(let _0x591bde=0x0;_0x591bde<_0x411ad3['path']['length'];_0x591bde++)if(_0xf8c77e['set'](_0x311875,_0x411ad3['path'][_0x591bde]),_0x591bde<_0x411ad3['path']['length']-0x1)_0x311875=_0x311875['getChild'](0x0);else{let _0x5e4219=_0x311875['nextSibling'];for(;_0x5e4219;)_0xf8c77e['set'](_0x5e4219,_0x411ad3['path'][_0x591bde]),_0x5e4219=_0x5e4219['nextSibling'];}return{'modelFragment':_0x52d5da,'anchorData':_0xf8c77e};}async['_executeAction'](_0xa45c0f,_0xc8134e,_0x43c261,_0x14d938,_0x74d1fb){const _0x144aa9=this['editor']['plugins']['get'](D),_0xb4f4e1=this['editor']['plugins']['get'](H),_0x509dd4=this['editor']['model']['document']['selection'],_0x36fb04=await _0x144aa9['modelToDataWithIds'](_0xc8134e),_0x2a9bc1=this['editor']['model']['document']['version'],_0x63dcce=[..._0x509dd4['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0xb4f4e1['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x14d938,'icon':_0x74d1fb||bt,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x63dcce,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0xb4f4e1),this['_interactionParams']={'action':_0xa45c0f,'content':_0x36fb04,'version':_0x2a9bc1,'aiBalloon':_0xb4f4e1,'modelFragment':_0xc8134e,'anchorData':_0x43c261},this['_setupApplyListeners'](),this['listenTo'](_0xb4f4e1,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0xb4f4e1,'dialogClosed',(_0x39b4de,{id:_0x57942c})=>{if('aiActionsBalloon'===_0x57942c){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0xf360de=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x642013=_0xf360de['changeGroups'][0x0];_0x642013&&'pending'===_0x642013['state']&&_0xf360de['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0xb4f4e1);}}),this['_createInteraction'](_0x36fb04,_0x2a9bc1,_0xb4f4e1,_0xa45c0f);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x412a0a,anchorData:_0x2d230c}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x412a0a,_0x2d230c,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x412a0a,_0x2d230c,!0x0);});}['_wrapWithCommonAncestors'](_0x17400f,_0xc4a4c9,_0x4c6818){const _0x18b7b6=this['editor']['model']['createRange'](_0xc4a4c9,_0x4c6818)['getCommonAncestor'](),_0x1cdf8c=_0x18b7b6['is']('documentFragment')?[]:_0x18b7b6['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x1cdf8c['length']){const _0x238d82=_0x1cdf8c['map'](_0x199668=>_0x199668['_clone'](!0x1));for(let _0x1cd4a7=0x1;_0x1cd4a7<_0x238d82['length'];_0x1cd4a7++)_0x238d82[_0x1cd4a7-0x1]['_appendChild'](_0x238d82[_0x1cd4a7]);return _0x238d82[_0x238d82['length']-0x1]['_appendChild'](_0x17400f),new jt(_0x238d82[0x0]);}return _0x17400f;}['_copyMarkersToFragment'](_0x77ece3,_0x24c1ce,_0x45ed33={'isTableSelection':!0x1}){const _0x127667=this['editor']['model'],_0x8b450b=Array['from'](_0x24c1ce['getRanges']()),_0x38cecb=_0x24c1ce['getFirstRange']()['start'];for(const _0x3d32ec of _0x127667['markers']){if(_0x3d32ec['name']['startsWith'](R)||!_0x3d32ec['affectsData'])continue;const _0x11cfa4=_0x3d32ec['getRange']();if(!_0x8b450b['some'](_0x507bc5=>_0x507bc5['containsRange'](_0x11cfa4,!0x0)))continue;const _0x497270=this['_regularCalculateMarkerPath'](_0x11cfa4['start'],_0x38cecb,_0x45ed33['isTableSelection']),_0x41b98b=this['_regularCalculateMarkerPath'](_0x11cfa4['end'],_0x38cecb,_0x45ed33['isTableSelection']),_0x549e05=_0x127667['createPositionFromPath'](_0x77ece3,_0x497270),_0x3ba528=_0x127667['createPositionFromPath'](_0x77ece3,_0x41b98b);if(!_0x549e05['isEqual'](_0x3ba528)){const _0x3bbc7d=_0x127667['createRange'](_0x549e05,_0x3ba528);_0x77ece3['markers']['set'](_0x3d32ec['name'],_0x3bbc7d);}}}['_regularCalculateMarkerPath'](_0x5e952c,_0x4bb903,_0x5b72ac=!0x1){const _0x497783=[..._0x5e952c['path']['slice']()];for(let _0x12d4c9=0x0;_0x12d4c9<Math['max'](_0x4bb903['path']['length'],_0x5e952c['path']['length']);_0x12d4c9++){const _0x1f94c9=_0x4bb903['path'][_0x12d4c9]||0x0,_0xafe88f=(_0x5e952c['path'][_0x12d4c9]||0x0)-_0x1f94c9;if(_0x497783[_0x12d4c9]=_0xafe88f,0x0!==_0xafe88f&&!_0x5b72ac)break;}return _0x497783;}async['_createInteraction'](_0x13a91b,_0x3cacb6,_0x3979fb,_0xd4c78f){const _0x56d378=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0xd4c78f,'content':_0x13a91b,'version':_0x3cacb6,'aiBalloon':_0x3979fb,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x451f2e=new wt({'connector':this['_aiConnector'],'editor':_0x56d378,'content':_0x13a91b,'version':_0x3cacb6,..._0xd4c78f});this['_interactions']['push'](_0x451f2e);const _0x585578=(_0x3fca18,_0x3bfd53=!0x1,_0x5073a6='streaming')=>this['_promiseQueue']['enqueue'](async _0x430ccb=>{try{const _0x412868=kt({'editor':_0x56d378,'changeGroups':_0x3fca18['changeGroups'],'documentContextContent':_0x3fca18['documentContextContent'],'showDiff':_0x3bfd53,'trimUnchanged':!0x1});_0x412868['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x412868[0x0],'renderingStrategy':_0x5073a6,'abortSignal':_0x430ccb});}catch(_0x242fb6){if(this['_isAbortError'](_0x242fb6))return;throw _0x242fb6;}});this['_interaction']['on']('replyCreated',(_0x4b8cae,_0x30d6ec)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x585578(_0x30d6ec)['catch'](_0x586420=>{this['_isAbortError'](_0x586420)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x586420),this['_setErrorState'](_0x451f2e));});}),this['_interaction']['on']('replyContentUpdated',(_0x5112a3,_0x1f1f20)=>{_0x585578(_0x1f1f20)['catch'](_0x3b0338=>{this['_isAbortError'](_0x3b0338)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x3b0338),this['_setErrorState'](_0x451f2e));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x9ed155){this['_isAbortError'](_0x9ed155)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x9ed155),this['_setErrorState'](_0x451f2e));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x4323a2,{showDiff:_0x5a7c50})=>{try{this['_balloonShowDiff']=_0x5a7c50;const _0x42da44=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x42da44&&await _0x585578(_0x42da44,_0x5a7c50,'static');}catch(_0x19a53c){this['_isAbortError'](_0x19a53c)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x19a53c),this['_setErrorState'](_0x451f2e));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x795440,{reply:_0x927d4e})=>{const _0x43a914={'positiveCount':_0x927d4e['changeGroups']['filter'](_0x19ec58=>'accepted'===_0x19ec58['state'])['length'],'totalCount':_0x927d4e['changeGroups']['length']},_0x47bdf7=this['_interaction']['actionCallId'],_0x3eb517=this['_interaction']['actionName'];_0x3eb517?this['_aiConnector']['upsertAIActionRating'](_0x3eb517,_0x47bdf7,_0x43a914):this['_aiConnector']['upsertCustomAIActionRating'](_0x47bdf7,_0x43a914);}),this['_setLoadingState']();try{const _0x1c7d80=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x1c7d80;}catch(_0x12af85){if(this['_isAbortError'](_0x12af85))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x451f2e);}}['_applyChanges'](_0x44828d,_0x21b85e,_0x31f7ff){const _0x562551=this['editor'];if(_0x31f7ff&&!_0x562551['plugins']['has']('TrackChanges'))throw new _0x465bb5('ai-no-track-changes',null);const _0x416a85=this['editor']['plugins']['get'](ot),_0x331a14=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x331a14||!_0x331a14['replies']['length'])return;const _0x157b61=_0x331a14['replies'][_0x331a14['replies']['length']-0x1],_0x4660f9=_0x157b61['changeGroups'];_0x157b61['setChangeGroupState'](0x0,'accepted');let _0x548331=at({'editor':_0x562551,'reply':_0x157b61,'interaction':_0x331a14,'groups':_0x4660f9,'transform':!0x1,'documentCompare':_0x416a85,'documentCompareOptions':{'anchor':_0x562551['model']['createPositionAt'](_0x44828d,0x0),'markDeletions':_0x31f7ff}});_0x548331=this['_filterOperationsOutsideRange'](_0x548331,_0x21b85e);for(const _0x116bb6 of _0x548331)this['_anchorOperation'](_0x21b85e,_0x116bb6,_0x562551['model']['document']['getRoot']());const _0x42c77b=_0x331a14['getDocumentContext']()['version'],_0x5cd83e=_0x562551['model']['document']['history']['getOperations'](_0x42c77b),_0x215f7c={'document':_0x562551['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x35ad4f=xt(_0x548331,_0x5cd83e,_0x215f7c)['operationsA'];_0x562551['model']['change'](_0x4bf997=>{if(_0x4bf997['setSelection'](_0x562551['model']['document']['selection']['focus']),_0x31f7ff)_0x562551['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x35ad4f);else{for(const _0x5527c9 of _0x35ad4f)_0x5527c9['baseVersion']=_0x562551['model']['document']['version'],rt(_0x562551,_0x5527c9),_0x4bf997['batch']['addOperation'](_0x5527c9),_0x562551['model']['applyOperation'](_0x5527c9);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x113caf,_0x29b9c8){return _0x113caf['filter'](_0x5a8e90=>{if('rename'==_0x5a8e90['type']){const _0x5d4b15=_0x5a8e90['position']['nodeAfter'];return!_0x29b9c8['has'](_0x5d4b15);}if(_0x5a8e90['type']['indexOf']('Attribute')>-0x1){const _0x3eacb0=_0x5a8e90['range']['start']['nodeAfter'];return!_0x29b9c8['has'](_0x3eacb0);}return!0x0;});}['_anchorOperation'](_0x21b59f,_0x20cff2,_0x39efae){const _0x58b07d=_0x20cff2['clone']();for(const _0x34cdd5 in _0x20cff2){const _0x9203b2=_0x20cff2[_0x34cdd5];_0x9203b2 instanceof dt?_0x20cff2[_0x34cdd5]=new dt(_0x3f0a5e(_0x9203b2['start']),_0x3f0a5e(_0x9203b2['end'])):_0x9203b2 instanceof Dt&&(_0x20cff2[_0x34cdd5]=_0x3f0a5e(_0x9203b2));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x58b07d['type'])){if(_0x58b07d['isDocumentOperation']=!0x1,_0x58b07d['baseVersion']=null,'remove'==_0x58b07d['type']){const _0x4d61bc=_0x58b07d['sourcePosition'],_0x310251=_0x58b07d['howMany'];new lt(_0x4d61bc,_0x310251)['_execute']();}else _0x58b07d['_execute']();}function _0x3f0a5e(_0x38f9c8){if('$graveyard'==_0x38f9c8['root']['rootName'])return _0x38f9c8;const _0x128767=[];let _0x72a9d1=_0x38f9c8['root'];for(let _0x4c53ed=0x0;_0x4c53ed<_0x38f9c8['path']['length'];_0x4c53ed++){const _0x42aad4=_0x21b59f['get'](_0x72a9d1)||0x0;_0x128767[_0x4c53ed]=_0x38f9c8['path'][_0x4c53ed]+_0x42aad4,_0x72a9d1=_0x72a9d1['getChildAtOffset'](_0x38f9c8['path'][_0x4c53ed]);}return new Dt(_0x39efae,_0x128767,_0x38f9c8['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x110c4d,content:_0x2d4f77,version:_0x3282b0,aiBalloon:_0x9d7076}=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'](_0x2d4f77,_0x3282b0,_0x9d7076,_0x110c4d)['catch'](_0x542ecc=>{this['_isAbortError'](_0x542ecc)||console['error']('Error\x20refreshing\x20interaction:',_0x542ecc);});}['_isAbortError'](_0x103247){return!!_0x103247['message']&&_0x103247['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 _0xe8cbd8=this['_interactions']['length'];this['_currentInteractionIndex']<_0xe8cbd8-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x1042c6){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x1042c6;const _0x11908b=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x11908b)return;if(_0x11908b['hasError'])return this['_setErrorState'](_0x11908b),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x11908b['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x4606c9=_0x11908b['replies'][_0x11908b['replies']['length']-0x1];if(_0x4606c9){const _0x33659b=this['editor'];try{const _0x2d033f=kt({'editor':_0x33659b,'changeGroups':_0x4606c9['changeGroups'],'documentContextContent':_0x4606c9['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x4561d7=>setTimeout(_0x4561d7,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x2d033f[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x123ca1){this['_isAbortError'](_0x123ca1)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x123ca1);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x372f0c){const _0x4d39ab=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x4d39ab),_0x372f0c['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 AIQuickActions extends _0x33cb4d{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5256f4){super(_0x5256f4),_0x5256f4['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Ws extends _0x26817f{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x445772,_0x51fff9){super(_0x445772),this['id']=_0x51fff9,this['set']('status','pending'),this['set']('changeId',_0x51fff9),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',(_0x36286f,_0x56af68)=>{_0x56af68&&_0x56af68['target']&&'A'===_0x56af68['target']['tagName']&&_0x56af68['preventDefault'](),this['fire']('activateChange',{'id':_0x51fff9,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x51fff9,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x51fff9,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x149aa2=new _0x26817f(this['locale']);return _0x149aa2['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',_0x5e64a5=>!_0x5e64a5)]}}),_0x149aa2;}['_createAcceptButtonView'](){const _0x50ed3f=new _0x33ce64(this['locale']);return _0x50ed3f['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x50ed3f['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x212867=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x212867['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x436a60=>'pending'!==_0x436a60&&'accepted'!==_0x436a60),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x9e48c8=>'pending'===_0x9e48c8),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x169c7b=>'accepted'===_0x169c7b)]}}),this['on']('change:status',(_0x48b8ac,_0x544f15,_0x13be51)=>{_0x50ed3f['isEnabled']='pending'===_0x13be51,'accepted'===_0x13be51&&(_0x50ed3f['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x50ed3f['icon']=_0x42b74e);}),_0x50ed3f;}['_createDismissButtonView'](){const _0x437e49=new _0x33ce64(this['locale']);return _0x437e49['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x437e49['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3f31ab=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x3f31ab['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x1ceac0=>'pending'!==_0x1ceac0&&'rejected'!==_0x1ceac0),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x56be5e=>'pending'===_0x56be5e),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x2d0cde=>'rejected'===_0x2d0cde)]}}),this['on']('change:status',(_0x424941,_0x21d448,_0x3f4b8d)=>{_0x437e49['isEnabled']='pending'===_0x3f4b8d,'rejected'===_0x3f4b8d&&(_0x437e49['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x437e49['icon']=_0x3c6485);}),_0x437e49;}['_createInfoButtonView'](){const _0x4ffcbf=new _0x33ce64(this['locale']);return _0x4ffcbf['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x401c5c,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x4ffcbf['bind']('isOn')['to'](this,'isInfoToggleOn',_0x23f559=>_0x23f559),_0x4ffcbf['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x4ffcbf;}['_createOutdatedButtonView'](){const _0x3ab6d8=new _0x33ce64(this['locale']);return _0x3ab6d8['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x29661b,'withText':!0x0,'isEnabled':!0x1}),_0x3ab6d8['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x56bdc5=>'outdated'!==_0x56bdc5)],'disabled':'disabled'}}),_0x3ab6d8;}}class me extends _0x59db14{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x388b97,_0x9ddb9a){super(_0x388b97),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']()),_0x9ddb9a['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x1926a9){this['resultItemView']['changeId']=_0x1926a9['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x1926a9['contentDiffed'];}['showBalloon'](_0x3c6625,_0x37d7e0,_0x5243a5,_0x1c4bdc,_0x136c0d,_0x48d1a2){const _0x1fa5a6=_0x37d7e0();if(!_0x1fa5a6)return;this['updateContent'](_0x3c6625),this['show']();const _0x5073b5=Array['from'](_0x1fa5a6['getClientRects']())['reverse'](),_0x340fb6=this['_getPointedRectIndexFromEvent'](_0x5243a5,_0x5073b5),_0xf5872b=_0x5073b5[_0x340fb6??0x0];'click'===_0x1c4bdc?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x37d7e0(),_0x340fb6,_0x3c6625['id'],_0x136c0d,_0x48d1a2)||_0xf5872b})):'hover'===_0x1c4bdc&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x37d7e0(),_0x340fb6,_0x3c6625['id'])||_0xf5872b}));}['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'](){_0x38a160({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x487f2a=[this['element']];return this['_pinnedTargetElement']&&_0x487f2a['push'](this['_pinnedTargetElement']),_0x487f2a;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x10c545=new _0x26817f();return this['resultItemView']=new Ws(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x10c545['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']]}]}),_0x10c545;}['_getBestRectPositionOnClick'](_0x1606a7,_0x567ce5,_0x56c776,_0x1e7949,_0x4d2350){if(!_0x1606a7)return null;const _0x5c077d=this['position']['replace']('arrow_',''),_0x7154c7=Array['from'](_0x1606a7['getClientRects']());let _0x1d2018,_0x2c4582=_0x7154c7['reverse']();return void 0x0!==_0x567ce5&&this['_isPinnedRectVisible'](_0x2c4582[_0x567ce5],_0x1e7949,_0x4d2350)?(_0x1d2018=_0x2c4582[_0x567ce5],this['_pinnedRectIndex']=_0x567ce5):this['_isPinnedRectVisible'](_0x2c4582[0x0],_0x1e7949,_0x4d2350)&&void 0x0===_0x567ce5?_0x1d2018=_0x2c4582[0x0]:(_0x2c4582='s'==_0x5c077d[0x0]?[..._0x7154c7]['reverse']():_0x7154c7,_0x2c4582['forEach'](_0xb770=>{this['_isPinnedRectVisible'](_0xb770,_0x1e7949,_0x4d2350)&&(_0x1d2018=_0xb770);})),this['_pinnedTargetChangeId']=_0x56c776,this['_pinnedTargetElement']=_0x1606a7,_0x1d2018||_0x1606a7['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x5e9bb2,_0x28294c,_0x11a18b){if(!_0x5e9bb2)return null;const _0x1dc264=Array['from'](_0x5e9bb2['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x28294c&&this['_pinnedTargetChangeId']!==_0x11a18b)return this['_pinnedRectIndex']=_0x28294c,this['_pinnedTargetElement']=_0x5e9bb2,this['_pinnedTargetChangeId']=_0x11a18b,_0x1dc264[_0x28294c];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x11a18b){if(_0x5e9bb2!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x1dc264[this['_pinnedRectIndex']];}return void 0x0!==_0x28294c&&this['_pinnedTargetChangeId']!==_0x11a18b?(this['_pinnedRectIndex']=_0x28294c,this['_pinnedTargetElement']=_0x5e9bb2,this['_pinnedTargetChangeId']=_0x11a18b,_0x1dc264[_0x28294c]):_0x5e9bb2['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x297166,_0x34939a){if(_0x297166)for(let _0x105115=0x0;_0x105115<_0x34939a['length'];_0x105115++){const _0x4fb39c=_0x34939a[_0x105115];if(_0x297166['clientX']>=_0x4fb39c['left']-0x3&&_0x297166['clientX']<=_0x4fb39c['right']+0x3&&_0x297166['clientY']>=_0x4fb39c['top']-0x3&&_0x297166['clientY']<=_0x4fb39c['bottom']+0x3)return _0x105115;}}['_isPinnedRectVisible'](_0x31dfa6,_0x258ec8,_0x274637){const _0x560bec=new _0x26a571(_0x31dfa6),_0x376e8f=_0x258ec8||document['documentElement'],_0x20abae=_0x560bec['getIntersection'](_0x287a04(_0x274637)),_0x16cc23=new _0x26a571(_0x376e8f)['getIntersection'](_0x560bec);return!!(_0x20abae&&_0x16cc23&&_0x560bec['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Me extends _0x4720c1{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[it];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x48ebed){super(_0x48ebed),this['_bodyCollection']=new _0x165cca(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 _0x3304f4=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x3304f4);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x35101d){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x468621=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x35101d,_0x468621);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x22aed5){_0x22aed5&&('error-general'!==_0x22aed5['status']?'error-chunk'!==_0x22aed5['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x5da40e){this['_mainView']['addCheckRunResult'](_0x5da40e);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x39052f){this['_mainView']['showGeneralReviewCoreErrorView'](_0x39052f??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x16bf45,_0x63a00d){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x16bf45,_0x63a00d);}['setActiveStateInResults'](_0x544ada){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x3d9936=>{_0x3d9936['id']===_0x544ada&&_0x3d9936['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x2c96cc=>_0x2c96cc['setItemAsInactive']());}['updateChangeState'](_0x553de3,_0x4bace7){'accepted'===_0x4bace7||'rejected'===_0x4bace7||'outdated'===_0x4bace7?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x553de3,_0x4bace7):this['_mainView']['reviewCheckResultsView']['showResult'](_0x553de3,_0x4bace7);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x35a8ec,_0x36eec3,_0x169c0f,_0xc057b0,_0x25139c,_0x4b3fa8){this['_balloonSuggestionView']['showBalloon'](_0x35a8ec,_0x36eec3,_0x169c0f,_0xc057b0,_0x25139c,_0x4b3fa8);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x1f6507){const _0x465522=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x3f527e=>_0x3f527e['id']===_0x1f6507);return _0x465522?_0x465522['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0x26817f{constructor(_0x151b06){super(_0x151b06),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x3b4e88=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x3b4e88['if']('isVisible','ck-hidden',_0x112b5f=>!_0x112b5f)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x3b4e88['to']('errorMessage')}]}]});}}class Ae extends _0x26817f{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x47c3ea,_0x30d72e){super(_0x47c3ea),this['reviewCoreHeader']=_0x30d72e['header'],this['generalErrorView']=new sh(_0x47c3ea),this['reviewCheckListView']=_0x30d72e['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0x30d72e['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0x30d72e['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'](_0x9c70c8){this['reviewCheckResultsView']['addResult'](_0x9c70c8),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'](_0x30e4eb){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x30e4eb;}['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 _0x33ce64{constructor(_0x187cda,_0x5e29fd){super(_0x5e29fd),this['set']({'label':_0x187cda,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ve extends _0x51dbe3{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x3c9f88,_0x1f78bc){super(_0x3c9f88),this['_contents']=_0x1f78bc,this['_resultViews']=new _0x1024e9(),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 vi(_0x3c9f88),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 _0x4c9097=this['_createCombinedSkeletonLoader'](),_0x378a84=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x378a84['if']('isLoading','ck-ai_review__check-run_loading',_0x270301=>_0x270301),_0x378a84['if']('isResultReady','ck-ai_review__check-run_ready',_0x1a33bc=>_0x1a33bc),_0x378a84['if']('isVisible','ck-hidden',_0x528d40=>!_0x528d40)]},'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',_0x431994=>_0x431994)]},'children':this['_resultViews']},_0x4c9097]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x29bc43){const _0x29f62d=new Ws(this['locale'],_0x29bc43['id']);_0x29f62d['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x29f62d),_0x29f62d['resultResponseView']['element']['innerHTML']=_0x29bc43['contentDiffed'];}['hideResult'](_0x5176f4,_0x4628d6){if('pending'===_0x4628d6)return;const _0x5a2d3b=this['_resultViews']['find'](_0x5a8aea=>_0x5a8aea['id']===_0x5176f4);_0x5a2d3b&&(_0x5a2d3b['status']=_0x4628d6,_0x5a2d3b['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x242566,_0x4a1354){if('pending'!==_0x4a1354)return;const _0x50bc7d=this['_resultViews']['find'](_0x1d43be=>_0x1d43be['id']===_0x242566);_0x50bc7d&&(_0x50bc7d['status']=_0x4a1354,_0x50bc7d['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x515e4c,_0x2a1c7a){this['headerTitle']=_0x515e4c,this['headerSubtitle']=_0x2a1c7a||'';}['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 Xe(this['locale'],Ye['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x166fad=new _0x26817f(this['locale']),_0x6028e9=[];for(let _0x31b646=0x0;_0x31b646<0x10;_0x31b646++){const _0x2b8f01=this['_createSkeletonLoader']();_0x2b8f01['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x6028e9['push'](_0x2b8f01);}return _0x166fad['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x4d2df5=>!_0x4d2df5)]},'children':_0x6028e9}),_0x166fad;}['_createErrorView'](){const _0xf8eb09=new _0x26817f(this['locale']),_0x3edffc=new _0x33ce64(this['locale']),t=this['locale']['t'];return _0xf8eb09['delegate']('retryReview')['to'](this),_0x3edffc['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x3edffc['on']('execute',()=>{this['fire']('retryReview');}),_0xf8eb09['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x7a3f56=>!_0x7a3f56),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0xb61d24=>'chunk'===_0xb61d24)]},'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',_0x9185ae=>'chunk'===_0x9185ae)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x8a8b34=>'general'!==_0x8a8b34)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x378f69=>'chunk'!==_0x378f69)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x3edffc]}),_0xf8eb09;}['_createCancelButtonView'](){const _0x529a8a=new _0x33ce64(this['locale']);return _0x529a8a['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x1051d5}),_0x529a8a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x47616a=>_0x47616a),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1976bf=>_0x1976bf)]}}),_0x529a8a['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x529a8a;}['_createToggleDiffButtonView'](){const _0x20ded9=new _0x33ce64(this['locale']);_0x20ded9['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x20ded9['bind']('isEnabled')['to'](this,'isError',_0xdbfa63=>!_0xdbfa63),_0x20ded9['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x18e3ba=>!_0x18e3ba),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4fbf64=>_0x4fbf64)]}});const _0x21d8db=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0xf6cdc4=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x20ded9['bind']('isOn')['to'](this,'isToggleDiffOn',_0x3643ee=>_0x3643ee),_0x20ded9['bind']('icon')['to'](this,'isToggleDiffOn',_0x391626=>_0x391626?_0x53f82b:_0x5c1ece),_0x20ded9['bind']('label')['to'](this,'isToggleDiffOn',_0x5a5a44=>_0x5a5a44?_0x21d8db:_0xf6cdc4),_0x20ded9['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x20ded9;}['_createAcceptAllButtonView'](){const _0x151468=new _0x33ce64(this['locale']);return _0x151468['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x151468['bind']('isEnabled')['to'](this,'isError',_0x35ac3a=>!_0x35ac3a),_0x151468['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x1de6b6=>!_0x1de6b6),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3edff7=>_0x3edff7)]}}),_0x151468['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x151468;}['_createExitReviewButtonView'](){const _0x3aa764=new _0x33ce64(this['locale']);return _0x3aa764['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x3aa764['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5b4434=>!_0x5b4434),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4970c0=>_0x4970c0)]}}),_0x3aa764['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x3aa764;}['_createResultHeaderView'](){const _0x1df4b9=new _0x26817f(this['locale']),_0x3ef4eb=this['_createTitleView']();return _0x1df4b9['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x17e3b3=>_0x17e3b3)]},'children':[_0x3ef4eb,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x1df4b9;}['_createTitleView'](){const _0x489804=new _0x26817f(this['locale']),_0x27a784=new Ze();return _0x27a784['bind']('isVisible')['to'](this,'isResultReady',_0x500d4e=>!_0x500d4e),_0x489804['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x27a784,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x200e14=>_0x200e14)]},'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',_0x1c53f4=>!_0x1c53f4)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x489804;}['_createFinishReviewButtonView'](){const _0x354a03=new vr(i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x354a03['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0xb75763=>!_0xb75763)]}}),_0x354a03['delegate']('finishReview')['to'](this),_0x354a03;}}class be extends _0x51dbe3{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x54f84e,_0xe5ee84){super(_0x54f84e),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0xe5ee84['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0xe5ee84['headerText']);const _0x192dc6=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x192dc6['if']('isVisible','ck-hidden',_0x3f6951=>!_0x3f6951)]},'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':_0xe5ee84['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x4f8732){const _0x241f99=new vr(_0x4f8732,this['locale']);return _0x241f99['delegate']('finishReview')['to'](this),_0x241f99;}['_createResultHeaderView'](_0x390a4e){const _0x23cc8c=new _0x26817f(this['locale']);return _0x23cc8c['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':_0x390a4e}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x23cc8c;}}class Dr extends _0x26817f{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x2dbfeb,_0x27080a){super(_0x2dbfeb),this['_defaultValue']=_0x27080a['default']||(_0x27080a['data']['length']>0x0?_0x27080a['data'][0x0]['id']:''),this['_defaultLabel']=_0x27080a['data']['find'](_0x31774c=>_0x31774c['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x1fec03(this['locale']);const _0x237450=this['_prepareListOptions'](_0x27080a['data']);_0x3b4b3d(this['_dropdownView'],_0x237450,{'role':'menu','ariaLabel':_0x27080a['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x45e3d6=>{_0x45e3d6['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x92954d=>{this['formValue']=_0x92954d['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x92954d['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'](_0x4f2b63=[]){const _0x4b2e0d=new _0x2c18a8();this['resetToDefault']();for(const _0x5e51c5 of _0x4f2b63){const _0x5ad33b=new _0x4d3eeb({'label':_0x5e51c5['label'],'withText':!0x0,'role':'menuitemradio','id':_0x5e51c5['id'],'model':_0x5e51c5});_0x5ad33b['bind']('isOn')['to'](this,'formValue',_0x54a90e=>_0x54a90e===_0x5ad33b['id']);const _0xc07fde={'type':'button','model':_0x5ad33b};_0x4b2e0d['add'](_0xc07fde);}return _0x4b2e0d;}}class tc extends _0x51dbe3{['_formItem']=null;constructor(_0x536b14,_0x3a2615,_0x107a43){super(_0x536b14),this['argsKey']=_0x3a2615?.['argsKey'];if('dropdown'===_0x3a2615['formType'])this['_formItem']=new Dr(this['locale'],_0x3a2615);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x5cbb23=new _0x584515(this['locale'],{'children':[this['_formItem']],'class':[_0x107a43?'ck-form__row_with-submit':'']});_0x107a43&&_0x5cbb23['children']['add'](_0x107a43),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x5cbb23]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class wo extends _0x17219f{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x15531e){super(_0x15531e),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x2ac014(),this['minRows']=wo['MIN_ROWS'],this['maxRows']=wo['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 _0x26817f{['focusTracker']=new _0x1203ce();['keystrokes']=new _0x2ac014();['focusCycler'];['_focusables']=new _0x1024e9();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x26b95d,_0x47a690,_0x455a0b=!0x1){super(_0x26b95d),this['_check']=_0x47a690,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x47a690['defaultModel']?_0x47a690['defaultModel']['id']:'',this['_defaultLabel']=_0x47a690['defaultModel']?_0x47a690['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0xbe7541(this['locale'],()=>new wo(_0x26b95d)),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 _0x2c18a8(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x455a0b),_0x3b4b3d(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x584515(this['locale'],{'children':[this['promptInputView']]}),new _0x584515(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x1f1839,_0x6d0372)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x6d0372()):_0x6d0372();}),this['focusCycler']=new _0x29c2cb({'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'](_0x4ef9a3=>{this['_focusables']['add'](_0x4ef9a3),this['focusTracker']['add'](_0x4ef9a3['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 _0x50481a of this['_getFormValidators']()){const _0x395fe8=_0x50481a();if(_0x395fe8)return this['promptInputView']['errorText']=_0x395fe8,!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 _0x511b2d=new _0x33ce64(this['locale']),t=this['locale']['t'];return _0x511b2d['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x511b2d['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x511b2d;}['_createCancelButtonView'](){const _0x31fc24=new _0x33ce64(this['locale']),t=this['locale']['t'];return _0x31fc24['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0x31fc24['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2e7a05=>{_0x2e7a05['stopPropagation']();})}}),_0x31fc24['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x31fc24;}['_setModelList'](_0x537579){this['_modelSelectionDropdownItems']['clear']();const _0x37c037=this['_check']['models'];if(_0x537579)this['set']('modelDisplayMode','hidden');else{const _0x525d0b=0x1===_0x37c037['length'];this['set']('modelDisplayMode',_0x525d0b?'name':'selector');}if(this['resetToDefault'](),_0x37c037?.['length']){0x1===_0x37c037['length']&&this['set']('activeModelName',_0x37c037[0x0]['name']||_0x37c037[0x0]['id']);for(const _0x4c546a of _0x37c037){const _0x3eaeb1=new _0x4d3eeb({'label':_0x4c546a['name'],'withText':!0x0,'role':'menuitemradio','id':_0x4c546a['id'],'model':_0x4c546a});_0x3eaeb1['bind']('isOn')['to'](this,'modelId',_0x49343c=>_0x49343c===_0x4c546a['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x3eaeb1,'labelView':new ModelButtonLabelView(this['locale'],_0x4c546a)});}}}['_createModelSelectionDropdown'](){const _0x49e315=_0x1fec03(this['locale']);return _0x49e315['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x49e315['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x49e315['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5660bf=>'selector'===_0x5660bf),this['listenTo'](_0x49e315,'execute',_0x51ebd2=>{this['modelId']=_0x51ebd2['source']['model']['id'],_0x49e315['buttonView']['label']=_0x51ebd2['source']['label'];}),_0x49e315;}['_createModelNameView'](){const _0x542e8d=new ModelNameView(this['locale']);return _0x542e8d['bind']('text')['to'](this,'activeModelName',_0x4da04a=>_0x4da04a??''),_0x542e8d['bind']('isVisible')['to'](this,'modelDisplayMode',_0x518ced=>'name'===_0x518ced),_0x542e8d;}['_createActionsFooterView'](){const _0xacaf81=new _0x26817f(this['locale']);return _0xacaf81['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']]}]}),_0xacaf81;}}class ModelNameView extends _0x26817f{constructor(_0x2c3a01){super(_0x2c3a01),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x8c10dc=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x8c10dc['if']('isVisible','ck-hidden',_0x1be5d3=>!_0x1be5d3)]},'children':[{'text':_0x8c10dc['to']('text')}]});}}class ModelButtonLabelView extends _0x3eefdf{constructor(_0x4edf52,_0x260b2c){super();const _0x277d55=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x277d55['to']('style'),'id':_0x277d55['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x277d55['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x260b2c['description']||'']}]}]});}}class ec extends _0x51dbe3{['_formItemsCollection']=new _0x1024e9();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0xf57d41,_0x388406,_0x4b526b,_0x5bef6c=!0x1){super(_0xf57d41),this['_hideModels']=_0x5bef6c,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x388406['isParameterized']);const _0x23b951=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',_0x57b00d=>_0x57b00d),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x1d1292=>_0x1d1292)],'style':{'--ck-ai-review-check-list-item-index':_0x4b526b}},'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':_0x388406['title']}]},_0x23b951]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x388406['description']?[{'text':_0x388406['description']}]:[]}]}]},..._0x388406['isParameterized']?[this['_createParameterizedView'](_0x388406)]:[],...'custom'===_0x388406['id']?[this['_createCustomView'](_0x388406,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x388406['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x388406['id'],'args':_0x388406['useArgs']?_0x388406['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x38a160({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x5df1b1=>{_0x5df1b1['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0xd63044=new _0x3c69cf();return _0xd63044['content']=_0x21fd87,_0xd63044['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0xd63044;}['_createParameterizedView'](_0x9029eb){const _0x125189=new _0x26817f(),_0x3fcea2=this['_createFormView'](_0x9029eb);return _0x125189['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x4dfad4=>!_0x4dfad4)]},'children':[_0x3fcea2]}),_0x125189;}['_createFormView'](_0x13b84d){const _0x1206ff=new _0x26817f(),_0x2077f8=Array['isArray'](_0x13b84d['options'])?_0x13b84d['options']:[],_0x1b9016=new _0x33ce64(this['locale']),t=this['locale']['t'];_0x1b9016['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x1b9016['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x35ad93=>{_0x35ad93['stopPropagation']();})}}),_0x1b9016['on']('execute',()=>{const _0x33f0ad=[],_0x5a46a0={};this['_formItemsCollection']['forEach'](_0x3171b7=>{_0x33f0ad['push'](_0x3171b7['value']),_0x13b84d['useArgs']&&_0x13b84d['options']&&(_0x5a46a0[_0x3171b7['argsKey']]=_0x3171b7['value']);}),this['fire']('runReviewCheck',{'id':_0x13b84d['id'],'params':_0x33f0ad['length']?_0x33f0ad:void 0x0,'args':Object['keys'](_0x5a46a0)['length']?_0x5a46a0:void 0x0});});const _0x1b9603=_0x2077f8['length'];return _0x2077f8['forEach']((_0x46c612,_0x278a7a)=>{const _0x465b7b=_0x278a7a===_0x1b9603-0x1;this['_formItemsCollection']['add'](new tc(this['locale'],_0x46c612,_0x465b7b?_0x1b9016:null));}),_0x1206ff['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x1206ff;}['_createCustomView'](_0x41d10d,_0x83696b=!0x1){return this['_customCheckView']=new sc(this['locale'],_0x41d10d,_0x83696b),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',_0x21ece3=>!_0x21ece3)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x3ee890,_0x2e6921,_0x7f1c4c)=>{_0x7f1c4c||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class je extends _0x51dbe3{['_checkViews'];constructor(_0x4df57f){super(_0x4df57f),this['_checkViews']=new _0x1024e9(),this['_setupTemplate']();}['setChecks'](_0x361628,_0x4aded5=!0x1){this['_checkViews']['clear']();for(const [_0x50fb27,_0x49d2d9]of _0x361628['entries']()){const _0x406868=new ec(this['locale'],_0x49d2d9,_0x50fb27,_0x4aded5);_0x406868['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x406868);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x2028ba of this['_checkViews'])_0x2028ba instanceof ec&&_0x2028ba['resetToDefault']();}['_setupTemplate'](){const _0x364a5c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x364a5c['if']('isVisible','ck-hidden',_0x4a4c53=>!_0x4a4c53)]},'children':this['_checkViews']});}}class ge extends Me{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x5a84d7=this['context']['locale'],_0x4a11cc=new _0x473725(_0x5a84d7,{'label':i(_0x5a84d7,'AI_REVIEW_MODE'),'icon':_0x1c850e,'class':'ck-ai-header\x20ck-ai-header_review'});return new Ae(this['context']['locale'],{'header':_0x4a11cc,'list':new je(_0x5a84d7),'results':new Ve(_0x5a84d7,{'generalErrorText':i(_0x5a84d7,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x5a84d7,{'headerText':i(_0x5a84d7,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':i(_0x5a84d7,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x5a84d7,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x3d2857=this['context']['plugins']['get']('AITabs');_0x3d2857['view']['on']('activateTab',(_0x51e97a,_0x1ea1f3)=>{'reviewMode'===_0x1ea1f3?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x3d2857['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x1c850e,'order':0x0,'content':this['_mainView']});}}const fe='review-';class de extends _0x4720c1{static get['requires'](){return[ot,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(_0xdd855){super(_0xdd855),this['_domEmitter']=new(_0x363382())(),this['_eventEmitter']=new(_0x2eb18e())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x1f44ae=T(this['context']);_0x1f44ae['conversion']['for']('editingDowncast')['markerToElement']({'model':fe+'insert','view':(_0x4ca80d,{writer:_0x409d04})=>{const _0x477bf8=this['_markers']['get'](_0x4ca80d['markerName']),_0x38490d={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x477bf8?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x4ca80d['markerName']};return _0x409d04['createUIElement']('span',_0x38490d,function(_0xbc05bf){const _0xa130f0=this['toDomElement'](_0xbc05bf);return _0xa130f0['innerHTML']=_0x477bf8?.['content']?.['asString']||'',_0xa130f0;});}}),_0x1f44ae['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-only','view':_0x354981=>{const _0x162c45=this['_markers']['get'](_0x354981['markerName']),_0x59e388=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x162c45?.['id']||'')&&_0x59e388['push']('ck-ai_review__change_active'),{'classes':_0x59e388,'attributes':{'data-marker-id':_0x354981['markerName']}};}}),_0x1f44ae['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-context','view':_0x59f473=>{const _0x2780fe=this['_markers']['get'](_0x59f473['markerName']),_0x9471e2=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x2780fe?.['id']||'')&&_0x9471e2['push']('ck-ai_review__change_active'),{'classes':_0x9471e2,'attributes':{'data-marker-id':_0x59f473['markerName']}};}}),_0x1f44ae['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-text','view':_0x20827d=>{const _0x585ed3=this['_markers']['get'](_0x20827d['markerName']),_0x1f1990=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x585ed3?.['id']||'')&&_0x1f1990['push']('ck-ai_review__change_active'),{'classes':_0x1f1990,'attributes':{'data-marker-id':_0x20827d['markerName']}};}}),_0x1f44ae['conversion']['for']('dataDowncast')['markerToElement']({'model':fe+'suggestion-context','view':(_0x61bc64,{writer:_0x8d69bb})=>_0x8d69bb['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x61bc64['isOpening']?'start':'end')})}),_0x1f44ae['conversion']['for']('downcast')['attributeToAttribute']({'model':nt,'view':_0x141dfb});const _0x303eea=_0x1f44ae['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x303eea,'mouseup',(_0x36684f,_0x1e5f02)=>{const _0x583787=_0x1e5f02['target'],_0x2da138=this['_findMarkerElement'](_0x583787);if(!_0x2da138)return;const _0x23ec29=_0x2da138['getAttribute']('data-marker-id'),_0x39201e=_0x23ec29['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x23ec29,'changeId':_0x39201e,'markerElement':()=>this['_findMarkerElementById'](_0x23ec29),'domEvent':_0x1e5f02});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x303eea,'mouseover',(_0xc360a0,_0x4171c3)=>{const _0x1a03e3=_0x4171c3['target'],_0x4eb935=_0x4171c3['relatedTarget'];let _0x4bb29f=this['_findMarkerElement'](_0x1a03e3);if(!_0x4bb29f&&_0x4eb935&&(_0x4bb29f=this['_findMarkerElement'](_0x4eb935)),!_0x4bb29f)return;const _0x4f50f9=_0x4bb29f['getAttribute']('data-marker-id'),_0x3b1190=_0x4f50f9['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x3b1190,'markerElement':()=>this['_findMarkerElementById'](_0x4f50f9),'domEvent':_0x4171c3});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x418eec((_0x522f2f,_0x26219e)=>{const _0x1d407a=_0x26219e['target'];if(this['_findMarkerElement'](_0x1d407a))return;_0x1d407a['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x1f44ae['model']['document']['registerPostFixer'](_0x3b9ec2=>this['_validateMarkers'](_0x1f44ae,_0x3b9ec2)),_0x1f44ae['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x1f44ae));}['getDocumentData'](){const _0x19970d=this['context']['plugins']['get']('AIEditing'),_0x3be490=T(this['context']),_0x19cfe5=_0x3be490['model'],_0x5b3134=new jt();for(const _0x44c84d of _0x19cfe5['document']['getRoot']()['getChildren']()){const _0x525a8d=_0x44c84d['_clone'](!0x0);_0x5b3134['_appendChild'](_0x525a8d);}for(const _0x130150 of _0x19cfe5['markers'])_0x5b3134['markers']['set'](_0x130150['name'],this['_changeRangeOwnerDocument'](_0x130150['getRange']()['clone'](),_0x5b3134));const _0x44a111=new _0x5f12bc({'ignoreElementEnd':!0x0,'startPosition':_0x19cfe5['createPositionAt'](_0x5b3134,0x0)}),_0x2d95ba=new Set(),_0x22a372=new Map();for(const {item:_0x45aceb}of _0x44a111){if(!_0x45aceb['is']('$textProxy'))continue;const _0x2b80a1=_0x45aceb['parent'];if(_0x2b80a1&&_0x2b80a1['is']('element')){const _0x5b094b=this['_upsertDataId'](_0x2b80a1,()=>_0x19970d['_nextDataId'](_0x2d95ba));_0x2d95ba['add'](_0x5b094b);for(const _0x1fafb6 of _0x2b80a1['getChildren']())_0x1fafb6['is']('element')&&_0x2d95ba['add'](this['_upsertDataId'](_0x1fafb6,()=>_0x19970d['_nextDataId'](_0x2d95ba)));let _0x11c46b=_0x2b80a1;for(;_0x11c46b['parent']&&!_0x11c46b['parent']['is']('documentFragment');)_0x11c46b=_0x11c46b['parent'],_0x11c46b['hasAttribute'](nt)&&_0x11c46b['_removeAttribute'](nt);_0x22a372['set'](_0x5b094b,{'path':_0x2b80a1['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x11c46b['_clone'](!0x0),_0x5b094b,_0x3be490['data'])}),_0x44a111['jumpTo'](_0x19cfe5['createPositionAfter'](_0x2b80a1));}}return{'content':_0x3be490['data']['processor']['toData'](_0x3be490['data']['toView'](_0x5b3134)),'version':_0x3be490['model']['document']['version'],'elements':_0x22a372};}['diffContent'](_0x296b72,_0x33fcdb,_0x238b27=!0x1){const _0x4f4031=[],_0x1b9454=T(this['context']),_0xd3c89b=_0x1b9454['data']['parse'](_0x33fcdb,'$documentFragment'),_0x5d5595=_0x1b9454['data']['parse'](_0x296b72,'$documentFragment'),_0x744b42=_0x1b9454['model']['createPositionAt'](_0x5d5595,0x0);if(this['_haveSingleTopLevelElement'](_0xd3c89b)){if(!this['_hasSameTopLevelElement'](_0x5d5595,_0xd3c89b))return _0x4f4031;}else{const _0x40ea42=_0x1b9454['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x5d5595,_0x40ea42)||!this['_haveOnlyInlineContent'](_0xd3c89b,_0x40ea42))return _0x4f4031;}const _0x2c4521=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x296b72,_0x33fcdb,{'anchor':_0x744b42,'markDeletions':!0x0})['getOperations']()['filter'](_0x4f015b=>'insert'===_0x4f015b['type']||'marker'===_0x4f015b['type']&&_0x4f015b['name']['startsWith']('$markedRemove')),_0x328851=this['_groupAdjacentOperations'](_0x2c4521),_0x1168ab=[];if(_0x238b27){if(_0x328851['length']){const _0x11a333=_0x328851[0x0]['operations'][0x0],_0x3e43fd='insert'===_0x11a333['type']?_0x11a333['position']:_0x11a333['newRange']['start'],_0x33d5fe=this['_getPositionLimitingRange'](_0x3e43fd,_0x1b9454,'inside'),_0x51b0e0=_0x33d5fe?_0xd3c89b['getChild'](0x0)['getChildren']():_0xd3c89b['getChildren'](),_0x188b16=_0x33d5fe||_0x1b9454['model']['createRangeIn'](_0x5d5595),_0x230088=[new _0x30f837('$markedRemove:synthetic'+_0x41685d(),null,_0x188b16,_0x1b9454['model']['document']['model']['markers'],!0x0,_0x1b9454['model']['document']['version']+0x1),new _0x298e42(_0x188b16['end'],_0x51b0e0,_0x1b9454['model']['document']['version']+0x2)];_0x1168ab['push']({'operations':_0x230088,'operationsIsolated':_0x230088,'groupOffset':0x0});}}else _0x1168ab['push'](..._0x328851);let _0x27d03a=0x0;return _0x1b9454['model']['change'](_0x4cbd1e=>{for(let _0x320aff=0x0;_0x320aff<_0x1168ab['length'];_0x320aff++){const _0x4d7121=_0x1168ab[_0x320aff],_0x5e7c8c=_0x4cbd1e['createDocumentFragment']();for(const _0x5e84fd of _0x5d5595['getChildren']())_0x4cbd1e['append'](_0x5e84fd['_clone'](!0x0),_0x5e7c8c);for(const _0x51ba17 of _0x4d7121['operationsIsolated'])if('insert'===_0x51ba17['type']){const _0x58f69d=_0x51ba17;_0x58f69d['baseVersion']=null,_0x58f69d['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x58f69d,_0x5e7c8c),_0x4cbd1e['batch']['addOperation'](_0x51ba17),_0x1b9454['model']['applyOperation'](_0x51ba17);const _0x2e0ec0='suggestion:insertion:id:authorId:'+_0x27d03a++,_0x1a8c3f=_0x1b9454['model']['createRange'](_0x58f69d['position'],_0x58f69d['position']['getShiftedBy'](_0x58f69d['howMany']));_0x5e7c8c['markers']['set'](_0x2e0ec0,_0x1a8c3f);}else{if('marker'===_0x51ba17['type']&&_0x51ba17['name']['startsWith']('$markedRemove')){const _0x52b891=_0x51ba17,_0x3a8dd5='suggestion:deletion:id:authorId:'+_0x27d03a++;this['_changeOperationOwnerDocument'](_0x52b891,_0x5e7c8c),_0x5e7c8c['markers']['set'](_0x3a8dd5,_0x52b891['newRange']);}}if(_0x238b27)_0x4f4031['push']({..._0x4d7121,'context':this['_createGetContentFn'](_0x5d5595,_0x1b9454['data']),'content':this['_createGetContentFn'](_0x5d5595,_0x1b9454['data'])});else{const _0x4ff4de=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x4d7121['operationsIsolated'][0x0]),_0x5e7c8c),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x4d7121['operationsIsolated'][_0x4d7121['operationsIsolated']['length']-0x1]),_0x5e7c8c));_0x5e7c8c['markers']['set'](fe+'suggestion-context',new dt(_0x4ff4de['start'],_0x4ff4de['end'])),_0x4f4031['push']({..._0x4d7121,'context':this['_createGetContextFn'](_0x5e7c8c,_0x1b9454['data'],{'ellipsisBefore':_0x4ff4de['hasContentBefore'],'ellipsisAfter':_0x4ff4de['hasContentAfter']}),'content':this['_createGetContentFn'](_0x5e7c8c,_0x1b9454['data'])});}}}),_0x4f4031;}['markChangePositionInEditorContent'](_0x483c13,_0x4c1a47){if(!_0x483c13['length'])return;const _0x383866=_0x483c13[0x0]['parent']['id'],_0x15be5a=_0x4c1a47['elements']['get'](_0x383866);if(!_0x15be5a)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x383866);const _0x39804f=_0x15be5a['path'],_0x113b01=T(this['context']),_0x42f355=_0x113b01['model']['document']['history']['getOperations'](_0x4c1a47['version']),_0x2e109b=[];for(const _0x214794 of _0x483c13){const _0x5c65e0=_0x214794['operationsIsolated']['map'](_0x19e38f=>this['_translateOperationToEditorContent'](_0x19e38f,_0x39804f,_0x113b01['model']['document']['getRoots']()[0x0]));if(!_0x5c65e0||!_0x5c65e0['length'])continue;const _0xa8cc27=_0x5c65e0['every'](_0x57950e=>'marker'===_0x57950e['type']&&_0x57950e['name']['startsWith']('$markedRemove')),_0x56fc5a={'document':_0x113b01['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x25df04=xt(_0x5c65e0,_0x42f355,_0x56fc5a)['operationsA'];for(const _0x5a8a67 of _0x25df04)if('insert'===_0x5a8a67['type']){const _0x21e86f=_0x5a8a67,_0x4edf57=_0x21e86f['nodes'];_0x113b01['model']['change'](_0x25273e=>{const _0x4d19d1=_0x25273e['createDocumentFragment']();for(const _0x1881e5 of _0x4edf57)_0x25273e['append'](_0x1881e5['_clone'](!0x0),_0x4d19d1);_0x2e109b['push']({'start':_0x21e86f['position'],'end':_0x21e86f['position'],'type':'insert','groupId':_0x214794['id'],'content':{'asString':this['_createGetContentFn'](_0x4d19d1,_0x113b01['data'])(),'asFragment':_0x4d19d1}});});}else{if('marker'===_0x5a8a67['type']&&_0x5a8a67['name']['startsWith']('$markedRemove')){const _0x2fe6c6=_0x5a8a67;let _0x37bbc6='remove-text';if(_0xa8cc27){const _0x3631a2=this['_findAdjacentContextDistance'](_0x2fe6c6['newRange']['start'],'backward',_0x113b01['model']['schema']),_0x45d646=this['_findAdjacentContextDistance'](_0x2fe6c6['newRange']['end'],'forward',_0x113b01['model']['schema']);if(_0x3631a2||_0x45d646){const _0x1993fb=_0x2fe6c6['newRange']['start']['getShiftedBy'](-_0x3631a2),_0x339c6b=_0x2fe6c6['newRange']['end']['getShiftedBy'](_0x45d646);_0x2e109b['push']({'start':_0x1993fb,'end':_0x339c6b,'groupId':_0x214794['id'],'type':'remove-context'});}else _0x37bbc6='remove-only';}_0x2e109b['push']({'start':_0x2fe6c6['newRange']['start'],'end':_0x2fe6c6['newRange']['end'],'groupId':_0x214794['id'],'type':_0x37bbc6});}}}this['_insertMarkers'](_0x2e109b);}['clearAllMarkers'](){const _0x5b7545=T(this['context']);_0x5b7545['model']['change'](_0x25f5a5=>{for(const _0x4cba67 of this['_markers']['keys']())_0x5b7545['model']['markers']['get'](_0x4cba67)&&_0x25f5a5['removeMarker'](_0x4cba67);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){T(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){T(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x4b98bc){const _0x5079ca=T(this['context']),_0x563878=_0x5079ca['model'],_0x5f2a69=_0x4b98bc['map'](_0x5aa099=>this['_getMarkersDataForGroup'](_0x5aa099))['flat']();_0x563878['change'](_0x3c6043=>{for(const _0x1a7e17 of _0x5f2a69){const _0x244295=_0x5079ca['model']['markers']['get'](_0x1a7e17['id']);if(_0x244295){if('insert'===_0x1a7e17['type']){if(!_0x1a7e17['content'])continue;_0x563878['insertContent'](_0x1a7e17['content']['asFragment']||null,_0x244295['getRange']()['start']);}else'remove-text'!==_0x1a7e17['type']&&'remove-only'!==_0x1a7e17['type']||_0x563878['deleteContent'](_0x563878['createSelection'](_0x244295['getRange']()));_0x3c6043['removeMarker'](_0x1a7e17['id']),this['_markers']['delete'](_0x1a7e17['id']);}}});}['rejectChange'](_0x475e1e){const _0x1a490c=T(this['context']),_0x2d2925=this['_getMarkersDataForGroup'](_0x475e1e);_0x1a490c['model']['change'](_0x492016=>{for(const _0x3655c4 of _0x2d2925)_0x492016['removeMarker'](_0x3655c4['id']),this['_markers']['delete'](_0x3655c4['id']);});}['getEditor'](){return T(this['context']);}['getMarkerElementForChange'](_0x554f80){const _0x5e67b3=Array['from'](this['_markers']['values']())['filter'](_0x3a280f=>_0x3a280f['groupId']===_0x554f80);if(!_0x5e67b3['length'])return null;const _0x3666d5=0x1===_0x5e67b3['length']?_0x5e67b3[0x0]:this['_sortMarkers'](_0x5e67b3)[0x0],_0x2b14ac=T(this['context'])['model']['markers']['get'](_0x3666d5['id']);if(!_0x2b14ac)return null;return{'modelRange':_0x2b14ac['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x3666d5['id'])};}['getContentElementForChange'](_0x15b255){const _0x28204f=Array['from'](this['_markers']['values']())['filter'](_0x1eb8ba=>_0x1eb8ba['groupId']===_0x15b255);if(!_0x28204f['length'])return null;const _0x12c954=0x1===_0x28204f['length']?_0x28204f[0x0]:this['_sortMarkers'](_0x28204f)[0x0],_0x52d450=T(this['context']),_0xb9cbc2=_0x52d450['model']['markers']['get'](_0x12c954['id']);if(!_0xb9cbc2)return null;const _0x10c7a8=_0xb9cbc2['getRange'](),_0x4dba78=_0x52d450['editing']['view']['getDomRoot']();if(!_0x4dba78||!_0x10c7a8)return null;let _0x2c2310=_0x10c7a8['start']['parent'];for(;_0x2c2310['parent']&&'$root'!==_0x2c2310['parent']['name'];)_0x2c2310=_0x2c2310['parent'];if(!_0x2c2310||!_0x2c2310['name'])return null;const _0x42c16f=_0x4dba78['querySelector']('[data-marker-id=\x22'+_0x12c954['id']+'\x22]');if(!_0x42c16f)return null;let _0x3dfc0d=null;_0x52d450['model']['change'](_0x4bd331=>{_0x3dfc0d=_0x4bd331['createDocumentFragment'](),_0x4bd331['append'](_0x2c2310['_clone'](!0x0),_0x3dfc0d);});const _0x495549=_0x52d450['data']['toView'](_0x3dfc0d)['getChild'](0x0);return _0x42c16f['closest'](_0x495549['name']);}['reactivateMarkers'](_0x28c008){const _0x445fc3=this['_getMarkersDataForGroup'](_0x28c008);if(!_0x445fc3['length'])return;const _0x462c41=Array['from'](this['_activeMarkers'])['sort'](),_0xfb2cc3=Array['from'](new Set(_0x445fc3['map'](_0x4f61dc=>_0x4f61dc['id'])))['sort']();_0x462c41['join']('|')!==_0xfb2cc3['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x28c008));}['setMarkersInElementAsActive'](_0x402767){const _0x453134=this['_getMarkersDataForGroup'](_0x402767);if(!_0x453134['length'])return;const _0x3edf9d=T(this['context']),_0x36acc6=new Set(_0x453134['map'](_0x35289b=>_0x35289b['id'])),_0xe1fbd5=Array['from'](_0x36acc6['values']())['map'](_0x2aa028=>_0x3edf9d['model']['markers']['get'](_0x2aa028))['filter'](_0x2cc772=>!!_0x2cc772);_0x36acc6['forEach'](_0x55fd93=>{this['_activeMarkers']['add'](_0x55fd93);}),_0x3edf9d['model']['change'](()=>{_0xe1fbd5['forEach'](_0x202267=>{_0x3edf9d['editing']['reconvertMarker'](_0x202267);});});}['setAllMarkersAsInactive'](){const _0x3ac5f4=Array['from'](this['_activeMarkers']);if(!_0x3ac5f4['length'])return;this['_activeMarkers']['clear']();const _0x292726=T(this['context']),_0x20dd46=_0x3ac5f4['map'](_0x17812d=>_0x292726['model']['markers']['get'](_0x17812d))['filter'](_0x2f131a=>!!_0x2f131a);_0x292726['model']['change'](()=>{_0x20dd46['forEach'](_0x5e0597=>{_0x292726['editing']['reconvertMarker'](_0x5e0597);});});}['_getPositionLimitingRange'](_0x449585,_0x368fbc,_0x439555='outside'){if(!_0x449585)return null;let _0x1500de=_0x449585['parent'];for(;_0x1500de&&_0x1500de['parent']&&'$root'!==_0x1500de['parent']['name']&&!_0x368fbc['model']['schema']['isLimit'](_0x1500de)&&!_0x368fbc['model']['schema']['isBlock'](_0x1500de);)_0x1500de=_0x1500de['parent'];if(!_0x1500de||!_0x1500de['name']||'$root'===_0x1500de['name'])return null;let _0x1f08d3=null;return _0x368fbc['model']['change'](_0x59b310=>{_0x1f08d3='inside'===_0x439555?_0x59b310['createRangeIn'](_0x1500de):_0x59b310['createRangeOn'](_0x1500de);}),_0x1f08d3;}['_validateMarkers'](_0x2a2b24,_0x3bffad){const _0x2b3886=Array['from'](this['_markers']['keys']()),_0x589506=new Map();for(const _0xddde0d of _0x2b3886){const _0x5bd4e9=_0x2a2b24['model']['markers']['get'](_0xddde0d);if(!_0x5bd4e9)continue;const _0x2dff1e=_0x5bd4e9['getStart']()['path'][0x0];_0x589506['has'](_0x2dff1e)||_0x589506['set'](_0x2dff1e,[]),_0x589506['get'](_0x2dff1e)['push'](_0x5bd4e9);}const _0x56dd37=new Set();for(const _0x357d62 of _0x2a2b24['model']['document']['differ']['getChanges']()){let _0x1153f2=-0x1,_0x3bacef=null;if('insert'===_0x357d62['type'])_0x3bacef=new dt(_0x357d62['position'],_0x357d62['position']['getShiftedBy'](_0x357d62['length'])),_0x1153f2=_0x357d62['position']['path'][0x0];else{if('remove'!==_0x357d62['type'])continue;_0x3bacef=new dt(_0x357d62['position']),_0x1153f2=_0x357d62['position']['path'][0x0];}const _0x528554=_0x589506['get'](_0x1153f2)||[];if(_0x528554['length']){for(const _0x1dcfc6 of _0x528554)if(_0x3bacef['root']['rootName']===_0x1dcfc6['getRange']()['root']['rootName']&&('insert'!==_0x357d62['type']||!_0x3bacef['containsRange'](_0x1dcfc6['getRange']()))&&(_0x3bacef['isIntersecting'](_0x1dcfc6['getRange']())||_0x3bacef['start']['isTouching'](_0x1dcfc6['getRange']()['end'])||_0x3bacef['end']['isTouching'](_0x1dcfc6['getRange']()['start']))){const _0x59a41a=this['_parseMarkerName'](_0x1dcfc6['name']);Array['from'](this['_markers']['values']())['filter'](_0x310334=>_0x310334['groupId']===_0x59a41a['groupId'])['forEach'](_0x5639ec=>_0x56dd37['add'](_0x5639ec['id']));}}}if(_0x56dd37['size']){for(const _0x3e33be of _0x56dd37)_0x3bffad['removeMarker'](_0x3e33be);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x15eb6f){for(const {name:_0x83b6bb,data:_0x595255}of _0x15eb6f['model']['document']['differ']['getChangedMarkers']()){if(!_0x83b6bb['startsWith'](fe))continue;const _0x57f5d9=_0x595255['oldRange'],_0x4780d0=_0x595255['newRange'],_0x1a22c3=_0x57f5d9&&'$graveyard'===_0x57f5d9['root']['rootName'],_0x5c4a71=_0x4780d0&&'$graveyard'===_0x4780d0['root']['rootName'];if(_0x1a22c3&&_0x5c4a71)continue;const _0x152278=this['_parseMarkerName'](_0x83b6bb);this['_markers']['get'](_0x83b6bb)&&(_0x5c4a71||!_0x4780d0?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x83b6bb,'changeId':_0x152278['groupId']}):_0x1a22c3&&_0x4780d0&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x83b6bb,'changeId':_0x152278['groupId']}));}}['_parseMarkerName'](_0x134a8b){const _0xbc725=_0x134a8b['split'](':'),_0x1ae5b6=(_0xbc725[0x1]||'')['split']('_');return{'prefix':_0xbc725[0x0],'groupId':_0x1ae5b6[0x0],'suffix':_0x1ae5b6[0x1]};}['_translateOperationToEditorContent'](_0x201f75,_0x2c7195,_0x19b5e6){if('insert'===_0x201f75['type']){const _0xe1acf0=_0x201f75;return new _0x298e42(this['_changePosition'](_0x2c7195['concat'](_0xe1acf0['position']['offset']),_0x19b5e6),_0xe1acf0['nodes'],_0xe1acf0['baseVersion']);}if('marker'===_0x201f75['type']&&_0x201f75['name']['startsWith']('$markedRemove')){const _0x4ce083=_0x201f75;return new _0x30f837(_0x4ce083['name'],_0x4ce083['oldRange'],this['_changeRange'](_0x4ce083['newRange'],_0x2c7195['concat'](_0x4ce083['newRange']['start']['offset']),_0x2c7195['concat'](_0x4ce083['newRange']['end']['offset']),_0x19b5e6),_0x4ce083['_markers'],_0x4ce083['affectsData'],_0x4ce083['baseVersion']);}return _0x201f75;}['_groupAdjacentOperations'](_0x41dc17){if(!_0x41dc17['length'])return[];const _0x2ea624=[];let _0x391b7d=0x0,_0x38bc5a=0x0,_0x425397=[];for(let _0x5988e5=0x0;_0x5988e5<=_0x41dc17['length'];_0x5988e5++){const _0x1be9dd=_0x41dc17[_0x5988e5],_0x118f6f=_0x41dc17[_0x5988e5-0x1];!_0x1be9dd||_0x118f6f&&!this['_getOperationEnd'](_0x118f6f)['isTouching'](this['_getOperationStart'](_0x1be9dd))?(_0x2ea624['push']({'operations':_0x425397,'operationsIsolated':_0x425397['map'](_0x140bdd=>this['_shiftOperation'](_0x140bdd['clone'](),-_0x38bc5a)),'groupOffset':_0x391b7d}),_0x425397=_0x1be9dd?[_0x1be9dd]:[],_0x38bc5a+=_0x391b7d,_0x391b7d=0x0):_0x425397['push'](_0x1be9dd),_0x1be9dd&&'insert'===_0x1be9dd['type']&&(_0x391b7d+=_0x1be9dd['howMany']);}return _0x2ea624;}['_findAdjacentContextDistance'](_0x593641,_0x2c6d34,_0x11cf61,_0x32f0e5=0x1){const _0x1576b8=new _0x5f12bc({'startPosition':_0x593641,'direction':_0x2c6d34});let _0x9e7a53=0x0;for(let _0xef1e5d=0x0;_0xef1e5d<_0x32f0e5;_0xef1e5d++){let _0x381207=0x0,_0x8902ac=!0x1,_0x28c13a='forward'===_0x2c6d34?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x34553f}of _0x1576b8)if(_0x34553f['is']('$textProxy')){const _0x2f4027=_0x28c13a['exec'](_0x34553f['data']);if(_0x2f4027&&_0x2f4027['length']){if(_0x381207+='forward'===_0x2c6d34?_0x2f4027['index']+_0x2f4027[0x0]['length']:_0x34553f['data']['length']-_0x2f4027['index'],_0x2f4027[0x0]['length']!==_0x34553f['data']['length'])break;_0x8902ac=!0x0,_0x28c13a='forward'===_0x2c6d34?/^\w+/:/\w+$/;}else{if(_0x8902ac)break;_0x381207+=_0x34553f['offsetSize'];}}else{if(_0x34553f['is']('element')){_0x11cf61['isInline'](_0x34553f)&&!_0x8902ac&&(_0x381207+=0x1);break;}}_0x9e7a53+=_0x381207,_0x1576b8['jumpTo'](_0x593641['getShiftedBy']('forward'===_0x2c6d34?_0x9e7a53:-_0x9e7a53));}return _0x9e7a53;}['_getChangeContext'](_0x3605e4,_0x5cdd5a){const _0x1d2371=T(this['context'])['model']['schema'],_0x15bcee=this['_findAdjacentContextDistance'](_0x3605e4,'backward',_0x1d2371,0x6),_0x39d8e0=this['_findAdjacentContextDistance'](_0x5cdd5a,'forward',_0x1d2371,0x6),_0x189dab=_0x3605e4['getShiftedBy'](-_0x15bcee),_0x3f9e2e=_0x5cdd5a['getShiftedBy'](_0x39d8e0);return{'start':_0x189dab,'end':_0x3f9e2e,'hasContentBefore':!_0x189dab['isAtStart'],'hasContentAfter':!_0x3f9e2e['isAtEnd']};}['_insertMarkers'](_0x29e590){const _0x350cfc=this['context']['plugins']['get']('AIEditing'),_0x401e9f=new Set();T(this['context'])['model']['change'](_0x53c1c5=>{for(const _0x3afdb0 of _0x29e590){const _0x2416c6=''+fe+_0x3afdb0['type']+':'+_0x3afdb0['groupId']+'_'+_0x350cfc['_nextDataId'](_0x401e9f);this['_markers']['set'](_0x2416c6,{'id':_0x2416c6,'groupId':_0x3afdb0['groupId'],'type':_0x3afdb0['type'],'content':_0x3afdb0['content']}),_0x53c1c5['addMarker'](_0x2416c6,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x53c1c5['createRange'](_0x3afdb0['start'],_0x3afdb0['end'])});}});}['_createGetContextFn'](_0xa91dbf,_0x232fbf,_0x3bd20b){let _0x84a66='';return()=>{if(!_0x84a66){const _0xc2b7d7=_0x232fbf['toView'](_0xa91dbf,{'showSuggestionHighlights':!0x0});let _0x2a451d=_0xc2b7d7['getChild'](0x0);if(_0x2a451d['is']('containerElement')||(_0x2a451d=_0xc2b7d7),!_0x2a451d)return'';let _0x5c775b=!0x1;const _0x502696=[];for(const _0xfdd2c2 of _0x2a451d['getChildren']())_0xfdd2c2['is']('element','span')&&_0xfdd2c2['hasClass']('ck-ai_review-marker_context-end')&&(_0x5c775b=!0x1),_0x5c775b&&_0x502696['push'](_0xfdd2c2),_0xfdd2c2['is']('element','span')&&_0xfdd2c2['hasClass']('ck-ai_review-marker_context-start')&&(_0x5c775b=!0x0);_0x2a451d['_removeChildren'](0x0,_0x2a451d['childCount']),_0x3bd20b?.['ellipsisBefore']&&_0x2a451d['_appendChild']('…'),_0x2a451d['_appendChild'](_0x502696),_0x3bd20b?.['ellipsisAfter']&&_0x2a451d['_appendChild']('…');const _0x15398f=_0x232fbf['htmlProcessor']['domConverter']['viewToDom'](_0xc2b7d7),_0x18e8c0=_0x232fbf['htmlProcessor']['htmlWriter']['getHtml'](_0x15398f);_0x84a66=_0x18e8c0;}return _0x84a66;};}['_createGetContentFn'](_0x4cffe8,_0xf0b922){let _0x49af80='';return()=>(_0x49af80||(_0x49af80=_0xf0b922['stringify'](_0x4cffe8,{'showSuggestionHighlights':!0x0})),_0x49af80);}['_createGetContentUsingDataIdFn'](_0x5bf6f2,_0x5c9c5e,_0xb5fe2a){let _0x5d4c2f='';return()=>{if(!_0x5d4c2f){const _0x687de7=_0xb5fe2a['toView'](new jt(_0x5bf6f2)),_0x38d693=_0xb5fe2a['htmlProcessor']['domConverter']['viewToDom'](_0x687de7)['querySelector']('[data-id=\x22'+_0x5c9c5e+'\x22]');_0x5d4c2f=_0x38d693?.['outerHTML']||'';}return _0x5d4c2f;};}['_findMarkerElement'](_0x136608,_0x1a6372=0x5){let _0x522bed=_0x136608,_0x4f68c2=null;for(let _0x114eea=0x0;_0x114eea<_0x1a6372&&_0x522bed;_0x114eea++){if(!_0x522bed['className']){_0x522bed=_0x522bed['parentElement'];continue;}if(!(''+_0x522bed['className'])['includes']('ck-ai_review-marker_')){_0x522bed=_0x522bed['parentElement'];continue;}if(!_0x522bed['getAttribute']('data-marker-id'))break;_0x4f68c2=_0x522bed;break;}return _0x4f68c2;}['_findMarkerElementById'](_0x476633){const _0x3b2693=T(this['context']),_0x28d4a0=_0x3b2693['model']['markers']['get'](_0x476633);return _0x28d4a0?_0x11336f(_0x3b2693['editing'],_0x28d4a0):null;}['_getMarkersDataForGroup'](_0x2e8e10){return Array['from'](this['_markers']['values']())['filter'](_0x32d156=>_0x32d156['groupId']===_0x2e8e10);}['_getOperationStart'](_0x3b09b8){return'insert'===_0x3b09b8['type']?_0x3b09b8['position']:_0x3b09b8['newRange']['start'];}['_getOperationEnd'](_0x5e8b3f,_0x5b1dbf=!0x1){return'insert'===_0x5e8b3f['type']?_0x5b1dbf?_0x5e8b3f['position']:_0x5e8b3f['position']['getShiftedBy'](_0x5e8b3f['howMany']):_0x5e8b3f['newRange']['end'];}['_shiftOperation'](_0x243626,_0x56f7e2){return'insert'===_0x243626['type']?_0x243626['position']=_0x243626['position']['getShiftedBy'](_0x56f7e2):'marker'===_0x243626['type']&&_0x243626['newRange']&&(_0x243626['newRange']=new dt(_0x243626['newRange']['start']['getShiftedBy'](_0x56f7e2),_0x243626['newRange']['end']['getShiftedBy'](_0x56f7e2))),_0x243626;}['_changeOperationOwnerDocument'](_0x5c5720,_0x5d71b6){'insert'===_0x5c5720['type']?_0x5c5720['position']=this['_changePositionOwnerDocument'](_0x5c5720['position'],_0x5d71b6):'marker'===_0x5c5720['type']&&_0x5c5720['newRange']&&(_0x5c5720['newRange']=this['_changeRangeOwnerDocument'](_0x5c5720['newRange'],_0x5d71b6));}['_changePositionOwnerDocument'](_0x502025,_0x38369e){return new Dt(_0x38369e,_0x502025['path']);}['_changeRangeOwnerDocument'](_0x7d016a,_0x265796){return new dt(this['_changePositionOwnerDocument'](_0x7d016a['start'],_0x265796),this['_changePositionOwnerDocument'](_0x7d016a['end'],_0x265796));}['_changePosition'](_0x4f3b41,_0x6398a7){return new Dt(_0x6398a7,[..._0x4f3b41]);}['_changeRange'](_0x476f68,_0x34baf1,_0x3d47e2,_0x22e2df){return new dt(this['_changePosition'](_0x34baf1,_0x22e2df),this['_changePosition'](_0x3d47e2,_0x22e2df));}['_sortMarkers'](_0x225fbf){const _0x530932=_0x4be2a5=>{switch(_0x4be2a5){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x225fbf['sort']((_0x5c96c6,_0x178d0e)=>_0x530932(_0x5c96c6['type'])-_0x530932(_0x178d0e['type']));}['_hasSameTopLevelElement'](_0x11a24f,_0x2bded8){const _0x5f0bca=_0x11a24f['getChild'](0x0),_0x35b110=_0x2bded8['getChild'](0x0);return!(!_0x5f0bca||!_0x35b110)&&((!_0x5f0bca['is']('element')||!_0x35b110['is']('element')||_0x5f0bca['name']===_0x35b110['name'])&&!(_0x5f0bca['is']('element')&&!_0x35b110['is']('element')||!_0x5f0bca['is']('element')&&_0x35b110['is']('element')));}['_haveSingleTopLevelElement'](_0x5d434c){return 0x1===_0x5d434c['childCount'];}['_haveOnlyInlineContent'](_0xb3add5,_0x1bce18){for(const _0x5bd6c7 of _0xb3add5['getChildren']())if(_0x5bd6c7['is']('element')&&!_0x1bce18['isInline'](_0x5bd6c7))return!0x1;return!0x0;}['_upsertDataId'](_0x26ed46,_0x251a20){let _0x4c89a2=_0x26ed46['getAttribute'](nt);return _0x4c89a2||(_0x4c89a2=_0x251a20(),_0x26ed46['_setAttribute'](nt,_0x4c89a2)),_0x4c89a2;}}class Ms extends _0x2eb18e(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x5314e6,contentNew:_0x1a07bb,contentInitial:_0x33a75a,documentVersion:_0x230e83}){super(),this['id']=_0x5314e6,this['contentNew']=_0x1a07bb,this['contentInitial']=_0x33a75a,this['documentVersion']=_0x230e83;}}class Os extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x29c99b,_0x12e28f,_0x15bf4e){super(),this['id']=_0x29c99b,this['parent']=_0x15bf4e,this['_data']=_0x12e28f,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 Js extends ts(){['id']=_0x41685d();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x543895,_0x2aaf1d,_0xb979a5,_0x372f5c,_0x23fdb3){super(),this['_sourceCheck']=_0x2aaf1d,this['_documentData']=_0x543895,this['_aiConnector']=_0xb979a5,this['_reviewParams']=_0x372f5c,this['_reviewArgs']=_0x23fdb3,this['on']('change:status',(_0x26ee58,_0x3ef5c5,_0x2995b5)=>{'aborted'==_0x2995b5&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x2995b5,'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'](_0x3fdcef=>'pending'===_0x3fdcef['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x55d720){this['_documentData']=_0x55d720;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x1b9ce9=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x27c489 of _0x1b9ce9)'unmodified'!==_0x27c489['data']['operation']&&('error'!==_0x27c489['data']['operation']?'review-metadata'!==_0x27c489['event']?this['_addReviewCheckResult'](_0x27c489['data']['dataId'],_0x27c489['data']['textDelta']):this['callId']=_0x27c489['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(_0x1f8e23){this['_currentError']=_0x1f8e23,_0x1f8e23 instanceof Error&&_0x1f8e23['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'](_0x40377a,_0x5f4015){const _0x1f7580=this['_results']['get'](_0x40377a);if(!_0x1f7580)return;if(0x0===_0x5f4015['length'])return;const _0x3f4f54=[];_0x5f4015['forEach']((_0x1286a2,_0xa350b)=>{const _0x3ef20a=new Os(_0x1f7580['id']+'-'+_0xa350b,_0x1286a2,_0x1f7580);_0x3ef20a['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x3ef20a,'status':_0x3ef20a['status']});}),_0x3ef20a['on']('change:isActivated',()=>{_0x3ef20a['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x3ef20a}):this['fire']('reviewCheckResultDeactivated',{'change':_0x3ef20a});}),this['_changes']['push'](_0x3ef20a),_0x3f4f54['push'](_0x3ef20a);}),this['fire']('reviewCheckResultReady',{'changes':_0x3f4f54,'result':_0x1f7580,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x38f7e1){const _0x1ab68a=this['_changes']['find'](_0x3b022a=>_0x3b022a['id']===_0x38f7e1);return!(!_0x1ab68a||'pending'!==_0x1ab68a['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x392cdc=>!0x0===_0x392cdc['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x34a772=>'pending'===_0x34a772['status']);}['getChangeById'](_0x3a1965){return this['_changes']['find'](_0x3e6d64=>_0x3e6d64['id']===_0x3a1965);}['markAllChangesAsAccepted'](){for(const _0x3d1f04 of this['_changes'])'pending'===_0x3d1f04['status']&&(_0x3d1f04['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x1d1e33){const _0x6deff6=this['_changes']['find'](_0xec39a4=>_0xec39a4['id']===_0x1d1e33);_0x6deff6&&'pending'===_0x6deff6['status']&&(_0x6deff6['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x40d358){const _0x57b291=this['_changes']['find'](_0x3c372b=>_0x3c372b['id']===_0x40d358);_0x57b291&&'pending'===_0x57b291['status']&&(_0x57b291['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x1cff40){const _0x864354=this['_changes']['find'](_0x3936a1=>_0x3936a1['id']===_0x1cff40);_0x864354&&'pending'===_0x864354['status']&&(_0x864354['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x51f822){const _0x1a29c4=this['_changes']['find'](_0x28a518=>_0x28a518['id']===_0x51f822);_0x1a29c4&&'outdated'===_0x1a29c4['status']&&(_0x1a29c4['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x594286){this['_changes']['filter'](_0x33738b=>_0x33738b['isActivated']&&_0x33738b['id']!==_0x594286)['forEach'](_0x13b19e=>{_0x13b19e['isActivated']=!0x1;});const _0x5d3e3f=this['_changes']['find'](_0x25a40f=>_0x25a40f['id']===_0x594286);_0x5d3e3f&&'pending'===_0x5d3e3f['status']&&(_0x5d3e3f['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x1b290e=>_0x1b290e['isActivated'])['forEach'](_0x495443=>{_0x495443['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0xa43b38){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x33944a;if(_0xa43b38){const _0x2f7a63=this['_changes']['find'](_0x1a03c1=>_0x1a03c1['id']===_0xa43b38);if(_0x2f7a63&&_0x2f7a63['isRated'])return;_0x2f7a63&&(_0x33944a=_0x2f7a63['parent']['id'],_0x2f7a63['isRated']=!0x0);}const _0x891702={'positiveCount':this['_changes']['filter'](_0x4c9422=>'accepted'===_0x4c9422['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x891702,this['callId'],_0x33944a);}['_addReviewCheckResult'](_0xca6354,_0x29b0d4){const _0x4ec261=this['_documentData']['elements']['get'](_0xca6354);if(!_0x4ec261)return;const _0xaf6a64=_0x4ec261['getContent']();if(_0xaf6a64===_0x29b0d4)return;const _0x35f5e1=new Ms({'id':_0xca6354,'contentInitial':_0xaf6a64,'contentNew':_0x29b0d4,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x35f5e1['id'],_0x35f5e1),this['fire']('reviewCheckResultAdded',{'result':_0x35f5e1,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x5034ae=>'pending'===_0x5034ae['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x4d222e=>'pending'===_0x4d222e['status'])['length']&&(this['status']='finished'));}}class si extends Js{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x490a08=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x38f39e=0x0;_0x38f39e<this['_reviewParams']['length'];_0x38f39e++){if(!this['_reviewParams'][_0x38f39e]||!this['_sourceCheck']['options'][_0x38f39e])continue;const _0x242e22=this['_sourceCheck']['options'][_0x38f39e],_0x4823e4=_0x242e22['data']?.['find'](_0xfe1d40=>_0xfe1d40['id']===this['_reviewParams'][_0x38f39e]);_0x4823e4&&_0x490a08['push'](_0x4823e4['label']);}return _0x490a08['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x4b8b57,_0x4ea658,_0x90928c){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x4ea658,_0x4b8b57,_0x90928c);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ve extends _0x4720c1{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[tt];}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(_0x3d60f1,_0xd91fcc)=>{const _0x4e2ed2=this['_aiReviewCheckList']['getCheckById'](_0xd91fcc['id']);if(_0x4e2ed2){this['_onReviewCheckRun'](_0xd91fcc),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0xd91fcc,_0x4e2ed2),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x18df3a,_0x2fdcd3)=>{switch(_0x2fdcd3['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x2fdcd3);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 _0x465bb5('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x465bb5('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'!==_0x2fdcd3['status']&&'error-chunk'!==_0x2fdcd3['status']&&'error-general'!==_0x2fdcd3['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x22e796,_0xe2f4ff)=>{if(!this['_currentReviewCheckRun'])throw new _0x465bb5('ai-review-mode-no-current-check-run',this);const _0x822107=this['_diffContent'](_0xe2f4ff['result']['contentInitial'],_0xe2f4ff['result']['contentNew']);_0xe2f4ff['source']['addResultChanges'](_0xe2f4ff['result']['id'],_0x822107);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x54f7cf,_0xce8cce)=>{for(const _0x581ab4 of _0xce8cce['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x581ab4);this['_markChangePositionInEditorContent'](_0xce8cce['changes'],_0xce8cce['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x41fae4,_0x419829)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x419829['change']['id'],_0x419829['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x1dd211,_0x32b079)=>{this['_onReviewCheckResultActivated'](_0x32b079);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x28f52b){_0x28f52b instanceof Error&&_0x28f52b['message']['includes']('ai-request-aborted')||(_0x28f52b instanceof _0x465bb5?this['_logError'](_0x28f52b):this['_logError'](new _0x465bb5('ai-review-mode-check-run-failed',this,void 0x0,_0x28f52b)));}}else this['_logError'](new _0x465bb5('ai-review-mode-source-check-not-found',this,{'checkId':_0xd91fcc['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 _0x1733c2=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x1733c2['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x1733c2['map'](_0x38eb64=>_0x38eb64['id']));const _0xdd6479=this['_currentReviewCheckRun'];_0xdd6479['markAllChangesAsAccepted'](),_0xdd6479['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x15a42b,_0x4318a4)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4318a4['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x4318a4['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x4318a4['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4318a4['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x32e5f4,_0x4cfe6e)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4cfe6e['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x4cfe6e['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x4cfe6e['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4cfe6e['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',(_0x5be268,_0x4a6d71)=>{this['_onActivateChange'](_0x4a6d71);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x1a9034,_0x3f6fea)=>{this['_onDeactivateChange'](_0x3f6fea);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x56e10e,_0x1e5d78)=>{this['_onChangeMarkerClicked'](_0x56e10e,_0x1e5d78);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x1aff58,_0xeec449)=>{this['_onChangeMarkerHovered'](_0x1aff58,_0xeec449);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x1cf982,_0x2c6654)=>{this['_onChangeMarkerRemoved'](_0x1cf982,_0x2c6654);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x37107e,_0x51e00e)=>{this['_onChangeMarkerRestored'](_0x37107e,_0x51e00e);});}['_createReviewCheckRun'](_0x34da9f,_0x112763){return new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x112763,this['_aiConnector'],_0x34da9f['params'],_0x34da9f['args']);}['_onChangeMarkerRemoved'](_0x363433,_0x3d6ebf){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x3d6ebf['changeId']);}['_onChangeMarkerRestored'](_0x545ba6,_0xc9e983){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0xc9e983['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x2b29fb=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x2b29fb&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x328cff=this['_aiReviewCoreEditing']['getEditor']();_0x328cff&&_0x328cff['editing']['view']['change'](_0x1b2389=>{const _0x4feabf=_0x328cff['editing']['view']['document']['getRoot']();_0x1b2389['removeClass']('ck-ai_review-diff',_0x4feabf),_0x1b2389['removeClass']('ck-ai_review-highlights',_0x4feabf),_0x1b2389['removeClass']('ck-ai-translate-mode-content',_0x4feabf);});}['_getTranslationWithDefault'](_0x3a2a25,_0x3ae710){const _0x1851e8=i(this['context']['locale'],_0x3a2a25);return _0x1851e8===_0x3a2a25?_0x3ae710:_0x1851e8;}['_logError'](_0x3c9eec,_0x103c2c=!0x1){_0x238b54(_0x3c9eec['message']),_0x103c2c||(_0x3c9eec['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x4ce8cb){if('content'===this['_changeActivationSource']){const _0x57f251=this['_aiReviewCoreUi']['getChangeElement'](_0x4ce8cb);_0x57f251&&_0x508662(_0x57f251['closest']('.ck-ai_review__check-run-result')||_0x57f251);}else{if('panel'===this['_changeActivationSource']){const _0x3fd697=this['_getChangeContentElement'](_0x4ce8cb);if(!_0x3fd697)return;_0x216c50({'target':_0x3fd697,'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(_0x354348){this['id']=_0x354348['id'],this['commandId']=_0x354348['commandId'],this['title']=_0x354348['title'],this['description']=_0x354348['description'],this['isParameterized']=_0x354348['isParameterized'],this['useArgs']=_0x354348['useArgs'],this['options']=_0x354348['options'],this['args']=_0x354348['args'];}}class po extends ts(){['_checks']=[];['setupChecks'](_0x522c47){this['_checks']=_0x522c47['map'](_0x1805ea=>new Ds(_0x1805ea));}get['checks'](){return this['_checks'];}['getCheckById'](_0x3531c9){return this['checks']['find'](_0x5d6770=>_0x5d6770['id']===_0x3531c9);}['removeCheckById'](_0x5c2bdd){this['_checks']=this['_checks']['filter'](_0x28e56f=>_0x28e56f['id']!==_0x5c2bdd);}}class ke extends Ds{['_models']=[];['_defaultModel']=null;constructor(_0x5df5de,_0x266803,_0x124778){super(_0x5df5de),this['_models']=_0x266803,this['_defaultModel']=_0x124778;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Ie extends Ds{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x26b98f,_0x289a9c,_0x152360){super(_0x26b98f),this['prompt']=_0x26b98f['prompt'],this['model']=_0x26b98f['model'],this['model']?this['_defaultModel']=_0x289a9c['find'](_0x4f0b1c=>_0x4f0b1c['id']===this['model'])||null:this['_defaultModel']=_0x152360;}get['defaultModel'](){return this['_defaultModel'];}}class _e extends po{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x57f84e,_0x4368e6,_0x23091d){super(),this['_allModels']=_0x57f84e,this['_recommendedModels']=_0x4368e6,this['_defaultModel']=_0x23091d;}['setupChecks'](_0x455252){this['_checks']=_0x455252['map'](_0x4bd9d3=>!0x0===_0x4bd9d3['isExtra']?new Ie(_0x4bd9d3,this['_allModels'],this['_defaultModel']):'custom'===_0x4bd9d3['id']?new ke(_0x4bd9d3,this['_recommendedModels'],this['_defaultModel']):new Ds(_0x4bd9d3));}}class Ce extends Js{['_prompt'];['_model'];constructor(_0x3d857c,_0x55f096,_0x568594,_0x22e412,_0x53464d){super(_0x568594,_0x22e412,_0x53464d),this['_prompt']=_0x3d857c,this['_model']=_0x55f096;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x56a3d4,_0xf075cf,_0x384254){return this['_aiConnector']['upsertCustomAIReviewRating'](_0xf075cf,_0x56a3d4,_0x384254);}}class Re extends Ce{get['subTitle'](){return'';}set['prompt'](_0x44696a){this['_prompt']=_0x44696a;}set['model'](_0x4d9148){this['_model']=_0x4d9148;}}class pe extends ve{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x286d06){super(_0x286d06),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',we['map'](_0x28998b=>_0x28998b['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x1aa3ac,_0x4abdeb)=>{this['_isDiffOn']=_0x4abdeb['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x320401,_0x5b81fe){return _0x320401['isCustom']?new Ce(_0x320401['args']['prompt'],_0x320401['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x5b81fe,this['_aiConnector']):_0x5b81fe['isExtra']?new Re(_0x5b81fe['prompt'],_0x5b81fe['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x5b81fe,this['_aiConnector']):new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x5b81fe,this['_aiConnector'],_0x320401['params'],_0x320401['args']);}['_onReviewCheckResultActivated'](_0x2b0409){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x2b0409['change']['id']),this['_scrollToChange'](_0x2b0409['change']['id']);const _0xe96d95=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x2b0409['change']['id']);if(!_0xe96d95)return;const _0x10e675=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2b0409['change'],()=>_0xe96d95['getElement'](),void 0x0,'click',_0x10e675?.['editing']?.['view']?.['getDomRoot'](),_0x10e675?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x2b0409['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x3bc560){this['_currentReviewCheckRun']&&'click'===_0x3bc560['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x3bc560['id']));}['_onDeactivateChange'](_0x48c5e0){this['_currentReviewCheckRun']&&'balloon'===_0x48c5e0['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x4e3209,_0x2cea10){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x2cea10['changeId']);const _0x5accc1=this['_currentReviewCheckRun']['getChangeById'](_0x2cea10['changeId']);if(!_0x5accc1)return;const _0x3d5da0=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x5accc1,_0x2cea10['markerElement'],_0x2cea10['domEvent'],'click',_0x3d5da0?.['editing']?.['view']?.['getDomRoot'](),_0x3d5da0?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x192d25,_0x3d4784){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0xdc9691=this['_currentReviewCheckRun']['getChangeById'](_0x3d4784['changeId']);if(!_0xdc9691)return;const _0x1ceae2=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0xdc9691,_0x3d4784['markerElement'],_0x3d4784['domEvent'],'hover',_0x1ceae2?.['editing']?.['view']?.['getDomRoot'](),_0x1ceae2?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x221a5c){const _0x57d027=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x221a5c);return _0x57d027?_0x57d027['getElement']():null;}['_markChangePositionInEditorContent'](_0x400838,_0xeba1e4){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x400838,_0xeba1e4);}['_diffContent'](_0x4af464,_0x1aa0f4){return this['_aiReviewCoreEditing']['diffContent'](_0x4af464,_0x1aa0f4);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0xd8ddb1){const _0x912b3a=this['_aiReviewCoreEditing']['getEditor']();_0xd8ddb1?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x912b3a&&_0x912b3a['editing']['view']['change'](_0x54fa32=>{const _0x2230fe=_0x912b3a['editing']['view']['document']['getRoot']();for(const _0x540366 of _0x2230fe['getClassNames']())_0x540366['startsWith']('ck-ai_review-')&&_0x54fa32['removeClass'](_0x540366,_0x2230fe);_0x54fa32['addClass'](_0xd8ddb1?'ck-ai_review-diff':'ck-ai_review-highlights',_0x2230fe);});}async['_getChecksList'](){const _0x58bd8b=[...we,...this['_getExtraChecks']()],_0x3457b2=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x3457b2,_0x58bd8b);let _0x15a2a3=_0x58bd8b;this['_hasDefaultAvailableCommands']||(_0x15a2a3=_0x3457b2['map'](_0xce9738=>_0x58bd8b['find'](_0x5e05c4=>_0x5e05c4['id']===_0xce9738))['filter'](_0x1dce6a=>!!_0x1dce6a)),_0x15a2a3=_0x15a2a3['map'](_0x27100f=>_0x27100f['isExtra']?_0x27100f:this['_translateReviewCheck'](_0x27100f));const _0xb81fc1=_0x15a2a3['some'](_0x1b9af5=>_0x1b9af5['isExtra']||'custom'===_0x1b9af5['id']);let _0x1e4d17=[],_0x1369a2=[],_0x430ef7=null;if(_0xb81fc1){const _0x57874d=await this['_getModels']();_0x1e4d17=_0x57874d['all'],_0x1369a2=_0x57874d['recommended'],_0x430ef7=_0x57874d['default'];}const _0x2c27ab=new _e(_0x1e4d17,_0x1369a2,_0x430ef7);return _0x2c27ab['setupChecks'](_0x15a2a3),_0xb81fc1&&this['_filterChecksWithMissingModel'](_0x2c27ab),_0x2c27ab;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x540a1e=>({'id':_0x540a1e['id'],'commandId':_0x540a1e['id'],'title':_0x540a1e['label'],'description':_0x540a1e['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x540a1e['prompt'],'model':_0x540a1e['model']}));}['_logErrorForNonExistentChecks'](_0x44ac46,_0x3054bf){const _0x2b25fe=_0x44ac46['filter'](_0x23a6b6=>!_0x3054bf['some'](_0x596751=>_0x596751['id']===_0x23a6b6));_0x2b25fe['length']&&this['_logError'](new _0x465bb5('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x2b25fe['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x15251f=new et({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x15251f['getAll'](),'recommended':await _0x15251f['getAvailableModels'](),'default':await _0x15251f['getDefault']()};}catch(_0x48d241){return this['_logError'](new _0x465bb5('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x48d241)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x3c5a50){const _0x1194d1='AI_REVIEW_CHECK_'+_0x3c5a50['id']['toUpperCase']()['replaceAll']('-','_'),_0x547f3b={..._0x3c5a50,'title':this['_getTranslationWithDefault'](_0x1194d1+'_TITLE',_0x3c5a50['title']),'description':this['_getTranslationWithDefault'](_0x1194d1+'_DESCRIPTION',_0x3c5a50['description'])};return _0x3c5a50['options']&&(_0x547f3b['options']=_0x3c5a50['options']['map'](_0x4f69cf=>({..._0x4f69cf,'label':this['_getTranslationWithDefault'](_0x1194d1+'_OPTIONS_LABEL',_0x4f69cf['label']||''),'data':_0x4f69cf['data']?_0x4f69cf['data']['map'](_0x38c206=>({..._0x38c206,'label':this['_getTranslationWithDefault'](_0x1194d1+'_OPTIONS_DATA_'+_0x38c206['id']['toUpperCase'](),_0x38c206['label'])})):void 0x0}))),_0x547f3b;}['_filterChecksWithMissingModel'](_0x1a48da){const _0x1e40c9=[];_0x1a48da['checks']['forEach'](_0x4c6156=>{(_0x4c6156 instanceof Ie&&!_0x4c6156['defaultModel']||_0x4c6156 instanceof ke&&!_0x4c6156['models']['length'])&&_0x1e40c9['push'](_0x4c6156['id']);}),_0x1e40c9['length']&&_0x1e40c9['forEach'](_0x317f85=>{_0x1a48da['removeCheckById'](_0x317f85),this['_logError'](new _0x465bb5('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x317f85}),!0x0);});}}class AIReviewMode extends _0x4720c1{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 po{['setupChecks'](_0xbb6b50){this['_checks']=_0xbb6b50['map'](_0x32025b=>new jr(_0x32025b));}}class Se extends si{['_title'];constructor(_0x4670ac,_0x318667,_0x377253,_0x2ff80b,_0x34c135,_0x43090e){super(_0x4670ac,_0x318667,_0x377253,_0x34c135,_0x43090e),this['_title']=_0x2ff80b;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ve{static get['pluginName'](){return'AITranslateController';}constructor(_0x236447){super(_0x236447),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'](_0xbff53,_0x553b63){return new Se(this['_aiReviewCoreEditing']['getDocumentData'](),_0x553b63,this['_aiConnector'],i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0xbff53['params'],_0xbff53['args']);}['_onReviewCheckResultActivated'](_0x5c2440){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x5c2440['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x5c2440['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x29d522){this['_currentReviewCheckRun']&&('hover'===_0x29d522['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x29d522['id'])),'click'===_0x29d522['uiInteraction']&&this['_scrollToChange'](_0x29d522['id']));}['_onDeactivateChange'](_0x2c8b15){this['_currentReviewCheckRun']&&'panel'===_0x2c8b15['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x1d6255,_0x14dfc0){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x14dfc0['changeId']),this['_scrollToChange'](_0x14dfc0['changeId']));}['_onChangeMarkerHovered'](_0x16212a,_0x452892){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x452892['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x452892['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x471c41){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x471c41);}['_markChangePositionInEditorContent'](_0x383c30,_0x234b6f){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x383c30,_0x234b6f);}['_diffContent'](_0x3491b0,_0x5f2b3e){return this['_aiReviewCoreEditing']['diffContent'](_0x3491b0,_0x5f2b3e,!0x0);}['_onReviewCheckRun'](){const _0xe14f01=this['_aiReviewCoreEditing']['getEditor']();_0xe14f01&&_0xe14f01['editing']['view']['change'](_0x3de188=>{const _0xeef25e=_0xe14f01['editing']['view']['document']['getRoot']();for(const _0xe4da71 of _0xeef25e['getClassNames']())(_0xe4da71['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0xe4da71)&&_0x3de188['removeClass'](_0xe4da71,_0xeef25e);_0x3de188['addClass']('ck-ai-translate-mode-content',_0xeef25e);});}async['_getChecksList'](){const _0x33dfb2=[],_0x1bfb85=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x42e47a of _0x1bfb85)_0x33dfb2['push']({'title':_0x42e47a['label'],'id':_0x42e47a['id'],'commandId':_0x42e47a['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x42e47a['id']}});const _0x146c2e=new Pe();return _0x146c2e['setupChecks'](this['_translateChecks'](_0x33dfb2)),_0x146c2e;}['_translateChecks'](_0x580931){return _0x580931['map'](_0x581c6e=>{const _0x23c7b3='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x581c6e['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x581c6e,'title':this['_getTranslationWithDefault'](_0x23c7b3,_0x581c6e['title'])};});}}class Le extends Ve{constructor(_0x599520,_0x382767){super(_0x599520,_0x382767),this['on']('set:isLoading',(_0x2d0e89,_0x49ccce,_0x34fccb)=>{_0x34fccb&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x263506,_0x2a4b8e,_0xf95ee0)=>{_0xf95ee0&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x1b1117=super['_createAcceptAllButtonView']();return _0x1b1117['set']('label',i(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x1b1117;}['_createExitReviewButtonView'](){const _0xdd6f32=super['_createExitReviewButtonView']();return _0xdd6f32['set']('label',i(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0xdd6f32;}}class Ne extends je{['_setupTemplate'](){const _0x48a320=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x48a320['if']('isVisible','ck-hidden',_0x4a2d48=>!_0x4a2d48)]},'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',_0x48a320['if']('isVisible','ck-hidden',_0x4268ad=>!_0x4268ad)]},'children':this['_checkViews']}]});}}class tr extends Me{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x554c17=this['context']['locale'],_0x32c407=new _0x473725(_0x554c17,{'label':i(_0x554c17,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x45549a,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x2f5f56=new Ae(_0x554c17,{'header':_0x32c407,'list':new Ne(_0x554c17),'results':new Le(_0x554c17,{'generalErrorText':i(_0x554c17,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x554c17,{'headerText':i(_0x554c17,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':i(_0x554c17,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x554c17,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x2f5f56['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x2f5f56;}['registerTab'](){const _0x3f0064=this['context']['plugins']['get']('AITabs');_0x3f0064['view']['on']('activateTab',(_0x14631b,_0x1a61ab)=>{'translate'===_0x1a61ab?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x3f0064['view']['addTab']({'id':'translate','buttonLabel':i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x45549a,'order':0x0,'content':this['_mainView']});}}class AITranslate extends _0x4720c1{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,AIAssistant,n as AIAssistantUI,H as AIBalloon,AIChat,q as AIChatController,G as AIChatHistory,ft as AIChatHistoryController,yt as AIChatHistoryUI,AIChatShortcuts,z as AIChatUI,tt as AIConnector,D as AIEditing,AIEditorIntegration,Qt as AIQuickActionType,AIQuickActions,ii as AIQuickActionsUI,er as AIRequestError,Ds as AIReviewCheck,Ms as AIReviewCheckResult,Js as AIReviewCheckRun,AIReviewMode,ve as AIReviewModeController,de as AIReviewModeEditing,ge as AIReviewModeUI,it as AITabs,ar as AITextAdapter,Pt as AIToggleButtonUI,AITranslate,rr as AITranslateController,tr as AITranslateUI,AWSTextAdapter,OpenAITextAdapter,E as ShowAIAssistantCommand,io as ToggleAICommand,us as createResizeButton,Wn as getDefaultAICommands};