@ckeditor/ckeditor5-ai 47.6.0-alpha.8 → 47.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/build/ai.js +1 -1
  2. package/dist/index.js +5 -5
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +15 -15
  150. package/src/aiactions/aiactions.js +1 -1
  151. package/src/aiactions/model/aiactionsinteraction.js +1 -1
  152. package/src/aiactions/model/aiactionsreply.js +1 -1
  153. package/src/aiassistant/adapters/aiadapter.js +1 -1
  154. package/src/aiassistant/adapters/aitextadapter.js +1 -1
  155. package/src/aiassistant/adapters/awstextadapter.js +1 -1
  156. package/src/aiassistant/adapters/openaitextadapter.js +1 -1
  157. package/src/aiassistant/aiassistant.js +1 -1
  158. package/src/aiassistant/aiassistantediting.js +1 -1
  159. package/src/aiassistant/aiassistantui.js +1 -1
  160. package/src/aiassistant/legacyerrors.js +1 -1
  161. package/src/aiassistant/ui/aiassistantcontroller.js +2 -2
  162. package/src/aiassistant/ui/form/aiformcontentarea.js +1 -1
  163. package/src/aiassistant/ui/form/aiformerrorview.js +1 -1
  164. package/src/aiassistant/ui/form/aiformpromptview.js +1 -1
  165. package/src/aiassistant/ui/form/aiformtoolbarview.js +1 -1
  166. package/src/aiassistant/ui/form/aiformview.js +1 -1
  167. package/src/aiassistant/ui/form/aihistorylistitemview.js +1 -1
  168. package/src/aiassistant/ui/form/aihistorylistview.js +1 -1
  169. package/src/aiassistant/ui/form/prompthistory.js +1 -1
  170. package/src/aiassistant/ui/showaiassistantcommand.js +1 -1
  171. package/src/aiassistant/utils/common-translations.js +1 -1
  172. package/src/aiassistant/utils/normalizecommandsconfig.js +1 -1
  173. package/src/aiballoon/aiballoon.js +1 -1
  174. package/src/aiballoon/ui/aiballoonview.js +1 -1
  175. package/src/aichat/aichat.js +1 -1
  176. package/src/aichat/aichatballoon.js +1 -1
  177. package/src/aichat/aichatcontroller.js +1 -1
  178. package/src/aichat/aichatui.js +1 -1
  179. package/src/aichat/model/aichatcontext.js +1 -1
  180. package/src/aichat/model/aichatconversation.js +1 -1
  181. package/src/aichat/model/aichatinteraction.js +1 -1
  182. package/src/aichat/ui/aichatballoonview.js +1 -1
  183. package/src/aichat/ui/aichatcontrolsview.js +1 -1
  184. package/src/aichat/ui/aichatfeedview.js +1 -1
  185. package/src/aichat/ui/aichatheaderview.js +1 -1
  186. package/src/aichat/ui/aichatview.js +1 -1
  187. package/src/aichat/ui/controls/aichatchipsoverflowmanager.js +1 -1
  188. package/src/aichat/ui/controls/aichatcontextitembuttonview.js +1 -1
  189. package/src/aichat/ui/controls/aichatcontextpanelurlinputview.js +1 -1
  190. package/src/aichat/ui/controls/aichatcontextpanelview.js +1 -1
  191. package/src/aichat/ui/controls/aichatcontrolsloaderview.js +1 -1
  192. package/src/aichat/ui/controls/aichatpromptcapabilitiesview.js +1 -1
  193. package/src/aichat/ui/controls/aichatpromptinputview.js +1 -1
  194. package/src/aichat/ui/controls/aichatpromptsuggestionslistview.js +1 -1
  195. package/src/aichat/ui/controls/resources/aichatcontextresourceslistview.js +1 -1
  196. package/src/aichat/ui/controls/resources/aichatcontextresourcesview.js +1 -1
  197. package/src/aichat/ui/controls/resources/aichatresourcelistitemview.js +1 -1
  198. package/src/aichat/ui/controls/resources/aichatresourcesballoonview.js +1 -1
  199. package/src/aichat/ui/controls/resources/aichatresourcessearchinputview.js +1 -1
  200. package/src/aichat/ui/feed/aichatfeedcontextchipsview.js +1 -1
  201. package/src/aichat/ui/feed/aichatfeedcustomelementview.js +1 -1
  202. package/src/aichat/ui/feed/aichatfeederroritemview.js +1 -1
  203. package/src/aichat/ui/feed/aichatfeedinteractionheaderview.js +1 -1
  204. package/src/aichat/ui/feed/aichatfeeditemview.js +1 -1
  205. package/src/aichat/ui/feed/aichatfeedreplyitemview.js +1 -1
  206. package/src/aichat/ui/feed/aichatfeedsuggestionitemactionsview.js +1 -1
  207. package/src/aichat/ui/feed/aichatfeedsuggestionitemview.js +1 -1
  208. package/src/aichat/ui/feed/aichatfeedusermessageitem.js +1 -1
  209. package/src/aichat/utils/eventnames.js +1 -1
  210. package/src/aichat/utils/promisequeue.js +1 -1
  211. package/src/aichathistory/aichathistory.js +1 -1
  212. package/src/aichathistory/aichathistorycontroller.js +1 -1
  213. package/src/aichathistory/aichathistoryui.js +1 -1
  214. package/src/aichathistory/model/aichathistoryconversations.js +1 -1
  215. package/src/aichathistory/model/aichathistoryitem.js +1 -1
  216. package/src/aichathistory/ui/aichathistorylistitemview.js +2 -2
  217. package/src/aichathistory/ui/aichathistorylistview.js +1 -1
  218. package/src/aichathistory/ui/aichathistorysectionlistview.js +1 -1
  219. package/src/aichathistory/ui/aichathistoryview.js +1 -1
  220. package/src/aichatshortcuts/aichatshortcuts.js +1 -1
  221. package/src/aichatshortcuts/ui/aichatshortcutsview.js +1 -1
  222. package/src/aichatshortcuts/ui/aichatshortcutview.js +1 -1
  223. package/src/aicore/aiconnector.js +1 -1
  224. package/src/aicore/aiediting.js +1 -1
  225. package/src/aicore/model/aicapabilities.js +1 -1
  226. package/src/aicore/model/aicontext.js +1 -1
  227. package/src/aicore/model/aiinteraction.js +1 -1
  228. package/src/aicore/model/aimodels.js +1 -1
  229. package/src/aicore/model/aireply.js +1 -1
  230. package/src/aicore/pipeline/airesponseapplier.js +2 -2
  231. package/src/aicore/pipeline/airesponseparser.js +2 -2
  232. package/src/aicore/ui/aidisclaimerview.js +1 -1
  233. package/src/aicore/ui/aiskeleton.js +1 -1
  234. package/src/aicore/ui/aispinner.js +1 -1
  235. package/src/aicore/ui/suggestioncontainer/aiminitoolbarview.js +1 -1
  236. package/src/aicore/ui/suggestioncontainer/aisuggestionbodyview.js +1 -1
  237. package/src/aicore/ui/suggestioncontainer/aisuggestioncontainerview.js +1 -1
  238. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartheaderview.js +1 -1
  239. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartstateview.js +1 -1
  240. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentparttoolbarview.js +1 -1
  241. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.js +1 -1
  242. package/src/aicore/ui/suggestioncontainer/aisuggestionheaderview.js +1 -1
  243. package/src/aicore/ui/suggestioncontainer/aisuggestionloaderview.js +1 -1
  244. package/src/aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.js +1 -1
  245. package/src/aicore/ui/suggestioncontainer/aiwebsourcesview.js +1 -1
  246. package/src/aicore/utils/common-translations.js +1 -1
  247. package/src/aicore/utils/createresizebutton.js +1 -1
  248. package/src/aicore/utils/documentposition.js +1 -1
  249. package/src/aicore/utils/documentrange.js +1 -1
  250. package/src/aicore/utils/eventnames.js +1 -1
  251. package/src/aicore/utils/geteditorfromcontext.js +1 -1
  252. package/src/aicore/utils/getoperationsfromreply.js +1 -1
  253. package/src/aicore/utils/getsuggestionpartsfromreply.js +1 -1
  254. package/src/aicore/utils/htmlparser.js +1 -1
  255. package/src/aicore/utils/htmlstreamer.js +1 -1
  256. package/src/aicore/utils/scrollmanager.js +1 -1
  257. package/src/aieditorintegration/aieditorintegration.js +1 -1
  258. package/src/aieditorintegration/aitogglebutton/aitogglebuttonui.js +1 -1
  259. package/src/aieditorintegration/aitogglebutton/toggleaicommand.js +1 -1
  260. package/src/aiquickactions/aiquickactions.js +1 -1
  261. package/src/aiquickactions/aiquickactionscommand.js +1 -1
  262. package/src/aiquickactions/aiquickactionsediting.js +1 -1
  263. package/src/aiquickactions/aiquickactionsui.js +1 -1
  264. package/src/aiquickactions/ui/aiquickactionsbuttoncreator.js +1 -1
  265. package/src/aiquickactions/ui/aiquickactionsdropdowncontentview.js +1 -1
  266. package/src/aiquickactions/ui/aiquickactionsdropdowncreator.js +1 -1
  267. package/src/aiquickactions/ui/aiquickactionsfilteredlistview.js +1 -1
  268. package/src/aiquickactions/ui/balloon/aiactionsballoondisclaimerview.js +1 -1
  269. package/src/aiquickactions/ui/balloon/aiactionsballoontoolbarview.js +1 -1
  270. package/src/aiquickactions/ui/balloon/aiactionsballoonview.js +1 -1
  271. package/src/aiquickactions/ui/dropdownmenubuttonwithhighlightview.js +1 -1
  272. package/src/aireviewcore/aireviewcorecontroller.js +1 -1
  273. package/src/aireviewcore/aireviewcoreediting.js +1 -1
  274. package/src/aireviewcore/aireviewcoreui.js +1 -1
  275. package/src/aireviewcore/model/aireviewcheck.js +1 -1
  276. package/src/aireviewcore/model/aireviewchecklist.js +1 -1
  277. package/src/aireviewcore/model/aireviewcheckresult.js +1 -1
  278. package/src/aireviewcore/model/aireviewcheckresultchange.js +1 -1
  279. package/src/aireviewcore/model/aireviewcheckrun.js +1 -1
  280. package/src/aireviewcore/model/aireviewsystemcheckrun.js +1 -1
  281. package/src/aireviewcore/ui/aireviewcoreballoonsuggestionview.js +1 -1
  282. package/src/aireviewcore/ui/aireviewcorechecklistitemresultview.js +1 -1
  283. package/src/aireviewcore/ui/aireviewcorecustomcheckview.js +1 -1
  284. package/src/aireviewcore/ui/aireviewcorefinishreviewbuttonview.js +1 -1
  285. package/src/aireviewcore/ui/aireviewcoregeneralerrorview.js +1 -1
  286. package/src/aireviewcore/ui/aireviewcorepromptinputview.js +1 -1
  287. package/src/aireviewcore/ui/aireviewcorereviewchecklistview.js +1 -1
  288. package/src/aireviewcore/ui/aireviewcorereviewcommandlistitemview.js +1 -1
  289. package/src/aireviewcore/ui/aireviewcorereviewcompletedview.js +1 -1
  290. package/src/aireviewcore/ui/aireviewcoreuicheckresultsview.js +1 -1
  291. package/src/aireviewcore/ui/aireviewcoreview.js +1 -1
  292. package/src/aireviewcore/ui/form/aireviewcoreformdropdown.js +1 -1
  293. package/src/aireviewcore/ui/form/aireviewcoreformmanager.js +1 -1
  294. package/src/aireviewmode/aireviewcheckdefinitions.js +1 -1
  295. package/src/aireviewmode/aireviewmode.js +1 -1
  296. package/src/aireviewmode/aireviewmodecontroller.js +1 -1
  297. package/src/aireviewmode/aireviewmodeui.js +1 -1
  298. package/src/aireviewmode/model/aireviewcheckcustom.js +1 -1
  299. package/src/aireviewmode/model/aireviewcheckextra.js +1 -1
  300. package/src/aireviewmode/model/aireviewcustomcheckrun.js +1 -1
  301. package/src/aireviewmode/model/aireviewextracheckrun.js +1 -1
  302. package/src/aireviewmode/model/aireviewmodechecklist.js +1 -1
  303. package/src/aitabs/aitabs.js +1 -1
  304. package/src/aitabs/aitabsmainview.js +1 -1
  305. package/src/aitabs/tabs/aitabsview.js +1 -1
  306. package/src/aitabs/tabs/tabbuttonview.js +1 -1
  307. package/src/aitabs/tabs/tabpanelview.js +1 -1
  308. package/src/aitranslate/aitranslate.js +1 -1
  309. package/src/aitranslate/aitranslatecontroller.js +1 -1
  310. package/src/aitranslate/aitranslateui.js +1 -1
  311. package/src/aitranslate/model/aitranslatecheck.js +1 -1
  312. package/src/aitranslate/model/aitranslatechecklist.js +1 -1
  313. package/src/aitranslate/model/aitranslatecheckrun.js +1 -1
  314. package/src/aitranslate/ui/aitranslatechecklistview.js +1 -1
  315. package/src/aitranslate/ui/aitranslatecheckresultsview.js +1 -1
  316. package/src/errors.js +1 -1
  317. package/src/errorsmap.js +1 -1
  318. package/src/index.js +1 -1
package/dist/index.js CHANGED
@@ -20,8 +20,8 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x38fe65,Command as Lt,ContextPlugin as _0x479a76,Editor as dt}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x2fc9a2,IconCheck as _0x44dfa1,IconError as _0x21428b,IconSubmit as _0x5ca66c,IconAIHistory as Nt,IconMagicWand as _0x5e7576,IconRobotPencil as _0x55b603,IconMaximize as _0x14f6c9,IconMinimize as _0x38ccb9,IconShowChangesOn as _0x466c2c,IconShowChangesOff as _0xcc61bd,IconDocument as _0x19edfe,IconBoxWithCross as _0x33843a,IconBoxWithCheck as _0xe39f1c,IconBoxWithMarker as _0x16c628,IconInfo as tc,IconLoupe as _0x44344e,IconCancel as _0x57255f,IconStop as _0x3d3372,IconAIChat as vt,IconPlus as _0x36e89f,IconPin as _0x21ba95,IconThreeHorizontalDots as _0x164ae1,IconChevronDown as _0x4a4dcc,IconChevronUp as _0x341559,IconOutdated as _0x45d10f,IconEye as _0x344a06,IconEyeCrossedOut as _0x2721df,IconChevronRight as _0x3d211d,IconAIReview as _0x42b4b2,IconAITranslate as _0x5b2e29}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x3d9d4e,CKEditorError as _0x459533,ObservableMixin as ts,global as _0x10b14d,isVisible as _0x4d96fb,Rect as _0x473971,Collection as _0x537dd4,FocusTracker as _0x39e72a,KeystrokeHandler as _0x2ecfe9,first as _0x1bf09b,toArray as _0x48bc65,EmitterMixin as _0x5d3056,logWarning as _0x31be16,logError as gt,scrollViewportToShowTarget as _0x53c419,scrollAncestorsToShowTarget as _0x3df2b3,ResizeObserver as _0x38f197,_isMotionReduced as Rt,getConstrainedViewportRect as _0x39de53,DomEmitterMixin as _0x2c2f77}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x3ccac8,ButtonView as _0x4e2d9f,View as _0x13ab0e,SpinnerView as _0x4d4103,IconView as _0x5495d5,AutocompleteView as _0x100fb1,ListView as _0x5f5dca,ListItemGroupView as _0x14c408,ListItemView as _0x27607e,ButtonLabelView as _0x9d7a0a,FocusCycler as _0x2ca20b,createLabeledTextarea as _0x4dfb61,Dialog as _0x52fe49,createDropdown as _0xb2afd1,addMenuToDropdown as _0x2da092,MenuBarMenuView as _0x399f5a,MenuBarMenuListItemButtonView as _0x19bfd7,DialogViewPosition as _0x2ba6b7,MenuBarMenuListView as _0x408ee4,MenuBarMenuListItemView as _0x1d2bc6,BodyCollection as _0xb3f722,BalloonPanelView as _0x551ec5,clickOutsideHandler as _0x570ad6,addListToDropdown as _0x319e41,UIModel as _0x26835d,submitHandler as _0x8e6905,LabeledFieldView as _0x25e34,createLabeledInputText as _0x1b22ce,FormHeaderView as _0x41a033,HighlightedTextView as _0x8fe7c,ViewCollection as _0x1562eb,FileDialogButtonView as _0xef292e,InputTextView as _0x22f961,SearchTextView as _0x41f7cc,ListItemButtonView as _0x1b09b3,ButtonLabelWithHighlightView as _0x2fcff1,DropdownMenuPanelPositioningFunctions as _0x3bd02b,BalloonToolbar as te,FormRowView as _0x41c5ae,TextareaView as _0x5eb035}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x2eed9d,ClipboardMarkersUtils as _0x17d7be}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x67347b,ViewDataTransfer as _0x22df6e,ViewUpcastWriter as _0x42f24c,Matcher as _0x4e8377,_DetachOperation as et,_insertIntoModelNodeList as _0x1f8e27,_removeFromModelNodeList as to,ModelRange as it,transformOperationSets as nt,ViewDowncastWriter as Dt,ModelDocumentFragment as tt,ModelPosition as st,ModelTreeWalker as _0x5445d5,MarkerOperation as _0x4f8962,InsertOperation as _0x1f1f5c}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x4042b3,escape as _0x210da0,escapeRegExp as _0x5553e0,debounce as _0x661314}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x2e08ca,InvokeModelWithResponseStreamCommand as _0x470573,InvokeModelCommand as _0x2ba763}from'@aws-sdk/client-bedrock-runtime';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x2be6e6}from'htmlparser2';import{isTag as _0x1d78cd,findOne as yt,getParent as _0x33c249,findAll as _0x2cfca1,removeElement as _0x187273,replaceElement as _0x41a070,prepend as _0x1e7915,prependChild as _0x14505f,appendChild as _0x50edfc,append as _0x1a4c25,find as _0x25fd48,isComment as _0x1d9f63,getChildren as _0x617e3b,textContent as _0x421916}from'domutils';import _0x59f43c from'dom-serializer';import{Document as Et,Element as _0x1fb8c4,Text as _0x29d6b1,cloneNode as _0x23cae7,isDocument as _0x1b732d,isText as _0x4bd0e8,NodeWithChildren as _0x25cfb7}from'domhandler';import{MarkdownGfmMdToHtml as _0x5c491a}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x4ddaa8,DocumentCompare as _0x18ff34,DATA_ID_MODEL_ATTRIBUTE as Ct,ConfirmMixin as _0xfb1d37,LateFocusDropdownButtonView as _0x5c8ac6,getAllMarkersDomElementsSorted as _0x2fb7f4,SuggestionsConversion as zt,DATA_ID_VIEW_ATTRIBUTE as _0x35106c,getMarkerDomElement as _0x11ff21}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x4e1a4d}from'es-toolkit';import _0xfeb52e from'morphdom';import{IconWeb as _0x4b3f58,IconClose as _0x49e645,IconDocument as _0x29c8bf,IconSelection as _0x1ac94e,IconFileUpload as _0x53d476,IconLink as _0x3635cf,IconBulb as _0x2a3269,IconAI as _0xb351b0,IconPreviousArrow as _0x43ac1c,IconCheck as _0x5c7a27,IconDocumentOutline as _0x4fa1af,IconPaperClip as _0x58ca13,IconBrowseFiles as _0x5c1bc0,IconDropdownArrow as _0x58790d,IconAIChat as _0x2e8a6e,IconAIReview as _0x17dcaf,IconAITranslate as Vt,IconAIAskAI as _0x27b938,IconThumbUp as _0x278a76,IconThumbDown as _0x9158bb,IconCopy as _0x5d6164,IconShowChangesOff as _0x1cf883,IconShowChangesOn as _0x580059,IconAIQuickActions as _0x17d053,IconAIChatCommands as Gt,IconAIImproveWriting as Bt,IconAIContinueWriting as Ft,IconAIGrammarCheck as Wt,IconAIAdjustLength as Kt,IconAIChangeTone as Yt,IconAIOther as Jt,IconRefresh as _0x131fa2,IconNextArrow as _0x1d2a7b}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x14dd80}from'diff';const x='_ungrouppedCommands';function o(_0x49f87c,_0x24e3b6){const _0x52288d=(0x0,_0x24e3b6['t'])('Other');return _0x49f87c['length']?'groupId'in _0x49f87c[0x0]?_0x49f87c:[{'groupId':x,'groupLabel':_0x52288d,'order':0x1/0x0,'commands':_0x49f87c}]:[{'groupId':x,'groupLabel':_0x52288d,'order':0x1/0x0,'commands':[]}];}const Kn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x38fe65{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x1b9049}=this,_0x4cf243=['ck-fake-ai-selection'];_0x1b9049['config']['get']('ai.assistant.useTheme')&&_0x4cf243['push']('ck-ai-assistant-ui_theme'),_0x1b9049['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x4cf243,'priority':0xc}}),_0x1b9049['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x55e22b,{writer:_0x40981e})=>{if(!_0x55e22b['markerRange']['isCollapsed'])return null;const _0x8a6eb=_0x40981e['createUIElement']('span');return _0x40981e['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x8a6eb),_0x8a6eb;}});}['afterInit'](){!async function(_0x22d5ff){const _0xe914a0=_0x42cc43([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]),_0x2be24e=0x3dffc4e1,_0x561d8e=0x3df84781^_0x2be24e,_0x25f9e5=window[_0x42cc43([0x44,0x61,0x74,0x65])][_0x42cc43([0x6e,0x6f,0x77])](),_0x39fbd8=_0x22d5ff[_0x42cc43([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x18b304=new window[(_0x42cc43([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x229976=>{_0x39fbd8[_0x42cc43([0x6f,0x6e,0x63,0x65])](_0x42cc43([0x72,0x65,0x61,0x64,0x79]),_0x229976);}),_0x58c413={[_0x42cc43([0x6b,0x74,0x79])]:_0x42cc43([0x45,0x43]),[_0x42cc43([0x75,0x73,0x65])]:_0x42cc43([0x73,0x69,0x67]),[_0x42cc43([0x63,0x72,0x76])]:_0x42cc43([0x50,0x2d,0x32,0x35,0x36]),[_0x42cc43([0x78])]:_0x42cc43([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]),[_0x42cc43([0x79])]:_0x42cc43([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]),[_0x42cc43([0x61,0x6c,0x67])]:_0x42cc43([0x45,0x53,0x32,0x35,0x36])},_0x10b079=_0x39fbd8[_0x42cc43([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x42cc43([0x67,0x65,0x74])](_0x42cc43([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x2977fa(){let _0x1ca852,_0x49341d=null,_0x77f21a=null;try{if(_0x10b079==_0x42cc43([0x47,0x50,0x4c]))return _0x42cc43([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x1ca852=_0x379306(),!_0x1ca852)return _0x42cc43([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x1ca852[_0x42cc43([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x77f21a=_0x3e90eb(_0x1ca852[_0x42cc43([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x1ca852[_0x42cc43([0x6a,0x74,0x69])])),await _0x747665()?_0x2741a2()?_0x5f201a()?_0x42cc43([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x353324()?(_0x1ca852[_0x42cc43([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x42cc43([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x49341d=_0x48802a(_0x42cc43([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x541034()):_0x42cc43([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x42cc43([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x42cc43([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x42cc43([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5f201a(){const _0x2c7f36=[_0x42cc43([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x42cc43([0x74,0x72,0x69,0x61,0x6c])][_0x42cc43([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1ca852[_0x42cc43([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x25f9e5/0x3e8:0xe10*_0x561d8e;return _0x1ca852[_0x42cc43([0x65,0x78,0x70])]<_0x2c7f36;}function _0x2741a2(){const _0x2a8757=_0x1ca852[_0x42cc43([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x2a8757&&(!!_0x2a8757[_0x42cc43([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x42cc43([0x2a]))||!!_0x2a8757[_0x42cc43([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x42cc43([0x41,0x49])));}function _0x353324(){const _0x16f0f8=_0x1ca852[_0x42cc43([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x16f0f8||0x0==_0x16f0f8[_0x42cc43([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x4a6fb9}=new URL(window[_0x42cc43([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x16f0f8[_0x42cc43([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4a6fb9))return!0x0;const _0x31fffd=_0x4a6fb9[_0x42cc43([0x73,0x70,0x6c,0x69,0x74])](_0x42cc43([0x2e]));return _0x16f0f8[_0x42cc43([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5b2913=>_0x5b2913[_0x42cc43([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x42cc43([0x2a])))[_0x42cc43([0x6d,0x61,0x70])](_0x22d30c=>_0x22d30c[_0x42cc43([0x73,0x70,0x6c,0x69,0x74])](_0x42cc43([0x2e])))[_0x42cc43([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4b8766=>_0x4b8766[_0x42cc43([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x31fffd[_0x42cc43([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x42cc43([0x6d,0x61,0x70])](_0x20a2e2=>Array(_0x31fffd[_0x42cc43([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x20a2e2[_0x42cc43([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x42cc43([0x66,0x69,0x6c,0x6c])](_0x20a2e2[0x0]===_0x42cc43([0x2a])?_0x42cc43([0x2a]):'')[_0x42cc43([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x20a2e2))[_0x42cc43([0x73,0x6f,0x6d,0x65])](_0x48a37a=>_0x31fffd[_0x42cc43([0x65,0x76,0x65,0x72,0x79])]((_0x23b701,_0x12bc5e)=>_0x48a37a[_0x12bc5e]===_0x23b701||_0x48a37a[_0x12bc5e]===_0x42cc43([0x2a])));}function _0x541034(){return _0x49341d&&_0x77f21a?new window[(_0x42cc43([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4e82bd,_0x48b85f)=>{_0x49341d[_0x42cc43([0x74,0x68,0x65,0x6e])](_0x4e82bd,_0x48b85f),_0x77f21a[_0x42cc43([0x74,0x68,0x65,0x6e])](_0x1995b2=>{_0x1995b2!=_0x42cc43([0x56,0x61,0x6c,0x69,0x64])&&_0x4e82bd(_0x1995b2);},_0x48b85f);}):_0x49341d||_0x77f21a||_0x42cc43([0x56,0x61,0x6c,0x69,0x64]);}}function _0x3e90eb(_0x178036,_0x3f960b){return new window[(_0x42cc43([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1d9e0e=>{if(_0x41acdb())return _0x1d9e0e(_0x42cc43([0x56,0x61,0x6c,0x69,0x64]));_0x3bd9cf(),_0x39fbd8[_0x42cc43([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x42cc43([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xb79a2=!0x1;const _0x5b9bb8=_0x3d9d4e();function _0x28cf0d(_0x2b161d){return!!_0x2b161d&&(typeof _0x2b161d===_0x42cc43([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x2b161d===_0x42cc43([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x2b161d[_0x42cc43([0x74,0x68,0x65,0x6e])]===_0x42cc43([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x2b161d[_0x42cc43([0x63,0x61,0x74,0x63,0x68])]===_0x42cc43([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x36c4d9(_0x263209){_0x4ebd65(_0x263209)[_0x42cc43([0x74,0x68,0x65,0x6e])](_0x541bbf=>{if(!_0x541bbf||_0x541bbf[_0x42cc43([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x42cc43([0x6f,0x6b]))return _0x42cc43([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x109108(_0x582221(_0x5b9bb8+_0x3f960b))!=_0x541bbf[_0x42cc43([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x42cc43([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x42cc43([0x56,0x61,0x6c,0x69,0x64]);})[_0x42cc43([0x74,0x68,0x65,0x6e])](_0x49b37b=>(_0xa1ef59(),_0x49b37b),()=>{const _0x59b92f=_0xccdc87();return null==_0x59b92f?(_0xa1ef59(),_0x42cc43([0x56,0x61,0x6c,0x69,0x64])):_0x42cc43(_0x25f9e5-_0x59b92f>(0x19f340e1^_0x2be24e)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x42cc43([0x74,0x68,0x65,0x6e])](_0x1d9e0e)[_0x42cc43([0x63,0x61,0x74,0x63,0x68])](()=>{_0x1d9e0e(_0x42cc43([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x4bd64c=0x3dc92a61^_0x2be24e;function _0xa1ef59(){const _0x1456af=_0x42cc43([0x6c,0x6c,0x63,0x74,0x2d])+_0x109108(_0x582221(_0x178036)),_0x1ab9df=_0xe57b89(_0x109108(window[_0x42cc43([0x4d,0x61,0x74,0x68])][_0x42cc43([0x63,0x65,0x69,0x6c])](_0x25f9e5/_0x4bd64c)));window[_0x42cc43([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x42cc43([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1456af,_0x1ab9df);}function _0xccdc87(){const _0x2a2858=_0x42cc43([0x6c,0x6c,0x63,0x74,0x2d])+_0x109108(_0x582221(_0x178036)),_0x4fd444=window[_0x42cc43([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x42cc43([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x2a2858);return _0x4fd444?window[_0x42cc43([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xe57b89(_0x4fd444),0x10)*_0x4bd64c:null;}function _0x4ebd65(_0x4ea9a7){return new window[(_0x42cc43([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x26461e,_0x35d608)=>{_0x4ea9a7[_0x42cc43([0x74,0x68,0x65,0x6e])](_0x26461e,_0x35d608),window[_0x42cc43([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x35d608,0x3dfe1021^_0x2be24e);});}}_0x39fbd8[_0x42cc43([0x6f,0x6e])](_0x42cc43([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x209d1b,_0xdce282)=>{if(_0xdce282[0x0]!=_0x178036)return _0x1d9e0e(_0x42cc43([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0xdce282[0x1]={..._0xdce282[0x1],[_0x42cc43([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x5b9bb8};},{[_0x42cc43([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x42cc43([0x68,0x69,0x67,0x68])}),_0x39fbd8[_0x42cc43([0x6f,0x6e])](_0x42cc43([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x2d1682=>{_0x28cf0d(_0x2d1682[_0x42cc43([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xb79a2=!0x0,_0x36c4d9(_0x2d1682[_0x42cc43([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x42cc43([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x42cc43([0x6c,0x6f,0x77])}),_0x18b304[_0x42cc43([0x74,0x68,0x65,0x6e])](()=>{_0xb79a2||_0x1d9e0e(_0x42cc43([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x41acdb(){return _0x39fbd8[_0x42cc43([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x42cc43([0x76,0x69,0x65,0x77])][_0x42cc43([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x42cc43([0x61,0x75,0x74,0x6f]);}function _0x3bd9cf(){_0x39fbd8[_0x42cc43([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x42cc43([0x76,0x69,0x65,0x77])][_0x42cc43([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x42cc43([0x61,0x75,0x74,0x6f]);}}function _0x48802a(_0x1b67be){const _0x4c48c8=[new window[(_0x42cc43([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4bbf51=>setTimeout(_0x4bbf51,0x3df6fa2d^_0x2be24e)),_0x18b304[_0x42cc43([0x74,0x68,0x65,0x6e])](()=>new window[(_0x42cc43([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x212a1d=>{let _0x5b95bc=0x0;_0x39fbd8[_0x42cc43([0x6d,0x6f,0x64,0x65,0x6c])][_0x42cc43([0x6f,0x6e])](_0x42cc43([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x139cda,_0x25edbb)=>{_0x25edbb[0x0][_0x42cc43([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x5b95bc++,_0x5b95bc==(0x3dffc109^_0x2be24e)&&(_0x212a1d(),_0x139cda[_0x42cc43([0x6f,0x66,0x66])]());});}))];return window[_0x42cc43([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x42cc43([0x72,0x61,0x63,0x65])](_0x4c48c8)[_0x42cc43([0x74,0x68,0x65,0x6e])](()=>_0x1b67be);}async function _0x511ff8(){await _0x18b304,_0x39fbd8[_0x42cc43([0x6d,0x6f,0x64,0x65,0x6c])][_0x42cc43([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x3821f4,_0x39fbd8[_0x42cc43([0x6d,0x6f,0x64,0x65,0x6c])][_0x42cc43([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x3821f4,_0x39fbd8[_0x42cc43([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x42cc43([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x6fc3ac(_0x12f4bb){const _0x4ca7fa=_0x42c1fd();_0x39fbd8[_0x4ca7fa]=_0x42cc43([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x12f4bb,_0x12f4bb!=_0x42cc43([0x56,0x61,0x6c,0x69,0x64])&&_0x511ff8();}function _0x42c1fd(){const _0x14b4ea=window[_0x42cc43([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x42cc43([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x42cc43([0x6e,0x6f,0x77])]())[_0x42cc43([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x42cc43([0x2e]),'');let _0x710b5c=_0x42cc43([0x6e]);for(let _0x29e4b7=0x0;_0x29e4b7<_0x14b4ea[_0x42cc43([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x29e4b7+=0x2){let _0x5e13c6=window[_0x42cc43([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x14b4ea[_0x42cc43([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x29e4b7,_0x29e4b7+0x2));_0x5e13c6>=_0xe914a0[_0x42cc43([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x5e13c6-=_0xe914a0[_0x42cc43([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x710b5c+=_0xe914a0[_0x5e13c6];}return _0x710b5c;}function _0x379306(){const _0x5ea0b6=_0x10b079[_0x42cc43([0x73,0x70,0x6c,0x69,0x74])](_0x42cc43([0x2e]));if(0x3!=_0x5ea0b6[_0x42cc43([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x53eb51(_0x5ea0b6[0x1]);function _0x53eb51(_0x707e56){const _0x5d1878=_0x4c34d7(_0x707e56);return _0x5d1878&&_0x512d06()?_0x5d1878:null;function _0x512d06(){const _0x12b856=_0x5d1878[_0x42cc43([0x6a,0x74,0x69])],_0x589341=window[_0x42cc43([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x12b856[_0x42cc43([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x12b856[_0x42cc43([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3df8e5={..._0x5d1878,[_0x42cc43([0x6a,0x74,0x69])]:_0x12b856[_0x42cc43([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x12b856[_0x42cc43([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3df8e5[_0x42cc43([0x76,0x63])],_0x582221(_0x3df8e5)==_0x589341;}}}async function _0x747665(){let _0x2b4ab8=!0x0;try{const _0x563897=_0x10b079[_0x42cc43([0x73,0x70,0x6c,0x69,0x74])](_0x42cc43([0x2e])),[_0x453f84,_0x183bdb,_0x864bea]=_0x563897;return _0x3e8c28(_0x453f84),await _0x2e53e0(_0x453f84,_0x183bdb,_0x864bea),_0x2b4ab8;}catch{return!0x1;}function _0x3e8c28(_0x2f4b01){const _0x22f100=_0x4c34d7(_0x2f4b01);_0x22f100&&_0x22f100[_0x42cc43([0x61,0x6c,0x67])]==_0x42cc43([0x45,0x53,0x32,0x35,0x36])||(_0x2b4ab8=!0x1);}async function _0x2e53e0(_0x5e0dd4,_0x29dc7a,_0x150fdc){const _0x3e90ff=window[_0x42cc43([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x42cc43([0x66,0x72,0x6f,0x6d])](_0x488cd1(_0x150fdc),_0x20d4a0=>_0x20d4a0[_0x42cc43([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x461df9=new window[(_0x42cc43([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x42cc43([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5e0dd4+_0x42cc43([0x2e])+_0x29dc7a),_0x461bfc=window[_0x42cc43([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x42cc43([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x461bfc)return;const _0x8f979a=await _0x461bfc[_0x42cc43([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x42cc43([0x6a,0x77,0x6b]),_0x58c413,{[_0x42cc43([0x6e,0x61,0x6d,0x65])]:_0x42cc43([0x45,0x43,0x44,0x53,0x41]),[_0x42cc43([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x42cc43([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x42cc43([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x461bfc[_0x42cc43([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x42cc43([0x6e,0x61,0x6d,0x65])]:_0x42cc43([0x45,0x43,0x44,0x53,0x41]),[_0x42cc43([0x68,0x61,0x73,0x68])]:{[_0x42cc43([0x6e,0x61,0x6d,0x65])]:_0x42cc43([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x8f979a,_0x3e90ff,_0x461df9)||(_0x2b4ab8=!0x1);}}function _0x4c34d7(_0x232c5f){return _0x232c5f[_0x42cc43([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x42cc43([0x65,0x79]))?JSON[_0x42cc43([0x70,0x61,0x72,0x73,0x65])](_0x488cd1(_0x232c5f)):null;}function _0x488cd1(_0x31d40b){return window[_0x42cc43([0x61,0x74,0x6f,0x62])](_0x31d40b[_0x42cc43([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x42cc43([0x2b]))[_0x42cc43([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x42cc43([0x2f])));}function _0x582221(_0x214994){let _0x4e0293=0x1505;function _0x2abb63(_0x30bc91){for(let _0x4cf70e=0x0;_0x4cf70e<_0x30bc91[_0x42cc43([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4cf70e++){const _0x465038=_0x30bc91[_0x42cc43([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x4cf70e);_0x4e0293=(_0x4e0293<<0x5)+_0x4e0293+_0x465038,_0x4e0293&=_0x4e0293;}}function _0x1a73a5(_0x58c6fb){Array[_0x42cc43([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x58c6fb)?_0x58c6fb[_0x42cc43([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x1a73a5):_0x58c6fb&&typeof _0x58c6fb==_0x42cc43([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x42cc43([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x58c6fb)[_0x42cc43([0x73,0x6f,0x72,0x74])]()[_0x42cc43([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x3f9e84,_0xb01f6b])=>{_0x2abb63(_0x3f9e84),_0x1a73a5(_0xb01f6b);}):_0x2abb63(window[_0x42cc43([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x58c6fb));}return _0x1a73a5(_0x214994),_0x4e0293>>>0x0;}function _0x109108(_0x3f206c){return _0x3f206c[_0x42cc43([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x42cc43([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x42cc43([0x30]));}function _0xe57b89(_0x1680b1){return _0x1680b1[_0x42cc43([0x73,0x70,0x6c,0x69,0x74])]('')[_0x42cc43([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x42cc43([0x6a,0x6f,0x69,0x6e])]('');}function _0x3821f4(){}function _0x42cc43(_0x1f0da4){return _0x1f0da4['map'](_0x8c671e=>String['fromCharCode'](_0x8c671e))['join']('');}_0x6fc3ac(await _0x2977fa());}(this);}['showFakeVisualSelection'](){const _0x3a2318=this['editor']['model'];_0x3a2318['change'](_0xd6f2cc=>{const _0x18b17e=_0x3a2318['document']['selection']['getRanges']();let _0x1896ae=0x0;for(const _0x9c73f4 of _0x18b17e){const _0x5357b8=f+':'+_0x1896ae;if(_0x3a2318['markers']['has'](_0x5357b8))_0xd6f2cc['updateMarker'](_0x5357b8,{'range':_0x9c73f4});else{if(_0x9c73f4['start']['isAtEnd']){const _0x5085e8=_0x9c73f4['start']['getLastMatchingPosition'](({item:_0x2c40ab})=>!_0x3a2318['schema']['isContent'](_0x2c40ab),{'boundaries':_0x9c73f4});_0xd6f2cc['addMarker'](_0x5357b8,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xd6f2cc['createRange'](_0x5085e8,_0x9c73f4['end'])});}else _0xd6f2cc['addMarker'](_0x5357b8,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x9c73f4});}_0x1896ae++;}});}['hideFakeVisualSelection'](){const _0x22265d=this['editor']['model'],_0x264be0=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x264be0['length']&&_0x22265d['change'](_0x35ad85=>{_0x264be0['forEach'](_0xcc1275=>{_0x35ad85['removeMarker'](_0xcc1275);});});}['insertContent'](_0x130473,_0x520566){const _0x1552ca=this['_getAISelection'](),_0x1b46ed=_0x520566||_0x1552ca['getFirstRange']();this['editor']['model']['canEditAt'](_0x1b46ed)&&this['editor']['model']['change'](_0x1a3a33=>{this['hideFakeVisualSelection'](),_0x520566||this['_resetContentOfSelectedTableCells'](_0x1a3a33,_0x1552ca),this['_pasteHTMLUsingClipboard']({'insertAt':_0x1b46ed,'writer':_0x1a3a33,'html':_0x130473});});}['insertContentBelow'](_0x51bd44){const {model:_0x21c308}=this['editor'],_0x1333ed=this['_getAISelection']();_0x21c308['change'](()=>{const _0x232aee=this['_prepareTableInsertBelowPosition'](_0x51bd44,_0x1333ed)||this['_getDefaultInsertBelowPosition'](_0x1333ed);this['insertContent'](_0x51bd44,_0x232aee);});}['_getAISelection'](){const _0x7f10bf=this['editor']['model'],_0x13bd75=Array['from'](_0x7f10bf['markers']['getMarkersGroup'](f))['map'](_0x359754=>_0x359754['getRange']());return _0x7f10bf['createSelection'](_0x13bd75);}['_pasteHTMLUsingClipboard']({writer:_0x454e3a,html:_0x4c2850,insertAt:_0x3e66c1}){const {view:_0x192737}=this['editor']['editing'],_0x208709=this['editor']['plugins']['get'](_0x2eed9d),_0x1fc2b1=new Kn();_0x1fc2b1['setData']('text/html',_0x4c2850);const _0x4d98f1=new ClipboardEvent('paste',{'clipboardData':_0x1fc2b1}),_0x43b795=new _0x67347b(_0x192737,_0x4d98f1,{'dataTransfer':new _0x22df6e(_0x1fc2b1)});_0x454e3a['setSelection'](_0x3e66c1);const _0x4ca7cb=(_0x2185e4,_0x2207d3)=>{_0x2207d3['resultRange']&&_0x454e3a['setSelection'](_0x2207d3['resultRange']);};_0x208709['once']('contentInsertion',_0x4ca7cb,{'priority':'lowest'}),_0x192737['document']['fire']('paste',_0x43b795),_0x208709['off']('contentInsertion',_0x4ca7cb);}['_getDefaultInsertBelowPosition'](_0x2f9836){const {model:_0x1055c6}=this['editor'],_0x472335=Array['from'](_0x2f9836['getSelectedBlocks']());return _0x472335['length']?_0x1055c6['createPositionAfter'](_0x472335['pop']()):_0x2f9836['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x9cc12d,_0xbdde8f){const {model:_0x3e1d76,plugins:_0x30fc2c}=this['editor'];if(_0x30fc2c['has']('TableUtils')){const _0x5c97e3=_0x30fc2c['get']('TableUtils')['getSelectedTableCells'](_0xbdde8f);if(_0x5c97e3['length']){const _0x3c03d2=this['_getTableRowCountFromContent'](_0x9cc12d),_0x37fc37=this['_createEmptyTableRows'](_0x5c97e3,_0x3c03d2);return _0x3e1d76['createPositionAt'](_0x37fc37,0x0);}}return null;}['_getTableRowCountFromContent'](_0x40ab55){const _0x47d792=this['editor']['plugins']['get']('TableUtils'),_0x3fb96e=this['editor']['data']['parse'](_0x40ab55),_0x5c854f=Array['from'](_0x3fb96e['getChildren']())['filter'](_0xb1ef98=>_0xb1ef98['is']('element','table'));let _0x2894e9=0x0;return _0x5c854f['forEach'](_0x19df4f=>{_0x2894e9+=_0x47d792['getRows'](_0x19df4f);}),_0x2894e9;}['_createEmptyTableRows'](_0x5c8724,_0x1ba6b1){const _0xde18ae=this['editor']['plugins']['get']('TableUtils'),_0xd8e35e=_0xde18ae['getRowIndexes'](_0x5c8724),_0x10c5ec=_0xde18ae['getColumnIndexes'](_0x5c8724),_0x14f350=_0xd8e35e['last']+0x1,_0x1a0fe7=_0x10c5ec['first'],_0x1dc4ec=_0x5c8724[0x0]['findAncestor']('table');for(let _0x298608=0x0;_0x298608<_0x1ba6b1;_0x298608++)_0xde18ae['insertRows'](_0x1dc4ec,{'at':_0x14f350});return _0x1dc4ec['getChild'](_0x14f350)['getChild'](_0x1a0fe7);}['_resetContentOfSelectedTableCells'](_0x3bbd03,_0x31a46d){const {plugins:_0x19c573}=this['editor'],{model:_0x35c4fa}=_0x3bbd03;if(!_0x19c573['has']('TableUtils'))return;_0x19c573['get']('TableUtils')['getSelectedTableCells'](_0x31a46d)['length']&&_0x35c4fa['deleteContent'](_0x31a46d);}}class K extends _0x38fe65{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x459533('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x5e6881){super(_0x5e6881),this['name']='AIRequestError';}}function Wn(_0x126d32,_0x49c58c,_0x3a8e71){const t=_0x126d32['t'];switch(_0x49c58c){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',_0x3a8e71);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3a8e71);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'},_0x3a8e71);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_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x49c58c;}}class E extends Lt{['_commandDefinitions'];constructor(_0x5e3a18,_0x250c93){super(_0x5e3a18),this['_commandDefinitions']=_0x250c93,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1d85dc,_0x32f3e4,_0x29c60a)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x29c60a));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x472c59,_0x16e253,_0x4ffc39)=>{this['enabledCommandsIds']=_0x4ffc39?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x29316a=this['editor']['model'];this['_hasContext']=function(_0x288d83){const _0x32d82f=_0x288d83['document']['selection'];return _0x32d82f['isCollapsed']?0x0!==[..._0x32d82f['getSelectedBlocks']()]['length']&&![..._0x32d82f['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x288d83['hasContent'](_0x32d82f['getFirstRange']());}(_0x29316a);const _0x22806f=_0x29316a['document']['selection'],_0x4b23c5=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x1f23d0 of _0x22806f['getRanges']())for(const _0x197c35 of _0x1f23d0['getItems']())if(_0x197c35['is']('element')&&_0x4b23c5['includes'](_0x197c35['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x5e5970='',_0x3a3620='',_0x1108cf='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x5e5970,_0x3a3620,_0x1108cf);}}function ns(_0x29d7a6,_0x18323a){const _0x5de54a=new Set();for(const _0x3574fc of _0x29d7a6['values']())(_0x18323a||!0x1===_0x3574fc['requiresContent'])&&_0x5de54a['add'](_0x3574fc['id']);return Array['from'](_0x5de54a);}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(_0x1408b7,_0x193701,_0x4ea2d5){super(),this['editor']=_0x1408b7,this['textAdapter']=_0x193701,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x4ea2d5,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4316f,_0x1881d9,_0x364d64)=>{this['view']['value']=this['_sanitizeHTML'](_0x364d64);}),this['listenTo'](this['view'],'submitPrompt',(_0x444307,_0x34eedb)=>{const _0x5f341b=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x34eedb,_0x5f341b,'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:_0xff3fa3,query:_0x454be1,htmlContent:_0x147130,label:_0x35baf0,mainActionLabel:_0x5cdf68}){this['view']['prompt']=_0x35baf0,this['view']['mainAction']=_0x5cdf68,this['initialContext']=_0x147130,_0x454be1&&(this['view']['isRendered']?this['_handleQuery'](_0x454be1,_0x147130,_0xff3fa3,_0x35baf0):this['view']['once']('render',()=>{this['_handleQuery'](_0x454be1,_0x147130,_0xff3fa3,_0x35baf0);}));}['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'](_0x8f61f2,_0x443619,_0x43ee65,_0x621ef9){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x443619,this['previousQuery']=_0x8f61f2,this['previousLabel']=_0x621ef9||_0x8f61f2,this['previousActionId']=_0x43ee65,new Promise(_0x2eb4df=>{this['textAdapter']['makeRequest']({'query':_0x8f61f2,'context':_0x443619,'onData':_0x2b60e7=>{this['currentResponse']=_0x2b60e7,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x43ee65})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x3e00d8=>{_0x3e00d8 instanceof er?this['view']['handleError'](_0x3e00d8['message']):this['view']['handleError'](),_0x2eb4df();})['finally'](()=>{this['stopProcessing'](),_0x2eb4df();});});}['_parseAndNormalizeContent'](_0x2d6c49,_0x40c1f3=!0x1){const _0x572cbe=hs['exec'](_0x2d6c49);_0x2d6c49=_0x572cbe?_0x2d6c49['substring'](_0x572cbe[0x1]['length']):_0x2d6c49['length']<0x64&&!_0x40c1f3?'':this['_stripMarkdownSyntax'](_0x2d6c49);const _0x1d4f4f=this['_domParser']['parseFromString'](_0x2d6c49,'text/html');if(_0x572cbe){const _0x585860=Array['from'](_0x1d4f4f['body']['childNodes']);_0x585860['reverse']();for(const _0xab276c of _0x585860){if(_0xab276c['nodeType']==Node['ELEMENT_NODE'])break;_0xab276c['remove']();}}const _0x3eabaa=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x1d4f4f['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x3eabaa);const _0x2d387b=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x27a2ee=this['editor']['data']['toModel'](_0x3eabaa);return _0x2d387b||_0x27a2ee['markers']['clear'](),this['editor']['data']['stringify'](_0x27a2ee);}['_normalizeResponseHeadings'](_0x45e320){const _0x1a62fe=new _0x42f24c(this['editor']['editing']['view']['document']),_0x38a342=new _0x4e8377({'name':/^h[1-5]$/}),_0x35cf4d=[];let _0x78dae1=!0x1;for(const _0x543beb of _0x45e320)_0x543beb['is']('element')&&_0x38a342['match'](_0x543beb)&&(_0x35cf4d['push'](_0x543beb),'h1'==_0x543beb['name']&&(_0x78dae1=!0x0));if(_0x78dae1){for(const _0x19c810 of _0x35cf4d)_0x1a62fe['rename']('h'+(parseInt(_0x19c810['name'][0x1])+0x1),_0x19c810);}}['_isH1TagSupportEnabled'](){const {data:_0x4711f0,editing:_0x21211d}=this['editor'],_0x307577=_0x4711f0['htmlProcessor']['toView']('<h1></h1>'),_0xf866cd=_0x4711f0['toView'](_0x4711f0['toModel'](_0x307577));return!!_0x21211d['view']['domConverter']['viewToDom'](_0xf866cd)['querySelector']('h1');}['_sanitizeHTML'](_0xe1fd83){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0xe1fd83),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x4f5986){const _0x32ec2f=_0x4f5986['trim']();return _0x32ec2f['startsWith']('```html')?_0x32ec2f['endsWith']('```')?_0x32ec2f['substring'](0x7,_0x32ec2f['length']-0x3):_0x32ec2f['substring'](0x7):_0x4f5986;}}const _={'REPLACE':'replace','INSERT':'insert'};class Pr extends _0x3ccac8{constructor(_0x1aa169){super(_0x1aa169),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x1b799b=>Wn(_0x1aa169,'AI_'+_0x1b799b['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Wn(_0x1aa169,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Wn(_0x1aa169,'Try\x20again')),this['stopButton']=this['_createButton'](Wn(_0x1aa169,'Stop'));const _0x10d29c=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x10d29c['if']('isVisible','ck-hidden',_0x16ce40=>!_0x16ce40)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x881753,_0xa503ce){const _0x4d9f41=new _0x4e2d9f(this['locale']);return _0x4d9f41['set']({'label':_0x881753,'class':_0xa503ce||'','isVisible':!0x0,'withText':!0x0}),_0x4d9f41;}}class Ir extends _0x13ab0e{['contentFieldView'];['copyButtonView'];constructor(_0x229d75,_0x1877d4=''){super(_0x229d75),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x303471=this['bindTemplate'];this['contentFieldView']=new Yn(_0x229d75,_0x1877d4),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x303471['if']('isVisible','ck-hidden',_0xbdc6d0=>!_0xbdc6d0)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x303471['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 _0x59b9a6=!0x1;this['on']('change:value',(_0x39d8e2,_0x4d178f,_0x42fd7d)=>{const _0xb31b6d=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x42fd7d),this['isProcessing']&&_0xb31b6d&&!_0x59b9a6&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x179f75,_0x338ad7,_0x1cf9ad)=>{_0x59b9a6=!0x1,_0x1cf9ad?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x59b9a6=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x59b9a6=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x5aa2ac=this['locale'],_0x654525=new _0x4e2d9f(this['locale']),_0x4dec57='ck-ai-form__copy-button';return _0x654525['set']({'label':Wn(_0x5aa2ac,'Copy'),'icon':_0x2fc9a2,'class':_0x4dec57,'tooltip':!0x0}),_0x654525['bind']('isVisible')['to'](this,'value',_0x137017=>!!_0x137017),_0x654525['bind']('isEnabled')['to'](this,'isProcessing',_0x204ebc=>!_0x204ebc),_0x654525['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x654525['icon']=_0x44dfa1,_0x654525['class']=_0x4dec57+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x654525['icon']=_0x2fc9a2,_0x654525['class']=_0x4dec57;},0x3e8);}),_0x654525;}['_copyHTMLToClipboard'](_0x10e583){const {window:_0x20746f,document:_0x576439}=_0x10b14d;if(_0x20746f['ClipboardItem']){const {Blob:_0x530aa0,ClipboardItem:_0x151fc7}=_0x20746f,_0x2a1564=[new _0x151fc7({'text/html':new _0x530aa0([_0x10e583['innerHTML']],{'type':'text/html'}),'text/plain':new _0x530aa0([_0x10e583['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x2a1564);}else{const _0x3c4a25=_0x576439['createElement']('div');_0x3c4a25['style']['position']='absolute',_0x3c4a25['style']['left']='-9999px',_0x3c4a25['innerHTML']='<span>[</span>'+_0x10e583['innerHTML']+'<span>]</span>',_0x576439['body']['appendChild'](_0x3c4a25);const _0x43ab2e=_0x576439['createRange']();_0x43ab2e['setStartAfter'](_0x3c4a25['firstElementChild']),_0x43ab2e['setEndBefore'](_0x3c4a25['lastElementChild']);const _0x19f993=_0x20746f['getSelection']();_0x19f993['removeAllRanges'](),_0x19f993['addRange'](_0x43ab2e),_0x576439['execCommand']('copy'),_0x3c4a25['remove']();}}}class Yn extends _0x13ab0e{constructor(_0x278f3c,_0x233d1d=''){super(_0x278f3c),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x233d1d,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x31ad7e){this['element']['innerHTML']=_0x31ad7e;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x1fe98b=new _0x13ab0e(),_0x57ce15=this['locale'],_0x5bda03=new _0x4d4103();return _0x5bda03['isVisible']=!0x0,_0x1fe98b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x5bda03,{'text':Wn(_0x57ce15,'AI\x20is\x20writing...')}]}),_0x1fe98b['render'](),_0x1fe98b;}}class Vr extends _0x13ab0e{constructor(_0xf26a9f,_0x3965dd=''){super(_0xf26a9f);const _0x4cfc54=new _0x5495d5(),_0x1a7399=this['bindTemplate'];this['set']('text',_0x3965dd),_0x4cfc54['content']=_0x21428b,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x4cfc54,{'text':_0x1a7399['to']('text')}]});}}class Cr extends _0x100fb1{['submitButtonView'];['showHistoryButtonView'];constructor(_0x2da960,_0x14bee2){super(_0x2da960,_0x14bee2),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',(_0xd75638,_0x50213f)=>{_0xd75638['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x50213f());});}['_createSubmitButton'](){const _0x2b38e6=new _0x4e2d9f(this['locale']),_0x47dbe6=this['locale'];return _0x2b38e6['set']({'icon':_0x5ca66c,'label':Wn(_0x47dbe6,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x2b38e6['on']('execute',()=>{this['submit']();}),_0x2b38e6['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x188c66,_0x1a259b)=>!_0x188c66&&_0x1a259b),_0x2b38e6;}['_createShowHistoryButton'](){const _0x14a4f3=new _0x4e2d9f(this['locale']),_0x54a89b=this['resultsView'],_0x36749d=this['locale'];_0x14a4f3['set']({'label':Wn(_0x36749d,'History'),'withText':!0x1,'icon':Nt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x14a4f3['bind']('isOn')['to'](_0x54a89b,'isVisible'),_0x14a4f3['bind']('isEnabled')['to'](this,'isEnabled'),_0x14a4f3['on']('execute',()=>{_0x54a89b['isVisible']=!_0x54a89b['isVisible'],_0x54a89b['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x4be513=()=>{_0x10b14d['window']['requestAnimationFrame'](()=>{if(_0x4d96fb(this['element'])){const _0x178956=new _0x473971(this['queryView']['fieldView']['element']),_0x2f468d=_0x178956['width'],_0x390f4f='rtl'===_0x36749d['uiLanguageDirection']?'left':'right';_0x178956['excludeScrollbarsAndBorders'](),_0x14a4f3['element']['style'][_0x390f4f]=_0x2f468d-_0x178956['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x4be513),this['on']('render',_0x4be513),_0x14a4f3;}['submit'](){const _0x58a024=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x58a024);}['focus'](_0x93d724){-0x1===_0x93d724?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Hr extends _0x5f5dca{['historyGroupView'];['clearHistoryButton'];constructor(_0x11068a){super(_0x11068a),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x14c408(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Wn(_0x11068a,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x474c76=0x0;for(const _0x3ec709 of this['items'])_0x474c76+=_0x3ec709['items']['length'];return{'resultsCount':_0x474c76,'totalItemsCount':_0x474c76};}['_createClearHistoryButton'](){const _0x1c35c3=this['locale'],_0x1d1ebb=new _0x4e2d9f(this['locale']);return _0x1d1ebb['set']({'label':'('+Wn(_0x1c35c3,'Clear')+')','withText':!0x0}),_0x1d1ebb['on']('execute',()=>this['fire']('clearHistory')),_0x1d1ebb;}}class Rr extends _0x27607e{constructor(_0x27ca41){super();const _0x2cae69=new _0x9d7a0a(),_0x3a6361=new _0x4e2d9f(this['locale'],_0x2cae69);this['children']['add'](_0x3a6361),_0x3a6361['set']({'label':_0x27ca41['prompt'],'withText':!0x0}),_0x3a6361['on']('execute',()=>{this['fire']('execute',{'value':_0x4042b3(_0x27ca41['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Br extends _0x537dd4{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x39a7b1,_0x72b076)=>{const _0x20fb61=go(_0x72b076['prompt']);for(const _0x4d350f of this)if(_0x4d350f!=_0x72b076&&go(_0x4d350f['prompt'])===_0x20fb61){this['remove'](_0x4d350f);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x26213e=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x26213e));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x26ae26=>_0x26ae26)));}}function go(_0x5e7a38){return _0x5e7a38['toLowerCase']()['trim']();}class k extends _0x13ab0e{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x491a60,_0x39e34f,_0x59ea53=''){super(_0x491a60),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(_0x491a60),this['contentArea']=new Ir(_0x491a60,_0x59ea53),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 _0x39e72a(),this['keystrokes']=new _0x2ecfe9(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x2ca20b({'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 _0xe497ec=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x39e34f],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0xe497ec['if']('isError','ck-hidden',_0x1b8b88=>!_0x1b8b88)]},'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'](_0xad7639=0x1){-0x1===_0xad7639?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 _0x4364fb=this['locale'],_0x49f829=new Cr(_0x4364fb,{'queryView':{'label':Wn(_0x4364fb,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x4dfb61,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Wn(_0x4364fb,'Empty\x20history'),'secondary':Wn(_0x4364fb,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x49f829['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x272017,_0x2877cb)=>_0x272017&&!_0x2877cb),this['listenTo'](_0x49f829,'submit',(_0x54b6b6,_0x4bfce9)=>{this['prompt']=_0x4bfce9;const _0x46b271=_0x210da0(_0x4bfce9);this['fire']('submitPrompt',_0x46b271),_0x4bfce9['trim']()&&this['_promptHistory']['add']({'prompt':_0x46b271},0x0);},{'priority':'high'}),_0x49f829;}['_createHistoryView'](){const _0x3dc8a3=new Hr(this['locale']);return _0x3dc8a3['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Rr),_0x3dc8a3['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3dc8a3;}['_createToolbar'](){const _0x39b20b=new Pr(this['locale']);return _0x39b20b['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x388fd4,_0x4727e7,_0x2fd13d)=>_0x388fd4&&!_0x4727e7&&!!_0x2fd13d),_0x39b20b['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x39b20b['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xe10d63,_0x3aeae2,_0x4a484b)=>_0xe10d63&&!_0x3aeae2&&!!_0x4a484b),_0x39b20b['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x39b20b['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x30c3ca,_0x1920c3)=>_0x30c3ca&&!_0x1920c3),_0x39b20b['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x39b20b['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x39b20b['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x39b20b;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x3ee5a3=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Wn(_0x3ee5a3,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x37d5d2){const _0x958ae7=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x37d5d2||Wn(_0x958ae7,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x38fe65{['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[_0x17d7be,a,K,_0x52fe49];}constructor(_0x3e75f5){super(_0x3e75f5),_0x3e75f5['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x3e75f5['config']['define']('ai.assistant.contentAreaCssClass',''),_0x3e75f5['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x3e75f5['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x23a3b8}=this;this['_aiAdapter']=_0x23a3b8['plugins']['get'](K),this['_dialog']=_0x23a3b8['plugins']['get'](_0x52fe49),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x56b74e=new E(_0x23a3b8,Array['from'](this['_commandDefinitions']['values']()));_0x23a3b8['commands']['add']('showAIAssistant',_0x56b74e),_0x23a3b8['ui']['componentFactory']['add']('aiCommands',_0x34e09f=>{const _0x313cdb=_0xb2afd1(_0x34e09f);return _0x313cdb['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x313cdb['buttonView']['set']({'label':Wn(_0x34e09f,'AI\x20Commands'),'icon':_0x5e7576,'tooltip':!0x0}),_0x313cdb['on']('execute',_0x1d8a6c=>this['_onExecute'](_0x1d8a6c['source']['id'])),_0x2da092(_0x313cdb,_0x23a3b8['ui']['view']['body'],function(_0x3cc415){const _0x32a5f3=o(_0x3cc415['config']['get']('ai.assistant.commands'),_0x3cc415['locale']),_0x22c76e=B(_0x3cc415,_0x32a5f3)['filter'](_0x3b5058=>_0x3b5058['commands']['length']);if(0x1===_0x22c76e['length'])return B(_0x3cc415,_0x22c76e[0x0]['commands'])['map'](_0x4344fb=>({'id':_0x4344fb['id'],'label':_0x4344fb['label']}));return _0x22c76e['map'](_0x49d5b9=>{const {groupId:_0x37510d,groupLabel:_0x18b5f7,commands:_0x476df6}=_0x49d5b9,_0x29f547=B(_0x3cc415,_0x476df6)['map'](_0x54c2db=>({'id':_0x54c2db['id'],'label':_0x54c2db['label']}));return{'id':_0x37510d,'menu':_0x18b5f7||_0x37510d,'children':_0x29f547};});}(_0x23a3b8),{'ariaLabel':Wn(_0x34e09f,'AI\x20Commands')}),_0x313cdb['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x56b74e['on']('change:enabledCommandsIds',_0xd6767c),_0x313cdb['menuView']['once']('render',_0xd6767c),_0x313cdb;function _0xd6767c(){_0x313cdb['isEnabled']=_0x56b74e['enabledCommandsIds']['length']>0x0;for(const _0x58c437 of _0x313cdb['menuView']['buttons'])_0x58c437['isEnabled']=_0x56b74e['enabledCommandsIds']['includes'](_0x58c437['id']);}}),_0x23a3b8['ui']['componentFactory']['add']('menuBar:aiCommands',_0x520f9c=>{const _0x1f0a7f=new _0x399f5a(_0x520f9c);_0x1f0a7f['buttonView']['set']({'label':Wn(_0x520f9c,'AI\x20Commands'),'icon':_0x5e7576}),_0x1f0a7f['bind']('isEnabled')['to'](_0x56b74e,'enabledCommandsIds',_0x3e1fbf=>_0x3e1fbf['length']>0x0);const _0x547cad=o(_0x23a3b8['config']['get']('ai.assistant.commands'),_0x520f9c);return this['_populateMenuBarMenu'](_0x56b74e,_0x1f0a7f,_0x547cad,_0x1dff21=>this['_onExecute'](_0x1dff21)),_0x1f0a7f;}),_0x23a3b8['ui']['componentFactory']['add']('aiAssistant',()=>{const _0xe4d2aa=this['_createAIAssistantUIButton'](_0x4e2d9f);return _0xe4d2aa['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0xe4d2aa;}),_0x23a3b8['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x3df2a6=this['_createAIAssistantUIButton'](_0x19bfd7);return _0x3df2a6['set']({'role':'menuitemcheckbox'}),_0x3df2a6;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x4b71bc=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3b9223;for(const _0x284b46 in _0x4b71bc){const _0x3ff65b=_0x284b46,_0x268fe1=_0x4b71bc[_0x3ff65b];if('aiLicenseKeyValid'==_0x268fe1||'aiLicenseKeyInvalid'==_0x268fe1||'aiLicenseKeyExpired'==_0x268fe1||'aiLicenseKeyDomainLimit'==_0x268fe1||'aiLicenseKeyNotAllowed'==_0x268fe1||'aiLicenseKeyEvaluationLimit'==_0x268fe1||'aiLicenseKeyUsageLimit'==_0x268fe1){delete _0x4b71bc[_0x3ff65b],_0x3b9223=_0x268fe1,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x3b9223&&_0x4b71bc['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x3b9223&&_0x4b71bc['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x3b9223&&_0x4b71bc['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x3b9223&&_0x4b71bc['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x3b9223&&_0x4b71bc['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x3b9223&&_0x4b71bc['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x41499c='',_0x565a0d='',_0x53e5b7='custom'){const _0x48194f=this['editor'],_0x6f7222=_0x48194f['editing']['view'],_0x28efeb=_0x48194f['plugins']['get'](a),_0x1662a7=_0x48194f['plugins']['get'](_0x17d7be);_0x28efeb['showFakeVisualSelection']();const _0x5da3e2=new w(),_0x4c82dc=new ClipboardEvent('copy',{'clipboardData':_0x5da3e2}),_0xf171ea=new _0x22df6e(_0x5da3e2),_0x3493a0=new _0x67347b(_0x6f7222,_0x4c82dc,{'dataTransfer':_0xf171ea});_0x1662a7['_forceMarkersCopy']('comment',()=>{_0x6f7222['document']['fire']('copy',_0x3493a0);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x48194f,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x3e2cde=_0xf171ea['getData']('text/html');const _0x4ae9f8=_0x48194f['model']['document']['selection'],_0x10cd33=Array['from'](_0x4ae9f8['getRanges']());0x1===_0x10cd33['length']&&_0x10cd33[0x0]['isFlat']&&!_0x4ae9f8['getSelectedElement']()&&''!==_0x3e2cde['replace'](/&nbsp;/g,'')['trim']()&&(_0x3e2cde='<p>'+_0x3e2cde+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x53e5b7,'query':_0x41499c,'htmlContent':_0x3e2cde,'label':_0x565a0d,'mainActionLabel':_[_0x48194f['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x55b603,'title':Wn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x2ba6b7['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x28efeb['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x3fc199=new Map(),_0x24572f=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x231583 of _0x24572f)for(const _0x4bcb72 of _0x231583['commands'])_0x3fc199['set'](_0x4bcb72['id'],{..._0x4bcb72,'groupId':_0x231583['groupId'],'groupLabel':_0x231583['groupLabel']||_0x231583['groupId']});return _0x3fc199;}['_createAIAssistantUIButton'](_0x2befeb){const _0x568b2b=this['editor'],_0x33ed61=_0x568b2b['commands']['get']('showAIAssistant'),_0x579f5b=new _0x2befeb(_0x568b2b['locale']);return _0x579f5b['set']({'label':Wn(_0x568b2b['locale'],'AI\x20Assistant'),'icon':_0x55b603,'isToggleable':!0x0}),_0x579f5b['bind']('isEnabled')['to'](_0x33ed61),_0x579f5b['bind']('isOn')['to'](this['_dialog'],'id',_0x5f5110=>'aiAssistant'===_0x5f5110),this['listenTo'](_0x579f5b,'execute',()=>{_0x579f5b['isOn']?this['hideUI']():_0x33ed61['execute']();}),_0x579f5b;}['_initView'](){const _0x124cb8=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',()=>{_0x124cb8['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x124cb8['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x4966ca,ui:{ariaLiveAnnouncer:_0x5980bb}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x7b5241,_0x79738a,_0xbce4e3)=>{const _0x335766=this['_aiAssistantController']['currentContext'];_0xbce4e3?_0x5980bb['announce'](Wn(_0x4966ca,'AI\x20is\x20writing')):_0x335766&&_0x5980bb['announce'](Wn(_0x4966ca,'Generated\x20content:\x20%0',_0x335766),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x52a3e1,_0x372fae,_0x2e6c68)=>{if(_0x2e6c68){const _0x22c09c=this['_formView']['errorView']['text'];_0x5980bb['announce'](Wn(_0x4966ca,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x22c09c));}});}['_onExecute'](_0x214758){const _0x23bc91=this['_commandDefinitions']['get'](_0x214758),_0x1aecb3=this['editor'],_0x311dd3=_0x1aecb3['model']['document']['selection'],_0x84282e=_0x1aecb3['commands']['get']('showAIAssistant'),_0x2e65de=_0x1aecb3['plugins']['get'](a),_0x32d9ab=''+(_0x23bc91['groupId']!==x?_0x23bc91['groupLabel']+':\x20':'')+_0x23bc91['label'];if(!0x1!==_0x23bc91['requiresContent']&&_0x311dd3['isCollapsed']){const _0x4572be=_0x1bf09b(_0x311dd3['getSelectedBlocks']())||_0x1aecb3['model']['schema']['getLimitElement'](_0x311dd3);_0x1aecb3['model']['change'](_0x4b434c=>{_0x4b434c['setSelection'](_0x4572be,'in');});}_0x2e65de['showFakeVisualSelection'](),_0x84282e['execute'](_0x23bc91['prompt'],_0x32d9ab,'command:'+_0x214758);}['_populateMenuBarMenu'](_0x32218c,_0x1c99a0,_0x405306,_0x55ee46){const _0x3619cb=this['editor'],_0x1e7f6a=_0x3619cb['locale'],_0x4dfcc1=new _0x408ee4(_0x1e7f6a),_0x2b2a86=B(_0x3619cb,_0x405306)['filter'](_0x234b4b=>_0x234b4b['commands']['length']);0x1===_0x2b2a86['length']?this['_getMenuBarGroupButtons']({'command':_0x32218c,'commands':_0x2b2a86[0x0]['commands'],'parentMenuView':_0x1c99a0,'onExecute':_0x55ee46})['forEach'](_0x512d72=>_0x4dfcc1['items']['add'](_0x512d72)):_0x2b2a86['forEach'](({groupId:_0x5c60c9,groupLabel:_0x53c46f,commands:_0x160b1e})=>{const _0x46d7ef=new _0x1d2bc6(_0x1e7f6a,_0x1c99a0),_0x5c2622=new _0x399f5a(_0x1e7f6a),_0x3bb646=new _0x408ee4(_0x1e7f6a),_0x21e7a6=this['_getMenuBarGroupButtons']({'command':_0x32218c,'commands':_0x160b1e,'parentMenuView':_0x5c2622,'onExecute':_0x55ee46});_0x5c2622['buttonView']['set']({'label':_0x53c46f||_0x5c60c9}),_0x5c2622['delegate']('execute')['to'](_0x1c99a0),_0x3bb646['items']['addMany'](_0x21e7a6),_0x5c2622['panelView']['children']['add'](_0x3bb646),_0x46d7ef['children']['add'](_0x5c2622),_0x4dfcc1['items']['add'](_0x46d7ef);}),_0x1c99a0['panelView']['children']['add'](_0x4dfcc1);}['_getMenuBarGroupButtons']({command:_0x39cb71,commands:_0x185f43,parentMenuView:_0x4d6784,onExecute:_0x5caf97}){const _0x425266=this['editor'],_0x5d1661=_0x425266['locale'];return B(_0x425266,_0x185f43)['map'](_0x5d4881=>{const _0x330ad7=new _0x1d2bc6(_0x5d1661,_0x4d6784),_0x51cfb1=new _0x19bfd7(_0x5d1661);return _0x51cfb1['set']({'label':_0x5d4881['label']}),_0x51cfb1['delegate']('execute')['to'](_0x4d6784),_0x51cfb1['on']('execute',()=>_0x5caf97(_0x5d4881['id'])),_0x51cfb1['bind']('isEnabled')['to'](_0x39cb71,'enabledCommandsIds',_0x4ff325=>_0x4ff325['includes'](_0x5d4881['id'])),_0x330ad7['children']['add'](_0x51cfb1),_0x330ad7;});}}function U(_0x4079a5,_0x45e51b){return void 0x0!==_0x4079a5['order']&&void 0x0===_0x45e51b['order']?0x1:void 0x0===_0x4079a5['order']&&void 0x0!==_0x45e51b['order']?-0x1:void 0x0!==_0x4079a5['order']&&void 0x0!==_0x45e51b['order']?_0x4079a5['order']-_0x45e51b['order']:0x0;}function B(_0x494ae1,_0x4b9fe0){_0x4b9fe0['sort'](U);const _0x1a76ca={},_0x4ec283=[];for(const _0x97916c of _0x4b9fe0)if(void 0x0!==_0x97916c['order']){if(_0x97916c['order']in _0x1a76ca)throw new _0x459533('ai-commands-config-order-collision',_0x494ae1,{'conflictingDefinitions':[_0x97916c,_0x1a76ca[_0x97916c['order']]]});_0x1a76ca[_0x97916c['order']]=_0x97916c,_0x4ec283['splice'](_0x97916c['order'],0x0,_0x97916c);}else _0x4ec283['push'](_0x97916c);return _0x4ec283;}class $n extends _0x38fe65{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x26ca79){super(_0x26ca79);const _0x2bdd2c=_0x26ca79['config'],_0x4c546d=_0x26ca79['locale'];_0x2bdd2c['define']('ai.assistant.preserveComments',!0x0),_0x2bdd2c['define']('ai.assistant.commands',qn(_0x4c546d)),_0x2bdd2c['define']('ai.assistant.extraCommandGroups',[]),_0x2bdd2c['define']('ai.assistant.removeCommands',[]);let _0x23ed5d=o(_0x2bdd2c['get']('ai.assistant.commands'),_0x4c546d);const _0x9de392=_0x2bdd2c['get']('ai.assistant.extraCommandGroups'),_0x409bf8=_0x2bdd2c['get']('ai.assistant.removeCommands');_0x9de392['forEach'](_0x2cdf6c=>{const _0x91aee4=_0x23ed5d['find'](_0x1e4717=>_0x1e4717['groupId']===_0x2cdf6c['groupId']);_0x91aee4?_0x91aee4['commands']=_0x91aee4['commands']['concat'](_0x2cdf6c['commands']):_0x23ed5d['push'](_0x2cdf6c);}),_0x23ed5d=_0x23ed5d['filter'](_0x58ac26=>!_0x409bf8['includes'](_0x58ac26['groupId'])),_0x23ed5d['forEach'](_0xbb0323=>{_0xbb0323['commands']=_0xbb0323['commands']['filter'](_0x409722=>!_0x409bf8['includes'](_0x409722['id']));}),_0x2bdd2c['set']('ai.assistant.commands',_0x23ed5d);}}function qn(_0x28ffba){return[{'groupId':'editOrReview','groupLabel':Wn(_0x28ffba,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Wn(_0x28ffba,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Wn(_0x28ffba,'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':Wn(_0x28ffba,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Wn(_0x28ffba,'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':Wn(_0x28ffba,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Wn(_0x28ffba,'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':Wn(_0x28ffba,'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':Wn(_0x28ffba,'Change\x20tone'),'commands':[{'id':'professional','label':Wn(_0x28ffba,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Wn(_0x28ffba,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Wn(_0x28ffba,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Wn(_0x28ffba,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Wn(_0x28ffba,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Wn(_0x28ffba,'Change\x20style'),'commands':[{'id':'business','label':Wn(_0x28ffba,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Wn(_0x28ffba,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Wn(_0x28ffba,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Wn(_0x28ffba,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Wn(_0x28ffba,'Translate'),'commands':[{'id':'translateEnglish','label':Wn(_0x28ffba,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Wn(_0x28ffba,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Wn(_0x28ffba,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Wn(_0x28ffba,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Wn(_0x28ffba,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Wn(_0x28ffba,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Wn(_0x28ffba,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Wn(_0x28ffba,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ye extends _0x38fe65{['abortController'];static get['requires'](){return[K];}constructor(_0x9be2ab){super(_0x9be2ab),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'](_0x1db01b){return this['sendRequest'](_0x1db01b)['catch'](_0x2931fd=>{if(_0x2931fd instanceof er)return Promise['reject'](_0x2931fd);if('AbortError'==_0x2931fd['name'])return Promise['resolve']();throw console['error'](_0x2931fd),new _0x459533('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x5a0ae7,_0x590c5d){const _0x51b2e4=this['editor']['locale'],_0x4df252={'Content-Type':'application/json'};if('object'==typeof _0x5a0ae7)Object['assign'](_0x4df252,_0x5a0ae7);else{if(_0x5a0ae7)try{const _0x54fac9=await _0x5a0ae7(_0x590c5d);Object['assign'](_0x4df252,_0x54fac9);}catch{return Promise['reject'](new er(Wn(_0x51b2e4,'AI_ERROR_GET_HEADERS')));}}return _0x4df252;}async['_prepareRequestParameters'](_0x41d9ce,_0x398269){const _0x2f7d9a=this['editor']['locale'];if('object'==typeof _0x41d9ce)return _0x41d9ce;try{return await _0x41d9ce(_0x398269);}catch{return Promise['reject'](new er(Wn(_0x2f7d9a,'AI_ERROR_GET_PARAMETERS')));}}}class Qn extends ye{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x251350){super(_0x251350),_0x251350['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x251350['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x251350['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x251350['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x251350['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x251350['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x32e8a0,context:_0x43f941,onData:_0x453f57,actionId:_0x2fd820}){const _0x5d0428=this['editor']['locale'],_0x435f67=await this['prepareMessages'](_0x32e8a0,_0x43f941,_0x2fd820),_0x51332b=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2fd820),_0xf9622=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2fd820),_0xd3fc99={'messages':_0x435f67,..._0xf9622},_0x271244={'method':'POST','headers':_0x51332b,'body':JSON['stringify'](_0xd3fc99),'signal':this['abortController']['signal']},_0xaf9a5d=await fetch(this['_apiUrl'],_0x271244);if(_0xaf9a5d['ok'])return _0xf9622['stream']?await this['_readStreamableResponse'](_0xaf9a5d,_0x453f57):await this['_readStaticResponse'](_0xaf9a5d,_0x453f57),Promise['resolve']();{const _0x1223e0=await _0xaf9a5d['text']();return _0x1223e0['includes']('context_length_exceeded')?Promise['reject'](new er(Wn(_0x5d0428,'AI_ERROR_CONTEXT_LENGTH'))):_0x1223e0['includes']('Moderation')?Promise['reject'](new er(Wn(_0x5d0428,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x1223e0));}}async['prepareMessages'](_0x31101d,_0x20b89e,_0x19736c){let _0x42d104,_0x26ce12;return _0x20b89e?(_0x42d104='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.',_0x26ce12='Instruction:\x0a'+_0x31101d+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x20b89e):(_0x42d104='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.',_0x26ce12=_0x31101d),[{'role':'system','content':_0x42d104},{'role':'user','content':_0x26ce12}];}async['_readStreamableResponse'](_0x52a974,_0x33493f){const _0x99575a=_0x52a974['body']['getReader'](),_0x5420e7=new TextDecoder();let _0xb63726='',_0x1e722b='',_0x33ea0e='',_0x5e948a=!0x1;for(;!_0x5e948a;){const {done:_0x13f7d0,value:_0x25d334}=await _0x99575a['read'](),_0x145b4d=_0xb63726+_0x5420e7['decode'](_0x25d334);let _0x3e0079='';_0x5e948a=_0x13f7d0;try{_0x3e0079=this['_cleanUpData'](_0x145b4d),_0xb63726='';}catch{_0xb63726=_0x145b4d;continue;}_0x1e722b+=_0x3e0079,!_0x5e948a&&this['_isBufferIncomplete'](_0x1e722b)||_0x1e722b&&(_0x33ea0e+=_0x1e722b,_0x1e722b='',_0x33493f(_0x33ea0e));}return Promise['resolve']();}async['_readStaticResponse'](_0xa2bad4,_0x1d6380){return _0x1d6380((await _0xa2bad4['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x5e25de){const _0x473104=_0x5e25de['split']('<')['length']!==_0x5e25de['split']('>')['length'],_0x2c6df7=_0x5e25de['length']<0x1e;return _0x473104&&_0x2c6df7;}['_cleanUpData'](_0x150405){return _0x150405['split'](/\n(?![^{]*\})/g)['map'](_0x35a81d=>_0x35a81d['replace']('data:\x20',''))['filter'](_0x486b75=>_0x486b75&&_0x486b75['length']>0x0&&'[DONE]'!==_0x486b75)['map'](_0x418a74=>{const {choices:_0x40eaa5}=JSON['parse'](_0x418a74);if(_0x40eaa5[0x0]?.['delta']?.['content'])return _0x40eaa5[0x0]['delta']['content'];})['filter'](_0x151cef=>_0x151cef)['join']('');}}class Xn extends ye{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x18f532){super(_0x18f532),_0x18f532['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x18f532['config']['define']('ai.assistant.adapter.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x18f532['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x18f532['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x18f532['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x18f532['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x38d4d6,context:_0x2642f5,onData:_0x26672c,actionId:_0x53b76d}){const {model:_0xb2d253,stream:_0x1d4b2f,..._0x8a420b}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x53b76d),_0x724b5e={'prompt':await this['preparePrompt'](_0x38d4d6,_0x2642f5,_0xb2d253,_0x53b76d),..._0x8a420b};this['_apiUrl']?await this['_processProxyRequest'](_0x724b5e,_0xb2d253,_0x1d4b2f,_0x26672c,_0x53b76d):await this['_processAWSRequest'](_0x724b5e,_0xb2d253,_0x1d4b2f,_0x26672c);}async['preparePrompt'](_0x1eb1dc,_0x49e2f1,_0x533084,_0x59242f){let _0x2ea2b7,_0x3412a7;return _0x49e2f1?(_0x2ea2b7='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.',_0x3412a7='Instruction:\x0a'+_0x1eb1dc+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x49e2f1):(_0x2ea2b7='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.',_0x3412a7=_0x1eb1dc),'meta.llama'==this['getModelFamily'](_0x533084)?'<<SYS>>\x0a'+_0x2ea2b7+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x3412a7+'\x0a[/INST]':'Human:\x0a'+_0x2ea2b7+'\x0a'+_0x3412a7+'\x0a\x0aAssistant:';}['getModelFamily'](_0x83e00e){if(/^anthropic\.claude/['test'](_0x83e00e))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x83e00e))return'ai21.j2';if(/^cohere\.command/['test'](_0x83e00e))return'cohere.command';if(/^meta\.llama/['test'](_0x83e00e))return'meta.llama';throw new er(Wn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x83e00e));}async['_processProxyRequest'](_0x585b47,_0x358526,_0x2fbe74,_0x5a9561,_0x31965b){const _0x5c1ac0={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x31965b),'body':JSON['stringify']({..._0x585b47,'model':_0x358526,'stream':_0x2fbe74}),'signal':this['abortController']['signal']},_0x2c6e49=await fetch(this['_apiUrl'],_0x5c1ac0);_0x2fbe74?await this['_readStreamableResponse'](_0x2c6e49,_0x358526,_0x5a9561):await this['_readStaticResponse'](_0x2c6e49,_0x358526,_0x5a9561);}async['_processAWSRequest'](_0x2ef15c,_0x1e2a81,_0x3e93a1,_0x3abdcc){const _0x4fd5ce=new _0x2e08ca(this['_bedrockClientConfig']),_0x5dfde4={'body':JSON['stringify'](_0x2ef15c),'contentType':'application/json','accept':'application/json','modelId':_0x1e2a81};let _0x497ced;if(_0x3e93a1){const _0x54f9f2=new _0x470573(_0x5dfde4);_0x497ced=await _0x4fd5ce['send'](_0x54f9f2,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x497ced,_0x1e2a81,_0x3abdcc);}else{const _0x395348=new _0x2ba763(_0x5dfde4);_0x497ced=await _0x4fd5ce['send'](_0x395348,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x497ced,_0x1e2a81,_0x3abdcc);}}async['_readAsyncIterableResponse'](_0x32ad65,_0x399b4e,_0xed865d){const _0x508f4e=_0x32ad65['body'],_0x123dec=new TextDecoder('utf-8');let _0x2fabb7='';for await(const _0x4504b2 of _0x508f4e)if(_0x4504b2['chunk']){const _0xb9f0b5=_0x123dec['decode'](_0x4504b2['chunk']['bytes']),_0x43cfc5=JSON['parse'](_0xb9f0b5);_0x2fabb7+=this['_getGeneratedText'](_0x43cfc5,_0x399b4e),_0xed865d(_0x2fabb7);}return Promise['resolve']();}async['_readStreamableResponse'](_0x14972d,_0x4f2280,_0x50913d){const _0x5f08cd=_0x14972d['body'],_0x264318=new TextDecoder('utf-8'),_0x5f190d=_0x5f08cd['getReader']();let _0x592419='',_0x56ab5b='',_0x218d22=!0x1;for(;!_0x218d22;){const {done:_0x396488,value:_0x1940b6}=await _0x5f190d['read']();if(_0x218d22=_0x396488,_0x218d22)break;const _0x58e600=(_0x592419+_0x264318['decode'](_0x1940b6))['split']('\x0a')['map'](_0x2d55e3=>{try{return _0x592419='',JSON['parse'](_0x2d55e3);}catch{return _0x592419=_0x2d55e3,null;}})['filter'](_0x8bc9a=>null!==_0x8bc9a);_0x58e600['length']&&(_0x56ab5b+=_0x58e600['map'](_0x1ab0a2=>this['_getGeneratedText'](_0x1ab0a2,_0x4f2280))['join'](''),_0x50913d(_0x56ab5b));}return Promise['resolve']();}async['_readStaticResponse'](_0x53de7c,_0x5750d1,_0x38be3f){let _0x7273d1;return _0x7273d1=_0x53de7c instanceof Response?await _0x53de7c['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x53de7c['body'])),(_0x38be3f(this['_getGeneratedText'](_0x7273d1,_0x5750d1)),Promise['resolve']());}['_getGeneratedText'](_0x4a6658,_0x28f52c){switch(this['getModelFamily'](_0x28f52c)){case'anthropic.claude':return _0x4a6658['completion'];case'ai21.j2':return _0x4a6658['completions'][0x0]['data']['text'];case'cohere.command':return _0x4a6658['generations'][0x0]['text'];case'meta.llama':return _0x4a6658['generation'];}}}class ia extends _0x4e2d9f{constructor(_0x2c2418,_0x306b84={}){super(_0x2c2418),this['isToggleable']=!0x0,this['set']('side',_0x306b84['side']||'top');const _0xf508ac=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x48bc65(_0x306b84['class']||[]),_0xf508ac['to']('side',_0x32e7fb=>'ck-tab-button_'+_0x32e7fb),_0xf508ac['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x13ab0e{['children'];constructor(_0x5c8979,_0x20f6ef={}){super(_0x5c8979);const _0x46f142=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x48bc65(_0x20f6ef['class']||[]),_0x46f142['to']('class'),_0x46f142['if']('isVisible','ck-hidden',_0x30f997=>!_0x30f997)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x13ab0e{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x441d83,_0x2de3ce={}){super(_0x441d83),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x2de3ce['side']||'top'),this['set']('isMaximized',!0x1);const _0x58e370=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x48bc65(_0x2de3ce['class']||[]),_0x58e370['to']('side',_0x130311=>'ck-tabs_'+_0x130311),_0x58e370['to']('class'),_0x58e370['to']('isMaximized',_0x1e7ca6=>_0x1e7ca6?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x58e370['to']('side',_0x5ad42d=>'ck-tabs__buttons-container_'+_0x5ad42d)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x58e370['to']('side',_0xd2a180=>'ck-tabs__panels-container_'+_0xd2a180)]},'children':this['panelViews']},..._0x48bc65(_0x2de3ce['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x46de81){const _0x281e96=this['_tabs']['get'](_0x46de81);return _0x281e96||null;}['addTab'](_0x23b3be){const _0x151beb=this['_setupButton']({'id':_0x23b3be['id'],'label':_0x23b3be['buttonLabel'],'icon':_0x23b3be['buttonIcon'],'order':_0x23b3be['order']}),_0x3c3acf=new ea(this['locale']);return _0x3c3acf['render'](),_0x23b3be['content']&&_0x3c3acf['children']['add'](_0x23b3be['content']),this['panelViews']['add'](_0x3c3acf),this['_tabs']['set'](_0x23b3be['id'],{'button':_0x151beb,'panel':_0x3c3acf,'order':void 0x0!==_0x23b3be['order']?_0x23b3be['order']:null}),this['fire']('addTab:'+_0x23b3be['id'],{'id':_0x23b3be['id'],'button':_0x151beb,'panel':_0x3c3acf}),null===this['activeTab']?this['activateTab'](_0x23b3be['id']):this['_hidePanel'](_0x23b3be['id']),{'button':_0x151beb,'panel':_0x3c3acf};}['activateTab'](_0x3f6a19){if(null!==_0x3f6a19&&!this['getTab'](_0x3f6a19))throw new _0x459533('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3f6a19});this['activeTab']!==_0x3f6a19&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x3f6a19,_0x3f6a19&&this['_showPanel'](_0x3f6a19),this['fire']('activateTab:'+_0x3f6a19,_0x3f6a19));}['showTab'](_0x253a69){if(!this['getTab'](_0x253a69))throw new _0x459533('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x253a69});this['_showPanel'](_0x253a69),this['_showButton'](_0x253a69),this['fire']('show:'+_0x253a69,_0x253a69);}['hideTab'](_0x2b4dd6){if(!this['getTab'](_0x2b4dd6))throw new _0x459533('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x2b4dd6});const _0x90df36=this['activeTab'];this['_hidePanel'](_0x2b4dd6),this['_hideButton'](_0x2b4dd6);const _0x2a5807=this['getTabIds']();_0x90df36===_0x2b4dd6&&_0x2a5807['length']>0x1&&this['activateTab'](_0x2a5807['find'](_0x354827=>_0x354827!==_0x2b4dd6)),this['fire']('hide:'+_0x2b4dd6,_0x2b4dd6);}['_getPanel'](_0x17caf0){const _0x29932c=this['_tabs']['get'](_0x17caf0);return _0x29932c?_0x29932c['panel']:null;}['_showPanel'](_0x1a2b2c){null!==this['activeTab']&&this['activeTab']!==_0x1a2b2c||this['_getPanel'](_0x1a2b2c)['show']();}['_hidePanel'](_0x42c05d){const _0x3d2eed=this['_getPanel'](_0x42c05d);_0x3d2eed['isVisible']&&(this['activeTab']===_0x42c05d&&(this['activeTab']=null),_0x3d2eed['hide']());}['_getButton'](_0x4e03b5){const _0x3de0db=this['_tabs']['get'](_0x4e03b5);return _0x3de0db?_0x3de0db['button']:null;}['_showButton'](_0x5c92d9){this['_getButton'](_0x5c92d9)['show']();}['_hideButton'](_0x50920b){this['_getButton'](_0x50920b)['hide']();}['_setupButton'](_0x4d9cc2){const _0x256bf9=new ia(this['locale'],{'side':this['side']}),_0x2a6649=this['buttonViews'];if(_0x256bf9['set']({'label':_0x4d9cc2['label'],'icon':_0x4d9cc2['icon'],'tooltip':!0x0,'withText':!0x0}),_0x256bf9['bind']('isOn')['to'](this,'activeTab',_0x254d9c=>_0x254d9c===_0x4d9cc2['id']),_0x256bf9['bind']('side')['to'](this,'side'),_0x4d9cc2['order']){const _0x3d53b3=[...this['_tabs']]['reduce']((_0x2f56b7,_0x5602aa)=>{const _0x3456bc=_0x5602aa[0x0],{order:_0x3f706b}=_0x5602aa[0x1];return!_0x3f706b||_0x3f706b>_0x4d9cc2['order']?_0x2f56b7:_0x3f706b>=_0x2f56b7['order']?{'id':_0x3456bc,'order':_0x3f706b}:_0x2f56b7;},{'id':'','order':0x0}),_0x1cd7c1=_0x2a6649['getIndex'](this['_getButton'](_0x3d53b3['id']));_0x2a6649['add'](_0x256bf9,_0x1cd7c1+0x1);}else _0x2a6649['add'](_0x256bf9);return _0x256bf9['on']('execute',()=>{this['activateTab'](_0x4d9cc2['id']);}),_0x256bf9;}}const ni=['overlay','sidebar','custom'],oi=['left','right'];class hi extends ss{constructor(_0x47a1e9,_0x334665={}){super(_0x47a1e9,_0x334665),this['set']('type',_0x334665['type']||'sidebar'),this['set']('side',_0x334665['side']||'right'),this['set']('isVisible',_0x334665['visibleByDefault']??!0x0);const _0x471d06=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x471d06['if']('type','ck-ai-tabs__overlay',_0x297250=>'overlay'===_0x297250),_0x471d06['if']('type','ck-ai-tabs__sidebar',_0x5a1c35=>'sidebar'===_0x5a1c35),_0x471d06['if']('isVisible','ck-hidden',_0x50a5d6=>!_0x50a5d6)]}}),this['buttonViews']['on']('add',(_0x2447ab,_0x2b1cd1)=>{_0x2b1cd1['set']('withText',!0x1);});}}class pt extends _0x479a76{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x542691){super(_0x542691);const _0x244c88=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x244c88)throw new _0x459533('ai-tabs-configuration-not-found');if(void 0x0!==_0x244c88['showResizeButton']&&(this['showResizeButton']=_0x244c88['showResizeButton']),'sidebar'!==_0x244c88['type']&&'overlay'!==_0x244c88['type']||_0x244c88['side']&&(this['side']=_0x244c88['side']),'sidebar'===_0x244c88['type']){if(this['container']=_0x244c88['element'],this['set']('type','sidebar'),!this['container'])throw new _0x459533('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x244c88['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===_0x244c88['visibleByDefault']||_0x244c88['visibleByDefault']}),this['view']['render'](),this['view']['bind']('side')['to'](this,'side'),this['view']['bind']('type')['to'](this,'type'),this['container']&&this['container']['appendChild'](this['view']['element']),this['context']instanceof dt&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x3c1ca3){if(_0x3c1ca3&&this['type']!==_0x3c1ca3){if(!ni['includes'](_0x3c1ca3))throw new _0x459533('ai-tabs-unsupported-ui-type');this['type']=_0x3c1ca3;}}['switchSide'](_0x22db68){if(_0x22db68&&this['side']!==_0x22db68){if(!oi['includes'](_0x22db68))throw new _0x459533('ai-tabs-unsupported-ui-side');this['side']=_0x22db68;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class q extends _0x479a76{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2d1ef0){super(_0x2d1ef0),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 _0x4b71d5=this['context']['plugins']['get']('CloudServices');if(!_0x4b71d5['token'])throw new _0x459533('ai-missing-token',this);this['_token']=_0x4b71d5['token'];}['startConversation'](_0x26504d,_0x1e1126){const _0x1c48e7=this['_sendApiRequest']('/conversations','POST',{'id':_0x26504d,'group':_0x1e1126});return{'getConversation':async()=>(await _0x1c48e7['request'])['json'](),'abortController':_0x1c48e7['abortController']};}['queryAssistant']({message:_0x4568d6,conversationId:_0x391c82,parts:_0x1839a7,capabilities:_0x498da9,model:_0x60abc0,attributes:_0xd665eb}){const _0x4eac7a={'prompt':_0x4568d6,'content':_0x1839a7,'model':_0x60abc0,..._0x498da9&&{'capabilities':_0x498da9},..._0xd665eb&&{'attributes':_0xd665eb}},_0x3ab68b=this['_sendApiRequest']('/conversations/'+_0x391c82+'/messages','POST',_0x4eac7a);return{'getStream':async()=>{const _0x4b5256=(await _0x3ab68b['request'])['body'];return this['_getStreamReader'](_0x4b5256);},'abortController':_0x3ab68b['abortController']};}['executeCustomAction']({content:_0x720c17,message:_0x53c579,model:_0xdef113,outputFormat:_0x562526}){const _0x215886={'content':[{'type':'text','content':_0x720c17}],'prompt':_0x53c579,'model':_0xdef113,'outputFormat':_0x562526},_0xe077ff=this['_sendApiRequest']('/actions/custom/calls','POST',_0x215886);return{'getStream':async()=>{const _0x355fe9=(await _0xe077ff['request'])['body'];return this['_getStreamReader'](_0x355fe9);},'abortController':_0xe077ff['abortController']};}['executeAction']({actionName:_0x97bd60,content:_0x346434,args:_0x65b657}){const _0x34c94b={'content':[{'type':'text','content':_0x346434}],'args':_0x65b657},_0x46d4b0=this['_sendApiRequest']('/actions/system/'+_0x97bd60+'/calls','POST',_0x34c94b);return{'getStream':async()=>{const _0x4e44ea=(await _0x46d4b0['request'])['body'];return this['_getStreamReader'](_0x4e44ea);},'abortController':_0x46d4b0['abortController']};}['uploadFile'](_0x27afbc,_0x5eae41,_0x208257){const _0x5c3994=new FormData();_0x5c3994['append']('file',_0x5eae41,_0x5eae41['name']),_0x208257&&_0x5c3994['append']('attributes',JSON['stringify'](_0x208257));const _0x35f8cc=this['_sendApiRequest']('/conversations/'+_0x27afbc+'/files','POST',_0x5c3994);return{'getId':async()=>(await _0x35f8cc['request'])['json'](),'abortController':_0x35f8cc['abortController']};}['fetchDocument'](_0x2ff4d4,_0x275874){const _0x49c08c=this['_sendApiRequest']('/conversations/'+_0x2ff4d4+'/documents/'+_0x275874,'GET');return{'getDocument':async()=>(await _0x49c08c['request'])['json'](),'abortController':_0x49c08c['abortController']};}['uploadDocument'](_0x353aae,_0x109b0c,_0x36f34c){const _0x3d29c3={'content':_0x109b0c};_0x36f34c&&(_0x3d29c3['attributes']=_0x36f34c);const _0x2db7f7=this['_sendApiRequest']('/conversations/'+_0x353aae+'/documents','POST',_0x3d29c3);return{'getId':async()=>(await _0x2db7f7['request'])['json'](),'abortController':_0x2db7f7['abortController']};}['fetchConversations'](_0x236a1f,_0x59cd21={}){const _0x50eef0=new URLSearchParams();_0x50eef0['append']('group',_0x236a1f),_0x50eef0['append']('excludeEmpty',!0x1!==_0x59cd21['excludeEmpty']?'true':'false'),_0x50eef0['append']('limit',_0x59cd21['limit']?_0x59cd21['limit']['toString']():'100'),_0x50eef0['append']('sortBy',_0x59cd21['sortBy']?_0x59cd21['sortBy']:'createdAt'),_0x50eef0['append']('order',_0x59cd21['order']?_0x59cd21['order']:'desc');const _0x11cb20=this['_sendApiRequest']('/conversations?'+_0x50eef0['toString'](),'GET');return{'getConversations':async()=>{const _0x1d9b58=await _0x11cb20['request'];return(await _0x1d9b58['json']())['items'];},'abortController':_0x11cb20['abortController']};}['deleteConversation'](_0x34c60a){const _0x5f4113=this['_sendApiRequest']('/conversations/'+_0x34c60a,'DELETE');return{'execute':async()=>{await _0x5f4113['request'];},'abortController':_0x5f4113['abortController']};}['updateConversation'](_0x20e915,_0xaa92ca){const _0x53d2c3=this['_sendApiRequest']('/conversations/'+_0x20e915,'PATCH',_0xaa92ca);return{'getResult':async()=>(await _0x53d2c3['request'],_0xaa92ca),'abortController':_0x53d2c3['abortController']};}['fetchConversation'](_0x5f4122){const _0x2dc816=this['_sendApiRequest']('/conversations/'+_0x5f4122,'GET');return{'getConversation':async()=>(await _0x2dc816['request'])['json'](),'abortController':_0x2dc816['abortController']};}['fetchConversationMessages'](_0x184d9f){const _0x2ade26=this['_sendApiRequest']('/conversations/'+_0x184d9f+'/messages','GET');return{'getMessages':async()=>{const _0x485e9f=await _0x2ade26['request'];return(await _0x485e9f['json']())['items'];},'abortController':_0x2ade26['abortController']};}['uploadUrl'](_0x248c36,_0x1ee749,_0x92d72c){const _0x5628ee=this['_sendApiRequest']('/conversations/'+_0x248c36+'/web-resources','POST',{'url':_0x1ee749,'attributes':_0x92d72c});return{'getId':async()=>(await _0x5628ee['request'])['json'](),'abortController':_0x5628ee['abortController']};}['getModels'](_0x4de626='en'){const _0x59eab8=new URLSearchParams();_0x59eab8['append']('language',_0x4de626);const _0x174227='/models/1?'+_0x59eab8['toString'](),_0x4bae6c=this['_sendApiRequest'](_0x174227,'GET');return{'list':async()=>await(await _0x4bae6c['request'])['json'](),'abortController':_0x4bae6c['abortController']};}['deleteFile'](_0x3fd40f,_0x2e0ec7){const _0xb55ac1=this['_sendApiRequest']('/conversations/'+_0x3fd40f+'/files/'+_0x2e0ec7,'DELETE');return{'execute':async()=>{await _0xb55ac1['request'];},'abortController':_0xb55ac1['abortController']};}['deleteDocument'](_0x562950,_0x3b399b){const _0x2b319f=this['_sendApiRequest']('/conversations/'+_0x562950+'/documents/'+_0x3b399b,'DELETE');return{'execute':async()=>{await _0x2b319f['request'];},'abortController':_0x2b319f['abortController']};}['deleteWebResource'](_0x3a5d8d,_0x2bce9f){const _0x1490c3=this['_sendApiRequest']('/conversations/'+_0x3a5d8d+'/web-resources/'+_0x2bce9f,'DELETE');return{'execute':async()=>{await _0x1490c3['request'];},'abortController':_0x1490c3['abortController']};}['callSystemReview']({reviewName:_0x56fa90,content:_0x2032ee,args:_0x24be1f}){const _0xb65ba4=this['_sendApiRequest']('/reviews/system/'+_0x56fa90+'/calls','POST',{'content':[{'type':'text','content':_0x2032ee}],'args':_0x24be1f});return{'getStream':async()=>{const _0x435991=(await _0xb65ba4['request'])['body'];return this['_getStreamReader'](_0x435991);},'abortController':_0xb65ba4['abortController']};}['callCustomReview']({content:_0x1e8184,prompt:_0x4c520f,model:_0x3eeb2e}){const _0x4530cc=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x1e8184}],'prompt':_0x4c520f,'model':_0x3eeb2e});return{'getStream':async()=>{const _0x569b62=(await _0x4530cc['request'])['body'];return this['_getStreamReader'](_0x569b62);},'abortController':_0x4530cc['abortController']};}['upsertAIChatRating'](_0x1ad4dc,_0x4e1e13,_0x455429){const _0x27ddd3=this['_sendApiRequest']('/conversations/'+_0x1ad4dc+'/messages/'+_0x4e1e13+'/ratings','PUT',{'positiveCount':_0x455429['positiveCount'],'totalCount':_0x455429['totalCount'],'modificationId':_0x455429['modificationId']});return{'execute':async()=>{await _0x27ddd3['request'];},'abortController':_0x27ddd3['abortController']};}['upsertAIActionRating'](_0x14fdea,_0x129a0d,_0x177301){const _0x5733fc=this['_sendApiRequest']('/actions/system/'+_0x14fdea+'/calls/'+_0x129a0d+'/ratings','PUT',{'positiveCount':_0x177301['positiveCount'],'totalCount':_0x177301['totalCount']});return{'execute':async()=>{await _0x5733fc['request'];},'abortController':_0x5733fc['abortController']};}['upsertCustomAIActionRating'](_0x4557d4,_0x2dcee8){const _0x96143e=this['_sendApiRequest']('/actions/custom/calls/'+_0x4557d4+'/ratings','PUT',{'positiveCount':_0x2dcee8['positiveCount'],'totalCount':_0x2dcee8['totalCount']});return{'execute':async()=>{await _0x96143e['request'];},'abortController':_0x96143e['abortController']};}['upsertAIReviewRating'](_0x3eb6f9,_0x3acf95,_0x3264df,_0x503f7b){const _0x1cef73=this['_sendApiRequest']('/reviews/system/'+_0x3eb6f9+'/calls/'+_0x3acf95+'/ratings','PUT',{'positiveCount':_0x3264df['positiveCount'],'totalCount':_0x3264df['totalCount'],'dataId':_0x503f7b});return{'execute':async()=>{await _0x1cef73['request'];},'abortController':_0x1cef73['abortController']};}['upsertCustomAIReviewRating'](_0x58d904,_0x319832,_0x2ae67c){const _0x516254=this['_sendApiRequest']('/reviews/custom/calls/'+_0x58d904+'/ratings','PUT',{'positiveCount':_0x319832['positiveCount'],'totalCount':_0x319832['totalCount'],'dataId':_0x2ae67c});return{'execute':async()=>{await _0x516254['request'];},'abortController':_0x516254['abortController']};}['_sendApiRequest'](_0x11d74f,_0x2f6278,_0x1c9b60){const _0x1d69c3=new AbortController(),_0x27ae42=_0x1c9b60 instanceof FormData,_0x5c6550={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x1c9b60&&!_0x27ae42&&(_0x5c6550['Content-Type']='application/json');const _0x125a08={'method':_0x2f6278,'headers':_0x5c6550,'signal':_0x1d69c3['signal']};return _0x1c9b60&&(_0x125a08['body']=_0x27ae42?_0x1c9b60:JSON['stringify'](_0x1c9b60)),{'request':fetch(''+this['_apiUrl']+_0x11d74f,_0x125a08)['catch'](_0x2905da=>{this['_handleError'](_0x2905da);})['then'](_0x3e5396=>_0x3e5396['ok']?_0x3e5396:_0x3e5396['json']()['then'](_0x2b694f=>{throw{'url':this['_apiUrl'],'path':_0x11d74f,'method':_0x2f6278,'body':_0x1c9b60,'status':(_0x3e5396||{})['status'],'statusText':(_0x3e5396||{})['statusText'],'code':_0x2b694f['code'],'message':_0x2b694f['message'],'traceId':_0x2b694f['traceId']};})),'abortController':_0x1d69c3};}async*['_getStreamReader'](_0x4891c0){const _0x17d964=[],_0x5ef0f3=_0x4891c0['getReader'](),_0x543d86=$t({'onError':_0x3b2121=>{this['_handleError'](_0x3b2121);},'onEvent':_0x4e7da5=>{_0x4e7da5['data']=JSON['parse'](_0x4e7da5['data']),_0x17d964['push'](_0x4e7da5);}});try{let _0x49bfd7=!0x1;for(;!_0x49bfd7;){const {done:_0x16031c,value:_0x78e770}=await _0x5ef0f3['read']();_0x16031c&&(_0x49bfd7=!0x0),_0x543d86['feed'](this['_decoder']['decode'](_0x78e770,{'stream':!0x0})),yield*_0x17d964,_0x17d964['length']=0x0;}}catch(_0x369d1a){this['_handleError'](_0x369d1a);}finally{_0x5ef0f3['releaseLock'](),_0x543d86['reset']();}}['_handleError'](_0x434c86){if(_0x434c86 instanceof _0x459533)throw _0x434c86;if(_0x434c86 instanceof Error&&'AbortError'===_0x434c86['name'])throw new _0x459533('ai-request-aborted',this,{'originalError':_0x434c86});throw new _0x459533('ai-request-failed',this,{'originalError':_0x434c86});}}function i(_0x60295c,_0x3f9cf6,_0x11949b){const t=_0x60295c['t'];switch(_0x3f9cf6){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'},_0x11949b);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.'},_0x11949b);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.'},_0x11949b);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.'},_0x11949b);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'},_0x11949b);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x11949b);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'},_0x11949b);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.'},_0x11949b);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.'},_0x11949b);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.'},_0x11949b);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.'},_0x11949b);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'},_0x11949b);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.'},_0x11949b);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 _0x3f9cf6;}}function Hs(_0x7bc8d1,_0x5e657e){const _0x242e30=new _0x4e2d9f(_0x7bc8d1),_0x379478=i(_0x7bc8d1,'AI_TABS_LABEL_MINIMIZE'),_0xf99790=i(_0x7bc8d1,'AI_TABS_LABEL_MAXIMIZE');return _0x242e30['set']({'withText':!0x1,'icon':_0x14f6c9,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0x242e30['bind']('label')['to'](_0x5e657e,'isMaximized',_0x22b515=>_0x22b515?_0x379478:_0xf99790),_0x242e30['bind']('icon')['to'](_0x5e657e,'isMaximized',_0x3cfc94=>_0x3cfc94?_0x38ccb9:_0x14f6c9),_0x242e30['bind']('isOn')['to'](_0x5e657e,'isMaximized'),_0x242e30['on']('execute',()=>{_0x5e657e['fire']('resizeTabs');}),_0x242e30;}function Ui(_0x365af7){return _0x2be6e6(_0x365af7);}function Tt(_0xd2f2f3){return _0x59f43c(_0xd2f2f3);}function St(_0x167a5a,_0x204a88,_0x2bf95a){const _0x172851=null!==_0x204a88?_0x5c7d63=>_0x5c7d63['attribs'][_0x167a5a]===_0x204a88:_0x3362f6=>Boolean(_0x3362f6['attribs'][_0x167a5a]);return yt(_0x370eac=>_0x1d78cd(_0x370eac)&&_0x172851(_0x370eac),_0x2bf95a);}function Ji(_0x1a0250,_0x4c4e0f,_0xf9afe6){const _0xf0f7e7=null!==_0x4c4e0f?_0x5e6c5f=>_0x5e6c5f['attribs'][_0x1a0250]===_0x4c4e0f:_0x2a2edb=>Boolean(_0x2a2edb['attribs'][_0x1a0250]);return _0x2cfca1(_0x970a3d=>_0x1d78cd(_0x970a3d)&&_0xf0f7e7(_0x970a3d),_0xf9afe6);}function At(_0xb189de,_0x552ee7){return _0xb189de&&_0x1d78cd(_0xb189de)?_0xb189de['attribs'][_0x552ee7]:null;}function Ns(_0x216c5d,_0x16c286,_0x1926b9){_0x1d78cd(_0x216c5d)&&(null===_0x1926b9?delete _0x216c5d['attribs'][_0x16c286]:_0x216c5d['attribs'][_0x16c286]=_0x1926b9);}function Xi(_0x50a5b1,_0x35b1a7,_0xa21a8f){const _0x2a17ed=_0x35b1a7['cloneNode'](!0x0);'beforebegin'===_0xa21a8f?_0x1e7915(_0x50a5b1,_0x2a17ed):'afterbegin'===_0xa21a8f?_0x14505f(_0x50a5b1,_0x2a17ed):'beforeend'===_0xa21a8f?_0x50edfc(_0x50a5b1,_0x2a17ed):'afterend'===_0xa21a8f&&_0x1a4c25(_0x50a5b1,_0x2a17ed);}function Pi(_0x195bb4){const _0x1154eb=[];let _0x39eeea=_0x195bb4;for(;_0x39eeea;)_0x39eeea=_0x33c249(_0x39eeea),_0x39eeea&&_0x1154eb['push'](_0x39eeea);return _0x1154eb;}function zn(_0x556ac0){return _0x556ac0['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Bs(_0x74ce61){let _0x4f53de=0x0;for(;_0x74ce61['parentNode'];)_0x74ce61=_0x74ce61['parentNode'],_0x4f53de++;return _0x4f53de;}function Us(_0x31ce42){const _0x29f4ba=[];let _0x445606=_0x31ce42['nextSibling'];for(;_0x445606;)_0x29f4ba['push'](_0x445606),_0x445606=_0x445606['nextSibling'];_0x29f4ba['forEach'](_0x99ed60=>{_0x187273(_0x99ed60);});}class qi extends/* #__PURE__ -- @preserve */
25
- ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x5c491a();}['convertMarkdownToHTML'](_0xe43599){const _0x22dd18=this['_m2html']['parse'](_0xe43599);return this['parseAndNormalizeHTML'](_0x22dd18);}['parseAndNormalizeHTML'](_0x156556){return this['_parseHTML'](_0x156556);}['_parseHTML'](_0x5e3abb){const _0x2337c6=Ui('<dummy>'+_0x5e3abb['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x2337c6['children']=_0x2337c6['children'][0x0]['children'],_0x2337c6;}}class zi extends/* #__PURE__ -- @preserve */
26
- ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x5d4624){super(),this['_generateUid']=_0x5d4624||_0x3d9d4e;}['merge'](_0x722751,_0x32eb4f,_0x2bc909){const _0x1af82c=_0x722751['cloneNode'](!0x0);if(0x0===_0x32eb4f['childNodes']['length']){const _0x5c4c9f=[];return Ji('data-id','new-element',_0x1af82c)['forEach'](_0x9e593e=>{const _0x166fe0=this['_generateUid']();Ns(_0x9e593e,'data-id',_0x166fe0),_0x5c4c9f['push'](_0x166fe0);}),this['_removeSpecialComments'](_0x1af82c),{'parsedContent':_0x1af82c,'newNodeIds':_0x5c4c9f,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x2bc909&&_0x2bc909['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x1af82c),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ji('data-id',null,_0x32eb4f)['map'](_0x215c61=>At(_0x215c61,'data-id'))['filter'](_0x4310b8=>!!_0x4310b8));let _0x109369=-0x1,_0x276c87=!0x1;const _0x3af1b6=_0x1af82c['childNodes'],_0x440159=Array['from'](_0x3af1b6)['filter'](_0x187972=>!(0x3===_0x187972['nodeType']&&''===Tt(_0x187972)['trim']())),_0x46397f=_0x440159['length'];for(let _0x1fc719=0x0;_0x1fc719<_0x46397f;_0x1fc719++){const _0x223fe7=_0x440159[_0x1fc719],_0x2cfcf9=_0x440159[_0x1fc719+0x1];if(this['_isNewNode'](_0x223fe7)){if(-0x1===_0x109369&&(_0x109369=_0x1fc719),this['_markWrappedElements'](_0x223fe7),!this['_isNewNode'](_0x2cfcf9)){const [_0x2e4a54,_0x1b3f49]=this['_findReferenceNode'](_0x223fe7,_0x276c87,_0x32eb4f);if(_0x2e4a54){const _0x9f551c=Array['from'](_0x440159)['slice'](_0x109369,_0x1fc719+0x1);this['_insertNodes'](_0x2e4a54,_0x9f551c,_0x1b3f49),_0x109369=-0x1;}}}else{if(this['_isExistingContentComment'](_0x223fe7))_0x276c87=!0x0;else{if(this['_isExistingNode'](_0x223fe7)){const _0x72ccb0=At(_0x223fe7,'data-id');if(_0x72ccb0&&this['_existingDataIds']['has'](_0x72ccb0)){const _0x5890cf=St('data-id',_0x72ccb0,_0x32eb4f);this['_replaceNode'](_0x5890cf,_0x223fe7);}if(this['_touchedNodesState']['removedIds']['includes'](_0x72ccb0)){const _0x1a3843=this['_touchedNodesState']['removedIds']['indexOf'](_0x72ccb0);this['_touchedNodesState']['removedIds']['splice'](_0x1a3843,0x1);}}else{if(this['_isDelNode'](_0x223fe7)){const _0x46595c=At(_0x223fe7,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x46595c)||this['_storeDeletedElementIds'](_0x223fe7);}}}}}for(const _0x2f7100 of this['_touchedNodesState']['removedIds']){const _0x44ff39=St('data-id',_0x2f7100,_0x32eb4f);if(_0x44ff39){if(_0x2bc909&&_0x2bc909['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x2f7100;const _0x4247ee=_0x2bc909['replaceRemovedWith']['cloneNode'](!0x0);Ns(_0x4247ee,'data-id',_0x2f7100),Ns(_0x4247ee,'data-removed','true'),_0x41a070(_0x44ff39,_0x4247ee);}else _0x187273(_0x44ff39);}}if(Ji('data-wrapped-id',null,_0x32eb4f)['forEach'](_0xac848a=>{const _0x3b0c1f=St('data-id',At(_0xac848a,'data-wrapped-id'),_0x32eb4f);var _0x4d8b21,_0x2890da;_0x3b0c1f&&(_0x2890da=_0xac848a,_0x187273(_0x4d8b21=_0x3b0c1f),_0x41a070(_0x2890da,_0x4d8b21));}),Ji('data-id','new-element',_0x32eb4f)['forEach'](_0x59d2c2=>{const _0x1486bf=this['_getUid'](_0x59d2c2);Ns(_0x59d2c2,'data-id',_0x1486bf),this['_touchedNodesState']['newIds']['push'](_0x1486bf);}),this['_removeSpecialComments'](_0x32eb4f),_0x2bc909&&_0x2bc909['markUnstableElements']&&this['_markUnstableElements'](_0x32eb4f,_0x2bc909['markUnstableElementsDepth']||0x0),_0x2bc909&&_0x2bc909['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x545c1e=St('data-id',this['_touchedNodesState']['lastTouchedId'],_0x32eb4f);for(;_0x545c1e;)Us(_0x545c1e),_0x545c1e=_0x545c1e['parentNode'];}return{'parsedContent':_0x32eb4f,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x53f094,_0x71cde0,_0x198bc0){for(const _0x19e832 of _0x71cde0){const _0xecc9a8=this['_getUid'](_0x19e832);Ns(_0x19e832,'data-id',_0xecc9a8),this['_touchedNodesState']['newIds']['push'](_0xecc9a8),this['_touchedNodesState']['lastTouchedId']=_0xecc9a8;}const _0x5d9e1c='afterbegin'===_0x198bc0||'afterend'===_0x198bc0?_0x71cde0['reverse']():_0x71cde0;for(const _0x1fe6a3 of _0x5d9e1c)Xi(_0x53f094,_0x1fe6a3,_0x198bc0);}['_replaceNode'](_0x26ddb8,_0xcd4647){if(!_0x26ddb8)return;if(_0x9b125e=_0xcd4647,zn(Tt(_0x26ddb8))===zn(Tt(_0x9b125e)))return;var _0x9b125e;const _0x3385b4=this['_getUid'](_0x26ddb8);Ns(_0xcd4647,'data-id',_0x3385b4),this['_touchedNodesState']['modifiedIds']['push'](_0x3385b4),this['_touchedNodesState']['lastTouchedId']=_0x3385b4,_0x41a070(_0x26ddb8,_0xcd4647['cloneNode'](!0x0));}['_findReferenceNode'](_0x116c72,_0x129529,_0x5db14e){const _0xeaa432=this['_findPrevElementWithDataId'](_0x116c72,!0x1);if(_0xeaa432){const _0xf7c4e8=this['_getNodeDataId'](_0xeaa432),_0xabf6=St('data-id',_0xf7c4e8,_0x5db14e);if(_0xabf6)return[_0xabf6,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0xf7c4e8);}const _0x3b8b14=this['_findNextElementWithDataId'](_0x116c72,!0x1);if(_0x3b8b14){const _0x3c5da1=this['_getNodeDataId'](_0x3b8b14),_0x152395=St('data-id',_0x3c5da1,_0x5db14e);if(_0x152395)return[_0x152395,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x3c5da1);}return _0x129529?_0x116c72['nextSibling']?this['_findFallbackReferenceNode'](_0x116c72,_0x5db14e):[_0x5db14e['childNodes'][_0x5db14e['childNodes']['length']-0x1],'afterend']:[_0x5db14e['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x4d87b4,_0x44a00d){const _0x361dcb=[],_0x42e360=this['_findPrevElementWithDataId'](_0x4d87b4,!0x0);if(_0x42e360){const _0x5cde0a=St('data-id',this['_getNodeDataId'](_0x42e360),_0x44a00d);_0x5cde0a&&_0x361dcb['push']([_0x5cde0a,'afterend']);}const _0x193c47=this['_findNextElementWithDataId'](_0x4d87b4,!0x0);if(_0x193c47){const _0x38c12b=St('data-id',this['_getNodeDataId'](_0x193c47),_0x44a00d);_0x38c12b&&_0x361dcb['push']([_0x38c12b,'beforebegin']);}if(_0x361dcb['length']>0x1)return Bs(_0x361dcb[0x0][0x0])<=Bs(_0x361dcb[0x1][0x0])?_0x361dcb[0x0]:_0x361dcb[0x1];return 0x1===_0x361dcb['length']?_0x361dcb[0x0]:[_0x44a00d['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x51553f,_0x547b0f){let _0x21882c=_0x51553f['nextSibling'],_0x1e0643=null,_0x13ad54=!0x1;for(;_0x21882c;){if(_0x1d9f63(_0x21882c)){if(this['_isDelNode'](_0x21882c)&&(_0x1e0643=_0x21882c),this['_isExistingContentComment'](_0x21882c)&&_0x547b0f&&!_0x13ad54){_0x13ad54=!0x0,_0x21882c=_0x21882c['nextSibling'];continue;}break;}const _0x183761=At(_0x21882c,'data-id');if(_0x183761&&'new-element'!==_0x183761&&this['_existingDataIds']['has'](_0x183761)){_0x1e0643=_0x21882c;break;}_0x21882c=_0x21882c['nextSibling'];}return _0x1e0643;}['_findPrevElementWithDataId'](_0x3103c3,_0x12d267){let _0x204444=_0x3103c3['previousSibling'],_0x4f04c0=null,_0x1d2148=!0x1;for(;_0x204444;){if(_0x1d9f63(_0x204444)){if(this['_isDelNode'](_0x204444)&&(_0x4f04c0=_0x204444),this['_isExistingContentComment'](_0x204444)&&_0x12d267&&!_0x1d2148){_0x1d2148=!0x0,_0x204444=_0x204444['previousSibling'];continue;}break;}const _0x149748=At(_0x204444,'data-id');if(_0x149748&&'new-element'!==_0x149748&&this['_existingDataIds']['has'](_0x149748)){_0x4f04c0=_0x204444;break;}_0x204444=_0x204444['previousSibling'];}return _0x4f04c0;}['_markWrappedElements'](_0x152861){_0x1d78cd(_0x152861)&&Ji('data-id',null,_0x152861)['forEach'](_0x3d09c7=>{this['_isExistingNode'](_0x3d09c7)&&!this['_hasWrappedParent'](_0x3d09c7)&&(Ns(_0x3d09c7,'data-wrapped-id',At(_0x3d09c7,'data-id')),Ns(_0x3d09c7,'data-id',null));});}['_getNodeDataId'](_0x40c169){if(!_0x40c169)return null;if(_0x1d78cd(_0x40c169))return At(_0x40c169,'data-id');if(_0x1d9f63(_0x40c169)){const _0x25e20f=Tt(_0x40c169)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x25e20f&&_0x25e20f[0x1])return _0x25e20f[0x1];}return null;}['_storeDeletedElementIds'](_0x2fb794){if(_0x1d9f63(_0x2fb794)){const _0xf2a665=Tt(_0x2fb794)['match'](/removed[\s*-]data-id="([^"]+)"/);_0xf2a665&&_0xf2a665[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0xf2a665[0x1]);}}['_getUid'](_0x34db3f){return this['_isExistingNode'](_0x34db3f)?At(_0x34db3f,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x167b51){(function(_0x1733b2){return _0x25fd48(_0x52e6ed=>_0x1d9f63(_0x52e6ed),_0x1733b2,!0x0,0x1/0x0);}(_0x167b51)['filter'](_0x1fb285=>this['_isDelNode'](_0x1fb285)||this['_isExistingContentComment'](_0x1fb285))['forEach'](_0x3b511c=>{_0x187273(_0x3b511c);}));}['_markLastTagElementUnstable'](_0x3b778a){const _0x6a7bf2=_0x3b778a['childNodes'],_0x15cc4c=_0x6a7bf2[_0x6a7bf2['length']-0x1];_0x15cc4c&&_0x1d78cd(_0x15cc4c)&&Ns(_0x15cc4c,'data-unstable','true');}['_markUnstableElements'](_0x493f2e,_0x4abfa3){const _0x3c6c1a=St('data-unstable','true',_0x493f2e);if(!_0x3c6c1a)return;const _0x45db03=Pi(_0x3c6c1a)['slice'](0x0,-0x1),_0x4c9687=_0x45db03['length'];let _0x418f9e=_0x3c6c1a;if(_0x4c9687>_0x4abfa3){let _0xbf6c3f=_0x4c9687,_0x1183a2=null;for(;_0xbf6c3f>_0x4abfa3&&_0xbf6c3f>=0x0;)_0xbf6c3f--,_0x1183a2=_0x45db03[_0xbf6c3f];_0x1183a2&&(_0x418f9e=_0x1183a2,Ns(_0x3c6c1a,'data-unstable',null),Ns(_0x1183a2,'data-unstable','true'));}else{if(_0x4c9687<_0x4abfa3){let _0x28c167=_0x4c9687,_0x48181c=_0x3c6c1a;for(;_0x28c167<_0x4abfa3;){const _0x24041e=_0x48181c['childNodes']['filter'](_0x87f4da=>_0x1d78cd(_0x87f4da));if(0x0===_0x24041e['length'])break;_0x28c167++,_0x48181c=_0x24041e[_0x24041e['length']-0x1];}_0x48181c&&(_0x418f9e=_0x48181c,Ns(_0x3c6c1a,'data-unstable',null),Ns(_0x48181c,'data-unstable','true'));}}let _0x1c98c7=_0x418f9e;for(;_0x1c98c7;){for(;_0x1c98c7['nextSibling'];)_0x1c98c7=_0x1c98c7['nextSibling'],_0x1d78cd(_0x1c98c7)&&Ns(_0x1c98c7,'data-unstable','true');_0x1c98c7=_0x1c98c7['parentNode'];}}['_isNewNode'](_0x1d2e11){return Boolean('new-element'===At(_0x1d2e11,'data-id'));}['_isExistingNode'](_0x1d87ef){return Boolean((At(_0x1d87ef,'data-id')||'')['length']>0x0&&'new-element'!==At(_0x1d87ef,'data-id'));}['_isDelNode'](_0x1f0388){return!!_0x1f0388&&Boolean(_0x1d9f63(_0x1f0388)&&Tt(_0x1f0388)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x57ed93){let _0x24b3f3=_0x57ed93['parentNode'];for(;_0x24b3f3;){if(At(_0x24b3f3,'data-wrapped-id'))return!0x0;_0x24b3f3=_0x24b3f3['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x9ef724){return Boolean(_0x1d9f63(_0x9ef724)&&Tt(_0x9ef724)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function J({editor:_0xc5e85,changeGroups:_0x4ef918,documentContextContent:_0x1e334c,showDiff:_0x4770be,trimUnchanged:_0x564d02=!0x0}){return _0x4ef918['map'](_0x130379=>{const _0x308b5e=new Et([]),_0x247b42=new Et([]);for(const _0x36136b of _0x130379['changes'])if(_0x4770be&&'removed'==_0x36136b['type']||_0x247b42['children']['push'](_0x36136b['node']['cloneNode'](!0x0)),'new'!=_0x36136b['type']&&(_0x4770be||'removed'!=_0x36136b['type'])){const _0x173ef7=yt(_0x164076=>At(_0x164076,'data-id')==_0x36136b['id'],_0x1e334c,!0x0);_0x173ef7&&_0x308b5e['children']['push'](_0x173ef7['cloneNode'](!0x0));}const {content:_0x13ee54,hasChanges:_0xf48557}=function(_0x5001ef,_0x5083ae,_0x519273,_0x436faa,_0x2cce0e=!0x0){const _0x35c815=_0x5001ef['plugins']['get']('DocumentCompare'),_0x69cc4f=Tt(_0x5083ae),_0x1baa2b=Tt(_0x519273),_0x455728=_0x5001ef['data']['parse'](_0x69cc4f,'$root'),_0x1d4832=_0x5001ef['model']['createPositionAt'](_0x455728,0x0),_0x1ad762=_0x35c815['getDiff'](_0x69cc4f,_0x1baa2b,{'anchor':_0x1d4832,'markDeletions':_0x436faa}),_0x6c7229=_0x1ad762['getOperations']();if(0x0==_0x6c7229['length'])return{'content':_0x5083ae['cloneNode'](!0x0),'hasChanges':!0x1};_0x436faa?function(_0xa66abd,_0x58cde6,_0x4f14f6){if(0x0==_0xa66abd['length'])return;const _0xf3fba=_0x4f14f6['plugins']['get']('DocumentCompare'),_0x25a87d=_0x4f14f6['plugins']['get']('SuggestionsConversion');_0x4f14f6['model']['change'](_0x93d67d=>{const _0x12feda=new Set();for(let _0x1f12b0=0x0;_0x1f12b0<_0xa66abd['length'];_0x1f12b0++){const _0x220209=_0xa66abd[_0x1f12b0];if(_0x220209['baseVersion']=null,_0x220209['isDocumentOperation']=!0x1,_0xf3fba['isMarkedRemoveOperation'](_0x220209)){const _0x137323=_0x4ddaa8(_0x220209['newRange'],_0x4f14f6['model']),_0x53c7ac='suggestion:deletion:'+_0x3d9d4e()+':$aiSuggestion';_0x58cde6['markers']['set'](_0x53c7ac,_0x137323);}else switch(_0x220209['type']){case'rename':{if(_0x220209['oldName']==_0x220209['newName'])break;_0x93d67d['batch']['addOperation'](_0x220209),_0x4f14f6['model']['applyOperation'](_0x220209);const _0x2af3d9='$elementName',_0xaee8fa=_0x220209['position'],_0x1b6796=_0x4f14f6['model']['createRange'](_0xaee8fa,_0x4f14f6['model']['createPositionAt'](_0xaee8fa['nodeAfter'],'end')),_0x208c30='suggestion:attribute:'+_0x2af3d9+':'+_0x3d9d4e()+':$aiSuggestion';_0x58cde6['markers']['set'](_0x208c30,_0x1b6796);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x220209['oldValue']==_0x220209['newValue'])break;_0x93d67d['batch']['addOperation'](_0x220209),_0x4f14f6['model']['applyOperation'](_0x220209);const _0x450d97=_0x220209['key'];if(!_0x25a87d['isRegisteredAttribute'](_0x450d97))break;const _0x3c6e85=_0x4ddaa8(_0x220209['range'],_0x4f14f6['model']),_0x3bf74a='suggestion:attribute:'+_0x450d97+':'+_0x3d9d4e()+':$aiSuggestion';_0x58cde6['markers']['set'](_0x3bf74a,_0x3c6e85);break;}case'insert':{_0x93d67d['batch']['addOperation'](_0x220209),_0x4f14f6['model']['applyOperation'](_0x220209);if(_0xa66abd[_0x1f12b0+0x1]&&'move'==_0xa66abd[_0x1f12b0+0x1]['type']){no(_0x58cde6,_0x220209);break;}const _0x2b2936=_0x220209['position'],_0x11934b=_0x220209['howMany'],_0x7bcc6=_0x4ddaa8(_0x4f14f6['model']['createRange'](_0x2b2936,_0x2b2936['getShiftedBy'](_0x11934b)),_0x4f14f6['model']),_0x426985='suggestion:insertion:'+_0x3d9d4e()+':$aiSuggestion';_0x58cde6['markers']['set'](_0x426985,_0x7bcc6);break;}case'split':{_0x93d67d['batch']['addOperation'](_0x220209),_0x4f14f6['model']['applyOperation'](_0x220209);const _0x19cb9b=_0x220209['splitPosition'],_0x11fb5a=_0x220209['moveTargetPosition'],_0xb0b44b=_0x4f14f6['model']['createRange'](_0x19cb9b,_0x11fb5a),_0x215e32='suggestion:insertion:'+_0x3d9d4e()+':$aiSuggestion';_0x58cde6['markers']['set'](_0x215e32,_0xb0b44b);break;}case'move':{_0x93d67d['batch']['addOperation'](_0x220209),_0x4f14f6['model']['applyOperation'](_0x220209),_0xa66abd[_0x1f12b0-0x1]&&'insert'==_0xa66abd[_0x1f12b0-0x1]['type']&&no(_0x58cde6,_0x220209);const _0x3debd5=_0x220209['getMovedRangeStart'](),_0x10815d=_0x220209['howMany'];for(let _0x5d8780=0x0;_0x5d8780<_0x10815d;_0x5d8780++){const _0x279349=_0x3debd5['getShiftedBy'](_0x5d8780)['nodeAfter'];_0x12feda['add'](_0x279349);}break;}case'remove':{const _0x27112a=_0x220209['sourcePosition'],_0x5f3c96=_0x220209['howMany'],_0x3df445=new et(_0x27112a,_0x5f3c96);_0x93d67d['batch']['addOperation'](_0x3df445),_0x4f14f6['model']['applyOperation'](_0x3df445);break;}}}for(const _0x4d4007 of _0x12feda){const _0x38711f=_0x4f14f6['model']['createRangeOn'](_0x4d4007),_0x42553f='suggestion:formatBlock:$fakeWrap:'+_0x3d9d4e()+':$aiSuggestion';_0x58cde6['markers']['set'](_0x42553f,_0x4ddaa8(_0x38711f,_0x4f14f6['model']));}});}(_0x6c7229,_0x455728,_0x5001ef):_0x5001ef['model']['change'](_0x4cb87a=>{for(const _0x5bb284 of _0x6c7229)if('remove'==_0x5bb284['type']){const _0xc2276=_0x5bb284['sourcePosition'],_0x28dbaa=_0x5bb284['howMany'],_0x4dcf28=new et(_0xc2276,_0x28dbaa);_0x4cb87a['batch']['addOperation'](_0x4dcf28),_0x5001ef['model']['applyOperation'](_0x4dcf28);}else{if('marker'==_0x5bb284['type']){const _0x1050ac=_0x5bb284['name'],_0x41a0a2=_0x5bb284['newRange'];null!==_0x41a0a2?_0x455728['markers']['set'](_0x1050ac,_0x41a0a2):_0x455728['markers']['delete'](_0x1050ac);}else _0x5bb284['baseVersion']=null,_0x5bb284['isDocumentOperation']=!0x1,_0x4cb87a['batch']['addOperation'](_0x5bb284),_0x5001ef['model']['applyOperation'](_0x5bb284);}});if(_0x2cce0e){const _0x3e3b14=mt(_0x5001ef,_0x6c7229,_0x455728);ft(_0x5001ef['model'],_0x3e3b14),function(_0x1e04fc,_0x19f962){const _0x483037=_0x19f962['getFirstRange']()['start'];let _0x7ab853=_0x19f962['getFirstRange']()['end'];const _0x498be0=_0x483037['root'];(_0x7ab853['textNode']||_0x7ab853['nodeAfter']&&_0x7ab853['nodeAfter']['is']('$text'))&&(_0x1f8e27(_0x7ab853,'...'),_0x7ab853=_0x7ab853['getShiftedBy'](0x3)),(_0x483037['textNode']||_0x483037['nodeBefore']&&_0x483037['nodeBefore']['is']('$text'))&&(_0x1f8e27(_0x483037,'...'),function(_0x462a73,_0xe4846e,_0x40cf95){for(let [_0x455971,_0x210af1]of _0x462a73['markers']){const _0x22cf58=_0x210af1['_getTransformedByInsertion'](_0xe4846e,_0x40cf95,!0x1);_0x210af1=_0x22cf58[0x0],_0x462a73['markers']['set'](_0x455971,_0x210af1);}}(_0x498be0,_0x483037,0x3),_0x483037['parent']==_0x7ab853['parent']&&(_0x7ab853=_0x7ab853['getShiftedBy'](0x3)));const _0x13077f=_0x1e04fc['createRange'](_0x1e04fc['createPositionAt'](_0x498be0,0x0),_0x483037),_0x4957aa=_0x1e04fc['createRange'](_0x7ab853,_0x1e04fc['createPositionAt'](_0x498be0,'end')),_0x4582b2=[..._0x13077f['getMinimalFlatRanges'](),..._0x4957aa['getMinimalFlatRanges']()];_0x4582b2['reverse']();for(const _0x3ae9aa of _0x4582b2)to(_0x3ae9aa),Jn(_0x498be0,_0x3ae9aa);}(_0x5001ef['model'],_0x3e3b14);}const _0x16dbe7=_0x5001ef['data']['stringify'](_0x455728,{'showSuggestionHighlights':!0x0});return{'content':Ui(_0x16dbe7),'hasChanges':!0x0};}(_0xc5e85,_0x308b5e,_0x247b42,_0x4770be,_0x564d02);return{'type':_0x130379['changes'][0x0]['type'],'index':_0x130379['index'],'content':_0x13ee54,'hasChanges':_0xf48557};});}function no(_0x52a6a7,_0x17a957){for(const [_0x1e2472,_0x40dc34]of _0x52a6a7['markers']){const _0x23043d=it['_createFromRanges'](_0x40dc34['getTransformedByOperation'](_0x17a957));_0x52a6a7['markers']['set'](_0x1e2472,_0x23043d);}}function mt(_0x189136,_0x234a29,_0x5daf5a){const _0x22825d=_0x189136['plugins']['get']('DocumentCompare');let _0x2e8721=_0x189136['model']['createPositionAt'](_0x5daf5a,Number['POSITIVE_INFINITY']),_0x28bf0a=_0x189136['model']['createPositionAt'](_0x5daf5a,0x0);for(const _0x47dd33 of _0x234a29){let _0x16f9ee,_0x4d443e;if(_0x22825d['isMarkedRemoveOperation'](_0x47dd33))_0x16f9ee=_0x47dd33['newRange']['start'],_0x4d443e=_0x47dd33['newRange']['end'];else switch(_0x2e8721=_0x2e8721['getTransformedByOperation'](_0x47dd33),_0x28bf0a=_0x28bf0a['getTransformedByOperation'](_0x47dd33),_0x47dd33['type']){case'rename':_0x16f9ee=_0x47dd33['position'],_0x4d443e=_0x16f9ee['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x16f9ee=_0x47dd33['range']['start'],_0x4d443e=_0x47dd33['range']['end'];break;case'insert':_0x16f9ee=_0x47dd33['position'],_0x4d443e=_0x16f9ee['getShiftedBy'](_0x47dd33['howMany']);break;case'split':_0x16f9ee=_0x47dd33['splitPosition'],_0x4d443e=_0x47dd33['moveTargetPosition'];break;case'merge':{const _0xf104a3=_0x47dd33['targetPosition']['path']['slice'](0x0,-0x1);_0x16f9ee=_0x189136['model']['createPositionFromPath'](_0x5daf5a,_0xf104a3),_0x4d443e=_0x16f9ee['getShiftedBy'](0x1);break;}case'remove':{const _0x39eee1=_0x47dd33['howMany'],_0x5f35c0=_0x47dd33['sourcePosition']['_getTransformedByInsertion'](_0x47dd33['targetPosition'],_0x39eee1),_0x2454ea=_0x47dd33['getMovedRangeStart']();'remove'==_0x47dd33['type']?(_0x16f9ee=_0x5f35c0,_0x4d443e=_0x5f35c0):(_0x16f9ee=_0x2454ea,_0x4d443e=_0x2454ea['getShiftedBy'](_0x39eee1));break;}}_0x16f9ee&&_0x16f9ee['isBefore'](_0x2e8721)&&(_0x2e8721=_0x16f9ee['clone'](),_0x2e8721['stickiness']='toNone'),_0x4d443e&&_0x4d443e['isAfter'](_0x28bf0a)&&(_0x28bf0a=_0x4d443e['clone'](),_0x28bf0a['stickiness']='toNone');}return _0x189136['model']['createSelection'](_0x189136['model']['createRange'](_0x2e8721,_0x28bf0a));}function ft(_0x474977,_0x17d19d){ro(_0x474977,_0x17d19d,'forward');const _0x2f4460=_0x17d19d['getFirstRange']();_0x17d19d['setTo']([]),_0x17d19d['setTo'](_0x2f4460,{'backward':!0x0}),ro(_0x474977,_0x17d19d,'backward');}function ro(_0x4c827b,_0x3e90c5,_0x20cfae){let _0x1546ca=0x14;for(;_0x1546ca;){_0x4c827b['modifySelection'](_0x3e90c5,{'unit':'word','direction':_0x20cfae}),_0x1546ca--;const _0x3e2731=_0x3e90c5['focus']['forward'==_0x20cfae?'nodeBefore':'nodeAfter'];if(_0x3e2731&&_0x3e2731['is']('element')&&_0x4c827b['schema']['isBlock'](_0x3e2731)&&_0x4c827b['schema']['isObject'](_0x3e2731))break;}}function Jn(_0x43b652,_0x46cbe6){for(const [_0x11e04b,_0x592936]of _0x43b652['markers']){const _0x5a8174=_0x592936['_getTransformedByDeletion'](_0x46cbe6['start'],_0x46cbe6['end']['offset']-_0x46cbe6['start']['offset']);null!=_0x5a8174?_0x43b652['markers']['set'](_0x11e04b,_0x5a8174):_0x43b652['markers']['delete'](_0x11e04b);}}class He extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new Et([]);['parsedMergedContent']=new Et([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x562c3b,content:_0x1397e0='',isDone:_0xf71ce6=!0x1,interactionId:_0x3de3f2,areActionsDisabled:_0x2b2519,documentContextContent:_0x347417,editor:_0x244817,id:_0x45e603}){super(),this['id']=_0x45e603||_0x3d9d4e(),this['interactionId']=_0x3de3f2,this['type']=_0x562c3b,this['areActionsDisabled']=!!_0x2b2519,this['editor']=_0x244817,this['aiResponseParser']=new qi(),this['aiResponseApplier']=new zi(),this['documentContextContent']=Ui(_0x347417||''),this['set']('isDone',_0xf71ce6),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x1397e0);}['appendContent'](_0x4d3ee6){this['set']('content',this['content']+_0x4d3ee6);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x806a4f,_0x5892b3){this['changeGroups'][_0x806a4f]['state']=_0x5892b3,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x806a4f,'state':_0x5892b3});}['getContentParts']({showDiff:_0x1d7a0d,groupIndex:_0x189357}){if(!this['editor'])throw new _0x459533('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x4e389a=this['_getCachedContentParts'](_0x1d7a0d,_0x189357);if(_0x4e389a)return _0x4e389a;let _0x57d7cd=[];if(void 0x0===_0x189357)_0x57d7cd=this['changeGroups'];else{const _0x5e3c31=this['changeGroups']['find'](({index:_0xb4dd50})=>_0xb4dd50===_0x189357);if(!_0x5e3c31)throw new _0x459533('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x189357});_0x57d7cd=[_0x5e3c31];}const _0x2e86e7=J({'editor':this['editor'],'showDiff':_0x1d7a0d,'changeGroups':_0x57d7cd,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x1d7a0d,_0x2e86e7),_0x2e86e7;}['_getCachedContentParts'](_0x39d1fb,_0x28dbc8){const _0x20bcc7=_0x39d1fb?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x20bcc7]['length'])return null;const _0x5f125f=this['cachedSuggestionContentParts'][_0x20bcc7];if(void 0x0===_0x28dbc8)return _0x5f125f['length']>0x0&&_0x5f125f['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x39d1fb,null),null):_0x4e1a4d(_0x5f125f);{const _0x37a37=_0x5f125f['find'](({index:_0x305b5a})=>_0x305b5a===_0x28dbc8);if(_0x37a37)return[_0x4e1a4d(_0x37a37)];}return null;}['_setCachedContentParts'](_0x582875,_0x8fc609){const _0x1193fc=_0x582875?'withDiff':'withoutDiff';_0x8fc609?_0x8fc609['forEach'](_0x4f611e=>{const _0x2bf425=this['cachedSuggestionContentParts'][_0x1193fc],_0x1d5667=_0x2bf425['find'](({index:_0x36967c})=>_0x36967c===_0x4f611e['index']);if(_0x1d5667){const _0x23ed14=_0x2bf425['indexOf'](_0x1d5667);_0x2bf425['splice'](_0x23ed14,0x1,_0x4f611e);}else _0x2bf425['push'](_0x4f611e);}):this['cachedSuggestionContentParts'][_0x1193fc]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x449426=this['changeGroups'];this['updateChangeGroups']();const _0x261bef=this['_getDifferentChangeGroups'](_0x449426,this['changeGroups']);(_0x261bef['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x261bef),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x4e0f63,_0x2ed9e0){const _0x29cab3=[];for(const _0x52b227 of _0x2ed9e0){const _0x3909e6=_0x4e0f63[_0x52b227['index']];_0x3909e6?_0x3909e6['changes']['length']!==_0x52b227['changes']['length']?_0x29cab3['push'](_0x52b227):_0x3909e6['changes']['forEach']((_0x3d6a84,_0x50e2d0)=>{const _0xd6af71=_0x52b227['changes'][_0x50e2d0];_0x3d6a84['id']!==_0xd6af71['id']&&_0x29cab3['push'](_0x52b227);}):_0x29cab3['push'](_0x52b227);}return _0x29cab3;}['updateChangeGroups'](){const _0xacfd1e=new _0x1fb8c4('p',{},[new _0x1fb8c4('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x29d6b1(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x42a174=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0xacfd1e,'cutAfterLastChange':!this['isDone']});if(!_0x42a174['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x42a174['parsedContent'];let _0xeda1d6=[];if(_0x2cfca1(_0x3ecc36=>{const _0x35eaec=At(_0x3ecc36,'data-id');if(!_0x35eaec||!_0x2d4a13(_0x35eaec))return!0x1;const _0x433696=[_0x3ecc36,...Pi(_0x3ecc36)]['at'](-0x2);if(_0x3ecc36!=_0x433696){const _0x52d21e=At(_0x433696,'data-id');_0x2d4a13(_0x52d21e)||(_0xeda1d6['push']({'node':_0x433696,'id':_0x52d21e,'type':'modified'}),_0x42a174['modifiedNodeIds']['push'](_0x52d21e));}else _0x42a174['modifiedNodeIds']['includes'](_0x35eaec)?_0xeda1d6['push']({'node':_0x3ecc36,'type':'modified','id':_0x35eaec}):_0x42a174['newNodeIds']['includes'](_0x35eaec)?_0xeda1d6['push']({'node':_0x3ecc36,'type':'new','id':_0x35eaec,'anchorId':At(_0x3ecc36['previousSibling'],'data-id')}):_0xeda1d6['push']({'node':_0x3ecc36,'type':'removed','id':_0x35eaec});return!0x0;},this['parsedMergedContent']),_0xeda1d6=_0xeda1d6['filter'](({node:_0x1fc34c})=>[...Pi(_0x1fc34c),_0x1fc34c]['every'](_0x5de10e=>!At(_0x5de10e,'data-unstable'))),0x0==_0xeda1d6['length'])return;const _0x544aeb=[[_0xeda1d6[0x0]]];for(let _0x54a954=0x1;_0x54a954<_0xeda1d6['length'];_0x54a954++){const _0x1298ab=_0x544aeb[_0x544aeb['length']-0x1],_0x5971b=_0x1298ab[_0x1298ab['length']-0x1];_0xeda1d6[_0x54a954]['node']['previousSibling']==_0x5971b['node']&&'modified'!=_0xeda1d6[_0x54a954]['type']&&'modified'!=_0x5971b['type']?_0x1298ab['push'](_0xeda1d6[_0x54a954]):_0x544aeb['push']([_0xeda1d6[_0x54a954]]);}for(const _0x3370c0 of _0x544aeb){const _0x2d1128=_0x3370c0[0x0],_0x20ad21=_0x3370c0[_0x3370c0['length']-0x1],_0x841e6e=_0x52daf6(_0x2d1128['node']['previousSibling']);_0x841e6e&&_0x3370c0['unshift'](_0x841e6e);const _0x29aa3d=_0x52daf6(_0x20ad21['node']['nextSibling']);_0x29aa3d&&_0x3370c0['push'](_0x29aa3d);}function _0x2d4a13(_0x48f589){return _0x42a174['modifiedNodeIds']['includes'](_0x48f589)||_0x42a174['newNodeIds']['includes'](_0x48f589)||_0x42a174['removedNodeIds']['includes'](_0x48f589);}function _0x52daf6(_0x44fb57){if(_0x44fb57&&At(_0x44fb57,'data-id')&&!At(_0x44fb57,'data-unstable')){const _0x4ddd72=At(_0x44fb57,'data-id');if(!_0x2d4a13(_0x4ddd72))return{'node':_0x44fb57,'type':'context','id':_0x4ddd72};}return null;}this['changeGroups']=_0x544aeb['map']((_0x210193,_0x415c7c)=>({'changes':_0x210193,'state':'pending','index':_0x415c7c}));}}const ze=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class Fe extends _0x5d3056(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x22a5fd,editor:_0x5add9b}){super(),this['id']=_0x3d9d4e(),this['connector']=_0x22a5fd,this['isStopped']=!0x0,this['editor']=_0x5add9b;}async['start'](){const _0x503703=[];let _0x5b4ec,_0x4e65ab,_0x4dcf70;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0xf1a2d7=await this['currentRequest']['getStream']();for await(const _0x25045d of _0xf1a2d7){if(this['isStopped'])return;if('error'==_0x25045d['event'])return void this['fire']('error',{'error':new _0x459533('ai-chat-interaction-error',this)});switch(_0x25045d['event']){case'message-metadata':this['messageId']=_0x25045d['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x25045d['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x25045d['data']['conversationTitle'],!0x0);break;case'source':_0x503703['push'](_0x25045d['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'](),_0x5b4ec='modification-delta'==_0x25045d['event']?'modification':'text',_0x4e65ab='modification-delta'==_0x25045d['event']?_0x25045d['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x5b4ec&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x5b4ec,'interactionId':this['id'],'id':_0x4e65ab}),'modification'==_0x5b4ec&&(this['currentReply']['sources']=_0x503703['splice'](0x0))),this['currentReply']['appendContent'](_0x25045d['data']['textDelta']);break;case'mcp-tool-result':_0x4dcf70=JSON['parse'](_0x25045d['data']['result']),this['_handleToolResultData']({'toolName':_0x25045d['data']['toolName'],'data':_0x4dcf70['data'],'attributes':_0x4dcf70['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x25045d['data']['toolName'],'data':_0x25045d['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x503703['length']>0x0&&(this['currentReply']['sources']=_0x503703['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x36fc6c){return this['replies']['find'](_0x3d860c=>_0x3d860c['id']===_0x36fc6c);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x4e6127=>_0x4e6127['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x52986e){const _0x26115e=new He({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x52986e});return this['replies']['push'](_0x26115e),_0x26115e['delegate'](...ze)['to'](this),this['fire']('replyCreated',_0x26115e),_0x26115e;}['setConversationTitle'](_0x56b385,_0x2c0bc9=!0x1){this['fire']('setConversationTitle',_0x56b385,_0x2c0bc9);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x34d2c1){this['fire']('toolDataReceived',{'type':'result','toolName':_0x34d2c1['toolName'],'data':structuredClone(_0x34d2c1['data']||{}),'attributes':structuredClone(_0x34d2c1['attributes']||{})},this);}['_handleToolNotificationData'](_0x535d5){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x535d5['toolName'],'data':structuredClone(_0x535d5['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Be=function(_0x5d661d){return _0x5d661d['TOOL']='mcp-tool-context',_0x5d661d['FILE']='file',_0x5d661d['DOCUMENT']='document',_0x5d661d['URL']='web-resource',_0x5d661d['TEXT']='text',_0x5d661d['SELECTION']='selection',_0x5d661d;}({}),Oe=function(_0x57eb3b){return _0x57eb3b['TEXT']='text',_0x57eb3b['MARKDOWN']='markdown',_0x57eb3b['HTML']='html',_0x57eb3b;}({});const $e=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']]),Qe=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Ke extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x570027,config:_0x2b5e90,ownerId:_0x506ca1}){super(),this['_connector']=_0x570027,this['_config']=_0x2b5e90,this['_ownerId']=_0x506ca1;}['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'](_0x56817e){const _0x4bd524=await this['_createContextItemFromContent'](_0x56817e);return this['_addToConversationContextItem'](_0x4bd524),'current-document'===_0x4bd524['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x4bd524;}async['_createContextItemFromContent'](_0x26183f){if(_0x26183f['type']===Be['DOCUMENT']){const _0x2563d0=await this['_connector']['fetchDocument'](this['_ownerId'],_0x26183f['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x26183f['type'],'content':_0x2563d0['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x2563d0['attributes']?.['version'],'sessionId':_0x2563d0['attributes']?.['sessionId']};}if(_0x26183f['type']===Be['TOOL'])return{'id':_0x26183f['id'],'uiId':_0x26183f['id'],'label':_0x26183f['data']?.['label']||_0x26183f['id'],'type':Be['TOOL'],'mcpServerName':_0x26183f['mcpServerName'],'toolName':_0x26183f['toolName'],'data':_0x26183f['data']||{}};return{'id':_0x26183f['id'],'uiId':_0x26183f['id'],'label':_0x26183f['attributes']?.['label']||_0x26183f['name']||_0x26183f['url']||_0x26183f['id'],'type':_0x26183f['type'],..._0x26183f?.['attributes']?.['resourceId']?{'resourceId':_0x26183f['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x5e118b){const _0x91a01d=this['_pendingContextItems']['get'](_0x5e118b);_0x91a01d?.['isReadOnly']||this['_removeContextItem'](_0x5e118b);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x172bc8 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x172bc8['uiId']);const _0x372660=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x372660&&this['_addContextItem']({..._0x372660,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x48542a){for(const _0xbf72b6 of _0x48542a['values']())this['_addToConversationContextItem'](_0xbf72b6);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'](_0x1a657d){return Array['from'](_0x1a657d['values']())['map'](_0x3e4e32=>this['_mapContextItemToRequestData'](_0x3e4e32))['filter'](_0x3ef310=>null!==_0x3ef310);}async['addFilesToContext'](_0x1197f7,_0x280ee1,_0x454986=Be['FILE']){const _0x454041='files-'+_0x3d9d4e();this['_startUploadOperation'](_0x454041);try{await Promise['all'](_0x1197f7['map'](async _0x567d59=>{const _0x59e37b='file-'+_0x3d9d4e(),_0xc19fbf=_0x210da0(_0x567d59['name']);try{this['_addContextItem']({'type':_0x454986,'label':_0x280ee1?.['label']||_0xc19fbf,'uiId':_0x59e37b,'resourceId':_0x280ee1?.['resourceId']},!0x0);const _0x51f684=this['_connector']['uploadFile'](this['_ownerId'],_0x567d59,_0x280ee1);this['_ongoingUploads']['set'](_0x59e37b,_0x51f684['abortController']);const {id:_0x2ca674}=await _0x51f684['getId']();this['_ongoingUploads']['delete'](_0x59e37b),this['_finishContextItemLoading']({'type':_0x454986,'id':_0x2ca674,'label':_0x280ee1?.['label']||_0xc19fbf,'uiId':_0x59e37b,'resourceId':_0x280ee1?.['resourceId']},!0x1);}catch(_0x3721f7){this['_ongoingUploads']['delete'](_0x59e37b);if(!(_0x3721f7 instanceof _0x459533&&_0x3721f7['message']['startsWith']('ai-request-aborted'))){const _0x6b5c7e=$e['get'](_0x3721f7['code'])||'ai-chat-file-upload-failed',_0x348941=new _0x459533(_0x6b5c7e,null,{'fileName':_0xc19fbf,..._0x3721f7});_0x348941['stack']=_0x3721f7['stack'],this['fire']('error',{'error':_0x348941});}this['_removeContextItem'](_0x59e37b);}}));}finally{this['_finishUploadOperation'](_0x454041);}}['addCurrentDocumentToContext'](_0x477991){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x1458bd={'type':Be['DOCUMENT'],'uiId':'current-document','label':_0x477991,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x1458bd);}async['updateCurrentDocument'](_0x10d91e,_0x5a8ea7,_0x55ce77,_0x333005){const _0x4ee75=this['_pendingContextItems']['get']('current-document');if(_0x4ee75&&_0x10d91e){_0x4ee75['selection']=_0x333005?_0x333005['map'](_0x49d4f8=>({'start':_0x49d4f8['start'],'end':_0x49d4f8['end']})):[];try{if(_0x4ee75['version']===_0x5a8ea7)return;const {id:_0x6bcc77}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x10d91e,{'version':_0x5a8ea7,'sessionId':_0x55ce77})['getId']();_0x4ee75['id']=_0x6bcc77,_0x4ee75['content']=_0x10d91e,_0x4ee75['version']=_0x5a8ea7,_0x4ee75['sessionId']=_0x55ce77;}catch(_0x466e7d){const _0x71f61b=new _0x459533('ai-chat-document-upload-failed',null);_0x71f61b['stack']=_0x466e7d['stack'],this['fire']('error',{'error':_0x71f61b});}}}['addSelectionToContext'](_0x558d4b){this['_addContextItem']({'type':Be['SELECTION'],'label':_0x558d4b,'uiId':'selection','content':_0x558d4b});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x9e1287,_0x538205){const _0x468882='url-'+_0x3d9d4e();this['_startUploadOperation'](_0x468882);const _0x52923d='url-'+_0x3d9d4e();try{this['_addContextItem']({'type':Be['URL'],'label':_0x538205?.['label']||_0x9e1287,'uiId':_0x52923d,'resourceId':_0x538205?.['resourceId']},!0x0);const _0x51bb54=this['_connector']['uploadUrl'](this['_ownerId'],_0x9e1287,_0x538205);this['_ongoingUploads']['set'](_0x52923d,_0x51bb54['abortController']);const {id:_0x372b85}=await _0x51bb54['getId']();this['_ongoingUploads']['delete'](_0x52923d),this['_finishContextItemLoading']({'type':Be['URL'],'id':_0x372b85,'label':_0x538205?.['label']||_0x9e1287,'uiId':_0x52923d,'resourceId':_0x538205?.['resourceId']},!0x1);}catch(_0x43db08){this['_ongoingUploads']['delete'](_0x52923d),(_0x43db08['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x459533('ai-chat-url-upload-failed',this,{'url':_0x9e1287,'originalError':_0x43db08}),'url':_0x9e1287}),this['_removeContextItem'](_0x52923d));}finally{this['_finishUploadOperation'](_0x468882);}}['addToolItemToContext'](_0x51fc83){_0x51fc83['id']=_0x51fc83['id']??_0x3d9d4e()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x51fc83['uiId'],_0x51fc83),this['fire']('contextItemAdded',{'contextItem':_0x51fc83,'isLoading':!0x1});}async['loadSourceResources'](_0x536f7b,_0x3dd68c,_0x54ef91){const _0x373dc2=this['_addContextOptionsState']['sources']['find'](_0x1b138b=>_0x1b138b['id']===_0x536f7b);if(!_0x373dc2)return this['fire']('error',{'error':new _0x459533('ai-chat-source-not-found',this,{'sourceId':_0x536f7b}),'sourceId':_0x536f7b}),[];try{const _0x67e183=(await _0x373dc2['getResources'](_0x3dd68c))['map'](_0x54a175=>{const _0x59932a=this['_isResourceInContext'](_0x54a175['id']);return{..._0x54a175,'isInContext':_0x59932a};});return _0x373dc2['resources']=_0x67e183,this['fire']('sourceResourcesLoaded',{'sourceId':_0x536f7b,'source':_0x373dc2,'resources':_0x67e183,'uid':_0x54ef91}),_0x67e183;}catch(_0x188b10){return this['fire']('error',{'error':new _0x459533('ai-chat-source-resources-load-failed',this,{'sourceId':_0x536f7b,'originalError':_0x188b10}),'sourceId':_0x536f7b,'sourceLabel':_0x373dc2['label']}),[];}}async['addResourceToContext'](_0x885bcc,_0xec872){if(this['_isResourceInContext'](_0xec872['id']))return;let _0x1f2a25=_0xec872['data'];if(!_0x1f2a25&&_0x885bcc['getData'])try{_0x1f2a25=await _0x885bcc['getData'](_0xec872['id']);}catch(_0xab3037){return void this['fire']('error',{'error':new _0x459533('ai-chat-resource-load-failed',this,{'resourceId':_0xec872['id'],'sourceId':_0x885bcc['id'],'originalError':_0xab3037}),'resourceId':_0xec872['id'],'sourceId':_0x885bcc['id']});}if(_0x1f2a25)switch(_0xec872['type']){case Be['URL']:if('string'!=typeof _0x1f2a25)return void this['fire']('error',{'error':new _0x459533('ai-chat-context-invalid-data',this,{'resourceId':_0xec872['id'],'sourceId':_0x885bcc['id'],'expectedType':'string','actualType':typeof _0x1f2a25}),'resourceId':_0xec872['id'],'sourceId':_0x885bcc['id']});await this['addUrlToContext'](_0x1f2a25,{'label':_0xec872['label'],'resourceId':_0xec872['id']});break;case Be['FILE']:if(!(_0x1f2a25 instanceof File))return void this['fire']('error',{'error':new _0x459533('ai-chat-context-invalid-data',this,{'resourceId':_0xec872['id'],'sourceId':_0x885bcc['id'],'expectedType':'File','actualType':typeof _0x1f2a25}),'resourceId':_0xec872['id'],'sourceId':_0x885bcc['id']});await this['addFilesToContext']([_0x1f2a25],{'label':_0xec872['label'],'resourceId':_0xec872['id']});break;case Be['TEXT']:if('object'!=typeof _0x1f2a25||!('content'in _0x1f2a25)||!('type'in _0x1f2a25))return void this['fire']('error',{'error':new _0x459533('ai-chat-context-invalid-data',this,{'resourceId':_0xec872['id'],'sourceId':_0x885bcc['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x1f2a25}),'resourceId':_0xec872['id'],'sourceId':_0x885bcc['id']});_0x1f2a25=Ke['_convertTextResourceToFile'](_0x1f2a25,_0xec872['label']),await this['addFilesToContext']([_0x1f2a25],{'label':_0xec872['label'],'resourceId':_0xec872['id']},Be['TEXT']);break;case Be['TOOL']:break;default:this['fire']('error',{'error':new _0x459533('ai-chat-context-unsupported-type',this,{'resourceId':_0xec872['id'],'sourceId':_0x885bcc['id'],'resourceType':_0xec872['type']}),'resourceId':_0xec872['id'],'sourceId':_0x885bcc['id']});}else this['fire']('error',{'error':new _0x459533('ai-chat-resource-no-data',this,{'resourceId':_0xec872['id'],'sourceId':_0x885bcc['id']}),'resourceId':_0xec872['id'],'sourceId':_0x885bcc['id']});}static['_convertTextResourceToFile'](_0x50f150,_0x47f05d){switch(_0x50f150['type']){case Oe['MARKDOWN']:return new File([_0x50f150['content']],_0x47f05d,{'type':'text/markdown'});case Oe['HTML']:return new File([_0x50f150['content']],_0x47f05d,{'type':'text/html'});default:return new File([_0x50f150['content']],_0x47f05d,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x27633d){switch(_0x27633d['type']){case Be['FILE']:return{'type':Be['FILE'],'id':_0x27633d['id']};case Be['URL']:return{'type':Be['URL'],'id':_0x27633d['id']};case Be['DOCUMENT']:return{'type':Be['DOCUMENT'],'id':_0x27633d['id'],..._0x27633d['selection']?.['length']&&{'selection':_0x27633d['selection']}};case Be['TEXT']:return{'type':Be['FILE'],'id':_0x27633d['id']};case Be['TOOL']:{const _0x2e41f0=_0x27633d;return{'type':Be['TOOL'],'mcpServerName':_0x2e41f0['mcpServerName'],'toolName':_0x2e41f0['toolName'],'data':_0x2e41f0['data'],'id':_0x2e41f0['id']};}default:return null;}}['_addContextItem'](_0x431586,_0x2bef17=!0x1){if(this['_pendingContextItems']['set'](_0x431586['uiId'],_0x431586),_0x431586['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x431586,'isLoading':_0x2bef17}),'current-document'===_0x431586['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x431586['resourceId']){const _0x52cbd2=this['_findSourceIdsByResourceId'](_0x431586['resourceId']);_0x52cbd2&&_0x52cbd2['forEach'](_0xa449d=>{this['_updateResourceInContextState'](_0xa449d,_0x431586['resourceId'],!0x0);});}}['_removeContextItem'](_0x4cc28d){const _0x512264=this['_pendingContextItems']['get'](_0x4cc28d),_0x2b9767=this['_ongoingUploads']['get'](_0x4cc28d);if(_0x2b9767&&(_0x2b9767['abort'](),this['_ongoingUploads']['delete'](_0x4cc28d)),_0x512264?.['resourceId']){const _0x28695c=this['_findSourceIdsByResourceId'](_0x512264['resourceId']);_0x28695c&&_0x28695c['forEach'](_0x11f15d=>{this['_updateResourceInContextState'](_0x11f15d,_0x512264['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x4cc28d),this['fire']('contextItemRemoved',{'uiId':_0x4cc28d,'type':_0x512264?.['type']}),'current-document'===_0x4cc28d&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x473916,_0x45ddcf){if(this['_pendingContextItems']['has'](_0x473916['uiId'])&&(this['_pendingContextItems']['set'](_0x473916['uiId'],_0x473916),this['fire']('contextItemLoadingEnded',{'contextItem':_0x473916,'isLoading':_0x45ddcf}),_0x473916['resourceId'])){const _0x57c325=this['_findSourceIdsByResourceId'](_0x473916['resourceId']);_0x57c325&&_0x57c325['forEach'](_0x116a8e=>{this['_updateResourceInContextState'](_0x116a8e,_0x473916['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x52592c){this['_conversationContextItems']['set'](_0x52592c['uiId'],_0x52592c);}['_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'](_0x57f71b=>({..._0x57f71b,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x229dbd=>({..._0x229dbd,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x469ef0=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x469ef0,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x4f7a1b){for(const _0x243ad1 of this['_pendingContextItems']['values']())if(_0x243ad1['resourceId']===_0x4f7a1b)return!0x0;for(const _0x22389f of this['_conversationContextItems']['values']())if(_0x22389f['resourceId']===_0x4f7a1b)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x16bd68){const _0x3176f9=[];for(const _0x4fcc3e of this['_addContextOptionsState']['sources']){_0x4fcc3e['resources']['find'](_0x4561e6=>_0x4561e6['id']===_0x16bd68)&&_0x3176f9['push'](_0x4fcc3e['id']);}return 0x0===_0x3176f9['length']?null:_0x3176f9;}['_updateResourceInContextState'](_0x4f5ad1,_0x1323e1,_0x3962d9){const _0x4e5a09=this['_addContextOptionsState']['sources']['find'](_0x179902=>_0x179902['id']===_0x4f5ad1);if(!_0x4e5a09)return;const _0x40371a=_0x4e5a09['resources']['find'](_0x138ab7=>_0x138ab7['id']===_0x1323e1);_0x40371a&&(_0x40371a['isInContext']=_0x3962d9,this['fire']('resourceStateChanged',{'sourceId':_0x4f5ad1,'resourceId':_0x1323e1,'isInContext':_0x3962d9}));}['_startUploadOperation'](_0x1f7335){this['_ongoingUploadOperations']['set'](_0x1f7335,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x2c955d){this['_ongoingUploadOperations']['delete'](_0x2c955d),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Ye=['capabilitiesUpdated'];class Xe extends _0x5d3056(){['_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'](_0x35a8f7){const _0x9f8716={};return _0x35a8f7&&_0x35a8f7['isWebSearchEnabled']&&(_0x9f8716['webSearch']={}),_0x35a8f7&&_0x35a8f7['isReasoningEnabled']&&(_0x9f8716['reasoning']={}),_0x9f8716;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x2c43e7){_0x2c43e7!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x2c43e7,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x6e2ecb){_0x6e2ecb!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x6e2ecb,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ze extends Fe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x5b6bf6){super(_0x5b6bf6),this['conversationId']=_0x5b6bf6['conversationId'],this['contextItems']=_0x5b6bf6['contextItems'],this['capabilities']=_0x5b6bf6['capabilities'],this['userMessage']=_0x5b6bf6['userMessage'],this['model']=_0x5b6bf6['model'],this['attributes']=_0x5b6bf6['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Ke['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Xe['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class _t extends _0x5d3056(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x3b123f){super(),this['options']=_0x3b123f,this['connector']=_0x3b123f['connector'],this['chatModels']=_0x3b123f['chatModels'],this['id']=_0x3b123f['conversationId'],this['isFromHistory']=_0x3b123f['isFromHistory'];}async['init'](_0x10ec19){try{this['chatContext']=new Ke({'connector':this['connector'],'config':_0x10ec19,'ownerId':this['id']}),this['chatContext']['delegate'](...Qe)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Xe(),this['chatCapabilities']['delegate'](...Ye)['to'](this),this['chatCapabilities']['init']();const _0x155ba5=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x155ba5});const _0x3b98f=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x3b98f&&await this['setModel'](_0x3b98f);}catch(_0x1a20ee){const _0x1c88ad=new _0x459533('ai-chat-conversation-init-failed',null,{'message':_0x1a20ee['message']||_0x1a20ee});_0x1c88ad['stack']=_0x1a20ee['stack'],this['fire']('error',{'error':_0x1c88ad});}}async['start'](){if(this['isStarted'])throw new _0x459533('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x459533('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x3dbe5f}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x3dbe5f,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x9573f5){const _0x184525=new _0x459533('ai-chat-conversation-start-failed',null,{'message':_0x9573f5['message'],'conversationId':this['id']});throw _0x184525['stack']=_0x9573f5['stack'],this['fire']('error',{'error':_0x184525}),_0x184525;}}async['load'](_0x34a3a2,_0x3905cc){try{const _0xbf60ae=await this['connector']['fetchConversation'](_0x34a3a2)['getConversation'](),_0x3a90ac=await this['connector']['fetchConversationMessages'](_0x34a3a2)['getMessages'](),_0x52188f=_0x3a90ac[0x0]['model'];this['isStarted']=!0x0,this['id']=_0xbf60ae['id'],'title'in _0xbf60ae?this['fire']('setConversationTitle',_0xbf60ae['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x179248=(await this['chatModels']['getAll']())['find'](_0x1359c3=>_0x1359c3['id']['toLowerCase']()===_0x52188f['toLowerCase']());return this['selectedModel']=_0x179248,this['fire']('modelSelected',{'selectedModel':_0x179248,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x3a90ac,_0x3905cc,_0x52188f),this['currentInteraction']=void 0x0,this;}catch(_0x5cbdc4){const _0x4b2fdb=new _0x459533('ai-chat-conversation-init-from-id-failed',null,{'message':_0x5cbdc4['message'],'conversationId':_0x34a3a2});throw _0x4b2fdb['stack']=_0x5cbdc4['stack'],this['fire']('error',{'error':_0x4b2fdb}),_0x4b2fdb;}}async['_processMessagesToInteractions'](_0x54e827,_0x15afff,_0x18c72b){let _0x524ddf;for(const _0x4e6272 of _0x54e827)if('user'===_0x4e6272['role']){const _0x58d7df=await this['_extractContextItems'](_0x4e6272),_0x1bafb1={'isReasoningEnabled':Object['hasOwn'](_0x4e6272['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x4e6272['capabilities'],'webSearch')};_0x524ddf=this['createInteraction']({'userMessage':_0x4e6272['prompt'],'contextItems':_0x58d7df,'capabilities':_0x1bafb1,'modelId':_0x18c72b,'attributes':_0x4e6272['attributes']}),this['currentInteraction']=_0x524ddf,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x4e6272['role']&&_0x524ddf){const _0x4a2c73=[];for(const _0x39dd61 of _0x4e6272['content'])switch(_0x39dd61['type']){case'text':case'modification':{const _0x129e9e=_0x524ddf['getDocumentContext']()?.['sessionId']!==_0x15afff;_0x524ddf['currentReply']=_0x524ddf['createReply']({'type':_0x39dd61['type'],'isDone':!0x0,'interactionId':_0x524ddf['id'],'areActionsDisabled':_0x129e9e}),_0x524ddf['currentReply']['appendContent'](_0x39dd61['content']),_0x4a2c73['length']>0x0&&(_0x524ddf['currentReply']['sources']=_0x4a2c73['splice'](0x0));break;}case'url':_0x4a2c73['push'](_0x39dd61);break;case'mcp-tool-result':{const {data:_0xbec2ce,attributes:_0x238f04}=JSON['parse'](_0x39dd61['content']);_0x524ddf['_handleToolResultData']({'toolName':_0x39dd61['toolName'],'data':_0xbec2ce,'attributes':_0x238f04});break;}}}}}async['_extractContextItems'](_0x378e90){const _0x18da65=new Map();if(!_0x378e90['content'])return _0x18da65;for(const _0x46de2d of _0x378e90['content']){const _0x23475b=await this['chatContext']['populateFromMessage'](_0x46de2d);_0x23475b&&_0x18da65['set'](_0x23475b['id'],_0x23475b);}return _0x18da65;}async['handleUserInteraction']({userMessage:_0x54cd00,attributes:_0x1a3616}){if(!this['isStarted'])throw new _0x459533('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x459533('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x174f7e=this['chatContext']['getPendingContextItems'](),_0x16388a=this['chatCapabilities']['getCapabilitiesConfig'](),_0x489110=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x54cd00,'contextItems':_0x174f7e,'capabilities':_0x16388a,'modelId':_0x489110,'attributes':_0x1a3616}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x5764ce){if(_0x5764ce instanceof _0x459533)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x5764ce});else{const _0x4e4735=$e['get'](_0x5764ce['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x459533(_0x4e4735,null,{'error':_0x5764ce})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x4dc67b,contextItems:_0x208aa8,capabilities:_0x1b9cc6,modelId:_0x22fe53,attributes:_0x3c33a4}){const _0x51bc20=new Ze({'userMessage':_0x4dc67b,'contextItems':_0x208aa8,'capabilities':_0x1b9cc6,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x22fe53,'attributes':_0x3c33a4});return _0x51bc20['delegate'](...ze)['to'](this),this['interactions']['push'](_0x51bc20),this['fire']('interactionCreated',_0x51bc20),_0x51bc20;}['getInteraction'](_0x447948){return this['interactions']['find'](_0x4a04cf=>_0x4a04cf['id']===_0x447948);}['removeInteraction'](_0x2e98cd){const _0x39bfc6=this['getInteraction'](_0x2e98cd);_0x39bfc6&&(_0x39bfc6['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x39bfc6),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x5b8ccf){this['chatContext']['addCurrentDocumentToContext'](_0x5b8ccf);}async['updateCurrentDocumentInContext']({content:_0x112689,version:_0x41b3be,sessionId:_0x1719d2,selections:_0x3f1ce6}){await this['chatContext']['updateCurrentDocument'](_0x112689,_0x41b3be,_0x1719d2,_0x3f1ce6);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x4287aa){this['chatContext']['addSelectionToContext'](_0x4287aa);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x5b4db4){this['chatContext']['addFilesToContext'](_0x5b4db4);}['addUrlToContext'](_0x291cc1){this['chatContext']['addUrlToContext'](_0x291cc1);}['addToolItemToContext'](_0x2288a3){this['chatContext']['addToolItemToContext'](_0x2288a3);}['addResourceToContext'](_0x4a3ac1,_0x3882c9){this['chatContext']['addResourceToContext'](_0x4a3ac1,_0x3882c9);}['loadSourceResources'](_0x35d8e2,_0x36a4a3,_0x2ae976){return this['chatContext']['loadSourceResources'](_0x35d8e2,_0x36a4a3,_0x2ae976);}['removeFromContext'](_0x65d3e0){this['chatContext']['removeFromContext'](_0x65d3e0);}['setWebSearch'](_0x1fd7e2){this['chatCapabilities']['setWebSearch'](_0x1fd7e2);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x1e809e){this['chatCapabilities']['setReasoning'](_0x1e809e);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x85c906){_0x85c906?!0x1===await this['chatModels']['isAvailable'](_0x85c906)&&(_0x31be16('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x85c906}),_0x85c906=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x31be16('ai-chat-conversation-set-model-null',{'conversation':this}),_0x85c906=(await this['chatModels']['getAvailableModels']())[0x0]),_0x85c906['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x85c906,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x85c906}));}}class It extends _0x5d3056(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0xefd1ba,config:_0x36a2ff,locale:_0x13a27c}){super(),this['_connector']=_0xefd1ba,this['_config']=_0x36a2ff,this['_locale']=_0x13a27c;}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 _0x14e2b1=await this['getAll']();let _0x28f161;return _0x28f161=this['_availableModels']?this['_filterModels'](_0x14e2b1,this['_availableModels']):_0x14e2b1['filter'](_0x13c041=>_0x13c041['recommended']),_0x28f161;}async['getModel'](_0x35fd62){const _0x45482a=await this['getAll']();if(!_0x45482a['length'])return null;if(_0x35fd62){const _0x372258=this['_getModelById'](_0x45482a,_0x35fd62);if(_0x372258)return _0x372258;_0x31be16('ai-chat-model-id-unrecognized',{'modelId':_0x35fd62,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x1e2fdf=await this['getAvailableModels']();if(!_0x1e2fdf['length'])return null;if(this['_defaultModelId']){const _0x3b5838=this['_getModelById'](_0x1e2fdf,this['_defaultModelId']);if(_0x3b5838)return _0x3b5838;_0x31be16('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x1e2fdf[0x0]['id']});}return _0x1e2fdf[0x0];}async['isAvailable'](_0x2e85dc){return(await this['getAvailableModels']())['some'](_0x259af6=>_0x259af6['name']===_0x2e85dc['name']&&_0x259af6['provider']===_0x2e85dc['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0xe0b781=this['_locale']['uiLanguage']||'en',_0xf4bb52=this['_connector']['getModels'](_0xe0b781),_0x5d2b70=await _0xf4bb52['list']();this['_modelList']=_0x5d2b70['items']['map'](_0x285366=>Bi(_0x285366)?{..._0x285366,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x285366);}catch(_0x2290d1){throw gt('ai-models-unable-to-retrieve',{'error':_0x2290d1}),_0x2290d1;}return[...this['_modelList']];}['_filterModels'](_0x2b7f52,_0x4f9a6e){let _0x53fc92;if(_0x4f9a6e){_0x53fc92=[];const _0x150d24=new Set(),_0x324b38='string'==typeof _0x4f9a6e?[_0x4f9a6e['toLocaleLowerCase']()]:_0x4f9a6e['map'](_0x4d9d5d=>_0x4d9d5d['toLocaleLowerCase']());for(const _0x577ba6 of _0x324b38)for(const _0x252d19 of _0x2b7f52)!_0x150d24['has'](_0x252d19['id'])&&this['_isMatchingFilter'](_0x252d19,_0x577ba6)&&(_0x53fc92['push'](_0x252d19),_0x150d24['add'](_0x252d19['id']));}else _0x53fc92=_0x2b7f52;return _0x53fc92;}['_isMatchingFilter'](_0x1ba38a,_0x314b12){const _0x360fa5=_0x1ba38a['id']['toLocaleLowerCase'](),_0x50d3a5=_0x1ba38a['name']['toLocaleLowerCase'](),_0x1dcdec=_0x1ba38a['provider']['toLocaleLowerCase']();return _0x360fa5===_0x314b12||_0x50d3a5===_0x314b12||Bi(_0x1ba38a)&&'auto'===_0x314b12||_0x1dcdec===_0x314b12||_0x360fa5['startsWith'](_0x314b12);}['_getModelById'](_0x4b248e,_0xfec424){return _0x4b248e['find'](_0x397a1f=>Bi(_0x397a1f)&&'auto'===_0xfec424?_0x397a1f:_0x397a1f['id']===_0xfec424)||null;}}function Bi(_0x4c97e0){return _0x4c97e0['id']['startsWith']('agent');}function T(_0x5ab93b){if(_0x5ab93b instanceof dt)return _0x5ab93b;if(_0x5ab93b?.['editors']&&_0x5ab93b['editors']['get'](0x0))return _0x5ab93b['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.'),_0x5ab93b['editors']['get'](0x0);throw new _0x459533('ai-get-editor-from-context-no-editor');}function Z({editor:_0x3dcb67,interaction:_0x2e0229,reply:_0x5284bd,groups:_0x1c208f,transform:_0x4deb81,documentCompare:_0x1893b2,documentCompareOptions:_0x3f70c0}){const _0x32a308=_0x2e0229['getDocumentContext']();if(!_0x32a308)return[];const _0x317388=_0x32a308['content'],_0x20a640=_0x32a308['version'],_0x12b5e8=_0x5284bd['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x30744b}of _0x1c208f){const _0x4cdf6b=_0x30744b['filter'](_0x3e5fa2=>'new'!=_0x3e5fa2['type'])['map'](_0x42bd8b=>St('data-id',_0x42bd8b['id'],_0x12b5e8)),_0x296f0b=_0x30744b['filter'](_0x1e6d03=>'removed'!=_0x1e6d03['type'])['map'](_0x4b1c5c=>_0x4b1c5c['node']['cloneNode'](!0x0));let _0x34c19d=null;if(_0x4cdf6b['length']){_0x34c19d=_0x4cdf6b[0x0]['previousSibling'];for(let _0x7e6836=0x0;_0x7e6836<_0x4cdf6b['length'];_0x7e6836++)_0x187273(_0x4cdf6b[_0x7e6836]);}if(_0x296f0b['length']){_0x34c19d||(_0x30744b[0x0]['anchorId']?_0x34c19d=St('data-id',_0x30744b[0x0]['anchorId'],_0x12b5e8):(_0x34c19d=_0x296f0b['shift'](),_0x14505f(_0x12b5e8,_0x34c19d)));for(let _0x24399b=0x0;_0x24399b<_0x296f0b['length'];_0x24399b++)_0x1a4c25(_0x34c19d,_0x296f0b[_0x24399b]),_0x34c19d=_0x296f0b[_0x24399b];}}const _0x4a4112=Tt(_0x12b5e8),_0x24e301=_0x1893b2['getDiff'](_0x317388,_0x4a4112,_0x3f70c0)['getOperations']();if(_0x4deb81){const _0x387daa=_0x3dcb67['model']['document']['history']['getOperations'](_0x20a640),_0xf005ea={'document':_0x3dcb67['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return nt(_0x24e301,_0x387daa,_0xf005ea)['operationsA'];}return _0x24e301;}function Y(_0x280279,_0x5020f5){if('marker'!=_0x5020f5['type'])return;const _0x59e7e7=_0x280279['model']['markers']['get'](_0x5020f5['name']);_0x59e7e7&&(_0x5020f5['oldRange']=_0x59e7e7['getRange']());}class at extends _0x479a76{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[q,_0x18ff34];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0xb3f722(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 It({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x3911cf=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x30c2fd,_0x475261)=>{this['_handleUIUserMessage']({'userMessage':_0x475261});}),this['listenTo'](_0x3911cf,'resizedTabs',(_0x44e968,_0x13e168)=>{this['_setIsMaximized'](_0x13e168);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x3911cf['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',(_0x16dfc0,_0x9920a6)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x9920a6));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x4cce3e,_0x385de5)=>{this['activeConversation']?.['addUrlToContext'](_0x385de5);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x23faba,_0x5ee6d6)=>{_0x5ee6d6['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x5384c5,_0x2e3572)=>{this['activeConversation']?.['addResourceToContext'](_0x2e3572['source'],_0x2e3572['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x37c046,_0x5d287b)=>{this['_removeFromContext'](_0x5d287b);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x1cb69f,_0x5c046a)=>{this['activeConversation']?.['loadSourceResources'](_0x5c046a['sourceId'],_0x5c046a['query'],_0x5c046a['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x19b76f,_0x57c38d)=>{this['activeConversation']?.['setModel'](_0x57c38d);}),this['listenTo'](this['_aiChatUi'],'like',(_0x1405d6,{replyId:_0x1cfcc1})=>{console['log']('Liked\x20response',_0x1cfcc1);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x5040d9,{replyId:_0x15acf8})=>{console['log']('Disliked\x20response',_0x15acf8);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x3febdf,_0x42449d)=>{this['_insertSuggestion'](_0x42449d);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x4fb769,{replyId:_0x2e0ea6,partIndex:_0x35913a})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x2e0ea6,_0x35913a);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x5786b2,{replyId:_0x4af110,partIndex:_0x10b086})=>{const _0x385f0b=this['_getDocumentRangeForReplyChanges'](_0x4af110,_0x10b086);_0x385f0b&&'$graveyard'!=_0x385f0b['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x385f0b['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x361a2a,_0xfd1bd4)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0xfd1bd4);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x1208a2,{replyId:_0x5a2e28,showDiff:_0x2aab60})=>{const {reply:_0x447c98}=this['getInteractionAndReplyById'](_0x5a2e28),_0x1ce5ce=_0x447c98['getContentParts']({'showDiff':_0x2aab60});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x447c98['id'],'parts':_0x1ce5ce,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x546c5a,{replyId:_0x380775,partIndex:_0x3e8cdc})=>{this['_rejectSuggestion']({'replyId':_0x380775,'partIndex':_0x3e8cdc}),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:_0x4413bb,partIndex:_0x1025f7}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x30c841}=this['getInteractionAndReplyById'](_0x4413bb),_0x1e8a28=_0x30c841['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x1025f7});this['_aiChatBalloon']['updateContent']({'part':_0x1e8a28[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x530a0d,partIndex:_0x15981c}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x530a0d,'partIndex':_0x15981c}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x44be68,partIndex:_0x16968a}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x44be68,'partIndex':_0x16968a}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x256006,partIndex:_0x1cb1c3}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x256006,'partIndex':_0x1cb1c3}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x19b5ef,partIndex:_0x21eb76}=this['_currentPreviewedChangeGroup'],_0x6d3437=this['_getPresentableSiblingContentPartIndex'](_0x19b5ef,_0x21eb76,'next');null!==_0x6d3437&&this['_openBalloonFor'](_0x19b5ef,_0x6d3437);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x5a9801,partIndex:_0x135eec}=this['_currentPreviewedChangeGroup'],_0x31b13b=this['_getPresentableSiblingContentPartIndex'](_0x5a9801,_0x135eec,'previous');null!==_0x31b13b&&this['_openBalloonFor'](_0x5a9801,_0x31b13b);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0xb358bf,{id:_0x342584})=>{if('aiChatBalloon'!==_0x342584)return;const {replyId:_0x2f3117,partIndex:_0x3dd75e}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x2f3117,'index':_0x3dd75e,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x1a48b0,_0x2499f3)=>{_0x2499f3['on']('ready',()=>{this['_integrateEditor'](_0x2499f3);});});const _0x49147f=this['context']['config']['get']('ai.chat.initialConversation');let _0x12d88e=_0x49147f;if('lastCreated'!=_0x49147f||(_0x12d88e=await this['_getLastCreatedConversationId'](),_0x12d88e))return'new'==_0x12d88e?this['_startConversationSafely']():this['loadConversation'](_0x12d88e);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x5b98b8){const _0xc5e1dd=T(this['context']);if(!_0xc5e1dd['plugins']['has']('TrackChanges'))throw new _0x459533('ai-no-track-changes',null);const _0x2a1ae7=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x12256c,interaction:_0x2426b1}=this['getInteractionAndReplyById'](_0x5b98b8['replyId']),_0x479c78=this['_getDocumentRangeForReplyChanges'](_0x5b98b8['replyId'],_0x5b98b8['partIndex']),_0x356d82=void 0x0!==_0x5b98b8['partIndex']?[_0x12256c['changeGroups'][_0x5b98b8['partIndex']]]:_0x12256c['changeGroups']['filter'](_0x2686c5=>'pending'==_0x2686c5['state']),_0x529720=_0x356d82['map'](_0x3b96e2=>_0x12256c['changeGroups']['indexOf'](_0x3b96e2));if(!_0x479c78||'$graveyard'==_0x479c78['range']['root']['rootName'])return void _0x529720['forEach'](_0x5716e2=>_0x12256c['setChangeGroupState'](_0x5716e2,'outdated'));_0x529720['forEach'](_0x20aa9c=>_0x12256c['setChangeGroupState'](_0x20aa9c,'accepted'));const _0x528204=Z({'editor':_0xc5e1dd,'reply':_0x12256c,'interaction':_0x2426b1,'groups':_0x356d82,'transform':!0x0,'documentCompare':_0x2a1ae7,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x525492;_0x479c78&&this['_scrollToSuggestionRange'](_0x479c78['range']),_0xc5e1dd['model']['change'](_0x9db8e0=>{_0x525492=_0x9db8e0['batch'],_0xc5e1dd['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x528204),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x525492,{'interactionId':_0x2426b1['id'],'replyId':_0x12256c['id'],'indexes':_0x529720['slice']()}),this['_updateRatings'](_0x12256c);}['_applySuggestion'](_0x1260ec){const _0x1a2e7d=T(this['context']),_0x4a4e18=this['context']['plugins']['get'](_0x18ff34),{reply:_0x11848c,interaction:_0x35c731}=this['getInteractionAndReplyById'](_0x1260ec['replyId']),_0x7663ea=this['_getDocumentRangeForReplyChanges'](_0x1260ec['replyId'],_0x1260ec['partIndex']),_0x2b2fd5=void 0x0!==_0x1260ec['partIndex']?[_0x11848c['changeGroups'][_0x1260ec['partIndex']]]:_0x11848c['changeGroups']['filter'](_0x422ec6=>'pending'==_0x422ec6['state']),_0x27b668=_0x2b2fd5['map'](_0x90d92=>_0x11848c['changeGroups']['indexOf'](_0x90d92));if(!_0x7663ea||'$graveyard'==_0x7663ea['range']['root']['rootName'])return void _0x27b668['forEach'](_0x2f7f68=>_0x11848c['setChangeGroupState'](_0x2f7f68,'outdated'));_0x27b668['forEach'](_0x4122b7=>_0x11848c['setChangeGroupState'](_0x4122b7,'accepted'));const _0x2b8444=Z({'editor':_0x1a2e7d,'reply':_0x11848c,'interaction':_0x35c731,'groups':_0x2b2fd5,'transform':!0x0,'documentCompare':_0x4a4e18,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x8c6315;_0x7663ea&&this['_scrollToSuggestionRange'](_0x7663ea['range']),_0x1a2e7d['model']['change'](_0x333529=>{_0x8c6315=_0x333529['batch'];for(const _0x36d0ed of _0x2b8444)_0x36d0ed['baseVersion']=_0x1a2e7d['model']['document']['version'],Y(_0x1a2e7d,_0x36d0ed),_0x333529['batch']['addOperation'](_0x36d0ed),_0x1a2e7d['model']['applyOperation'](_0x36d0ed);}),this['_batchToChanges']['set'](_0x8c6315,{'interactionId':_0x35c731['id'],'replyId':_0x11848c['id'],'indexes':_0x27b668['slice']()}),this['_updateRatings'](_0x11848c);}['_rejectSuggestion'](_0x597692){const {reply:_0x4d638b}=this['getInteractionAndReplyById'](_0x597692['replyId']);_0x4d638b['setChangeGroupState'](_0x597692['partIndex'],'rejected');}['_openBalloonFor'](_0x39f249,_0x888e6d){if(!this['_aiChatBalloon'])return;const {reply:_0x384edb}=this['getInteractionAndReplyById'](_0x39f249),_0x347d00=_0x384edb['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x4c2d7b,_0x403b83;if(void 0x0!==_0x888e6d?(_0x403b83=_0x347d00['find'](_0x5d7bf8=>_0x5d7bf8['index']==_0x888e6d),_0x4c2d7b=_0x403b83?.['index']):(_0x403b83=_0x347d00[0x0],_0x4c2d7b=_0x403b83['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x39f249&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x4c2d7b)return;const _0x177fc4=this['_getUserPresentableContentPartDocumentRange'](_0x39f249,_0x384edb,_0x403b83);if(!_0x177fc4)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x39f249,'partIndex':_0x4c2d7b},this['_scrollToSuggestionRange'](_0x177fc4,!0x0);const _0x504c54=this['_getPresentableSiblingContentPartIndex'](_0x39f249,_0x4c2d7b,'next');this['_aiChatBalloon']['updateContent']({'part':_0x403b83,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x4c2d7b,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x4c2d7b+0x1)['toString']()),'showRotator':null!==_0x504c54,'ranges':[_0x177fc4],'areActionsDisabled':_0x384edb['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x39f249,_0x4c2d7b),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x39f249,'index':_0x4c2d7b,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0xc8c4a,_0x135492,_0x3f1488){const {reply:_0x73f1b}=this['getInteractionAndReplyById'](_0xc8c4a),_0x493d32=_0x73f1b['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x493d32['length'])return null;const _0x4a70d0=_0x493d32['findIndex'](_0x19d73c=>_0x19d73c['index']==_0x135492),_0xb6841f='next'==_0x3f1488?0x1:-0x1;let _0x1994bf=_0x493d32['at']((_0x4a70d0+_0xb6841f)%_0x493d32['length'])['index'],_0x2d56a8=_0x493d32[_0x1994bf];for(;!this['_getUserPresentableContentPartDocumentRange'](_0xc8c4a,_0x73f1b,_0x2d56a8);){if(_0x1994bf=_0x493d32['at']((_0x1994bf+_0xb6841f)%_0x493d32['length'])['index'],_0x1994bf===_0x4a70d0)return null;_0x2d56a8=_0x493d32[_0x1994bf];}return _0x1994bf;}['_getUserPresentableContentPartDocumentRange'](_0x180dc4,_0x418f70,_0x44ca09){const _0x4e60c6=_0x418f70['changeGroups'];if(!_0x44ca09['hasChanges'])return null;const _0x56c8ba=_0x4e60c6['find'](_0x3014a9=>_0x3014a9['index']==_0x44ca09['index']);if('pending'!==_0x56c8ba?.['state'])return null;const _0x32dc70=this['_getDocumentRangeForReplyChanges'](_0x180dc4,_0x44ca09['index']);if(!_0x32dc70)return null;const {range:_0x451562,currentIndex:_0x5e5505}=_0x32dc70;return'$graveyard'==_0x451562['root']['rootName']?(_0x418f70['setChangeGroupState'](_0x5e5505,'outdated'),null):_0x32dc70['range'];}['_getDocumentRangeForReplyChanges'](_0x473aeb,_0x1104a4){const _0x306a62=T(this['context']),{reply:_0x5ec56e,interaction:_0x374ff5}=this['getInteractionAndReplyById'](_0x473aeb),_0x55fe42=_0x5ec56e['changeGroups']['filter'](_0x13fa87=>'pending'==_0x13fa87['state']),_0x3fadbf=_0x55fe42['map'](_0x36017c=>_0x5ec56e['changeGroups']['indexOf'](_0x36017c));void 0x0===_0x1104a4&&(_0x1104a4=_0x3fadbf[0x0]);const _0x3b0024=_0x3fadbf['indexOf'](_0x1104a4);if(-0x1==_0x3b0024)return null;const _0x36d09a=_0x55fe42[_0x3b0024],_0x2e04ce=new Et([]),_0x24c677=new Et([]);for(const _0x11ad1e of _0x36d09a['changes'])if('removed'!=_0x11ad1e['type']&&_0x24c677['children']['push'](_0x11ad1e['node']['cloneNode'](!0x0)),'new'!=_0x11ad1e['type']){const _0x26af64=yt(_0x41c875=>At(_0x41c875,'data-id')==_0x11ad1e['id'],_0x5ec56e['documentContextContent'],!0x0);_0x2e04ce['children']['push'](_0x26af64['cloneNode'](!0x0));}if(0x0==_0x2e04ce['children']['length']){if(_0x36d09a['changes'][0x0]['anchorId']){const _0x1f36af=St('data-id',_0x36d09a['changes'][0x0]['anchorId'],_0x5ec56e['documentContextContent']);_0x2e04ce['children']['unshift'](_0x1f36af['cloneNode'](!0x0)),_0x24c677['children']['unshift'](_0x1f36af['cloneNode'](!0x0)),_0x1f36af['nextSibling']&&(_0x2e04ce['children']['push'](_0x1f36af['nextSibling']['cloneNode'](!0x0)),_0x24c677['children']['push'](_0x1f36af['nextSibling']['cloneNode'](!0x0)));}else{const _0x1bd032=_0x5ec56e['documentContextContent']['children'][0x0];if(!_0x1bd032)return null;_0x2e04ce['children']['push'](_0x1bd032['cloneNode'](!0x0)),_0x24c677['children']['push'](_0x1bd032['cloneNode'](!0x0));}}const _0x4d1840=_0x374ff5['getDocumentContext'](),_0x27cae0=_0x306a62['data']['parse'](_0x4d1840['content']),_0x23a8d7=Tt(_0x2e04ce),_0x5c86b3=_0x306a62['data']['parse'](_0x23a8d7),_0x2444d2=_0x306a62['data']['parse'](_0x23a8d7),_0x4a0149=_0x306a62['model']['createPositionAt'](_0x5c86b3,0x0),_0x10c27a=Tt(_0x24c677),_0x2a74c1={'anchor':_0x4a0149,'markDeletions':!0x1},_0x10ee23=_0x306a62['plugins']['get'](_0x18ff34)['getDiff'](_0x23a8d7,_0x10c27a,_0x2a74c1)['getOperations']();if(!_0x10ee23['length'])return null;_0x306a62['model']['change'](_0x13a462=>{for(const _0xd4cad9 of _0x10ee23)if('remove'==_0xd4cad9['type']){const _0x24f3b3=_0xd4cad9['sourcePosition'],_0xa93bc5=_0xd4cad9['howMany'],_0x4ea6e6=new et(_0x24f3b3,_0xa93bc5);_0x13a462['batch']['addOperation'](_0x4ea6e6),_0x306a62['model']['applyOperation'](_0x4ea6e6);}else'marker'!==_0xd4cad9['type']&&(_0xd4cad9['baseVersion']=null,_0xd4cad9['isDocumentOperation']=!0x1,_0x13a462['batch']['addOperation'](_0xd4cad9),_0x306a62['model']['applyOperation'](_0xd4cad9));});const _0x5f0553=mt(_0x306a62,_0x10ee23,_0x5c86b3);ft(_0x306a62['model'],_0x5f0553);const _0x51f051=_0x5f0553['getFirstRange']()['start']['path']['slice'](),_0x22559c=_0x5f0553['getFirstRange']()['end']['path']['slice'](),_0x32c94e=[];let _0x2700dc=_0x5c86b3,_0x47f472=_0x2444d2;for(let _0x32a63d=0x0;_0x32a63d<_0x22559c['length'];_0x32a63d++){const _0x157db3=_0x2700dc['maxOffset']-_0x22559c[_0x32a63d];_0x32c94e[_0x32a63d]=_0x47f472['maxOffset']-_0x157db3,_0x2700dc=_0x2700dc['getChildAtOffset'](_0x22559c[_0x32a63d]),_0x47f472=_0x47f472['getChildAtOffset'](_0x32c94e[_0x32a63d]);}const _0x46b98c=_0x306a62['model']['createRange'](_0x306a62['model']['createPositionFromPath'](_0x2444d2,_0x51f051),_0x306a62['model']['createPositionFromPath'](_0x2444d2,_0x32c94e)),_0x13e6a2=_0x2444d2['getChild'](0x0)['getAttribute'](Ct),_0x26be3e=Array['from'](_0x27cae0['getChildren']())['find'](_0x525ff7=>_0x525ff7['getAttribute'](Ct)==_0x13e6a2)['getPath'](),_0x136038=_0x46b98c['start']['path']['slice'](),_0x10c62e=_0x46b98c['end']['path']['slice']();_0x136038[0x0]=_0x26be3e[0x0]+_0x136038[0x0],_0x10c62e[0x0]=_0x26be3e[0x0]+_0x10c62e[0x0];let _0x4711c6=_0x306a62['model']['createRange'](_0x306a62['model']['createPositionFromPath'](_0x306a62['model']['document']['getRoot'](),_0x136038),_0x306a62['model']['createPositionFromPath'](_0x306a62['model']['document']['getRoot'](),_0x10c62e));const _0x4942c8=_0x306a62['model']['document']['history']['getOperations'](_0x4d1840['version']);for(const _0x133854 of _0x4942c8)_0x4711c6=it['_createFromRanges'](_0x4711c6['getTransformedByOperation'](_0x133854));return{'range':_0x4711c6,'currentIndex':_0x1104a4};}['_integrateEditor'](_0x7d7563){if(!_0x7d7563['plugins']['has']('Undo'))return;const _0x4a8e7d=_0x7d7563['commands']['get']('undo'),_0x392a6e=_0x7d7563['commands']['get']('redo');this['listenTo'](_0x4a8e7d,'revert',(_0x1e1e21,_0x19d4ff,_0x5aca30)=>{const _0x3571c2=this['_batchToChanges']['get'](_0x19d4ff);if(!_0x3571c2)return;const _0x8a3a2e=this['activeConversation']['getInteraction'](_0x3571c2['interactionId'])['getReply'](_0x3571c2['replyId']);_0x3571c2['indexes']['forEach'](_0x36c81f=>_0x8a3a2e['setChangeGroupState'](_0x36c81f,'pending')),this['_batchToChanges']['delete'](_0x19d4ff),this['_batchToChanges']['set'](_0x5aca30,_0x3571c2);}),this['listenTo'](_0x392a6e,'revert',(_0x375549,_0x2baf7c,_0x2dc1fa)=>{const _0x573351=this['_batchToChanges']['get'](_0x2baf7c);if(!_0x573351)return;const _0x226837=this['activeConversation']['getInteraction'](_0x573351['interactionId'])['getReply'](_0x573351['replyId']);_0x573351['indexes']['forEach'](_0x5a95c9=>_0x226837['setChangeGroupState'](_0x5a95c9,'accepted')),this['_batchToChanges']['delete'](_0x2baf7c),this['_batchToChanges']['set'](_0x2dc1fa,_0x573351);});}async['loadConversation'](_0x34a774){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](pt)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x34a774)['getConversation'](),await this['_startConversationSafely'](_0x34a774),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x34a774,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x1b8205){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x34a774}),this['_logError'](new _0x459533('ai-chat-conversation-not-found',this,{'error':_0x1b8205}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0x1a747c=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x252db2=await _0x1a747c['getConversations']();return _0x252db2['length']?_0x252db2[0x0]['id']:'new';}catch(_0x1eed38){return this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x3d9d4e()}),this['_logError'](new _0x459533('ai-chat-conversation-init-failed',this,{'error':_0x1eed38})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x1f4f4d){this['activeConversation']['id']===_0x1f4f4d&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x166706=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x166706),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x2de545,attributes:_0x4955ae}){await this['_handleUIUserMessage']({'userMessage':_0x2de545,'attributes':_0x4955ae});}['getGroupId'](){const _0x48edf4=this['context']['config']['get']('collaboration.channelId');if(!_0x48edf4)throw new _0x459533('ai-chat-missing-channel-id',this);return _0x48edf4;}async['_startConversationSafely'](_0x34ff6b){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x34ff6b);}catch(_0x37e328){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x34ff6b||_0x3d9d4e()}),console['error'](_0x37e328),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x41a5a4){let _0x14c189;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x41a5a4||!this['activeConversation']?_0x14c189=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x14c189=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x1ae798=this['getGroupId'](),_0x2847d4=_0x41a5a4||_0x3d9d4e();this['activeConversation']=new _t({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x14c189,'conversationId':_0x2847d4,'group':_0x1ae798,'getEditor':()=>T(this['context']),'isFromHistory':!!_0x41a5a4}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x164b56,_0x5bec22)=>{this['_aiChatUi']['createConversation'](_0x5bec22),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x41a5a4||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x1a5297,_0x170362)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x170362['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x1ad7b0,_0x134ef5)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x134ef5);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x2ff21d=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x2ff21d);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x56d82=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x56d82);}),this['activeConversation']['on']('webSearchFinished',(_0x206901,_0xef734e)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0xef734e,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x1448fa,_0x1e0c9a)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x1e0c9a,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x17a5d8,_0x18b9a0)=>{this['_aiChatUi']['removeFeedInteraction'](_0x18b9a0['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x30ea65,_0x5624e9,_0x15c692)=>{this['updateConversationTitle'](_0x5624e9,_0x15c692);}),this['activeConversation']['on']('replyCreated',(_0x23e24c,_0x26b21a)=>{'text'===_0x26b21a['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x26b21a):this['_aiChatUi']['addFeedItemAISuggestion'](_0x26b21a);}),this['activeConversation']['on']('replyContentUpdated',async(_0x4333ab,_0x40a987)=>{await this['_updateReplyContent']({'reply':_0x40a987});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x303cac,{reply:_0xa328ec,index:_0x5a7575,state:_0x1d2b07})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0xa328ec['id'],'index':_0x5a7575,'state':_0x1d2b07}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0xa328ec['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x5a7575&&this['_aiChatBalloon']?.['setState'](_0x1d2b07);}),this['activeConversation']['on']('contextItemAdded',(_0x26b270,_0x3fec03)=>{if(this['_aiChatUi']['addContextItem'](_0x3fec03['contextItem'],_0x3fec03['isLoading']),'selection'===_0x3fec03['contextItem']['type']){const _0x13ebab=[...T(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x13ebab,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x30554e,_0x538665)=>{this['_aiChatUi']['removeContextItem'](_0x538665['uiId']),'current-document'==_0x538665['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x538665['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x2d571b,_0xf4d870)=>{this['_aiChatUi']['setContextItemLoading'](_0xf4d870['contextItem']['uiId'],_0xf4d870['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x3889e9,_0x2df412)=>{this['_aiChatUi']['setConversationContext'](_0x2df412['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x323eae,_0x54d878)=>{this['_aiChatUi']['setAddContextOptions'](_0x54d878['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x4d2a83,_0x1f7a4e)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x1f7a4e['sourceId'],_0x1f7a4e['source'],_0x1f7a4e['resources'],_0x1f7a4e['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x4346c3,_0xef4bbd)=>{this['_aiChatUi']['updateResourceState'](_0xef4bbd['sourceId'],_0xef4bbd['resourceId'],_0xef4bbd['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x421192,_0x1b177a)=>{this['_aiChatUi']['updateCapabilities'](_0x1b177a);}),this['activeConversation']['on']('modelSelected',async(_0x80a2e,_0x5cb544)=>{const _0x776486=(await this['_aiChatModels']['getAll']())['find'](_0x3e387d=>_0x3e387d['id']===_0x5cb544['selectedModel']['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x776486,_0x5cb544['isDisabled']);}),this['activeConversation']['on']('error',(_0x474071,{error:_0x8d0902,interactionId:_0x476710,fileName:_0x53a7a7,url:_0x2b88a4,sourceId:_0x27aacf,sourceLabel:_0x187bf7})=>{const _0x3f06f0=_0x476710?_0x476710+':'+_0x3d9d4e():_0x3d9d4e();_0x8d0902['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x3f06f0}):_0x8d0902['message']['startsWith']('ai-chat-conversation-init-failed')||_0x8d0902['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x3f06f0}),this['_logError'](_0x8d0902)):_0x8d0902['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x53a7a7),'id':_0x3f06f0}):_0x8d0902['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x2b88a4),'id':_0x3f06f0}):_0x8d0902['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x3f06f0}):_0x8d0902['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x3f06f0}):_0x8d0902['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x27aacf&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x27aacf),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x187bf7||'source'),'id':_0x3f06f0}),this['_logError'](_0x8d0902)):_0x8d0902['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x3f06f0}),this['_logError'](_0x8d0902)):_0x8d0902['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x3f06f0}),this['_logError'](_0x8d0902)):_0x8d0902['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x3f06f0}),this['_logError'](_0x8d0902)):_0x8d0902['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x3f06f0}),this['_logError'](_0x8d0902)):_0x8d0902['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':_0x3f06f0}),this['_logError'](_0x8d0902)):_0x8d0902['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':_0x3f06f0}),this['_logError'](_0x8d0902)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x3f06f0}),this['_logError'](_0x8d0902));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x41a5a4||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x14297c,attributes:_0x1f352c}){if(!this['activeConversation'])throw new _0x459533('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x2c8727=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x2c8727);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x14297c,'attributes':_0x1f352c});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x2e110a){this['_aiChatUi']['setIsMaximized'](_0x2e110a);}['_logError'](_0x4c8749){gt(_0x4c8749['message']);}['_removeFromContext'](_0x5ec688){this['activeConversation']?.['removeFromContext'](_0x5ec688);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x274200){const [_0x14420e,_0x182dbf]=_0x274200['split'](':'),_0x104a89=this['activeConversation']['getInteraction'](_0x14420e),_0x5f043f=_0x104a89['getReply'](_0x182dbf);return{'interaction':_0x104a89,'reply':_0x5f043f};}['_scrollToSuggestionRange'](_0x1dd92d,_0x19ca0f=!0x1){const _0x37c096=T(this['context']),_0x145a17={'target':_0x37c096['editing']['view']['domConverter']['viewRangeToDom'](_0x37c096['editing']['mapper']['toViewRange'](_0x1dd92d)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x19ca0f};_0x19ca0f&&(_0x145a17['alignToTop']=!0x0),_0x53c419(_0x145a17);}['updateConversationTitle'](_0x17bc49,_0x51f946=!0x1){this['_aiChatUi']['setConversationTitle'](_0x17bc49||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x51f946);}async['_updateReplyContent']({reply:_0x3677b0,renderingStrategy:_0x274c3a}){const {id:_0x42ca83,interactionId:_0x437e2f,isDone:_0x1b957a,type:_0x538264,parsedContent:_0x24ba07}=_0x3677b0,_0x2d3af5=_0x437e2f+':'+_0x42ca83;if('modification'===_0x538264){const _0x410b57=_0x3677b0['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x2d3af5,'parts':_0x410b57,'renderingStrategy':_0x274c3a,'isDone':_0x1b957a});}else'text'===_0x538264&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x2d3af5,'parsedContent':_0x24ba07,'renderingStrategy':_0x274c3a,'isDone':_0x1b957a});_0x1b957a&&_0x3677b0['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x2d3af5,_0x3677b0['sources']);}async['_stopLastInteraction'](){const _0x621afb=this['activeConversation']?.['lastInteraction'];_0x621afb&&(_0x621afb['stop'](),this['_aiChatUi']['stopInteraction'](_0x621afb));}async['_flushLastInteractionUI'](){const _0x1ac904=this['activeConversation']?.['lastInteraction'];if(_0x1ac904){for await(const _0x114ce9 of _0x1ac904['replies'])await this['_updateReplyContent']({'reply':_0x114ce9,'renderingStrategy':'static'});}}['_updateRatings'](_0x1e4afd){const _0x24f34d={'positiveCount':_0x1e4afd['changeGroups']['filter'](_0x1bc857=>'accepted'===_0x1bc857['state'])['length'],'totalCount':_0x1e4afd['changeGroups']['length'],'modificationId':_0x1e4afd['id']},_0x41dee4=this['activeConversation']['getInteraction'](_0x1e4afd['interactionId'])['messageId'];_0x41dee4&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x41dee4,_0x24f34d);}['_registerToolDataCallback'](_0x2f12ff){let _0x4da47f=null,_0x562e40=null;this['on']('toolDataReceived',(_0x46a3ec,_0xf25a37,_0x3f8b8a)=>{_0x3f8b8a['id']!==_0x4da47f&&(_0x4da47f=_0x3f8b8a['id'],_0x562e40=this['_getAIChatInteractionAPI'](_0x3f8b8a)),_0x2f12ff(_0xf25a37,_0x562e40);});}['_getAIChatInteractionAPI'](_0x50e354){const _0x2fb297=this['_aiChatUi'],_0x1ecb83=()=>{_0x50e354['resetWebSearchState'](),_0x50e354['resetReasoningState'](),_0x2fb297['clearLoadingMessage']();},_0x36fc6f=()=>{_0x50e354['currentReply']&&(_0x50e354['currentReply']['done'](),_0x50e354['currentReply']=void 0x0);};return{'insertTextReply':(_0x123442,_0x425c7a)=>{_0x36fc6f(),_0x1ecb83();const _0x429edf=_0x50e354['currentReply']=_0x50e354['createReply']({'type':'text','interactionId':_0x50e354['id'],'content':_0x123442,'id':_0x425c7a||_0x3d9d4e()});return _0x36fc6f(),_0x429edf;},'insertCustomElement':async(_0x30443e,_0x24365f)=>(_0x36fc6f(),_0x1ecb83(),_0x2fb297['addFeedItemCustomElement'](_0x30443e,_0x24365f||_0x3d9d4e())),'setLoadingMessage':_0x2cdd03=>{_0x2fb297['setLoadingMessage'](_0x2cdd03);},'clearLoadingMessage':()=>{_0x2fb297['clearLoadingMessage']();}};}}const R='ai-selection';class D extends _0x479a76{constructor(_0x2f4930){super(_0x2f4930),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 _0x44d670=T(this['context']),_0x203994=_0x44d670['plugins']['has']('RealTimeCollaborationClient')&&_0x44d670['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x203994||_0x3d9d4e();}return this['_sessionId'];}async['getDocumentData'](){const _0x43ab17=T(this['context']),_0xa57784=_0x43ab17['model'],_0x3086e0=_0x43ab17['data']['toView'](_0xa57784['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x3bb7a3=new Dt(_0x43ab17['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x3086e0,_0x3bb7a3);let _0x487b33=await this['_getDocumentDataStringFromView'](_0x3086e0);const _0x54bc00=this['_getMarkersInDocumentOrder'](),_0x2c704d=[];for(const _0x36634f of _0x54bc00){const _0x16c259='<'+_0x36634f['name']+':start></'+_0x36634f['name']+':start>',_0x3f4599=_0x487b33['indexOf'](_0x16c259);_0x487b33=_0x487b33['substring'](0x0,_0x3f4599)+_0x487b33['substring'](_0x3f4599+_0x16c259['length']);const _0x69e3b1='<'+_0x36634f['name']+':end></'+_0x36634f['name']+':end>',_0x52793a=_0x487b33['indexOf'](_0x69e3b1);_0x487b33=_0x487b33['substring'](0x0,_0x52793a)+_0x487b33['substring'](_0x52793a+_0x69e3b1['length']),_0x2c704d['push']({'markerName':_0x36634f['name'],'start':_0x3f4599,'end':_0x52793a,'htmlFragment':_0x487b33['substring'](_0x3f4599,_0x52793a)});}return{'content':_0x487b33,'version':_0x43ab17['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x2c704d};}async['afterInit'](){this['context']instanceof dt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x3ec7e6,_0xd63e59)=>{_0xd63e59['on']('ready',()=>{this['_integrateEditor'](_0xd63e59);});});}['_setOutputDataProcessor'](_0x584b5e){this['_outputDataProcessor']=_0x584b5e;}async['_getDocumentDataStringFromView'](_0x30d1dc){let _0x49637f;const _0x2d1bab=T(this['context']);if(this['_outputDataProcessor']){const _0x5df57b=_0x2d1bab['data']['processor']['domConverter']['viewToDom'](_0x30d1dc),_0x86e177=await this['_outputDataProcessor'](_0x5df57b);_0x49637f=_0x2d1bab['data']['processor']['htmlWriter']['getHtml'](_0x86e177);}else _0x49637f=_0x2d1bab['data']['processor']['toData'](_0x30d1dc);return _0x49637f;}['_integrateEditor'](_0x4f3641){_0x4f3641['conversion']['for']('editingDowncast')['markerToHighlight']({'model':R,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x4f3641['conversion']['for']('dataDowncast')['markerToElement']({'model':R,'view':(_0x507047,{writer:_0x91e3dc,options:_0x135ba9})=>_0x135ba9['convertAiChatSelectionMarker']?_0x91e3dc['createUIElement'](_0x507047['markerName']+':'+(_0x507047['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x3a046c,_0x5bd889,_0x49f643=!0x1,_0x45bcd3=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x45bcd3)return!0x1;const _0x288a0a=T(this['context'])['model'];return _0x288a0a['change'](_0x506da1=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x5bd889,this['_displayedFakeSelectionLocked']=_0x49f643;let _0xe4ad40=0x0;for(let _0x10577d of _0x3a046c){const _0x4dae39=R+':'+_0xe4ad40;if(_0x10577d['start']['isAtEnd']){const _0x5bb65f=_0x10577d['start']['getLastMatchingPosition'](({item:_0x2b48ef})=>!_0x288a0a['schema']['isContent'](_0x2b48ef),{'boundaries':_0x10577d});_0x10577d=_0x506da1['createRange'](_0x5bb65f,_0x10577d['end']);}_0x506da1['addMarker'](_0x4dae39,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x10577d}),_0xe4ad40++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x40f1dc){if(this['_displayedFakeSelectionId']!=_0x40f1dc)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x12f9dc=T(this['context']),_0x327a5e=_0x12f9dc['model']['markers']['getMarkersGroup'](R);return _0x12f9dc['model']['change'](_0x4f9a84=>{for(const _0x20fbf5 of _0x327a5e)_0x4f9a84['removeMarker'](_0x20fbf5);}),!0x0;}async['modelToDataWithIds'](_0x3c7b84){const _0x1a2332=T(this['context']),_0xfe197d=_0x1a2332['data']['toView'](_0x3c7b84),_0x1225e5=new Dt(_0x1a2332['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0xfe197d,_0x1225e5),this['_getDocumentDataStringFromView'](_0xfe197d);}['_setDataIdsOnChildren'](_0x379e8d,_0x2f878a){let _0x4e6d72=!0x1;const _0x31c255=new Set();for(const _0x5e1390 of _0x379e8d['getChildren']()){const _0x325eee=_0x5e1390['is']('emptyElement')||_0x5e1390['is']('containerElement');if(!_0x5e1390['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x5e1390,_0x2f878a)||_0x325eee)&&(_0x2f878a['setAttribute']('data-id',this['_nextDataId'](_0x31c255),_0x5e1390),_0x4e6d72=!0x0);}return _0x4e6d72;}['_nextDataId'](_0x123e15){let _0x13c0d0;do{_0x13c0d0='';for(let _0x1c028=0x0;_0x1c028<0x4;_0x1c028++)_0x13c0d0+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x123e15['has'](_0x13c0d0));return _0x123e15['add'](_0x13c0d0),_0x13c0d0;}['getSelectionText'](){const {model:_0x401d65}=T(this['context']),_0x4b6666=_0x401d65['document']['selection'],_0x3e362e=[];for(const _0x49d62d of _0x4b6666['getRanges']())for(const _0x8c6b57 of _0x49d62d['getItems']())_0x8c6b57['is']('$textProxy')?_0x3e362e['push'](_0x8c6b57['data']):_0x8c6b57['is']('element')&&_0x3e362e['length']>0x0&&'\x20'!==_0x3e362e[_0x3e362e['length']-0x1]&&_0x3e362e['push']('\x20');return _0x3e362e['length']?'\x22'+_0x3e362e['join']('')['trim']()+'\x22':i(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0x586cc0=T(this['context'])['model'];return Array['from'](_0x586cc0['markers']['getMarkersGroup'](R))['sort']((_0xef9a16,_0x12912f)=>_0xef9a16['getStart']()['isBefore'](_0x12912f['getStart']())?-0x1:_0xef9a16['getStart']()['isAfter'](_0x12912f['getStart']())?0x1:0x0);}}const ut=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],bt=[...ut,'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(_0x9ae2f){this['options']={'delay':_0x9ae2f['delay']??0x14,'textNodeStyle':_0x9ae2f['textNodeStyle'],'onStreamUpdate':_0x9ae2f['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x420fc8,targetElement:_0x1d6378,abortSignal:_0x5773d3}){this['isStreaming']&&this['stop'](),_0x5773d3?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x23cae7(_0x420fc8,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x463f6a=0x0;_0x463f6a<this['currentIndex'];_0x463f6a++)this['nodesList'][_0x463f6a]['shouldBeStreamed']=!0x0;do{const _0x4e7065=Date['now'](),_0x2fe778=this['nodesList'][this['currentIndex']],_0x163f64=_0x4e7065-this['lastUpdateTime'];if(_0x2fe778){_0x2fe778['shouldBeStreamed']=!0x0;let _0x4a9189=_0x2fe778['parent'];for(;_0x4a9189;)_0x4a9189['shouldBeStreamed']=!0x0,_0x4a9189=_0x4a9189['parent'];}if(_0x163f64<this['options']['delay'])try{const {promise:_0x7b0fa3,abortController:_0x3209ee}=Os(this['options']['delay']-_0x163f64);this['timeoutAbortController']=_0x3209ee,await _0x7b0fa3;}catch(_0x375484){return;}_0xfeb52e(_0x1d6378,'<'+_0x1d6378['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x1d6378['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:_0x4f95a0}){Array['from'](_0x4f95a0['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x5e55d5=>{_0x5e55d5['replaceWith'](_0x5e55d5['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x235195){let _0x3e8170='';if(function(_0x59c7d0){return _0x1b732d(_0x59c7d0);}(_0x235195)){for(const _0x1ff1b5 of _0x235195['children'])_0x3e8170+=this['renderNode'](_0x1ff1b5);}else{if(Ls(_0x235195)){if(!_0x235195['shouldBeStreamed'])return'';const _0x329e0e=_0x235195,_0x33bd84=Object['entries'](_0x329e0e['attribs'])['map'](([_0xac023c,_0x4edba8])=>_0xac023c+'=\x22'+_0x4edba8+'\x22')['join']('\x20');_0x3e8170+='<'+_0x329e0e['tagName']+(_0x33bd84?'\x20'+_0x33bd84:'')+'>';for(const _0x3f5366 of _0x617e3b(_0x329e0e))_0x3e8170+=this['renderNode'](_0x3f5366);_0x3e8170+='</'+_0x329e0e['tagName']+'>';}else{if(!Ts(_0x235195))return'';if(!_0x235195['shouldBeStreamed'])return'';!function(_0x422e30){if(!_0x422e30['parent']||!Ls(_0x422e30['parent']))return!0x1;if(!ys['includes'](_0x422e30['parent']['tagName']))return!0x1;return!_0x421916(_0x422e30)['match'](/^\s*[<>]\s*$/);}(_0x235195)?_0x3e8170+=_0x59f43c(_0x235195):_0x3e8170+=_0x59f43c(new _0x1fb8c4('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x235195]));}}return _0x3e8170;}['getParsedDocumentNodeList'](){const _0x32eccd=[];return function(_0x5460c5,_0x15a67e){const _0xc0dd=_0x58231e=>{if(_0x15a67e(_0x58231e),_0x58231e instanceof _0x25cfb7)for(let _0x298827=0x0;_0x298827<_0x58231e['children']['length'];_0x298827++){const _0x280045=_0x58231e['children'][_0x298827];_0xc0dd(_0x280045);}};for(let _0x4c5365=0x0;_0x4c5365<_0x5460c5['children']['length'];_0x4c5365++)_0xc0dd(_0x5460c5['children'][_0x4c5365]);}(this['document'],_0x11aa62=>{if(Ts(_0x11aa62)){const _0x5ee477=this['splitTextNodeIntoWordNodes'](_0x11aa62);_0x5ee477['length']&&_0x32eccd['push'](..._0x5ee477);}_0x11aa62['isWordSplitSource']||_0x11aa62['isWordSplitResult']||_0x32eccd['push'](_0x11aa62);}),_0x32eccd;}['splitTextNodeIntoWordNodes'](_0x10ae68){if(_0x10ae68['isWordSplitSource']||_0x10ae68['isWordSplitResult'])return[];const _0x11c4f7=_0x421916(_0x10ae68)['match'](/(?:\s*\S+\s*)/g),_0x133130=[];if(_0x11c4f7&&_0x11c4f7['length']>0x1){for(const _0x2d5f24 of _0x11c4f7){const _0x425661=new _0x29d6b1(_0x2d5f24);_0x425661['isWordSplitResult']=!0x0,_0x1e7915(_0x10ae68,_0x425661),_0x133130['push'](_0x425661);}_0x10ae68['isWordSplitSource']=!0x0,_0x187273(_0x10ae68);}return _0x133130;}}const ys=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Ts(_0xe70975){return _0x4bd0e8(_0xe70975);}function Ls(_0x21f222){return _0x1d78cd(_0x21f222);}function Os(_0xa490bb){const _0x3ba2ca=new AbortController();return{'promise':new Promise((_0x2f8b8a,_0x2f6961)=>{const _0x23726c=setTimeout(_0x2f8b8a,_0xa490bb);_0x3ba2ca['signal']['addEventListener']('abort',()=>{clearTimeout(_0x23726c),_0x2f6961();});}),'abortController':_0x3ba2ca};}class Fr extends _0x13ab0e{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x2985b5){super();const _0x62d864=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']=_0x2985b5,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x62d864['if']('isDone','ck-ai-chat__feed__item_done'),_0x62d864['if']('isVisible','ck-hidden',_0x3a64fe=>!_0x3a64fe),'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'](_0xa25ead=>{_0xa25ead['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x17d72f,_0x5868e5,_0x4a24a7){await this['htmlStreamer']['stream']({'document':_0x17d72f,'targetElement':_0x5868e5,'abortSignal':_0x4a24a7});}}class oa extends _0x13ab0e{['showChangesToggleView'];constructor(_0x252d79,_0x2d2ae2){super(_0x252d79),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Zn(_0x252d79),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x252d79,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x2d2ae2['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x4f2357=>_0x4f2357?_0x466c2c:_0xcc61bd),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x4c9ab6=new _0x5495d5();_0x4c9ab6['content']=_0x19edfe,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x2d2ae2['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x4c9ab6,{'tag':'span','children':[i(_0x252d79,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Zn extends _0x4e2d9f{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const Or={'accepted':_0xe39f1c,'rejected':_0x33843a,'outdated':_0x33843a};class ws extends _0x13ab0e{['stateIconView'];constructor(_0x55e5db){super(_0x55e5db);const _0xefa231=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new Nr(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0xefa231['to']('state',_0x23f800=>'ck-ai-suggestion__content-part-state_'+_0x23f800),_0xefa231['if']('isVisible','ck-hidden',_0x5b59e5=>!_0x5b59e5)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0xefa231['to']('state',_0x43ef45=>{switch(_0x43ef45){case'accepted':return i(_0x55e5db,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return i(_0x55e5db,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return i(_0x55e5db,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x2bfca7){this['state']=_0x2bfca7;}}class Nr extends _0x5495d5{constructor(){super(),this['set']('state','accepted'),this['content']=Or[this['state']],this['on']('change:state',()=>{this['content']=Or[this['state']];});}}class cs extends _0x3ccac8{['_applyButton'];['_suggestButton'];constructor(_0x1602df,_0x2b6823,_0x4b6bae){super(_0x1602df);const _0x59bc47=Boolean(_0x4b6bae);this['set']('isEnabled',!_0x59bc47),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x4eae78=[];if(_0x59bc47){const _0x56e7dd=new _0x4e2d9f(_0x1602df);_0x56e7dd['set']({'label':i(_0x1602df,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc}),_0x4eae78['push'](_0x56e7dd);}else{_0x2b6823['includes']('applySuggestion')&&(this['_applyButton']=new _0x4e2d9f(_0x1602df),this['_applyButton']['set']({'label':i(_0x1602df,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0xe39f1c}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x4eae78['push'](this['_applyButton'])),_0x2b6823['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x4e2d9f(_0x1602df),this['_suggestButton']['set']({'label':i(_0x1602df,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x16c628}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x4eae78['push'](this['_suggestButton']));const _0x138cce=new _0x4e2d9f(_0x1602df);_0x138cce['set']({'label':i(_0x1602df,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x33843a}),_0x138cce['bind']('isEnabled')['to'](this),_0x138cce['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x4eae78['push'](_0x138cce);}this['items']['addMany'](_0x4eae78);const _0x77822c=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x77822c['if']('isVisible','ck-hidden',_0x5f1b8b=>!_0x5f1b8b)]}});}['setButtonsVisibility']({showApplyButton:_0x38f0da,showSuggestButton:_0x3be0c3}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x38f0da),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x3be0c3);}}class vn extends _0x13ab0e{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x32ca53,{part:_0x43ba29,uiIndex:_0x145426,availableActions:_0x423c3e,areActionsDisabled:_0x1769b5}){super(_0x32ca53),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new cs(_0x32ca53,_0x423c3e,_0x1769b5),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x43ba29['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x43ba29['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x43ba29['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new ws(_0x32ca53),this['titleLabelView']=new Sn(_0x32ca53,_0x145426),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',(_0x52c5c9,_0x5237a4,_0x3aadca,_0x48848e)=>{'pending'===_0x48848e?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x3aadca?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x3aadca),this['children']['add'](this['stateView']));});}}class Sn extends _0x13ab0e{constructor(_0x336582,_0x38c4b8){super(_0x336582),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x336582,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x38c4b8['toString']())]});}}class as extends _0x13ab0e{['htmlStreamer'];constructor(_0xc140c9){super(_0xc140c9),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:_0x59fab3,renderingStrategy:_0x3a6c6b,abortSignal:_0x5d21a6}){'streaming'===_0x3a6c6b?await this['htmlStreamer']['stream']({'document':_0x59fab3['content'],'targetElement':this['element'],'abortSignal':_0x5d21a6}):this['element']['innerHTML']=Tt(_0x59fab3['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0x13ab0e{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x352a88,{part:_0x2bba75,uiIndex:_0xb030,areActionsDisabled:_0x1aa183,availableActions:_0x42f113}){super(_0x352a88);const _0x9fc9f1=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x1b8e9d=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x1aa183;};this['on']('change:state',_0x1b8e9d),this['on']('change:isDone',_0x1b8e9d),_0x1b8e9d(),this['_children']=this['createCollection'](),this['_headerView']=new vn(_0x352a88,{'part':_0x2bba75,'uiIndex':_0xb030,'availableActions':_0x42f113,'areActionsDisabled':_0x1aa183}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...ut)['to'](this),this['_streamableContentView']=new as(_0x352a88),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x9fc9f1['to']('state',_0x9f8da9=>'ck-ai-suggestion__body__content-part_'+_0x9f8da9),_0x9fc9f1['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x9fc9f1['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x9fc9f1['if']('isVisible','ck-hidden',_0x39a92c=>!_0x39a92c)]},'children':this['_children'],'on':{'mouseenter':_0x9fc9f1['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x2bba75['index']});}),'mouseleave':_0x9fc9f1['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x2bba75['index']});}),'click':_0x9fc9f1['to'](_0x4b544f=>{const _0x1359ec=_0x4b544f['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x1359ec)&&this['fire']('showChangeInText',{'index':_0x2bba75['index']});})}});}async['updateContent']({part:_0x39ad1b,renderingStrategy:_0x535f4a,showUnchangedParts:_0x43e060=!0x1,abortSignal:_0x9f2dda}){this['partDefinition']=_0x39ad1b,this['isVisible']=this['partDefinition']['hasChanges']||_0x43e060,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x39ad1b,'renderingStrategy':_0x535f4a,'abortSignal':_0x9f2dda});}['markAsDone'](){this['isDone']=!0x0;}}class z extends _0x5d3056(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x370b40){const _0x2cf76e=this['createTask'](_0x370b40);return this['queue']['push'](_0x2cf76e),this['_processQueue'](),_0x2cf76e['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(_0x487583=>{this['once']('_queueEmpty',()=>{_0x487583();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x4fb848=this['queue']['shift']();try{await _0x4fb848['callback'](this['_abortController']['signal']),_0x4fb848['resolve']();}catch(_0x1fcf66){_0x4fb848['reject'](_0x1fcf66);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x482707){let _0x4ac777,_0x487d32;const _0x400cf9=new Promise((_0x3c7acd,_0x4bf64c)=>{_0x4ac777=_0x3c7acd,_0x487d32=_0x4bf64c;});return{'callback':_0x482707,'resolve':_0x4ac777,'reject':_0x487d32,'completePromise':_0x400cf9};}}class mi extends Fr{constructor(_0x2864be){super(_0x2864be),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x2864be['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x33fc04){this['element']['innerHTML']=_0x33fc04;}}const ot=['applySuggestion','insertSuggestion'];class ra extends _0x13ab0e{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x212403,_0xf92882=[...ot],_0x4bb5a4){super(_0x212403);const _0x2ea786=this['bindTemplate'],_0x57f6e0=Boolean(_0x4bb5a4);if(this['set']('isEnabled',!_0x57f6e0),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x57f6e0){const _0x59127d=new _0x4e2d9f(_0x212403);_0x59127d['set']({'label':i(_0x212403,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc});const _0x5c40ed=new _0x13ab0e(_0x212403);_0x5c40ed['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[i(_0x212403,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x59127d]}]}),this['children']['add'](_0x5c40ed);}else this['_applyChangesButton']=new _0x4e2d9f(_0x212403),this['_applyChangesButton']['set']({'label':i(_0x212403,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0xf92882['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x4e2d9f(_0x212403),this['_insertSuggestionsButton']['set']({'label':i(_0x212403,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0xf92882['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'](_0x33767a=>{_0x33767a['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',_0x2ea786['if']('isVisible','ck-hidden',_0x27c0a4=>!_0x27c0a4)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x18d2a3){this['isVisible']=_0x18d2a3;}['_switchButtonLabelsPlurality'](_0x530056){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x530056?(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 _0x13ab0e{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x865f33,_0x4d8c06){super(_0x865f33),this['bodyCollection']=_0x4d8c06,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',_0x5033b7=>!_0x5033b7)]},'children':this['children']});const _0x32cd78=new _0x13ab0e(this['locale']),_0x36e26=new _0x5495d5();_0x36e26['content']=_0x4b3f58,_0x32cd78['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x36e26,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x32cd78),this['_setupBalloonPanel'](_0x865f33);}['addSource'](_0x1692c2){this['children']['add'](new qr(this['locale'],_0x1692c2,this['balloonPanelView']));}['_setupBalloonPanel'](_0x4eb781){this['balloonPanelView']=new _0x551ec5(_0x4eb781),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class qr extends _0x4e2d9f{['balloonPanelView'];['source'];constructor(_0x1c4365,_0x244ca4,_0x3929b3){super(_0x1c4365),this['source']=_0x244ca4,this['balloonPanelView']=_0x3929b3,this['set']({'label':_0x244ca4['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x49f430=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x49f430['to'](()=>{window['open'](_0x244ca4['url'],'_blank');}),'mouseenter':_0x49f430['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x49f430['to'](()=>{this['_hideTooltip']();})}}),_0x244ca4['favicon']){const _0xc92a74=new _0x13ab0e(_0x1c4365);_0xc92a74['setTemplate']({'tag':'img','attributes':{'src':_0x244ca4['favicon']||_0x4b3f58,'alt':_0x244ca4['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0xc92a74);}else this['set']('icon',_0x4b3f58);}['_createTooltipContentView'](_0x3757f9,_0x3357ce){const _0x310926=new _0x13ab0e(_0x3757f9),_0x271e5e=[];let _0x31ab93;_0x3357ce?.['favicon']?(_0x31ab93=new _0x13ab0e(_0x3757f9),_0x31ab93['setTemplate']({'tag':'img','attributes':{'src':_0x3357ce['favicon'],'alt':_0x3357ce['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x31ab93=new _0x5495d5(),_0x31ab93['content']=_0x4b3f58,_0x31ab93['extendTemplate']({'attributes':{'alt':_0x3357ce['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x271e5e['push'](_0x31ab93);const _0x7979d2=new _0x13ab0e(_0x3757f9);_0x7979d2['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x3357ce['url']},'children':[{'text':new URL(_0x3357ce['url'])?.['hostname']}]}),_0x271e5e['push'](_0x7979d2);const _0x3bdfdd=new _0x13ab0e(_0x3757f9);_0x3bdfdd['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x271e5e});const _0x28f1f8=new _0x13ab0e(_0x3757f9);return _0x28f1f8['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x3357ce['title']['length']>0x190?_0x3357ce['title']['substring'](0x0,0x190)+'...':_0x3357ce['title']}]}),_0x310926['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x3bdfdd,_0x28f1f8]}),_0x310926;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x551ec5['defaultPositions']['northArrowSouth'],_0x551ec5['defaultPositions']['northArrowSouthWest'],_0x551ec5['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 _0x40e054=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x40e054);}}class ca extends _0x13ab0e{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x40fe56,_0x885b8b){super(_0x40fe56);const {areActionsDisabled:_0x599445,showUnchangedParts:_0x1eb63b,availableActions:_0x3b93b1}=_0x885b8b;this['_areActionsDisabled']=_0x599445,this['_showUnchangedParts']=_0x1eb63b,this['_availableActions']=_0x3b93b1,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new z(),this['_emptyPartsWarningView']=new mi({'id':'empty-parts-warning','initialContent':i(_0x40fe56,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x40fe56,_0x885b8b['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sr(this['locale'],_0x885b8b['bodyCollection']),_0x885b8b['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...ut)['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:_0x46167f,renderingStrategy:_0x2b7a40,abortSignal:_0x198aff}){this['_children']['length']?_0x46167f['forEach'](_0x300eb0=>{const _0xc6ab92=this['_cachedContentParts']['findIndex'](_0x2cd4ce=>_0x2cd4ce['index']==_0x300eb0['index']);-0x1===_0xc6ab92?this['_cachedContentParts']['push'](_0x300eb0):this['_cachedContentParts'][_0xc6ab92]=_0x300eb0;}):this['_cachedContentParts']=_0x46167f;const _0x4046a5=this['_showUnchangedParts']?_0x46167f:_0x46167f['filter'](_0x30b320=>_0x30b320['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x4046a5['length']>0x1);for(const _0x2097b2 of _0x4046a5)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x43ef7d=>{let _0x419a37=this['getPartView'](_0x2097b2['index']);_0x419a37||(_0x419a37=new na(this['locale'],{'part':_0x2097b2,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x419a37['delegate'](...ut)['to'](this),this['_children']['add'](_0x419a37),this['hasPendingParts']=!0x0),await _0x419a37['updateContent']({'part':_0x2097b2,'renderingStrategy':_0x2b7a40,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x43ef7d}),_0x419a37['markAsDone']();});return _0x198aff?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x3332ef,_0x16a85e){const _0x5f3179=this['getPartView'](_0x3332ef);_0x5f3179&&(_0x5f3179['state']=_0x16a85e),this['hasPendingParts']='pending'==_0x16a85e||Array['from'](this['_children'])['some'](_0x39e49e=>'pending'==_0x39e49e['state']);}['setPartActive'](_0x5b64b8,_0x2b8ec8){if(!0x1===_0x5b64b8){for(const _0x58c632 of this['_children'])_0x58c632['isActive']=!0x1;}else{const _0x4c9e6a=this['getPartView'](_0x5b64b8);_0x4c9e6a&&(_0x4c9e6a['isActive']=_0x2b8ec8);}}['updateSources'](_0x164e1b){_0x164e1b['forEach'](_0xe72bc4=>this['_sourcesView']['addSource'](_0xe72bc4)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x344975){return this['_children']['find'](_0x569836=>_0x569836['partDefinition']['index']==_0x344975)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x2e2863=!this['_cachedContentParts']['find'](({hasChanges:_0x3013ea})=>_0x3013ea),_0x415083=!!this['_cachedContentParts']['find'](({hasChanges:_0x5644f1})=>!_0x5644f1);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x415083,_0x2e2863?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'](_0x2c4fc9=>_0x2c4fc9['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x26194b=>_0x26194b['partDefinition']['hasChanges'])['length']>0x0;}}class gn extends _0x13ab0e{['bodyView'];['children'];['headerView'];constructor(_0x4a6dd8,_0x510b44,_0x2fac60){super(_0x4a6dd8);const {showDiff:_0x185dc3,areActionsDisabled:_0x39d0dc,showUnchangedParts:_0xd78183,availableActions:_0x45adb4}=_0x510b44;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0x4a6dd8,{'showDiff':_0x185dc3}),this['headerView']['on']('toggleShowChanges',(_0x3d9595,_0x1f11e3)=>{this['areChangesVisible']=_0x1f11e3['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x1f11e3['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ca(_0x4a6dd8,{'areActionsDisabled':_0x39d0dc,'showUnchangedParts':!!_0xd78183,'availableActions':_0x45adb4,'bodyCollection':_0x2fac60}),this['bodyView']['delegate'](...ut)['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'](_0x3df8d1){await this['bodyView']['updateContentParts'](_0x3df8d1);}['updateSources'](_0x359503){this['bodyView']['updateSources'](_0x359503);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class ai extends Fr{['containerView'];constructor(_0x3ca25b,_0x591aa7,_0x40dabc){super(_0x591aa7),this['set']('isTrackChangesOn',!0x1),this['containerView']=new gn(_0x3ca25b,{'showDiff':_0x591aa7['showDiff'],'areActionsDisabled':_0x591aa7['areActionsDisabled'],'availableActions':_0x591aa7['availableActions']},_0x40dabc),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x2d54a0,_0x277f73)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x277f73['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',(_0x18a881,{index:_0x3e426c})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x3e426c});}),this['containerView']['on']('applySuggestion',(_0x59006b,{index:_0x171e15}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x171e15});}),this['containerView']['on']('insertSuggestion',(_0x22df9d,{index:_0x2cc9dd}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2cc9dd});}),this['containerView']['on']('rejectSuggestion',(_0x3172e4,{index:_0x4779b2})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4779b2});}),this['containerView']['on']('mouseOverSuggestion',(_0x5bc679,{index:_0x1bad9f})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1bad9f});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x39627a,{index:_0x333a70})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x333a70});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x277261){await this['containerView']['updateContent'](_0x277261);}['updatePartState'](_0x5580be,_0xf2f020){this['containerView']['bodyView']['updatePartState'](_0x5580be,_0xf2f020);}['setPartActive'](_0x1e9cab,_0x4c048f){!0x1===_0x1e9cab?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x1e9cab,_0x4c048f);}['updateSources'](_0x6386ae){this['containerView']['updateSources'](_0x6386ae);}['getPartView'](_0x499f5c){return this['containerView']['bodyView']['getPartView'](_0x499f5c);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class di extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x34c61e,_0x14e62c,_0x323116){super(_0x14e62c),this['_bodyCollection']=_0x323116,this['locale']=_0x34c61e,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x13ab0e(),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':Ui(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x33c642,renderingStrategy:_0x25ba72,abortSignal:_0x1790f6}){'streaming'===_0x25ba72?await this['streamIntoElement'](_0x33c642,this['replyContainer']['element'],_0x1790f6):this['replyContainer']['element']['innerHTML']=_0x59f43c(_0x33c642);}['updateSources'](_0x3916f8){const _0x1d59c5=new Sr(this['locale'],this['_bodyCollection']);_0x1d59c5['children']['addMany'](_0x3916f8['map'](_0x49077c=>new qr(this['locale'],_0x49077c,_0x1d59c5['balloonPanelView']))),_0x1d59c5['isVisible']=!0x0,this['children']['add'](_0x1d59c5);}}class pi extends _0x4d4103{constructor(_0x35a854=void 0x0){super();const _0x502f35=_0x35a854?'ck-ai-spinner_'+_0x35a854:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x502f35]}});}}const xn={'file':_0x53d476,'document':_0x29c8bf,'web-resource':_0x3635cf,'text':_0x53d476,'selection':_0x1ac94e,'mcp-tool-context':_0x29c8bf},Ur='ck-ai-chat-context-chip',Wr='ck-ai-chat-context-chip_wide',Yr='ck-ai-chat-context-chip_document',$r='ck-ai-chat-context-chip__label',Qr='ck-ai-chat-context-chip__type-icon',Xr='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class Vo extends _0x4e2d9f{constructor(_0x2cd132,_0x223863,_0x1454c2,_0x8a59d7,_0x376279=!0x1){super(_0x2cd132),this['_isAnimationOnEnterEnabled']=_0x8a59d7,this['_initializeProperties'](_0x223863,_0x1454c2,_0x376279),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'](_0x3a9f2c,_0x5183db,_0x11bcad){this['set']('label',_0x3a9f2c['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x3a9f2c['type']),this['set']('id',_0x3a9f2c['uiId']),this['set']('readonly',_0x5183db),this['set']('isLoading',_0x11bcad);}['_setupTemplate'](){const _0x443bee=this['_createIconView'](),_0x5dec7e=this['_createRemoveButton'](),_0x5dee29=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x5dee29),'children':this['_createTemplateChildren'](_0x443bee,_0x5dec7e,_0x5dee29)});}['_createTemplateAttributes'](_0x4484d5){return{'class':[Ur,_0x4484d5['if']('itemType',Yr,_0x381f25=>'document'==_0x381f25),_0x4484d5['if']('itemType',Wr,_0x2dbadf=>'selection'==_0x2dbadf)],'data-cke-tooltip-text':_0x4484d5['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':Xr};}['_createTemplateChildren'](_0x4e62bd,_0x5112ff,_0x4c5f5a){const _0xe4afd7=this['_createLabelElement'](_0x4c5f5a),_0x1dfc5b=this['_createLoaderIcon']();return this['readonly']?[_0x4e62bd,_0xe4afd7]:[_0x4e62bd,_0x1dfc5b,_0xe4afd7,_0x5112ff];}['_createLabelElement'](_0x4e931b){return{'tag':'span','attributes':{'class':$r},'children':[{'text':_0x4e931b['to']('label')}]};}['_createRemoveButton'](){const _0xc39422=new _0x4e2d9f(this['locale']);return _0xc39422['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x49e645}),this['_setupRemoveButtonEvent'](_0xc39422),_0xc39422;}['_setupRemoveButtonEvent'](_0x160af7){_0x160af7['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x56c92e=this['bindTemplate'],_0x5ee34e=new _0x5495d5();return _0x5ee34e['content']=xn[this['itemType']],_0x5ee34e['extendTemplate']({'attributes':{'class':[Qr,_0x56c92e['if']('isLoading','ck-hidden',_0x25c831=>_0x25c831)]}}),_0x5ee34e;}['_handleAnimationEndOnce'](_0x2cdd9b,_0x450cdb){if(!_0x2cdd9b)return;const _0x28451d=()=>{_0x450cdb(),_0x2cdd9b['removeEventListener']('animationend',_0x28451d),_0x2cdd9b['removeEventListener']('webkitAnimationEnd',_0x28451d);};_0x2cdd9b['addEventListener']('animationend',_0x28451d),_0x2cdd9b['addEventListener']('webkitAnimationEnd',_0x28451d);}['_createLoaderIcon'](){const _0x3c79c5=new pi('small');return _0x3c79c5['bind']('isVisible')['to'](this,'isLoading',_0x3e5b3f=>_0x3e5b3f),_0x3c79c5;}}function In(_0x47f33d){if(!_0x47f33d)return _0x47f33d;if(_0x47f33d['length']<=0x78)return _0x47f33d;const _0x4a04ce=_0x47f33d['slice'](0x0,0x78),_0x5a42a6=_0x4a04ce['lastIndexOf']('\x20');return(_0x5a42a6>0x0?_0x4a04ce['slice'](0x0,_0x5a42a6):_0x4a04ce)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Ro{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x5895bc,_0x46fc17,_0xfb11d8,_0x2ee127,_0x5e4662){this['_locale']=_0x5895bc,this['_visibleChips']=_0x46fc17,this['_config']={...hn,..._0xfb11d8,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0xfb11d8['cssClasses']}},this['_overflowChips']=new _0x537dd4(),this['_bodyCollection']=_0x2ee127,this['_parentView']=_0x5e4662||null;}['setContainerElement'](_0x57be0a){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x57be0a,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 _0x3dcc0c=[...this['_visibleChips'],...this['_overflowChips']],_0x2d7e1f=this['_createCalculationContainer'](),_0x3bda3e=this['_calculateOverflowInContainer'](_0x2d7e1f,_0x3dcc0c),_0x3970d4=_0x2d7e1f['_ancestorsToRestore'];_0x3970d4&&this['_restoreAncestorVisibility'](_0x3970d4),_0x2d7e1f['remove'](),this['_applyOverflowResults'](_0x3dcc0c,_0x3bda3e);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x570ad6({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x596d2e=new _0x4e2d9f(this['_locale']);_0x596d2e['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x3c34ad=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x3c34ad['push'](this['_config']['cssClasses']['controlsButton']),_0x596d2e['extendTemplate']({'attributes':{'class':_0x3c34ad}}),_0x596d2e;}['_createShowMoreBalloonPanelView'](){const _0x2826a9=new _0x551ec5(this['_locale']);return _0x2826a9['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x2826a9),_0x2826a9;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x179e85=>{_0x179e85['disableAnimationOnEnter']();});const _0x4cdce4=new _0x13ab0e(this['_locale']);_0x4cdce4['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x4cdce4);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x4430ac=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x4430ac?'':'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'](_0x1e6500){const _0x129b36=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x26463a=this['_containerElement']?.['classList'];if(_0x26463a){const _0x5109ee=_0x26463a[0x0]||'',_0x4887e9=_0x1e6500['querySelector']('.'+_0x5109ee),_0x1e2e45=_0x1e6500['querySelector'](_0x129b36);return _0x4887e9||_0x1e2e45||_0x1e6500;}return _0x1e6500['querySelector'](_0x129b36)||_0x1e6500;}['_calculateContainerWidth'](){const _0x3d2803=this['_parentView']?.['element']||this['_containerElement'];if(!_0x3d2803)return an;const _0x46a13a=window['getComputedStyle'](_0x3d2803)['width'];if('auto'===_0x46a13a||'0px'===_0x46a13a||!_0x46a13a){const _0x5cc681=_0x3d2803['parentElement'];if(_0x5cc681){const _0x536a1d=window['getComputedStyle'](_0x5cc681);return'auto'!==_0x536a1d['width']?_0x536a1d['width']:an;}return an;}return _0x46a13a;}['_applyCalculationStyles'](_0x248473,_0x2f50e6){this['_config']['cssClasses']['calculationContainer']&&_0x248473['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x248473['style']['width']=_0x2f50e6,_0x248473['style']['position']='absolute',_0x248473['style']['top']='-9999px',_0x248473['style']['left']='-9999px',_0x248473['style']['opacity']='0',_0x248473['style']['pointerEvents']='none',_0x248473['style']['zIndex']='-1',_0x248473['style']['visibility']='visible\x20!important',_0x248473['style']['display']='block\x20!important',_0x248473['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x62b728){_0x62b728['forEach'](({element:_0x5549f6,originalDisplay:_0x531172,originalVisibility:_0x29a31b})=>{_0x5549f6['style']['display']=_0x531172,_0x5549f6['style']['visibility']=_0x29a31b;});}['_makeAncestorsVisible'](_0x3e2187){const _0x57fba9=[];let _0x1c940f=_0x3e2187;for(;_0x1c940f&&_0x1c940f!==document['body'];){const _0x303b87=window['getComputedStyle'](_0x1c940f);'none'!==_0x303b87['display']&&'hidden'!==_0x303b87['visibility']||(_0x57fba9['push']({'element':_0x1c940f,'originalDisplay':_0x1c940f['style']['display'],'originalVisibility':_0x1c940f['style']['visibility']}),_0x1c940f['style']['display']='block',_0x1c940f['style']['visibility']='visible'),_0x1c940f=_0x1c940f['parentElement'];}return _0x57fba9;}['_createContainerElements'](){let _0x5172d5,_0x42c1cc;return this['_parentView']?.['element']?(_0x5172d5=this['_parentView']['element']['cloneNode'](!0x0),_0x42c1cc=this['_findTargetContainer'](_0x5172d5)):(_0x5172d5=document['createElement']('div'),_0x42c1cc=_0x5172d5),{'calculationContainer':_0x5172d5,'targetContainer':_0x42c1cc};}['_createCalculationContainer'](){const {calculationContainer:_0x406b33,targetContainer:_0x16cb95}=this['_createContainerElements'](),_0x392f3b=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x406b33,_0x392f3b);const _0x202ab6=this['_parentView']?.['element']||this['_containerElement'],_0x5015cf=_0x202ab6?.['parentElement'];_0x5015cf?_0x5015cf['appendChild'](_0x406b33):document['body']['appendChild'](_0x406b33),_0x406b33['_targetContainer']=_0x16cb95;const _0x5ec601=this['_makeAncestorsVisible'](_0x5015cf||null);return _0x406b33['offsetWidth'],_0x406b33['_ancestorsToRestore']=_0x5ec601,_0x406b33;}['_calculateOverflowInContainer'](_0x48307c,_0x27723){const _0x5723f8=_0x48307c['_targetContainer']||_0x48307c,_0x3d2e62=[],{rowCount:_0x1dc330}=this['_renderChipsAndCountRows'](_0x5723f8,_0x27723);if(_0x1dc330<=this['_config']['maxVisibleRows'])return _0x3d2e62;const _0xdc942d=_0x27723['slice']();for(;_0xdc942d['length']>0x0;){if(this['_testButtonFit'](_0x48307c,_0x5723f8,_0xdc942d)){const _0x5d79e5=_0x27723['filter'](_0x3d2ddc=>!_0xdc942d['includes'](_0x3d2ddc));_0x3d2e62['push'](..._0x5d79e5);break;}if(!_0xdc942d['pop']())break;}return _0x3d2e62;}['_renderChipsAndCountRows'](_0x4727f5,_0x46d57c){_0x4727f5['innerHTML']='',_0x46d57c['forEach'](_0x12cb57=>{if(_0x12cb57['element']){const _0x3e3c54=_0x12cb57['element']['cloneNode'](!0x0);_0x4727f5['appendChild'](_0x3e3c54);}}),_0x4727f5['offsetWidth'];const _0x1c79eb=_0x4727f5['children'],_0x3a4038=[];return Array['from'](_0x1c79eb)['forEach'](_0x38dba6=>{const _0x56d28a=_0x38dba6['getBoundingClientRect']()['top'];_0x3a4038['some'](_0x37d3c8=>Math['abs'](_0x37d3c8-_0x56d28a)<this['_config']['rowDetectionTolerance'])||_0x3a4038['push'](_0x56d28a);}),{'rowCount':_0x3a4038['length']};}['_createMockButton'](){const _0x243151=document['createElement']('button');return _0x243151['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x243151['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x243151['textContent']='+\x201',_0x243151;}['_testButtonFit'](_0x503a37,_0x345f3e,_0x72d5db){this['_renderChipsAndCountRows'](_0x345f3e,_0x72d5db);const _0x5de5d8=this['_createMockButton']();_0x503a37['appendChild'](_0x5de5d8),_0x503a37['offsetWidth'];const _0x1df119=[..._0x345f3e['children'],_0x5de5d8],_0x1106b6=[];_0x1df119['forEach'](_0x5964fe=>{const _0x1fb05c=_0x5964fe['getBoundingClientRect']()['top'];_0x1106b6['some'](_0x4ced82=>Math['abs'](_0x4ced82-_0x1fb05c)<this['_config']['rowDetectionTolerance'])||_0x1106b6['push'](_0x1fb05c);});const _0x787d49=_0x1106b6['length'];return _0x5de5d8['remove'](),_0x787d49<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x254308,_0x279361){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x254308['forEach'](_0x44e85d=>{_0x279361['includes'](_0x44e85d)?this['_overflowChips']['add'](_0x44e85d):this['_visibleChips']['add'](_0x44e85d);});}['_updateOverflowUI'](_0x1498fa){if(_0x1498fa>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x1498fa>0x0&&this['_showMoreButtonView']){const _0x44a2d3=''+this['_config']['showMoreLabelPrefix']+(_0x1498fa<0x63?_0x1498fa:'99');this['_showMoreButtonView']['label']=_0x44a2d3;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x261184,_0x244d18){this['_distributeChips'](_0x261184,_0x244d18),this['_updateOverflowUI'](_0x244d18['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x90b90e=>{_0x90b90e[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 _0x48b33a=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x48b33a['width']||0x0===_0x48b33a['height'])return!0x1;const _0x30e1b3=window['innerHeight']||document['documentElement']['clientHeight'],_0x441aad=window['innerWidth']||document['documentElement']['clientWidth'],_0x375a21=0xc8;return _0x48b33a['bottom']>=-0xc8&&_0x48b33a['top']<=_0x30e1b3+_0x375a21&&_0x48b33a['right']>=-0xc8&&_0x48b33a['left']<=_0x441aad+_0x375a21;}}const Zr='ck-ai-chat__feed__context-chips',la='ck-ai-chat-context-chips-wrapper',ua='ck-ai-chat-context-chips-wrapper-balloon',da='ck-ai-chat-controls-button',_a='ck-ai-chat-controls_context_show-more-button',Aa='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0x13ab0e{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x328205,_0x1fc7a3,_0x181643){super(_0x328205),this['_bodyCollection']=_0x181643,this['_createContextChips'](_0x1fc7a3);const _0x271087={'cssClasses':{'showMoreButton':_a,'showMoreBalloon':Aa,'overflowContainer':ua,'controlsButton':da}};this['_overflowManager']=new Ro(_0x328205,this['_contextChips'],_0x271087,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Zr,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':la},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x529101=this['element']['querySelector']('.'+la);_0x529101&&(this['_overflowManager']['setContainerElement'](_0x529101),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x2110eb){for(const _0x22815b of _0x2110eb){const _0x13027a=new Vo(this['locale'],_0x22815b,!0x0,!0x1);this['_contextChips']['add'](_0x13027a);}}}class li extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x4d5fc0,_0x18d14b,_0x2628f9){super(_0x18d14b),this['_locale']=_0x4d5fc0,this['_bodyCollection']=_0x2628f9,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'](_0x3c4b10=>!_0x3c4b10['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x13ab0e(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 Mt extends Fr{['capabilities'];constructor(_0x48ca95,_0x120ed4){super(_0x120ed4);const {isWebSearchEnabled:_0x33600b,isReasoningEnabled:_0x449db9}=_0x120ed4['capabilities'],_0x342ae9=[];let _0x46c5a6='';_0x33600b&&_0x449db9?(_0x46c5a6=i(_0x48ca95,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x342ae9['push'](aa(_0x4b3f58)),_0x342ae9['push'](aa(_0x2a3269))):_0x33600b?(_0x46c5a6=i(_0x48ca95,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x342ae9['push'](aa(_0x4b3f58))):_0x449db9&&(_0x46c5a6=i(_0x48ca95,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x342ae9['push'](aa(_0x2a3269))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x46c5a6?'':'ck-hidden']}});const _0x52a2d7=new _0x13ab0e();_0x52a2d7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x342ae9,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x46c5a6]}]}),this['children']['add'](_0x52a2d7),this['capabilities']=_0x120ed4['capabilities'];}}function aa(_0x20148d){const _0x226422=new _0x5495d5();return _0x226422['content']=_0x20148d,_0x226422;}const Fs=['wheel','touchstart','pointerdown','keydown'],qs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class gi{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x397eb5){this['element']=_0x397eb5,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x3da4e3 of Fs){const _0x58c286='keydown'!==_0x3da4e3;this['element']['addEventListener'](_0x3da4e3,this['_onUserEvent']['bind'](this),{'passive':_0x58c286,'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'](_0x2f6f6b){if(this['isRunning']){if('keydown'===_0x2f6f6b['type']){const _0x329365=_0x2f6f6b['key'];if(!qs['includes'](_0x329365))return;}_0x2f6f6b instanceof WheelEvent?_0x2f6f6b['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x112310,scrollHeight:_0x458133,clientHeight:_0x5a6a37}=this['element'];return _0x458133-_0x112310-_0x5a6a37<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class ui extends _0x13ab0e{constructor(_0x444f24,_0x4c6ec6){super(_0x444f24),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x4c6ec6)});}['_createSkeletonItems'](_0x344e3d){const _0x26753c=['ck','ck-ai-skeleton__item'];return _0x344e3d['map'](_0x45359c=>{let _0x207880='';switch(_0x45359c['attributes']['align']){case'right':_0x207880='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x207880='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x207880='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x45359c['tag'],'attributes':{'class':[..._0x26753c,_0x45359c['attributes']['class']?_0x45359c['attributes']['class']:''],'style':'width:\x20'+_0x45359c['attributes']['width']+';\x20height:\x20'+_0x45359c['attributes']['height']+';'+_0x207880}};});}}const fi={'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(_0x119cba,_0x404905,_0xc5fa3b,_0x3f37ba){return new Array(_0x119cba)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x404905,'height':_0xc5fa3b,'align':_0x3f37ba}}));}class wi extends Fr{constructor(_0x36dedc){super(_0x36dedc),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class ji extends _0x13ab0e{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x2d6f7b,_0x206dc3){super(_0x2d6f7b),this['_bodyCollection']=_0x206dc3,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...bt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new gi(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x50510f,_0x3476d8){let _0x54ef35;return'ai-reply'===_0x50510f?_0x54ef35=new di(this['locale'],_0x3476d8,this['_bodyCollection']):'ai-suggestion-reply'===_0x50510f?(_0x54ef35=new ai(this['locale'],_0x3476d8,this['_bodyCollection']),_0x54ef35['bind']('isTrackChangesOn')['to'](this)):_0x54ef35='user-message'===_0x50510f?new li(this['locale'],_0x3476d8,this['_bodyCollection']):'interaction-header'===_0x50510f?new Mt(this['locale'],_0x3476d8):'custom-element'===_0x50510f?new wi(_0x3476d8):new mi(_0x3476d8),this['children']['add'](_0x54ef35),_0x54ef35;}async['updateReplyItem']({id:_0x4f6553,parsedContent:_0x48b9b9,renderingStrategy:_0x4e2625,abortSignal:_0xe3684e}){const _0x146dff=this['getItemById'](_0x4f6553);if(!(_0x146dff instanceof di))throw new _0x459533('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x146dff,'id':_0x4f6553,'parsedContent':_0x48b9b9});await _0x146dff['updateContent']({'parsedContent':_0x48b9b9,'renderingStrategy':_0x4e2625,'abortSignal':_0xe3684e});}async['updateWebSources'](_0x4088ec,_0x595b02){const _0x408a7d=this['getItemById'](_0x4088ec);if(_0x408a7d instanceof ai)_0x408a7d['updateSources'](_0x595b02);else{if(!(_0x408a7d instanceof di))throw new _0x459533('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x408a7d,'id':_0x4088ec,'sources':_0x595b02});_0x408a7d['updateSources'](_0x595b02);}}async['updateSuggestionItem']({id:_0x11013c,parts:_0x3cd503,renderingStrategy:_0x54689e,abortSignal:_0x25fda5}){const _0xa10c63=this['getItemById'](_0x11013c);if(!(_0xa10c63 instanceof ai))throw new _0x459533('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0xa10c63,'id':_0x11013c,'parts':_0x3cd503});await _0xa10c63['updateContent']({'parts':_0x3cd503,'renderingStrategy':_0x54689e,'abortSignal':_0x25fda5});}['updateSuggestionPartState']({id:_0xcd03a3,index:_0x28bea7,state:_0x2e9c7d}){const _0x5e3142=this['getItemById'](_0xcd03a3);if(!(_0x5e3142 instanceof ai))throw new _0x459533('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0xcd03a3});_0x5e3142['updatePartState'](_0x28bea7,_0x2e9c7d);}['setSuggestionPartActive']({id:_0x2f16ca,index:_0x2f18a1,isActive:_0x516f1d}){const _0x2bd4dd=this['getItemById'](_0x2f16ca);if(!(_0x2bd4dd instanceof ai))throw new _0x459533('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x2f16ca});this['children']['filter'](_0x5e098e=>_0x5e098e instanceof ai)['forEach'](_0x4801c6=>{_0x4801c6['setPartActive'](!0x1);}),_0x2bd4dd['setPartActive'](_0x2f18a1,_0x516f1d);}['markItemAsDone'](_0xf01c17){this['getItemById'](_0xf01c17)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x2ea949=>_0x2ea949['options']['id']);}['removeItem'](_0x19d5b5){this['children']['remove'](this['getItemById'](_0x19d5b5));}['hasItem'](_0x30a530){return!!this['children']['find'](_0x2a5112=>_0x2a5112['options']['id']['includes'](_0x30a530));}['scrollToSuggestion'](_0x382b05,_0x4052de){const _0x4c3459=this['getItemById'](_0x382b05);if(!(_0x4c3459 instanceof ai))return void _0x31be16('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x382b05,'partIndex':_0x4052de});const _0x24f570=_0x4c3459['getPartView'](_0x4052de);_0x24f570?_0x3df2b3(_0x24f570['element'],0x14,this['element']['parentElement'],!0x0,!0x0):_0x31be16('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x382b05,'partIndex':_0x4052de});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x4d96f2=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x4d96f2,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x557946=new ui(this['locale'],fi['aiFeed']);return _0x557946['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x5deb6d=>!_0x5deb6d)]}}),_0x557946;}['_createFeedItems'](){const _0x57d208=new _0x13ab0e(this['locale']);return _0x57d208['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x57d208;}['_createFeedLoader'](){const _0x2104b5=new _0x13ab0e(this['locale']);return _0x2104b5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x36d2d6=>!_0x36d2d6)]},'children':this['_createLoaderChildren']()}),_0x2104b5;}['_createLoaderChildren'](){const _0x58bf5c=new pi();return _0x58bf5c['isVisible']=!0x0,[_0x58bf5c,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x59ac29){const _0xbf3906=this['children']['find'](_0x2b080f=>_0x2b080f['options']['id']['includes'](_0x59ac29));if(!_0xbf3906)throw new _0x459533('ai-chat-feed-view-item-not-found',this,{'id':_0x59ac29});return _0xbf3906;}['setLoadingMessage'](_0x4def07){this['set']('loadingMessage',_0x4def07);}['toggleLoadingSkeleton'](_0x4482fd){this['set']('isLoadingSkeletonVisible',_0x4482fd);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class ph extends _0x5f5dca{['filter'](){let _0x455f3c=0x0;for(const _0x47e539 of this['items'])_0x455f3c+=_0x47e539['items']['length'];return{'resultsCount':_0x455f3c,'totalItemsCount':_0x455f3c};}}const uh='ck-ai-chat__prompt-input_highlighted';class _s extends _0x100fb1{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x4669fc,_0x5c7b8e){super(_0x4669fc,{'queryView':{'label':'','creator':_0x4dfb61,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new ph(_0x4669fc),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x5c7b8e,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=_s['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=_s['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x57cc70,_0xde516b)=>!_0x57cc70&&!_0xde516b),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x197c63,_0x6cf0a7)=>{this['isUploadInProgress']||this['isEmpty']||_0x197c63['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x6cf0a7());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x103d15=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x103d15)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x3565d9=_0x210da0(_0x103d15);this['fire']('sendUserMessage',_0x3565d9),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x572426){this['queryView']['fieldView']['set']('placeholder',_0x572426);}['focus'](_0x36547c=!0x1){super['focus'](),_0x36547c&&(this['element']['classList']['contains'](uh)||(this['element']['classList']['add'](uh),setTimeout(()=>{this['element']['classList']['remove'](uh);},0x320)));}['_createSubmitButton'](){const _0x431841=new _0x4e2d9f(this['locale']);return _0x431841['set']({'icon':_0x5ca66c,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x431841['on']('execute',()=>{this['submit']();}),_0x431841;}['setIsUploadInProgress'](_0x33d64b){this['isUploadInProgress']=_0x33d64b;}['_setUpAddContextButtonPositioning'](){const _0x10ca2f=this['locale'],_0x195ab4=()=>{_0x10b14d['window']['requestAnimationFrame'](()=>{if(_0x4d96fb(this['element'])){const _0x554a96=new _0x473971(this['queryView']['fieldView']['element']),_0xc8fe6b=new _0x473971(this['_addContextButtonView']['element']),_0x237268=_0x554a96['width'],_0x4a9338='rtl'===_0x10ca2f['uiLanguageDirection']?'right':'left';_0x554a96['excludeScrollbarsAndBorders']();const _0xfd5b74=_0x237268-_0x554a96['width']+0x1;this['_addContextButtonView']['element']['style'][_0x4a9338]='calc('+(_0x237268-_0xc8fe6b['width']-_0xfd5b74)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x195ab4),this['on']('render',()=>{_0x195ab4(),this['_queryViewResizeObserver']=new _0x38f197(this['queryView']['fieldView']['element'],()=>{_0x195ab4();});});}}const ga='ck-ai-chat__prompt-capabilities',Ia='ck-ai-chat-controls-button',Ea='ck-ai-chat-controls-button--commands',pa='ck-ai-button-tertiary',Ta='ck-ai-chat-controls__model-selection',ma='ck-ai-chat-controls__model-selection__item-name',Ca='ck-ai-chat-controls__model-selection__item-description',wa='ck-ai-chat-controls__model-selection__item-capabilities',fa='n';class vs extends _0x13ab0e{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x482e5f){super(_0x482e5f),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',_0x8e2209=>'selector'===_0x8e2209),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x1bfdc8=>_0x1bfdc8?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x96ff76=>_0x96ff76),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x40e009=>_0x40e009),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x793a4e=>i(this['locale'],_0x793a4e?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x5278ab=>_0x5278ab),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x241583=>i(this['locale'],_0x241583?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ga]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x537dd4(),_0x319e41(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x45402a,_0x4108f9){if(_0x4108f9)this['set']('modelDisplayMode','hidden');else{const _0x794d10=0x1===_0x45402a['length'];this['set']('modelDisplayMode',_0x794d10?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x45402a?.['length'])for(const _0x26e06d of _0x45402a){const _0x1684a3=new _0x26835d({'label':_0x26e06d['name'],'withText':!0x0,'role':'menuitemradio','id':_0x26e06d['id'],'model':_0x26e06d});_0x1684a3['bind']('isOn')['to'](this,'activeModelId',_0x560226=>_0x560226===_0x26e06d['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x1684a3,'labelView':new Sa(this['locale'],_0x26e06d)});}}['setWebSearch'](_0x18f55a){this['set']('webSearchActive',_0x18f55a);}['setReasoning'](_0x731732){this['set']('reasoningActive',_0x731732);}['setModel'](_0x490ec5){if(!_0x490ec5)return;this['activeModelId']=_0x490ec5['id'],this['activeModelName']=_0x490ec5['name']||_0x490ec5['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x490ec5['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x490ec5['name']);const _0x12f193=_0x490ec5['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x12f193),this['_webSearchButton']['set']('isVisible',_0x12f193);const _0x183a46=_0x490ec5['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x183a46),this['_reasoningButton']['set']('isVisible',_0x183a46);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x4b2a14){this['set']('modelSelectorEnabled',!0x1),_0x4b2a14&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x3690dc=new _0x4e2d9f();return _0x3690dc['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x4b3f58,'class':Ia,'isToggleable':!0x0,'tooltipPosition':fa}),_0x3690dc['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x3690dc;}['_createReasoningButton'](){const _0x52aa1d=new _0x4e2d9f();return _0x52aa1d['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x2a3269,'class':Ia,'isToggleable':!0x0,'tooltipPosition':fa}),_0x52aa1d['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x52aa1d;}['_createCommandsButton'](){const _0xb91c9b=new _0x4e2d9f();return _0xb91c9b['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0xb351b0,'withText':!0x0,'class':Ia,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':fa}),_0xb91c9b['extendTemplate']({'attributes':{'class':[Ea]}}),_0xb91c9b['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0xb91c9b;}['_createModelSelectionDropdown'](){const _0x5b3f1a=_0xb2afd1(this['locale']);return _0x5b3f1a['set']({'panelPosition':'ne','class':[Ta]}),_0x5b3f1a['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':fa,'class':pa}),this['listenTo'](_0x5b3f1a,'execute',_0x215f9e=>{this['fire']('selectModel',_0x215f9e['source']['model']);}),_0x5b3f1a;}['_createModelNameView'](){const _0x13d965=new ba(this['locale']);return _0x13d965['bind']('text')['to'](this,'activeModelName',_0x188dae=>_0x188dae??''),_0x13d965['bind']('isVisible')['to'](this,'modelDisplayMode',_0x232f39=>'name'===_0x232f39),_0x13d965;}}let Sa=class extends _0x9d7a0a{constructor(_0x3b2f7b,_0x1a721c){super();const _0x2660c4=this['bindTemplate'],_0x54179c=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x2660c4['to']('style'),'id':_0x2660c4['to']('id')},'children':[{'tag':'div','attributes':{'class':[ma]},'children':[{'text':_0x2660c4['to']('text')}]},{'tag':'div','attributes':{'class':[Ca]},'children':[{'tag':'span','children':[{'text':_0x1a721c['description']}]}]},{'tag':'div','attributes':{'class':[wa]},'children':_0x54179c}]}),_0x54179c['addMany'](this['_getCapabilityParts'](_0x3b2f7b,_0x4b3f58,'AI_CHAT_SEARCH_WEB',_0x1a721c['capabilities']['webSearch']?.['enabled']??!0x1)),_0x54179c['addMany'](this['_getCapabilityParts'](_0x3b2f7b,_0x2a3269,'AI_CHAT_REASONING',_0x1a721c['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x447633,_0xc240f,_0x18fb94,_0x3e5f2f){const _0x3cb380=new _0x5495d5();_0x3cb380['content']=_0xc240f;const _0x38d582=new _0x13ab0e(_0x447633);_0x38d582['setTemplate']({'tag':'span','children':[{'text':i(_0x447633,_0x18fb94)+':\x20'}]});const _0x56fc09=new _0x13ab0e(_0x447633);return _0x56fc09['setTemplate']({'tag':'span','children':[{'text':i(_0x447633,_0x3e5f2f?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x3cb380,_0x38d582,_0x56fc09];}},ba=class extends _0x13ab0e{constructor(_0x5177b3){super(_0x5177b3),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x54a373=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x54a373['if']('isVisible','ck-hidden',_0x2d75b5=>!_0x2d75b5)]},'children':[{'text':_0x54a373['to']('text')}]});}};const Ra='ck-ai-chat-context-controls__url-form',Oa='ck-ai-chat-context-controls__url-input-section';class Po extends _0x13ab0e{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x2a4892){super(_0x2a4892),this['focusTracker']=new _0x39e72a(),this['keystrokes']=new _0x2ecfe9(),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 _0x2ca20b({'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'](_0x40c362=>{this['focusTracker']['add'](_0x40c362['element']),this['keystrokes']['listenTo'](_0x40c362['element']);}),_0x8e6905({'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'](_0x1ea92a){this['urlInputField']['errorText']=_0x1ea92a,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x167658=new _0x4e2d9f(this['locale']);return _0x167658['set']({'icon':_0x43ac1c,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x5ca203,_0x3b7c93,_0x1fed3e)=>{_0x167658['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x1fed3e?'':'\x20ck-hidden')]});}),_0x167658;}['_createUrlInputField'](){const _0x2f9762=new _0x25e34(this['locale'],_0x1b22ce);return _0x2f9762['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x2f9762['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x2f9762;}['_createConfirmButton'](){const _0x9f500e=new _0x4e2d9f(this['locale']);return _0x9f500e['set']({'icon':_0x5c7a27,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x9f500e;}['_setupTemplate'](){const _0x41aa64=new _0x41a033(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'});_0x41aa64['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Ra,'tabindex':'-1'},'children':[_0x41aa64,{'tag':'div','attributes':{'class':Oa},'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',_0x3a00cb=>{_0x3a00cb['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x1943c9,_0x15a90c)=>{this['clear'](),this['fire']('cancel'),_0x15a90c();});}['_handleSubmit'](){const _0x4c382a=this['getValue']()['trim']();_0x4c382a?this['_isValidUrl'](_0x4c382a)?(this['clearError'](),this['fire']('submitUrl',_0x4c382a)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x40618b=this['getValue']()['trim'](),_0x3cfdaf=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x40618b['length']>0x0&&!_0x3cfdaf;}['_isValidUrl'](_0x313aaf){try{return!!new URL(_0x313aaf);}catch{return!0x1;}}}const ka='ck-ai-chat-resources__item',Na='ck-ai-chat-resources__item--in-context',ya='ck-ai-chat-resources__item-title',va='ck-ai-chat-resources__item__icon';class hc extends _0x27607e{['resource'];['_titleView'];['_iconView'];constructor(_0x40ad66,_0x4d44bf){super(_0x40ad66),this['resource']=_0x4d44bf,this['set']('isInContext',!!_0x4d44bf['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x332136){if(_0x332136['isInContext'])return _0x5c7a27;switch(_0x332136['type']){case Be['DOCUMENT']:return _0x29c8bf;case Be['URL']:return _0x3635cf;case Be['FILE']:case Be['TEXT']:return _0x53d476;default:return _0x4fa1af;}}['highlightText'](_0x32f220){if(!_0x32f220||''===_0x32f220['trim']())return void this['_titleView']['highlightText'](null);const _0x42ee76=new RegExp(_0x5553e0(_0x32f220),'gi');this['_titleView']['highlightText'](_0x42ee76);}['updateResourceState'](_0x27d6bc){this['resource']['isInContext']=_0x27d6bc,this['isInContext']=_0x27d6bc,this['_updateIcon']();}['_createTitleView'](){const _0x3bbab4=new _0x8fe7c();return _0x3bbab4['text']=this['resource']['label'],_0x3bbab4['extendTemplate']({'tag':'span','attributes':{'class':[ya]}}),_0x3bbab4;}['_createIconView'](){const _0x1465d6=new _0x5495d5();return _0x1465d6['content']=this['getResourceIcon'](this['resource']),_0x1465d6;}['_setupTemplate'](){const _0x43ef09=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[ka,_0x43ef09['if']('isVisible','ck-hidden',_0x10fa8c=>!_0x10fa8c),_0x43ef09['if']('isInContext',Na)]},'children':[{'tag':'div','attributes':{'class':[va]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x43ef09['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const xa='ck-ai-chat-resources__list';class Lr extends _0x5f5dca{['_source'];constructor(_0x5e37e6,_0x2fdb28){super(_0x5e37e6),this['_source']=_0x2fdb28,this['extendTemplate']({'attributes':{'class':[xa]}});}['setResources'](_0x12e4f1,_0x24ad78){this['items']['clear']();let _0x55a17c=_0x12e4f1;if(this['_source']['useDefaultFiltering']&&_0x24ad78&&''!==_0x24ad78['trim']()){const _0x152e9a=new RegExp(_0x24ad78['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x55a17c=_0x12e4f1['filter'](_0x326e0a=>_0x152e9a['test'](_0x326e0a['label']));}for(const _0x1e307a of _0x55a17c){const _0x134f3c=new hc(this['locale'],_0x1e307a);_0x134f3c['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x1e307a);}),this['items']['add'](_0x134f3c);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x24ad78);}['highlightText'](_0x17bc2e){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x2f5b74=>{_0x2f5b74['highlightText'](_0x17bc2e);});}['updateResourceState'](_0x212c64,_0x120694){for(const _0x2854e8 of this['items']){const _0x10f936=_0x2854e8;_0x10f936['resource']['id']===_0x212c64&&_0x10f936['updateResourceState'](_0x120694);}}['_handleResourceSelection'](_0x313ed4,_0x1c2311){this['fire']('addResourceToContext',{'source':_0x313ed4,'resource':_0x1c2311});}}class Tr extends _0x25e34{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0xf4efb9){const t=_0xf4efb9['t'],_0xc4ad3c={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x1b22ce,'label':i(_0xf4efb9,'AI_CHAT_SEARCH_RESOURCES')};super(_0xf4efb9,_0xc4ad3c['creator']),this['label']=_0xc4ad3c['label'],this['_viewConfig']=_0xc4ad3c,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0xf4efb9,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x1aff56){this['fire']('search',_0x1aff56);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x5495d5(),this['iconView']['content']=_0x44344e,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0xf08f04,t){this['resetButtonView']=new _0x4e2d9f(_0xf08f04),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x57255f,'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',_0x18f86d=>!_0x18f86d),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 _0x13ab0e{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x500783,_0x30e8b4){super(_0x500783),this['_source']=_0x30e8b4['source'],this['_searchInputVisibleFrom']=_0x30e8b4['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 _0x1562eb([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 _0x4fb42f=new _0x13ab0e(this['locale']);return _0x4fb42f['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x5aa75b,_0x3814c7)=>{this['loadResources'](_0x3814c7),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x3814c7);}),_0x4fb42f;}['_createResourcesListView'](){const _0x5b73eb=new Lr(this['locale'],this['_source']);return _0x5b73eb['delegate']('addResourceToContext')['to'](this),_0x5b73eb['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x5b73eb;}['_createSkeletonView'](){const _0x249c56=new ui(this['locale'],fi['aiChatResources']);return _0x249c56['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x5e7731=>!_0x5e7731)]}}),_0x249c56;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0xeda93c){const _0x8c5689=_0x3d9d4e();this['_latestLoadResourcesUid']=_0x8c5689,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0xeda93c,'uid':_0x8c5689}),this['isLoading']=!0x0;}['setResources'](_0x249bba,_0xd43164){if(_0xd43164&&_0xd43164!==this['_latestLoadResourcesUid'])return;const _0x3c5dda=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x249bba,_0x3c5dda),_0x249bba['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x20635c,_0x75126){this['_resourcesListView']['updateResourceState'](_0x20635c,_0x75126);}}const La='ck-ai-chat-context-controls__source-balloon-panel',Da='ck-button-icon\x20ck-button-back',Pa='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Oo{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x47d565,_0x23303a,_0x21a624){this['_locale']=_0x47d565,this['_bodyCollection']=_0x23303a,this['_config']=_0x21a624;}['showSourceResourcesBalloon']({source:_0x57e1c5,withBackButton:_0x58cca8}){let _0x50ef1e=this['_sourceResourceBalloons']['get'](_0x57e1c5['id']);_0x50ef1e||(_0x50ef1e=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x57e1c5['id'],_0x50ef1e),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x50ef1e)),this['_addSourceResourceContent']({'balloonPanel':_0x50ef1e,'source':_0x57e1c5,'withBackButton':_0x58cca8}),_0x50ef1e['show']();const _0x5c4870=this['_config']['getTargetElement']();_0x5c4870&&_0x50ef1e['pin']({'target':_0x5c4870,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x2bf96f,_0x9fc36a,_0x62748a){const _0x53e5cd=this['_sourceResourceBalloons']['get'](_0x2bf96f);if(!_0x53e5cd)return;const _0x401f53=this['_getResourcesViewFromBalloon'](_0x53e5cd);_0x401f53&&(_0x401f53['setResources'](_0x9fc36a,_0x62748a),_0x401f53['once']('change:isLoading',()=>{_0x53e5cd['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x23e39f){const _0x2951f9=this['_sourceResourceBalloons']['get'](_0x23e39f);_0x2951f9&&requestAnimationFrame(()=>{_0x2951f9['hide'](),this['_sourceResourceBalloons']['delete'](_0x23e39f),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x3347a9 of this['_sourceResourceBalloons']['values']())if(_0x3347a9['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x1a7563,_0x2fa1d4,_0x261b89){const _0x3592ea=this['_sourceResourceBalloons']['get'](_0x1a7563);if(!_0x3592ea||!_0x3592ea['isVisible'])return;const _0x44e4c5=this['_config']['getTargetElement']();if(!_0x44e4c5)return;_0x3592ea['pin']({'target':_0x44e4c5,'limiter':this['_config']['getLimiterElement']()});const _0x5813a7=this['_getResourcesViewFromBalloon'](_0x3592ea);_0x5813a7&&_0x5813a7['updateResourceState'](_0x2fa1d4,_0x261b89);}['destroy'](){for(const _0x12e8db of this['_sourceResourceBalloons']['values']())_0x12e8db['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x23aa36=new _0x551ec5(this['_locale']);return _0x23aa36['extendTemplate']({'attributes':{'class':La}}),this['_bodyCollection']['add'](_0x23aa36),_0x23aa36;}['_addSourceResourceContent']({balloonPanel:_0x50a929,source:_0x3c89dd,withBackButton:_0x2577d8}){_0x50a929['content']['clear']();const _0x5060b8=this['_createBalloonHeader']({'balloonPanel':_0x50a929,'source':_0x3c89dd,'withBackButton':_0x2577d8});_0x50a929['content']['add'](_0x5060b8);const _0x8b5f9f=this['_createBalloonResourcesView'](_0x3c89dd);_0x50a929['content']['add'](_0x8b5f9f);}['_createBalloonHeader']({balloonPanel:_0x1c13ce,source:_0x3c66dd,withBackButton:_0x15194e}){const _0x3f9bbe=new _0x41a033(this['_locale'],{'label':_0x3c66dd['label'],'class':Pa});return _0x15194e&&_0x3f9bbe['children']['add'](this['_createBackButton'](_0x1c13ce),0x0),_0x3f9bbe;}['_createBackButton'](_0x540ec3){const _0x4cb938=new _0x4e2d9f(this['_locale']);return _0x4cb938['set']({'icon':_0x43ac1c,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Da}),_0x4cb938['on']('execute',()=>{_0x540ec3['hide'](),this['_config']['onBackToContext']();}),_0x4cb938;}['_createBalloonResourcesView'](_0x12c750){const _0x5b0d72=new lc(this['_locale'],{'source':_0x12c750,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x5b0d72['on']('loadSourceResources',(_0x94f419,_0xc25cf9)=>{this['_config']['onLoadSourceResources'](_0xc25cf9);}),_0x5b0d72['on']('addResourceToContext',(_0x18390a,_0x1888b3)=>{this['_config']['onResourceSelected'](_0x1888b3['source'],_0x1888b3['resource']),this['closeSourceResourceBalloon'](_0x12c750['id']);}),_0x5b0d72;}['_getResourcesViewFromBalloon'](_0xc90b26){const _0x1dd61c=_0xc90b26['content']['get'](0x1);return _0x1dd61c instanceof lc?_0x1dd61c:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x33683f){_0x570ad6({'emitter':_0x33683f,'contextElements':[_0x33683f['element']],'callback':()=>{_0x33683f['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x33683f['isVisible']});}}const xs=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Uo='ck-ai-chat-context-controls',Lo='ck-ai-chat-context-controls__pending-contexts',No='ck-ai-chat-context-controls__add-context-balloon-panel',Mo='ck-ai-chat-context-controls__add-context-button',Ho='ck-ai-chat-context-controls__url-balloon-panel',jo='ck-ai-chat-context-controls__balloon-button',Fo='ck-ai-chat-context-controls__balloon-button-source',Xo='ck-ai-chat-controls-button',Do='ck-ai-chat-context-chips-wrapper-balloon',$o='ck-ai-chat-controls_context_show-more-button',Wo='ck-ai-chat-context-controls__show-more-balloon-panel',qo='ck-ai-chat',zo=[_0x551ec5['defaultPositions']['northArrowSouthWest'],_0x551ec5['defaultPositions']['northArrowSouth'],_0x551ec5['defaultPositions']['northArrowSouthEast'],_0x551ec5['defaultPositions']['southArrowNorthWest'],_0x551ec5['defaultPositions']['southArrowNorth'],_0x551ec5['defaultPositions']['southArrowNorthEast']];class Is extends _0x13ab0e{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x2e4979,_0x3a3c1b){super(_0x2e4979),this['bodyCollection']=_0x3a3c1b['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x2e4979),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x2e4979),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x2e4979),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x2e4979,_0x3a3c1b);const _0x1c5cff={'cssClasses':{'showMoreButton':$o,'showMoreBalloon':Wo,'overflowContainer':Do,'controlsButton':Xo}};this['_overflowManager']=new Ro(_0x2e4979,this['_currentContextsChips'],_0x1c5cff,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'](_0x52ee4c,_0x526d2f){const _0x9f4b05=this['_createContextButton'](_0x52ee4c,'current',!0x0,_0x526d2f);this['_addContextToCollection'](_0x9f4b05,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x24410a){this['_removeContextFromCollection'](_0x24410a,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x24410a,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x54c94b,_0x4c3036){let _0x47784f=this['_currentContextsChips']['find'](_0x1aae0b=>_0x1aae0b['id']===_0x54c94b);_0x47784f||(_0x47784f=this['_overflowManager']['overflowChips']['find'](_0x1a616c=>_0x1a616c['id']===_0x54c94b)),_0x47784f&&(_0x47784f['isLoading']=_0x4c3036);}['setConversationContext'](_0x1f6a8a){this['_conversationContextsChips']['clear']();for(const _0x34fd28 of _0x1f6a8a){const _0x99f0dc=this['_createContextButton'](_0x34fd28,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x99f0dc,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x2ecf88,_0x113359,_0xf4b6ed){this['_resourcesBalloonView']['updateResourceState'](_0x2ecf88,_0x113359,_0xf4b6ed);}['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:_0x444ab7,withBackButton:_0xc6cf81}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x444ab7,'withBackButton':_0xc6cf81}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0xd8cdf1,_0x113012,_0x1ba607,_0x1e62d1){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0xd8cdf1,_0x1ba607,_0x1e62d1);}['closeSourceResourceBalloon'](_0x35621c){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x35621c),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x31447a){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x31447a),this['_setAddContextButtonEnabled'](_0x31447a);}['_setAddContextButtonEnabled'](_0x40c34f){const _0x407b7d=!_0x40c34f['document']['isHidden']&&_0x40c34f['document']['enabled'],_0x24ef09=_0x40c34f['urls']['enabled'],_0x47d413=_0x40c34f['files']['enabled'],_0x2f0c37=_0x40c34f['sources']['length']>0x0,_0x4abe01=_0x40c34f['customItems']&&_0x40c34f['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x407b7d||_0x24ef09||_0x47d413||_0x2f0c37||_0x4abe01;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Uo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Lo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x4133bd){const _0x35c79b=new _0x4e2d9f(_0x4133bd);return _0x35c79b['set']({'label':i(_0x4133bd,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Xo+'\x20'+Mo,'icon':_0x58ca13,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x35c79b;}['_createAddContextBalloonPanelView'](_0x45a0e5){return this['_createBaseBalloonPanel'](_0x45a0e5,No);}['_createUrlBalloonPanelView'](_0x573466){const _0x2d3224=this['_createBaseBalloonPanel'](_0x573466,Ho);return this['_addUrlContent'](_0x2d3224,_0x573466),_0x2d3224;}['_createResourcesBalloonView'](_0x236a4e,_0x344909){const _0x4365fb={'searchInputVisibleFrom':_0x344909['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo});},'onResourceSelected':(_0x5cf32a,_0x4d198a)=>{this['fire']('addResourceToContext',{'source':_0x5cf32a,'resource':_0x4d198a});},'onLoadSourceResources':_0x3fe2fb=>{this['fire']('loadSourceResources',_0x3fe2fb);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Oo(_0x236a4e,_0x344909['bodyCollection'],_0x4365fb);}['_getLimiterElement'](){return this['element']?.['closest']('.'+qo)||document['body'];}['_createBaseBalloonPanel'](_0x1f5f20,_0x48693b){const _0x4c6e80=new _0x551ec5(_0x1f5f20);return _0x4c6e80['extendTemplate']({'attributes':{'class':_0x48693b}}),this['bodyCollection']['add'](_0x4c6e80),_0x4c6e80;}['_setBalloonPanelContent'](_0x44843c,_0x1c7d44,_0x3e498b){if(_0x44843c['content']['clear'](),!_0x3e498b['document']['isHidden']&&_0x3e498b['document']['enabled']){const _0x1776ce=this['_createBalloonButton'](_0x1c7d44,{'label':i(_0x1c7d44,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x29c8bf});_0x1776ce['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x44843c['content']['add'](_0x1776ce);}if(_0x3e498b['urls']['enabled']){const _0x26a799=this['_createBalloonButton'](_0x1c7d44,{'label':i(_0x1c7d44,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x3635cf});_0x26a799['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}),this['_urlInputView']['focus']();}),_0x44843c['content']['add'](_0x26a799);}if(_0x3e498b['files']['enabled']){const _0x1fc635=new _0xef292e(_0x1c7d44);_0x1fc635['set']({'label':i(_0x1c7d44,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x5c1bc0,'withText':!0x0,'tooltip':!0x0,'class':jo,'allowMultipleFiles':!0x0}),_0x1fc635['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x1fc635['on']('done',(_0x19e444,_0x16c043)=>{this['fire']('addFileToContext',_0x16c043);}),_0x1fc635['tooltip']=!0x0,_0x44843c['content']['add'](_0x1fc635);}for(const _0x4b6d45 of _0x3e498b['sources']){const _0x394a7e=this['_createBalloonButton'](_0x1c7d44,{'label':_0x4b6d45['label'],'icon':_0x4b6d45['icon']||_0x4fa1af,'type':'source'});_0x44843c['content']['add'](_0x394a7e),_0x394a7e['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x4b6d45,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x3532e2 of _0x3e498b['customItems']||[]){const _0x1bb0a0=this['_createBalloonButton'](_0x1c7d44,{'label':_0x3532e2['label'],'icon':_0x3532e2['icon']||_0x4fa1af,'type':'customItem'});_0x44843c['content']['add'](_0x1bb0a0),_0x1bb0a0['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x3532e2);});}this['_hasExactlyOneSource']=0x1===_0x44843c['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x2f9929,_0x4ee19f){this['_urlInputView']=new Po(_0x4ee19f),this['_urlInputView']['on']('submitUrl',(_0x1d63ac,_0x148206)=>{this['_handleUrlSubmit'](_0x148206);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo});}),_0x2f9929['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x134480,_0x556418){const _0x1abaf2='source'===_0x556418['type']?new Ha(_0x134480):new _0x4e2d9f(_0x134480);return _0x1abaf2['set']({'label':_0x556418['label'],'icon':_0x556418['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':jo}),_0x1abaf2;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x570ad6({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x1e1c8c){const _0x402d11=this['_addContextBalloonConfig'];_0x402d11['buttonView']['isOn']=_0x1e1c8c,_0x1e1c8c?_0x402d11['balloonView']['show']():_0x402d11['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x4ff020,buttonView:_0x57d5b9,hideMethod:_0x219509}=this['_addContextBalloonConfig'];_0x570ad6({'emitter':_0x4ff020,'contextElements':[_0x4ff020['element'],_0x57d5b9['element']],'callback':()=>{_0x219509();},'activator':()=>_0x57d5b9['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x151e60,_0x455190,_0xfc3203=!0x1,_0x34e1d5=!0x1){const _0x540b56='conversation'===_0x455190||!0x0===_0x151e60['isReadOnly'],_0x449ecf=new Vo(this['locale'],_0x151e60,_0x540b56,_0xfc3203,_0x34e1d5);return _0x540b56||_0x449ecf['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x449ecf['id']);}),_0x449ecf;}['_addContextToCollection'](_0x534d81,_0x5c3e21){_0x5c3e21['add'](_0x534d81,0x0);}['_removeContextFromCollection'](_0x5bf268,_0x4856dc){const _0x73865d=_0x4856dc['find'](_0x5824ff=>_0x5824ff['id']===_0x5bf268);_0x73865d&&_0x4856dc['remove'](_0x73865d);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x3d43a6){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x3d43a6);}}class Ha extends _0x4e2d9f{['arrowView'];constructor(_0x56f6bd){super(_0x56f6bd),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Fo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x884871=new _0x5495d5();return _0x884871['content']=_0x58790d,_0x884871['extendTemplate']({'attributes':{'class':Fo+'__arrow'}}),_0x884871;}}class Cs extends _0x13ab0e{['_cancelButtonView'];['_loaderView'];constructor(_0x311f2f){super(_0x311f2f),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 _0x5687ca=new _0x4e2d9f(this['locale']);return _0x5687ca['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x3d3372}),_0x5687ca['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x5687ca;}['_createLoaderView'](){const _0x3ef2f3=new _0x13ab0e(this['locale']);return _0x3ef2f3['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')}]}),_0x3ef2f3;}}class ki extends _0x13ab0e{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x4a1595,_0x5d8d0f){super(_0x4a1595),this['_contextPanelView']=this['_createContextPanelView'](_0x4a1595,{'bodyCollection':_0x5d8d0f['bodyCollection'],'searchInputVisibleFrom':_0x5d8d0f['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x4a1595),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x4a1595),this['_loaderView']=this['_createLoaderView'](_0x4a1595),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x4a1595),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...xs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x107dd9=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x107dd9['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x107dd9['if']('isLoading','ck-hidden',_0x59a70e=>_0x59a70e||!this['isModelAvailable']),_0x107dd9['if']('isModelAvailable','ck-hidden',_0x1ac1ab=>!_0x1ac1ab||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x107dd9['if']('isLoading','ck-hidden',_0x48c46f=>!_0x48c46f)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x107dd9['if']('isModelAvailable','ck-hidden',_0x3966b7=>_0x3966b7)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x570ad6({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0xba24f3,_0x5433ac){return new Is(_0xba24f3,_0x5433ac);}['_createPromptInputView'](_0x3a5a58){return new _s(_0x3a5a58,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0xc515b8){return new vs(_0xc515b8);}['_createLoaderView'](_0x3fe79d){return new Cs(_0x3fe79d);}['_createModelUnavailableMessageView'](_0x3d58d8){const _0x31c4fa=new As(_0x3d58d8);return _0x31c4fa['delegate']('startConversation')['to'](this),_0x31c4fa;}['_handlePromptInputFocus'](_0x500eaf,_0x5dd231,_0xf03613){_0xf03613?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x2bacda,_0x369860){this['_contextPanelView']['addContextItem'](_0x2bacda,_0x369860);}['removeContextItem'](_0x37de04){this['_contextPanelView']['removeContextItem'](_0x37de04);}['setContextItemLoading'](_0x428b53,_0x52f95d){this['_contextPanelView']['setContextItemLoading'](_0x428b53,_0x52f95d);}['setIsUploadInProgress'](_0x3231dc){this['_promptInputView']['setIsUploadInProgress'](_0x3231dc);}['setConversationContext'](_0x485c48){this['_contextPanelView']['setConversationContext'](_0x485c48);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x29425c,_0x2bb142,_0x1d808f){this['_contextPanelView']['updateResourceState'](_0x29425c,_0x2bb142,_0x1d808f);}['setWebSearch'](_0x519db3){this['_promptCapabilitiesView']['setWebSearch'](_0x519db3);}['setReasoning'](_0x3b2c1d){this['_promptCapabilitiesView']['setReasoning'](_0x3b2c1d);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x391e24){this['_contextPanelView']['setAddContextOptions'](_0x391e24);}['setInputPlaceholder'](_0x2e5d55){this['_promptInputView']['setPlaceholderText'](_0x2e5d55);}['setModelList'](_0x1e8dbe,_0x2ead5c){this['_promptCapabilitiesView']['setModelList'](_0x1e8dbe,_0x2ead5c);}['setModel'](_0xc701b7){_0xc701b7?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0xc701b7)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x310781){this['_promptCapabilitiesView']['disableModelSelector'](_0x310781);}['populateSourceResourceBalloon'](_0xf94563,_0x13d7e4,_0x2c89d5,_0x54f81f){this['_contextPanelView']['populateSourceResourceBalloon'](_0xf94563,_0x13d7e4,_0x2c89d5,_0x54f81f);}['closeSourceResourceBalloon'](_0x2f1b3e){this['_contextPanelView']['closeSourceResourceBalloon'](_0x2f1b3e);}['focusPromptInput'](_0xd9e6fd=!0x1){this['_promptInputView']['focus'](_0xd9e6fd);}['setPromptInputValue'](_0x27f5a4){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x27f5a4;}}class As extends _0x13ab0e{constructor(_0x1742ed){super(_0x1742ed);const _0x3235b5=new _0x4e2d9f(_0x1742ed);_0x3235b5['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x3235b5['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'},_0x3235b5]}]});}}class vi extends _0x41a033{['conversationStartButton'];['resizeButton'];constructor(_0x422b28,_0x5afd0a){super(_0x422b28,{'label':i(_0x422b28,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':vt}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x422b28),this['children']['add'](this['conversationStartButton']),_0x5afd0a&&(this['resizeButton']=Hs(_0x422b28,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x4eb2e9){const _0x185386=new _0x4e2d9f(_0x4eb2e9);return _0x185386['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x36e89f,'class':'ck-ai-chat__start-conversation'}),_0x185386['on']('execute',()=>{this['fire']('startConversation');}),_0x185386;}}class bi extends _0x13ab0e{constructor(_0x4fa510){super(_0x4fa510),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x4fa510,'AI_DISCLAIMER_TEXT')}]}]});}}class Pt extends _0x13ab0e{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x25e01d,_0x20d6b0){super(_0x25e01d),this['_bodyCollection']=new _0xb3f722(_0x25e01d),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new vi(_0x25e01d,_0x20d6b0['showResizeButton']),this['chatHeader']['delegate'](...bt)['to'](this),this['chatFeed']=new ji(_0x25e01d,this['_bodyCollection']),this['chatFeed']['delegate'](...bt)['to'](this),this['chatControls']=new ki(_0x25e01d,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x20d6b0['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...bt)['to'](this),this['chatDisclaimer']=new bi(_0x25e01d),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x25e01d['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x46dcfb,_0x58f7c6,_0x1ebe20,_0x150323){this['chatControls']['populateSourceResourceBalloon'](_0x46dcfb,_0x58f7c6,_0x1ebe20,_0x150323);}['closeSourceResourceBalloon'](_0x28b4cc){this['chatControls']['closeSourceResourceBalloon'](_0x28b4cc);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ct extends _0x479a76{static get['requires'](){return[pt];}['_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(_0x43d6e7){super(_0x43d6e7);const _0x5b153e=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new z(),this['_view']=new Pt(this['context']['locale'],{'showResizeButton':_0x5b153e['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...bt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x380ecd,{showDiff:_0x1dbd76})=>{this['showDiff']=_0x1dbd76;}),_0x5b153e['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':vt,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x3a2635=>_0x3a2635),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x2c945b=>_0x2c945b),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x51f06d){const _0x29c682=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'](_0x51f06d['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x29c682}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0x3b7ffe,staticMessage:_0x147228}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x3b7ffe,'initialContent':'<p>'+_0x147228+'</p>'});}['addFeedItemUserMessage'](_0x1d2506){const _0x142fe4=_0x1d2506['attributes']?.['displayedPrompt']||_0x1d2506['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x1d2506['contextItems']['values']()),'initialContent':'<p>'+_0x142fe4+'</p>','id':_0x1d2506['id']});}['addFeedItemError']({errorMessage:_0x1f08bb,id:_0x27d585}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x1f08bb+'</p>','id':_0x27d585});}['addFeedItemAIReply'](_0x478f20){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x478f20['interactionId']+':'+_0x478f20['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x4986f2){const _0x5bb4de=T(this['context']);let _0x2c8c45=_0x5bb4de['config']['get']('ai.availableReplyActions')||[...ot];if(_0x5bb4de['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x17204d=_0x5bb4de['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x17204d,'value');}}else _0x2c8c45=_0x2c8c45['filter'](_0x3e197d=>'insertSuggestion'!=_0x3e197d);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x4986f2['interactionId']+':'+_0x4986f2['id'],'areActionsDisabled':_0x4986f2['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x2c8c45}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x333049,_0x4bc418){const _0x46135f=this['_view']['chatFeed']['children']['last'];if(_0x46135f instanceof Mt)return this['_view']['chatFeed']['children']['remove'](_0x46135f),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x333049['id'],'capabilities':{'isWebSearchEnabled':_0x46135f['capabilities']['isWebSearchEnabled']||_0x4bc418['isWebSearchEnabled'],'isReasoningEnabled':_0x46135f['capabilities']['isReasoningEnabled']||_0x4bc418['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x333049['id'],'capabilities':_0x4bc418});}async['addFeedItemCustomElement'](_0x522a04,_0x207535){let _0x3c81c3;return await this['_promiseQueue']['enqueue'](async()=>{_0x3c81c3=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x522a04,'id':_0x207535});}),_0x3c81c3;}['removeFeedItem'](_0x360f38){this['_view']['chatFeed']['removeItem'](_0x360f38);}['hasFeedItem'](_0x341e98){return this['_view']['chatFeed']['hasItem'](_0x341e98);}['updateFeedInteractionHeader'](_0x426839){const _0x3b8eb0=this['_view']['chatFeed']['children']['find'](_0x17f7b3=>_0x17f7b3['options']['id']==_0x426839['id']&&_0x17f7b3 instanceof Mt);_0x3b8eb0&&_0x3b8eb0['set']('isVisible',_0x426839['isVisible']);}async['updateFeedItemAIReplyContent'](_0x52cf80){const _0x15e712=_0x52cf80['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x2f5ce2=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x52cf80,'abortSignal':_0x2f5ce2,'renderingStrategy':_0x15e712}),_0x52cf80['isDone']&&this['markFeedItemAsDone'](_0x52cf80['id']);});}['updateFeedItemAIReplySources'](_0x1117f6,_0x3b6878){this['_view']['chatFeed']['updateWebSources'](_0x1117f6,_0x3b6878);}async['updateFeedItemAIReplySuggestionContent'](_0xee6059){const _0x3a6eaf=_0xee6059['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0xab725c=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0xee6059,'abortSignal':_0xab725c,'renderingStrategy':_0x3a6eaf}),_0xee6059['isDone']&&this['markFeedItemAsDone'](_0xee6059['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x20309b){this['_view']['chatFeed']['updateSuggestionPartState'](_0x20309b);}['setFeedItemAIReplySuggestionPartActive'](_0x10975b){this['_view']['chatFeed']['setSuggestionPartActive'](_0x10975b);}['markFeedItemAsDone'](_0x810737){this['_view']['chatFeed']['markItemAsDone'](_0x810737);}['removeFeedInteraction'](_0x4c40a0){this['_view']['chatFeed']['getItemIds']()['filter'](_0x7f3ba1=>_0x7f3ba1['startsWith'](_0x4c40a0))['forEach'](_0x276e36=>this['_view']['chatFeed']['removeItem'](_0x276e36));}['startInteraction'](){const _0x1d9f56=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x1d9f56),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x1c0e01){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x5362e6=>_0x5362e6['startsWith'](_0x1c0e01['id']))['forEach'](_0x3608dd=>this['markFeedItemAsDone'](_0x3608dd)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0xc9fc1,_0xf58119){this['_view']['chatControls']['addContextItem'](_0xc9fc1,_0xf58119);}['removeContextItem'](_0x48b296){this['_view']['chatControls']['removeContextItem'](_0x48b296);}['setContextItemLoading'](_0x4d94d5,_0x22dac5){this['_view']['chatControls']['setContextItemLoading'](_0x4d94d5,_0x22dac5);}['setIsUploadInProgress'](_0x4157ff){this['_view']['chatControls']['setIsUploadInProgress'](_0x4157ff);}['setConversationContext'](_0x32f181){this['_view']['chatControls']['setConversationContext'](_0x32f181);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x190535,_0x534097,_0x26c1e8){this['_view']['chatControls']['updateResourceState'](_0x190535,_0x534097,_0x26c1e8);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x32c87c){this['_view']['chatControls']['setAddContextOptions'](_0x32c87c);}['updateCapabilities'](_0x322e92){this['_view']['chatControls']['setWebSearch'](_0x322e92['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x322e92['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x322e92));}['setSelectedModel'](_0x5a10d1,_0x3faa9b){this['_view']['chatControls']['setModel'](_0x5a10d1),_0x3faa9b&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x4e280f){this['feedItemRenderingStrategy']=_0x4e280f;}['toggleLoadingSkeleton'](_0x5defa2){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x5defa2);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x1267c0,_0x54d81c=!0x1){if(_0x54d81c&&!Rt()&&_0x1267c0['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x1267c0);this['_view']['chatHeader']['label']=_0x1267c0;}['setLoadingMessage'](_0x47256f){this['_view']['chatFeed']['setLoadingMessage'](_0x47256f);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x5131ba){let _0x48be1d=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x5131ba[_0x48be1d],_0x48be1d++,_0x48be1d===_0x5131ba['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x2281b8){this['_view']['chatHeader']['isMaximized']=_0x2281b8;}['prepareLoadingMessage'](_0x1c30d5){return _0x1c30d5['isWebSearchEnabled']&&_0x1c30d5['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x1c30d5['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x1c30d5['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x36d253){return _0x36d253?_0x36d253['isWebSearchEnabled']&&_0x36d253['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x36d253['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x36d253['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'](_0x1ef1a8,_0x25363d,_0x5758d5,_0x507ad3){this['_view']['populateSourceResourceBalloon'](_0x1ef1a8,_0x25363d,_0x5758d5,_0x507ad3);}['closeSourceResourceBalloon'](_0x5247ca){this['_view']['closeSourceResourceBalloon'](_0x5247ca);}['setPromptInputValue'](_0x30ed2d){this['_view']['chatControls']['setPromptInputValue'](_0x30ed2d);}['focusPromptInput'](_0x34fd44=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x34fd44);}['scrollFeedToSuggestion'](_0x2953d1,_0x23d01c){this['_view']['chatFeed']['scrollToSuggestion'](_0x2953d1,_0x23d01c);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Ri extends _0x5f5dca{['sections'];constructor(_0x4e7b0f,_0x37dbe6){super(_0x4e7b0f),this['sections']=_0x37dbe6,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0xeaf902){let _0x3318e5=0x0,_0x4de262=0x0;for(const _0x2b8b5d of this['sections']){const {resultsCount:_0x1ef0fb,totalItemsCount:_0xe6b2c4}=_0x2b8b5d['filter'](_0xeaf902);_0x3318e5+=_0x1ef0fb,_0x4de262+=_0xe6b2c4;}return{'resultsCount':_0x3318e5,'totalItemsCount':_0x4de262};}}class Mi extends _0x27607e{['title'];['itemsViews'];['_itemsListView'];constructor(_0x977a2a,{title:_0x32a0a9,items:_0x67b244}){super(_0x977a2a);const _0x4b5bb3=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x32a0a9,this['itemsViews']=_0x67b244;const _0x575abf=new _0x13ab0e(_0x977a2a);_0x575abf['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x5f5dca(_0x977a2a),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x4b5bb3['if']('isVisible','ck-hidden',_0x1e22a7=>!_0x1e22a7)]},'children':[_0x575abf,this['_itemsListView']]});}['filter'](_0x49ee35){const _0x515753=this['itemsViews']['length'];let _0x38c09b=0x0;for(const _0x140630 of this['itemsViews']){if(_0x49ee35){const _0x2e9629=_0x140630['isMatching'](_0x49ee35);_0x140630['isVisible']=!!_0x2e9629,_0x140630['highlightText'](_0x49ee35);}else _0x140630['isVisible']=!0x0,_0x140630['highlightText'](null);_0x140630['isVisible']&&_0x38c09b++;}return this['isVisible']=_0x38c09b>0x0,{'resultsCount':_0x38c09b,'totalItemsCount':_0x515753};}['getItem'](_0x464070){return this['itemsViews']['find'](_0x4f9bbf=>_0x4f9bbf['id']===_0x464070);}['removeItem'](_0x2ec651){const _0x2a0d3b=this['itemsViews']['indexOf'](_0x2ec651);-0x1!==_0x2a0d3b&&(this['itemsViews']['splice'](_0x2a0d3b,0x1),this['_itemsListView']['items']['remove'](_0x2ec651));}}class xi extends/* #__PURE__ -- @preserve */
27
- _0xfb1d37(_0x27607e){['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(_0x4cee3b,_0x1cb9c0){super(_0x4cee3b);const _0x44f5e2=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x1cb9c0['pinned']),this['set']('loadingState',null),this['id']=_0x1cb9c0['id'];const {title:_0x2444fb,createdAt:_0x49677,active:_0x26c5a1=!0x1}=_0x1cb9c0;this['_titleView']=new _0x8fe7c(),this['_titleView']['text']=_0x2444fb,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x2b02eb=this['_createCheckView'](),_0x2e19a1=this['_createPinButtonView'](_0x4cee3b),_0x5ba094=this['_createMenuDropdownView'](),_0x328038=this['_createEditInputView'](_0x4cee3b,_0x2444fb),_0x2ee4f2=this['_createAcceptEditButtonView'](_0x4cee3b,_0x328038),_0x2e81c7=this['_createCancelEditButtonView'](_0x4cee3b,_0x328038);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x2e19a1),this['actions']['add'](_0x5ba094),this['on']('change:isEdit',(_0xcc79a6,_0x52f65c,_0x54bcc5)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x54bcc5?(this['actions']['add'](_0x2ee4f2),this['actions']['add'](_0x2e81c7),this['mainContent']['add'](_0x328038),_0x328038['element']['focus']()):(this['actions']['add'](_0x2e19a1),this['actions']['add'](_0x5ba094),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x26c5a1?'ck-ai-chat-history__item--active':'',_0x44f5e2['if']('isVisible','ck-hidden',_0x25daaf=>!_0x25daaf),_0x44f5e2['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',_0x44f5e2['if']('loadingState','ck-hidden',_0x2c6663=>!!_0x2c6663)]},'children':_0x26c5a1?[_0x2b02eb]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x44f5e2['if']('loadingState','ck-hidden',_0x5d4aa2=>!_0x5d4aa2)]},'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',_0x44f5e2['if']('loadingState','ck-hidden',_0x5b329c=>!!_0x5b329c)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x44f5e2['if']('loadingState','ck-hidden',_0x1decd5=>!_0x1decd5)]},'children':[{'text':_0x44f5e2['to']('loadingState',_0x384e1f=>_0x384e1f?i(this['locale'],xi['LOADING_LABELS'][_0x384e1f]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x49677]}]},{'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'](_0x29ac12){this['_titleView']['text']=_0x210da0(_0x29ac12);}['updateLoadingState'](_0x59cf9d,_0x5d9968){this['set']('loadingState',_0x5d9968?_0x59cf9d:null);}['_createCheckView'](){const _0x2d702e=new _0x5495d5();return _0x2d702e['set']({'content':_0x44dfa1}),_0x2d702e;}['_createPinButtonView'](_0x236557){const _0x3009ef=new _0x4e2d9f(_0x236557);return _0x3009ef['set']({'label':i(_0x236557,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x21ba95,'withText':!0x1,'tooltip':!0x0}),_0x3009ef['bind']('isOn')['to'](this,'pinned'),_0x3009ef['on']('execute',()=>{const _0x2a8df8=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x2a8df8});}),_0x3009ef;}['_createMenuDropdownView'](){const _0x2aefa0=_0xb2afd1(this['locale'],_0x5c8ac6),_0x173950=_0x2aefa0['panelView']['children'];_0x2aefa0['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x164ae1}),_0x2aefa0['panelPosition']='sw';const _0x1b0c59=new _0x4e2d9f(this['locale']);_0x1b0c59['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x1b0c59['withText']=!0x0,_0x1b0c59['on']('execute',()=>{this['isEdit']=!0x0;});const _0x18c35f=new _0x4e2d9f(this['locale']);_0x18c35f['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x18c35f['withText']=!0x0,_0x18c35f['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x212268=new _0x5f5dca(this['locale']),_0x16fa14=new _0x27607e(this['locale']);_0x16fa14['children']['add'](_0x1b0c59);const _0xe7fc74=new _0x27607e(this['locale']);return _0xe7fc74['children']['add'](_0x18c35f),_0x212268['items']['addMany']([_0x16fa14,_0xe7fc74]),_0x173950['add'](_0x212268),_0x2aefa0;}['_createEditInputView'](_0x560f43,_0x1984a1){const _0x1e2ab5=new _0x22f961(_0x560f43),_0x7f4987=_0x1e2ab5['bindTemplate'];return _0x1e2ab5['value']=_0x1984a1,_0x1e2ab5['extendTemplate']({'on':{'keydown':_0x7f4987['to'](_0x21669f=>{'Enter'==_0x21669f['key']&&this['_commitEditInputValue'](_0x1e2ab5);})}}),_0x1e2ab5;}['_createAcceptEditButtonView'](_0x342153,_0x49ca58){const _0x792351=new _0x4e2d9f(_0x342153);return _0x792351['set']({'icon':_0x44dfa1,'withText':!0x1,'tooltip':i(_0x342153,'AI_CHAT_HISTORY_ACCEPT')}),_0x792351['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x792351['on']('execute',()=>{this['_commitEditInputValue'](_0x49ca58);}),_0x792351;}['_commitEditInputValue'](_0x5c51c1){const _0x21dc60=_0x5c51c1['element']['value']||'';this['_titleView']['text']=_0x21dc60,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x21dc60});}['_createCancelEditButtonView'](_0x2ee199,_0x4ca930){const _0x373f8e=new _0x4e2d9f(_0x2ee199);return _0x373f8e['set']({'icon':_0x57255f,'withText':!0x1,'tooltip':i(_0x2ee199,'AI_CHAT_HISTORY_CANCEL')}),_0x373f8e['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x373f8e['on']('execute',()=>{this['isEdit']=!0x1,_0x4ca930['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x373f8e;}['_createSpinnerView'](){const _0x25e8a2=new pi('tiny');return _0x25e8a2['isVisible']=!0x0,_0x25e8a2;}['isMatching'](_0x57f2ad){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x57f2ad)?{'title':!0x0}:null;}['highlightText'](_0x36969e){this['_titleView']['highlightText'](_0x36969e);}}class wt extends _0x13ab0e{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x1d03d5,_0x38e8cd){super(_0x1d03d5),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 _0x5eb366=new _0x41a033(_0x1d03d5,{'label':i(_0x1d03d5,'AI_CHAT_HISTORY_HEADING'),'icon':Nt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x38e8cd&&(this['resizeButton']=Hs(_0x1d03d5,this),_0x5eb366['children']['add'](this['resizeButton'])),this['sectionsView']=new Ri(_0x1d03d5,[]),this['sectionsView']['delegate'](...Li)['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',_0x389e49=>!_0x389e49)]}}),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':[_0x5eb366,{'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 _0x21905f=new _0x41f7cc(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x1f50c5=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x1f50c5),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x3a6e40=this['_createErrorView']();return _0x3a6e40['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x47a01d=>!_0x47a01d)]}}),_0x21905f['on']('render',()=>{_0x21905f['children']['add'](_0x3a6e40,0x1);}),_0x21905f['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x20d022=>!_0x20d022)]}}),_0x21905f;}['_createSkeletonView'](){const _0x372f98=new ui(this['locale'],fi['aiHistory']);return _0x372f98['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x5bd065=>!_0x5bd065)]}}),_0x372f98;}['_createErrorView'](){const _0x3d76da=new _0x13ab0e(this['locale']),_0x38f592=new _0x4e2d9f(this['locale']);_0x38f592['set']({'withText':!0x1,'icon':_0x57255f,'class':'ck-ai-notification_error__dismiss-button'}),_0x38f592['bind']('isVisible')['to'](this,'hasItems',_0x344ad5=>!!_0x344ad5),_0x38f592['on']('execute',()=>{this['errorMessage']='';});const _0x5ee796=this['bindTemplate'];return _0x3d76da['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x5ee796['to']('errorMessage')}]},_0x38f592]}),_0x3d76da;}['_createEmptyStateView'](){const _0x5263d8=new _0x4e2d9f(this['locale']);_0x5263d8['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x36e89f,'class':'ck-ai-chat__start-conversation'}),_0x5263d8['on']('execute',()=>{this['fire']('openChat');});const _0x13c0aa=new _0x13ab0e(this['locale']);return _0x13c0aa['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x51ed42=>!_0x51ed42)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x5263d8]}),_0x13c0aa;}['_createListItemViews'](_0x521910,_0x20c0c1){const _0x6f1433=[];for(const _0x451a69 of _0x521910){const _0x3e1e2a=new xi(_0x20c0c1,_0x451a69);_0x3e1e2a['delegate'](...Li)['to'](this),_0x6f1433['push'](_0x3e1e2a);}return _0x6f1433;}['updateHistoryItemsWithCategories'](_0x31d104){const _0x2667d4=this['locale']||'en',_0x34b94a=[];for(const _0x56f6f9 of _0x31d104){const _0x35cca9=this['_createListItemViews'](_0x56f6f9['items'],_0x2667d4);_0x34b94a['push'](new Mi(_0x2667d4,{'title':_0x56f6f9['title'],'items':_0x35cca9}));}this['sectionsView']['sections']=_0x34b94a,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x34b94a),this['hasItems']=_0x31d104['some'](_0x29f011=>_0x29f011['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x22c109){for(const _0x14244c of this['sectionsView']['sections']){const _0x4f98d0=_0x14244c['getItem'](_0x22c109);if(_0x4f98d0){if(_0x14244c['removeItem'](_0x4f98d0),0x0===_0x14244c['itemsViews']['length']){const _0x38d65e=this['sectionsView']['sections']['indexOf'](_0x14244c);-0x1!==_0x38d65e&&(this['sectionsView']['sections']['splice'](_0x38d65e,0x1),this['sectionsView']['items']['remove'](_0x14244c));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x4d5421,_0x5c6477){for(const _0x55760f of this['sectionsView']['sections']){const _0x245b0f=_0x55760f['getItem'](_0x4d5421);if(_0x245b0f){_0x245b0f['updateTitle'](_0x5c6477);break;}}}['updateItemLoadingState'](_0x3df51f,_0x5788c2,_0x395c01){for(const _0xb29547 of this['sectionsView']['sections']){const _0x53867e=_0xb29547['getItem'](_0x3df51f);if(_0x53867e){_0x53867e['updateLoadingState'](_0x5788c2,_0x395c01);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x2d52e2=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x2d52e2);}}}const Li=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends _0x479a76{static get['requires'](){return[pt];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3b59f1){super(_0x3b59f1);const _0x4cad0d=this['context']['plugins']['get']('AITabs');this['_historyView']=new wt(this['context']['locale'],_0x4cad0d['showResizeButton']),this['_historyView']['delegate'](...Li)['to'](this),_0x4cad0d['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Nt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0xc32398){this['_historyView']['removeHistoryItem'](_0xc32398);}['updateItems'](_0x183513){this['_historyView']['updateHistoryItemsWithCategories'](_0x183513);}['updateItemTitle'](_0x248cd2,_0x4ec32e){this['_historyView']['updateItemTitle'](_0x248cd2,_0x4ec32e);}['updateItemLoadingState'](_0xb76ba3,_0x3d9fb6,_0x133800){this['_historyView']['updateItemLoadingState'](_0xb76ba3,_0x3d9fb6,_0x133800);}['setLoadingSkeleton'](_0x263e95){this['_historyView']['isLoading']=_0x263e95;}['showError'](_0x32c56a){this['_historyView']['errorMessage']=_0x32c56a;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x3c197b){this['_historyView']['isMaximized']=_0x3c197b;}}class ir extends ts(){['id'];['createdAt'];constructor({id:_0xa968db,title:_0x431f0d,createdAt:_0x1f878b,updatedAt:_0x1c583,pinned:_0x215e01}){super(),this['id']=_0xa968db,this['createdAt']=new Date(_0x1f878b),this['set']('title',_0x431f0d),this['set']('updatedAt',_0x1c583?new Date(_0x1c583):null),this['set']('pinned',_0x215e01||!0x1);}['updateTitle'](_0x19b5ec){this['set']('title',_0x210da0(_0x19b5ec)),this['updatedAt']=new Date();}['updatePinned'](_0x38d4cb){this['set']('pinned',_0x38d4cb),this['updatedAt']=new Date();}}class Ht extends _0x5d3056(){['items']=[];['connector'];['group'];constructor({connector:_0x17813f,group:_0x5c15bf}){super(),this['connector']=_0x17813f,this['group']=_0x5c15bf;}async['init'](){try{const _0x23f064=this['connector']['fetchConversations'](this['group']),_0x3ea0ac=await _0x23f064['getConversations']();this['loadItems'](_0x3ea0ac);}catch(_0x48e2d4){this['fire']('error',{'error':_0x48e2d4,'operation':'init'});}}['addItem'](_0xbfc852){this['items']['push'](_0xbfc852);}async['removeItem'](_0x2f238c){const _0x7d45c9=this['items']['findIndex'](_0x4eb5de=>_0x4eb5de['id']===_0x2f238c);if(-0x1===_0x7d45c9)return!0x1;try{return await this['connector']['deleteConversation'](_0x2f238c)['execute'](),this['items']['splice'](_0x7d45c9,0x1),this['fire']('itemRemoved',{'itemId':_0x2f238c}),!0x0;}catch(_0x5c12d2){return this['fire']('error',{'error':_0x5c12d2,'operation':'removeItem','itemId':_0x2f238c}),!0x1;}}['getItem'](_0x1a44a5){return this['items']['find'](_0x5f0626=>_0x5f0626['id']===_0x1a44a5);}async['updateItemTitle'](_0x211221,_0x4f769c){const _0xf693b5=this['getItem'](_0x211221);if(!_0xf693b5)return!0x1;try{return await this['connector']['updateConversation'](_0x211221,{'title':_0x4f769c})['getResult'](),_0xf693b5['updateTitle'](_0x4f769c),this['fire']('itemUpdated',{'itemId':_0x211221,'updates':{'title':_0x4f769c}}),!0x0;}catch(_0x40214a){return this['fire']('error',{'error':_0x40214a,'operation':'updateItemTitle','itemId':_0x211221}),!0x1;}}async['updateItemPinned'](_0x3c162e,_0x4ef70a){const _0x4d7e03=this['getItem'](_0x3c162e);if(!_0x4d7e03)return!0x1;try{return await this['connector']['updateConversation'](_0x3c162e,{'pinned':_0x4ef70a})['getResult'](),_0x4d7e03['updatePinned'](_0x4ef70a),this['fire']('itemUpdated',{'itemId':_0x3c162e,'updates':{'pinned':_0x4ef70a}}),!0x0;}catch(_0x4de299){return this['fire']('error',{'error':_0x4de299,'operation':'updateItemPinned','itemId':_0x3c162e}),!0x1;}}['loadItems'](_0x1895ed){try{this['items']=[],_0x1895ed['map'](_0x4878a6=>{this['addItem'](new ir(_0x4878a6));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x13b45a){this['fire']('error',{'error':_0x13b45a,'operation':'loadItems'});}}['getItems'](_0x8fbefd={}){const _0x43beee=void 0x0!==_0x8fbefd['pinned']&&_0x8fbefd['pinned'],_0x1a3911=_0x8fbefd['from']?new Date(_0x8fbefd['from']['getFullYear'](),_0x8fbefd['from']['getMonth'](),_0x8fbefd['from']['getDate']()):null,_0x4f24c3=_0x8fbefd['to']?new Date(_0x8fbefd['to']['getFullYear'](),_0x8fbefd['to']['getMonth'](),_0x8fbefd['to']['getDate']()):null;return this['items']['filter'](_0x2f8519=>{if(_0x2f8519['pinned']!==_0x43beee)return!0x1;if(_0x4f24c3){const _0x5c966d=new Date(_0x2f8519['createdAt']['getFullYear'](),_0x2f8519['createdAt']['getMonth'](),_0x2f8519['createdAt']['getDate']());return _0x1a3911?_0x1a3911['getTime']()===_0x4f24c3['getTime']()?_0x5c966d['getTime']()===_0x1a3911['getTime']():_0x5c966d<_0x4f24c3&&_0x5c966d>=_0x1a3911:_0x5c966d<_0x4f24c3;}return!0x0;});}}class jt extends _0x479a76{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[q,at,xt,pt];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](q),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](at);const _0x38c24f=this['context']['plugins']['get'](pt);try{const _0x4aa40a=this['_aiChatController']['getGroupId']();this['history']=new Ht({'connector':this['_aiConnector'],'group':_0x4aa40a}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x1bdc62,_0x4b45e7)=>{this['_setItemLoading'](_0x4b45e7['id'],'remove'),this['_handleRemove'](_0x4b45e7['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x48f835,_0x1382f1)=>{this['_setItemLoading'](_0x1382f1['id'],'rename'),this['_handleEditTitle'](_0x1382f1['id'],_0x1382f1['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x11b939,_0xbfe7f9)=>{void 0x0!==_0xbfe7f9['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0xbfe7f9['itemId'],_0xbfe7f9['updates']['title']),void 0x0!==_0xbfe7f9['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0xbfe7f9['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x4597a3,_0x5a3055)=>{this['_aiChatController']['handleRemovedConversation'](_0x5a3055['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x5a3055['itemId']),this['_clearItemLoading'](_0x5a3055['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x5167d6,_0x4683d3)=>{this['_handleHistoryErrorUI'](_0x4683d3['error'],_0x4683d3['operation'],_0x4683d3['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0xf4271e,_0x4268b1)=>{this['_handleSelectConversation'](_0x4268b1['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x1df94d,_0xa73c30)=>{const _0xcb5911=_0xa73c30['pinned']?'pin':'unpin';this['_setItemLoading'](_0xa73c30['id'],_0xcb5911),this['_handleTogglePin'](_0xa73c30['id'],_0xa73c30['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x38c24f['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x38c24f['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x38c24f,'resizedTabs',(_0x29c434,_0x174439)=>{this['_setIsMaximized'](_0x174439);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x38c24f['resize']();});}catch(_0x25dd62){this['_handleHistoryErrorUI'](_0x25dd62,'init');}}async['_handleEditTitle'](_0xb47dbe,_0x11e362){await this['history']['updateItemTitle'](_0xb47dbe,_0x11e362);}async['_handleTogglePin'](_0x264693,_0x67396d){await this['history']['updateItemPinned'](_0x264693,_0x67396d);}async['_handleRemove'](_0x5b1ee7){await this['history']['removeItem'](_0x5b1ee7);}async['_handleSelectConversation'](_0x3abda8){await this['_aiChatController']['loadConversation'](_0x3abda8);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x2b06df=this['_aiChatController']['activeConversation']?.['id'],_0x141199=this['_getCategorizedItems']()['map'](_0x4bfbc1=>({'title':_0x4bfbc1['title'],'items':_0x4bfbc1['items']['map'](_0x7d8205=>({'id':_0x7d8205['id'],'title':_0x7d8205['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x7d8205['createdAt'])['toLocaleDateString'](),'active':_0x7d8205['id']===_0x2b06df,'pinned':_0x7d8205['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x141199);}['_setItemLoading'](_0x57d1f5,_0x342f31){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x57d1f5,_0x342f31,!0x0);}['_clearItemLoading'](_0x17015f){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x17015f,null,!0x1);}['_handleHistoryErrorUI'](_0x4d9900,_0x28df29,_0x563cb9){const _0x366538=this['_generateErrorMessage'](_0x28df29,_0x563cb9);this['_aiChatHistoryUi']['showError'](_0x366538),_0x563cb9&&this['_clearItemLoading'](_0x563cb9),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x2a63ae,_0x1581b4){const _0x2ad154=_0x1581b4?this['history']['getItem'](_0x1581b4):null,_0x4110e7=_0x2ad154?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x2a63ae){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x4110e7);case'updateItemPinned':{const _0x48fe76=i(this['context']['locale'],_0x2ad154?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x48fe76,_0x4110e7]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x4110e7);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 _0x41958e=new Date(),_0x202539=new Date(_0x41958e['getFullYear'](),_0x41958e['getMonth'](),_0x41958e['getDate']()),_0x353d6b=new Date(_0x202539);_0x353d6b['setDate'](_0x353d6b['getDate']()-0x1);const _0xba22a3=new Date(_0x202539);_0xba22a3['setDate'](_0xba22a3['getDate']()-0xe);const _0xb913e1=this['history']['getItems']({'pinned':!0x0}),_0x33ecd2=this['history']['getItems']({'from':_0x202539,'to':_0x202539}),_0x49f11a=this['history']['getItems']({'from':_0x353d6b,'to':_0x353d6b}),_0x1bb60a=this['history']['getItems']({'from':_0xba22a3,'to':_0x353d6b}),_0x2709e3=this['history']['getItems']({'to':_0xba22a3}),_0x224630=[];return _0xb913e1['length']>0x0&&_0x224630['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0xb913e1}),_0x33ecd2['length']>0x0&&_0x224630['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x33ecd2}),_0x49f11a['length']>0x0&&_0x224630['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x49f11a}),_0x1bb60a['length']>0x0&&_0x224630['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x1bb60a}),_0x2709e3['length']>0x0&&_0x224630['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x2709e3}),_0x224630;}['_setIsMaximized'](_0x118e0c){this['_aiChatHistoryUi']['setIsMaximized'](_0x118e0c);}}class ht extends _0x479a76{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ma extends _0x479a76{static get['requires'](){return[at,D,ct,ht];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3dfbfb){super(_0x3dfbfb),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'](at)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](at)['startConversation']();}async['sendMessage']({message:_0x4a3e8a,attributes:_0x41533d}){await this['context']['plugins']['get'](at)['sendMessage']({'message':_0x4a3e8a,'attributes':_0x41533d});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](at)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](at)['focusPromptInput']();}['registerToolDataCallback'](_0x39176b){this['context']['plugins']['get'](at)['_registerToolDataCallback'](_0x39176b);}}class fs extends _0x4e2d9f{['id'];constructor(_0x27c31c,_0xa20743){super(_0x27c31c);const {id:_0x3bc2bb,type:_0x2feaa1,icon:_0x377cda}=_0xa20743;this['id']=_0x3bc2bb,this['set']({'label':_0xa20743['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0xa20743['id']}}),_0x377cda?this['icon']=_0x377cda:'chat'===_0x2feaa1?this['icon']=_0x2e8a6e:'review'===_0x2feaa1?this['icon']=_0x17dcaf:'translate'===_0x2feaa1&&(this['icon']=Vt);}}class kt extends _0x13ab0e{['listView'];constructor(_0xe11c2,_0xc04854){super(_0xe11c2);const _0x1ceae4=_0xc04854['map'](_0x33e514=>{const _0x3023b3=new _0x27607e(this['locale']),_0x346b17=new fs(this['locale'],_0x33e514);return _0x3023b3['children']['add'](_0x346b17),_0x346b17['delegate']('execute')['to'](this),_0x3023b3;});this['listView']=new _0x5f5dca(this['locale']),this['listView']['items']['addMany'](_0x1ceae4),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const Ut='chat-shortcuts';var Ua=function(_0x2e76e6){return _0x2e76e6['CHAT']='chat',_0x2e76e6['REVIEW']='review',_0x2e76e6['TRANSLATE']='translate',_0x2e76e6;}({});class Va extends _0x479a76{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[ct];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](ct),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x1c08ce=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x1c08ce['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x1c08ce,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0xfa0b45=Object['values'](Ua);this['_shortcuts']['forEach'](_0xae63a5=>{let _0x123885=!0x0;if(_0xae63a5['id']&&_0xae63a5['label']&&_0xfa0b45['includes'](_0xae63a5['type'])?'chat'===_0xae63a5['type']&&(_0x123885='string'==typeof _0xae63a5['prompt']):_0x123885=!0x1,!_0x123885)throw new _0x459533('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0xae63a5});});}['_injectShortcuts'](){const _0x3ce8ef=this['context']['plugins']['get'](ct);this['_shortcutsView']=new kt(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x3ce8ef['addFeedItemCustomElement'](this['_shortcutsView']['element'],Ut),this['_shortcutsView']['on']('execute',_0x7bc3a6=>{const _0x3d91db=_0x7bc3a6['source']['id'];this['_executeShortcut'](_0x3d91db);});}['_removeShortcuts'](){const _0x5353bc=this['context']['plugins']['get'](ct);_0x5353bc['hasFeedItem'](Ut)&&_0x5353bc['removeFeedItem'](Ut),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x28cd75){const _0x3f155d=this['_shortcuts']['find'](_0x483a22=>_0x483a22['id']===_0x28cd75),_0x555fbd=_0x3f155d['type'];'chat'===_0x555fbd?this['_runChatShortcut'](_0x3f155d):'review'===_0x555fbd?_0x3f155d['check']?this['_runReviewShortcut'](_0x3f155d):this['_switchTab']('reviewMode'):'translate'===_0x555fbd&&(_0x3f155d['language']?this['_runTranslateShortcut'](_0x3f155d):this['_switchTab']('translate'));}['_switchTab'](_0x481731){if(!this['context']['plugins']['has']('AITabs'))throw new _0x459533('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x481731});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x481731);}async['_runChatShortcut']({prompt:_0x24c3ca,draftMode:_0x4c47a3,useWebSearch:_0xdd07e2=!0x1,useReasoning:_0x4ba08e=!0x1,model:_0x5946be}){const _0xafd020=this['context']['plugins']['get']('AIChat'),_0x45a92a=this['context']['plugins']['get']('AIChatController'),_0x1d69f2=_0x45a92a['activeConversation'];let _0x392df5;_0x392df5=_0x5946be?await _0x1d69f2['chatModels']['getModel'](_0x5946be):await _0x1d69f2['chatModels']['getDefault'](),_0x392df5&&await _0x1d69f2['setModel'](_0x392df5),_0x1d69f2['setWebSearch'](_0xdd07e2),_0x1d69f2['setReasoning'](_0x4ba08e),_0x45a92a['addCurrentDocumentToChatContext'](),_0x4c47a3?(this['_aiChatUI']['setPromptInputValue'](_0x24c3ca),this['_aiChatUI']['focusPromptInput'](!0x0)):_0xafd020['sendMessage']({'message':_0x24c3ca});}['_runReviewShortcut']({check:_0x4eb8c5,model:_0x3e77b0,prompt:_0x235f75,params:_0x4df99d}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0x459533('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x117bc2={'id':_0x4eb8c5,'isCustom':'custom'===_0x4eb8c5};_0x3e77b0&&_0x235f75&&(_0x117bc2['args']={'model':_0x3e77b0,'prompt':_0x235f75}),_0x4df99d&&(_0x117bc2['params']=_0x4df99d),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x117bc2);}['_runTranslateShortcut']({language:_0x1f1fd3}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0x459533('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x1f1fd3,'args':{'language':_0x1f1fd3}});}}class io extends Lt{constructor(_0x1c83cd){super(_0x1c83cd);const _0x55d56e=_0x1c83cd['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x55d56e,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x442ee4=this['editor']['plugins']['get']('AITabs')['view'];_0x442ee4['isVisible']=!_0x442ee4['isVisible'];}}class qt extends _0x38fe65{static get['requires'](){return[pt];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4a7cba=this['editor'];_0x4a7cba['commands']['add']('toggleAi',new io(_0x4a7cba)),_0x4a7cba['ui']['componentFactory']['add']('toggleAi',()=>{const _0x5e4c50=this['_createAIUIButton'](_0x4e2d9f);return _0x5e4c50['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x5e4c50;}),_0x4a7cba['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x1c498a=this['_createAIUIButton'](_0x19bfd7);return _0x1c498a['set']({'role':'menuitemcheckbox'}),_0x1c498a;});}['_createAIUIButton'](_0x51e656){const _0x355c44=this['editor'],_0x434071=_0x355c44['commands']['get']('toggleAi'),_0x5e71e8=new _0x51e656(_0x355c44['locale']);return _0x5e71e8['set']({'label':i(_0x355c44['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x27b938,'isToggleable':!0x0}),_0x5e71e8['bind']('isEnabled')['to'](_0x434071),_0x5e71e8['bind']('isOn')['to'](_0x434071,'value',_0x4bfce5=>!!_0x4bfce5),this['listenTo'](_0x5e71e8,'execute',()=>{_0x434071['execute']();}),_0x5e71e8;}}const F=['applySuggestion','insertSuggestion','showNext','showPrevious'];class ls extends _0x13ab0e{['_errorView'];constructor(_0xffc407){super(_0xffc407),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x35917d){this['showError'](_0x35917d);}['showError'](_0x4b732e){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x4b732e,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x2b56f4=new _0x13ab0e(this['locale']),_0x3ab700=new _0x13ab0e(this['locale']);return _0x3ab700['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x2b56f4['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x2743cf=>!_0x2743cf)]},'children':[_0x3ab700]}),_0x2b56f4;}}const $=0xa;class Q extends _0x479a76{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'](_0x1841f5){const {id:_0x4b396a}=this['_currentConfig']??{};this['_currentConfig']=_0x1841f5;const {id:_0xf074b}=this['_currentConfig'];this['isOpen']&&_0x4b396a===_0xf074b?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x19eb1e=T(this['context'])['plugins']['get']('Dialog');_0x19eb1e['isOpen']&&this['_currentConfig']&&_0x19eb1e['id']===this['_currentConfig']['id']&&_0x19eb1e['hide']();}['_updateDialog'](){const _0x19243f=T(this['context'])['plugins']['get']('Dialog'),{icon:_0x483451,title:_0x5a34eb}=this['_currentConfig'];_0x19243f['view']?.['headerView']&&(_0x19243f['view']['headerView']['label']=_0x5a34eb,_0x19243f['view']['headerView']['iconView']&&_0x483451&&(_0x19243f['view']['headerView']['iconView']['content']=_0x483451)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x19243f['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](D)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x3476ec){this['context']['plugins']['get'](D)['hideFakeVisualSelection']('ai-balloon-'+_0x3476ec);}['_showDialog'](){const _0x2e9688=T(this['context'])['plugins']['get']('Dialog'),{id:_0x3115e3,title:_0x24ecfd,icon:_0x403ee1,class:_0x5307aa,mainView:_0x36beae}=this['_currentConfig'];_0x36beae['delegate'](...F)['to'](this),_0x2e9688['show']({'title':_0x24ecfd,'icon':_0x403ee1,'hasCloseButton':!0x0,'id':_0x3115e3,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x5307aa||''),'content':_0x36beae,'onShow':_0x29a25e=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0xeb915=this['_getSelectionElements']();_0xeb915&&_0xeb915[0x0]&&_0x53c419({'target':_0xeb915[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x29a25e['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x3115e3});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x3115e3}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x4f504b,_0x3fa3b6){if(!_0x3fa3b6)return null;const _0x7a5d47=this['_getSelectionElements']();if(!_0x7a5d47||0x0===_0x7a5d47['length'])return{'left':Math['round'](_0x3fa3b6['left']+_0x3fa3b6['width']/0x2-_0x4f504b['width']/0x2),'top':Math['round'](_0x3fa3b6['top']+_0x3fa3b6['height']/0x2-_0x4f504b['height']/0x2)};const _0x254b97=Math['round'](_0x3fa3b6['left']+_0x3fa3b6['width']/0x2-_0x4f504b['width']/0x2),_0x9539d7=_0x7a5d47['map'](_0x134010=>new _0x473971(_0x134010)),_0x261605=_0x4f504b['height'];return{'left':_0x254b97,'top':this['_calculateOptimalTopPosition'](_0x9539d7,_0x261605,_0x3fa3b6)};}['_calculateOptimalTopPosition'](_0x33de0b,_0x5f55fc,_0x55e8a1){const _0x4ef9f4=new _0x473971(_0x10b14d['window']),_0x24b01c=_0x33de0b['map'](_0x1df869=>_0x1df869['getVisible']())['filter'](_0x5ee329=>_0x5ee329),_0x5b3b6e=_0x473971['getBoundingRect'](_0x24b01c);if(!_0x5b3b6e)return Math['round'](_0x55e8a1['top']+_0x55e8a1['height']/0x2);const _0xb8ed7f=_0x4ef9f4['getIntersection'](_0x5b3b6e);if(!_0xb8ed7f)return Math['round'](_0x55e8a1['top']+_0x55e8a1['height']/0x2);const _0x3f26f2=_0x55e8a1['getVisible'](),_0x407417=_0x3f26f2&&_0x5b3b6e['height']>_0x3f26f2['height'],_0x13414a=_0xb8ed7f['top'],_0x2e1fb9=_0xb8ed7f['bottom'];if(_0x407417){const _0x314fb4=(_0x3f26f2||_0x4ef9f4)['height']/0x2-_0x5f55fc/0x2,_0x4d8dbb=_0x13414a-$-_0x55e8a1['top'],_0x432430=_0x55e8a1['bottom']-_0x2e1fb9-$;return _0x4d8dbb>=_0x5f55fc?Math['max']($,_0x13414a-_0x5f55fc-$):_0x432430>=_0x5f55fc?_0x2e1fb9+$:Math['max']($,_0x314fb4);}const _0x127c03=_0x13414a-_0x5f55fc,_0x22c4d1=_0x55e8a1['bottom']-_0x2e1fb9-$,_0x2c2b87=_0x13414a-$-_0x55e8a1['top'];let _0xe4b2e2;if(_0x22c4d1>=_0x5f55fc)_0xe4b2e2=_0x2e1fb9+$;else{if(_0x2c2b87>=_0x5f55fc)_0xe4b2e2=_0x127c03-$;else _0xe4b2e2=_0x13414a+_0x5b3b6e['height']/0x2-_0x5f55fc/0x2;}return _0xe4b2e2;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0xf39d56=T(this['context']);this['listenTo'](_0xf39d56['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x4a2bb4,data:{newRange:_0x48a975}}of _0xf39d56['model']['document']['differ']['getChangedMarkers']())if(_0x4a2bb4['startsWith'](R+':')&&(_0x48a975&&(_0x48a975['start']['isEqual'](_0x48a975['end'])||'$graveyard'==_0x48a975['root']['rootName'])||null==_0x48a975)){const _0x2afb65=i(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x2afb65),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x33c4d1=T(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x33c4d1['model']['document']);}['_getSelectionElements'](){const _0x506ed0=T(this['context']);return _0x2fb7f4(_0x506ed0['editing'],[..._0x506ed0['model']['markers']['getMarkersGroup']('ai-selection'),..._0x506ed0['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class us extends _0x3ccac8{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x1c226a,_0x29efad={}){super(_0x1c226a),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x29efad};const _0x476c01=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x476c01?'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'](_0x3d91a3){this['showChangesButton']['isEnabled']=_0x3d91a3;}['_setupRatingButtons'](){this['likeButton']=new _0x4e2d9f(this['locale']),this['likeButton']['set']({'icon':_0x278a76,'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 _0x4e2d9f(this['locale']),this['dislikeButton']['set']({'icon':_0x9158bb,'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 _0x4e2d9f(this['locale']),this['copyButton']['set']({'icon':_0x5d6164,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x1fca74=new _0x5495d5();_0x1fca74['set']({'content':_0x5c7a27}),_0x1fca74['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'](_0x1fca74);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x4e2d9f(this['locale']),this['showChangesButton']['set']({'icon':_0x1cf883,'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',_0x97c853=>_0x97c853?_0x580059:_0x1cf883),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class lt extends ls{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0xda0679,_0x361bb0){super(_0xda0679);const _0x54b012=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _0x39e72a(),this['_keystrokes']=new _0x2ecfe9(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x2ca20b({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x361bb0,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new as(_0xda0679),this['_partToolbarView']=new cs(_0xda0679,_0x361bb0['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x361bb0),this['_stateView']=new ws(_0xda0679),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new us(_0xda0679,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new ms(_0xda0679,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x16f649,_0x4ae0fa,_0x3d3777,_0x1b6332)=>{let _0x33cd50,_0x2e60b1;'pending'===_0x1b6332?(_0x33cd50=this['_partToolbarView'],_0x2e60b1=this['_stateView']):(_0x33cd50=this['_stateView'],_0x2e60b1=this['_partToolbarView']),this['_stateView']['setState'](_0x3d3777),_0x33cd50['isVisible']=!0x1,_0x2e60b1['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x54b012['to']('_state',_0x5f2dc8=>'ck-ai-chat-balloon-main_state_'+_0x5f2dc8)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x361bb0);});}['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'](_0x4d1699){_0x4d1699?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x4d1699);}['setState'](_0x477ec8){this['_state']=_0x477ec8;}['showError'](_0x10a81f){super['showError'](_0x10a81f),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x259ced){super['showBlockingError'](_0x259ced),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x39e20f){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x39e20f;}['togglePartToolbarEnabled'](_0x101e79){this['_partToolbarView']['isEnabled']=_0x101e79;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x28784b,showSuggestButton:_0x477969}){_0x28784b=_0x28784b&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x477969=_0x477969&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x28784b,'showSuggestButton':_0x477969});}['_createNextButtonView'](){const _0x519293=new _0x4e2d9f(this['locale']);return _0x519293['set']({'icon':_0x4a4dcc,'label':i(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x519293['on']('execute',()=>{this['fire']('showNext');}),_0x519293;}['_createPreviousButtonView'](){const _0x43c1e9=new _0x4e2d9f(this['locale']);return _0x43c1e9['set']({'icon':_0x341559,'label':i(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x43c1e9['on']('execute',()=>{this['fire']('showPrevious');}),_0x43c1e9;}}class ms extends _0x13ab0e{constructor(_0x5df0b9,_0x1ba8cd){super(_0x5df0b9),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x1ba8cd});}}class Ot extends _0x38fe65{static get['requires'](){return[_0x52fe49,Q];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x82912c){super(_0x82912c),this['set']('showDiff',!0x1);}['open'](_0x14cfa7){const _0xcee3a8=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0xcee3a8['plugins']['get']('AIBalloon')['open']({..._0x14cfa7,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x14cfa7['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x14cfa7['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x2c2758){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x2c2758);}['setState'](_0x2008e6){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x2008e6);}['_createChatBalloonView'](){const _0x52cfb4=this['editor'],_0x16c97e=_0x52cfb4['plugins']['get']('AIBalloon'),_0x17567a=_0x52cfb4['commands']['get']('trackChanges');let _0x53e296=_0x52cfb4['config']['get']('ai.availableReplyActions')||[...ot];_0x52cfb4['plugins']['has']('TrackChanges')||(_0x53e296=_0x53e296['filter'](_0x18c3a5=>'insertSuggestion'!=_0x18c3a5));const _0x5ec178=new lt(_0x52cfb4['locale'],{'availableActions':_0x53e296,'showApplyButton':!0x0,'showSuggestButton':!!_0x17567a});return _0x5ec178['bind']('showDiff')['to'](this),_0x5ec178['delegate'](...ut)['to'](this),_0x5ec178['delegate']('showPrevious','showNext')['to'](this),_0x16c97e['delegate']('dialogClosed')['to'](this),_0x5ec178['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x5ec178['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x5ec178['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x17567a&&_0x5ec178['bind']('isTrackChangesOn')['to'](_0x17567a,'value'),_0x5ec178['render'](),_0x5ec178;}['_toggleRotatorButtonsInDialogHeader'](_0xb7a576){const _0x4c7341=this['editor'],_0x2f54d4=_0x4c7341['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0xb7a576),_0x2f54d4['has'](this['_chatBalloonView']['previousButtonView'])||(_0x2f54d4['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x4c7341['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x2f54d4['remove'](this['_chatBalloonView']['previousButtonView']),_0x2f54d4['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class Ba extends _0x38fe65{static get['requires'](){return[qt,Ot,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Zt(_0x15630a){const {editor:_0x1f1142,action:_0x5f0f07,withText:_0x374684=!0x1,withIcon:_0x593acf=!0x0,isInDropdown:_0x85aa81=!0x0,shouldPreventFocus:_0x7087ab=!0x1}=_0x15630a;return()=>{const _0x47bc6f=_0x1f1142['locale'],_0x5c5d42=new _0x4e2d9f(_0x47bc6f),_0x363a06=_0x5c5d42['bindTemplate'];_0x85aa81&&_0x5c5d42['extendTemplate']({'on':{'mouseenter':_0x363a06['to'](()=>{_0x7087ab&&_0x7087ab()||_0x5c5d42['focus']();})}});const _0x5dcb61=_0x5f0f07['icon']??_0x5f0f07['parent']?.['icon'];return _0x5c5d42['set']({'label':_0x5f0f07['displayedPrompt'],'withText':_0x374684,'role':'menuitem','icon':_0x593acf?_0x5dcb61??_0x17d053:void 0x0,'tooltip':!_0x374684,'class':'ck-ai-quick-actions-button','isEnabled':_0x5f0f07['isEnabled']}),_0x5c5d42['on']('execute',()=>{_0x1f1142['editing']['view']['focus'](),_0x1f1142['commands']['execute']('aiQuickAction',_0x5f0f07);}),_0x5c5d42;};}class Gs extends _0x1b09b3{['arrowView'];constructor(_0x32eec4,_0x186b63){super(_0x32eec4,_0x186b63);const _0xad5716=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',_0x29f12b=>String(_0x29f12b)),'data-cke-tooltip-disabled':_0xad5716['to']('isOn')},'on':{'mouseenter':_0xad5716['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x4fdca2=new _0x5495d5();return _0x4fdca2['content']=_0x58790d,_0x4fdca2['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x4fdca2;}}class Ks extends _0x5f5dca{['_allListItems'];['_allSearchableItems'];constructor(_0x58c8ce,_0x525eb6,_0x39da81){super(_0x58c8ce),this['_allListItems']=_0x525eb6,this['_allSearchableItems']=_0x39da81;}['filter'](_0x28398e){if(!_0x28398e)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x23771b=_0x28398e['source']['toLowerCase']()['trim'](),_0x425657=this['_allSearchableItems']['filter'](_0x5aaa03=>(_0x5aaa03['groupLabel']?_0x5aaa03['label']+'\x20('+_0x5aaa03['groupLabel']+')':_0x5aaa03['label'])['toLowerCase']()['includes'](_0x23771b));return this['items']['clear'](),this['items']['addMany'](_0x425657['sort']((_0x5f2d4d,_0x1b7af7)=>{const _0xfbd9a0=_0x5f2d4d['groupLabel'],_0x35db86=_0x1b7af7['groupLabel'];return _0xfbd9a0||_0x35db86?_0xfbd9a0?0x1:-0x1:0x0;})['map'](_0x19e8e1=>_0x19e8e1['item'])),this['_highlightQuery'](_0x23771b,_0x425657),{'resultsCount':_0x425657['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x18c84d,_0x244b7d){if(!_0x18c84d)return;const _0x48e4cd=new RegExp(_0x5553e0(_0x18c84d),'gi');_0x244b7d['forEach'](_0x5e955a=>{_0x5e955a['highlightViews']&&_0x5e955a['highlightViews']['forEach'](_0x565be8=>{'function'==typeof _0x565be8['highlightText']&&_0x565be8['highlightText'](_0x48e4cd);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x344bbe=>{_0x344bbe['highlightViews']&&_0x344bbe['highlightViews']['forEach'](_0xc96070=>{'function'==typeof _0xc96070['highlightText']&&_0xc96070['highlightText'](null);});});}}const Js='menu',Ws='menuitem';class co extends _0x13ab0e{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x325541,_0x237179,_0x2d2baa,_0x1f4e84,_0x455f27=!0x1){const _0x551549=_0x325541['locale'];super(_0x551549),this['_bodyCollection']=_0x1f4e84,this['_hasSearch']=_0x455f27;const _0x393e93=this['_createListItems'](_0x325541,_0x237179,_0x2d2baa);this['optionsListView']=new Ks(_0x551549,_0x393e93,this['_allSearchableItems']),this['optionsListView']['role']=Js,this['optionsListView']['items']['addMany'](_0x393e93),this['focusTracker']=new _0x39e72a(),this['keystrokes']=new _0x2ecfe9(),_0x455f27&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x393e93,this['focusCycler']=new _0x2ca20b({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x455f27&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x525144=_0x455f27&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x1562eb(_0x525144),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x551549['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x41f7cc(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 _0x388c52=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x388c52);}['_createListItems'](_0x1535af,_0x1e85df,_0x440156){const _0x4fd0bf=new _0x1562eb();return _0x1e85df['forEach'](_0x4f444b=>{if('actions'in _0x4f444b){const {listItem:_0x465763}=this['_createActionGroupButton'](_0x1535af,_0x4f444b,_0x440156);_0x4fd0bf['add'](_0x465763),_0x4f444b['actions']['forEach'](_0x1f51a0=>{this['_createActionButton'](_0x1535af,_0x1f51a0,_0x4f444b['label'],_0x4f444b['icon']);const {listItem:_0x4d0c34,highlightViews:_0x3e35d4}=this['_createSearchResultActionButton'](_0x1535af,_0x1f51a0,_0x4f444b['label'],_0x4f444b['icon']);this['_allSearchableItems']['push']({'item':_0x4d0c34,'label':_0x1f51a0['displayedPrompt'],'groupLabel':_0x4f444b['label'],'highlightViews':_0x3e35d4});});}else{const {listItem:_0x2d8a3a}=this['_createActionButton'](_0x1535af,_0x4f444b);_0x4fd0bf['add'](_0x2d8a3a);const _0x1b1a94=_0x2d8a3a['children']['first'];if(_0x1b1a94){const {listItem:_0x389e9b,highlightViews:_0x176edb}=this['_createSearchResultActionButton'](_0x1535af,_0x4f444b);this['_allSearchableItems']['push']({'item':_0x389e9b,'label':_0x1b1a94['label']||'','highlightViews':_0x176edb});}}}),_0x4fd0bf;}['_createActionButton'](_0x1a2b55,_0x1695ba,_0x1023e4,_0x2582a0){const _0x43e08a=new _0x27607e(this['locale']);if(_0x1023e4&&_0x2582a0){const _0x9562dc=new _0x4e2d9f(this['locale']),_0x1a7628=_0x9562dc['bindTemplate'],_0x3a8b93=new _0x8fe7c();_0x3a8b93['text']=_0x1695ba['displayedPrompt'];const _0x5b162e=new _0x8fe7c();_0x5b162e['text']=_0x1023e4;const _0x2032a2=new _0x5495d5();_0x2032a2['content']=_0x2582a0,_0x2032a2['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x2c0123=new _0x13ab0e(this['locale']);_0x2c0123['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x5e158f=new _0x13ab0e(this['locale']);return _0x5e158f['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x9562dc['set']({'label':_0x1695ba['displayedPrompt']+'\x20('+_0x1023e4+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x9562dc['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':[_0x3a8b93,_0x2c0123,_0x2032a2,_0x5b162e,_0x5e158f],'on':{'mouseenter':_0x1a7628['to'](()=>{this['_isSearchFocused']()||_0x9562dc['focus']();}),'click':_0x1a7628['to'](()=>{_0x9562dc['fire']('execute');})}}),_0x9562dc['on']('execute',()=>{_0x1a2b55['editing']['view']['focus'](),_0x1a2b55['commands']['execute']('aiQuickAction',_0x1695ba);}),_0x43e08a['children']['add'](_0x9562dc),{'listItem':_0x43e08a,'highlightViews':[_0x3a8b93,_0x5b162e]};}{const _0xa7f659=new _0x2fcff1(),_0x4d1dac=new _0x4e2d9f(this['locale'],_0xa7f659),_0x36126e=_0x4d1dac['bindTemplate'],_0xd45bce=_0x1695ba['icon']??_0x1695ba['parent']?.['icon'],_0x1340c8=void 0x0!==_0x1695ba['icon'];return _0x4d1dac['set']({'label':_0x1695ba['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x1340c8?_0xd45bce??_0x17d053:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x4d1dac['extendTemplate']({'on':{'mouseenter':_0x36126e['to'](()=>{this['_isSearchFocused']()||_0x4d1dac['focus']();})}}),_0x4d1dac['on']('execute',()=>{_0x1a2b55['editing']['view']['focus'](),_0x1a2b55['commands']['execute']('aiQuickAction',_0x1695ba);}),_0x43e08a['children']['add'](_0x4d1dac),{'listItem':_0x43e08a,'highlightViews':[_0xa7f659]};}}['_createSearchResultActionButton'](_0x48c8ae,_0x3071d1,_0x1b1657,_0x14d9d4){return _0x1b1657&&_0x14d9d4?this['_createSearchResultGroupedActionButton'](_0x48c8ae,_0x3071d1,_0x1b1657,_0x14d9d4):this['_createSearchResultIndividualActionButton'](_0x48c8ae,_0x3071d1);}['_createSearchResultGroupedActionButton'](_0x203e04,_0x431544,_0x1e3084,_0x1d9fdd){const _0x31a4eb=new _0x27607e(this['locale']),_0x2d0fa8=new _0x4e2d9f(this['locale']),_0x577cc9=_0x2d0fa8['bindTemplate'],{view:_0x36bd76,highlightView:_0xcdc297}=this['_createSearchResultGroupRow'](_0x1e3084,_0x1d9fdd),{view:_0x213125,highlightView:_0x5b75a8}=this['_createSearchResultActionRow'](_0x431544['displayedPrompt']),_0x45f269=this['_createSearchResultContentView'](_0x36bd76,_0x213125);return _0x2d0fa8['set']({'label':_0x431544['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}),_0x2d0fa8['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':[_0x45f269],'on':{'mouseenter':_0x577cc9['to'](()=>{this['_isSearchFocused']()||_0x2d0fa8['focus']();}),'click':_0x577cc9['to'](()=>{this['_handleSearchResultButtonClick'](_0x2d0fa8);})}}),this['_setupActionButtonExecution'](_0x2d0fa8,_0x203e04,_0x431544),_0x31a4eb['children']['add'](_0x2d0fa8),{'listItem':_0x31a4eb,'highlightViews':[_0xcdc297,_0x5b75a8]};}['_createSearchResultIndividualActionButton'](_0x566972,_0x1ebf42){const _0x39d734=new _0x27607e(this['locale']),_0x1718c3=new _0x2fcff1(),_0x3e5128=new _0x4e2d9f(this['locale'],_0x1718c3),_0x2dddff=_0x3e5128['bindTemplate'];return _0x3e5128['set']({'label':_0x1ebf42['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x3e5128['extendTemplate']({'on':{'mouseenter':_0x2dddff['to'](()=>{this['_isSearchFocused']()||_0x3e5128['focus']();})}}),this['_setupActionButtonExecution'](_0x3e5128,_0x566972,_0x1ebf42),_0x39d734['children']['add'](_0x3e5128),{'listItem':_0x39d734,'highlightViews':[_0x1718c3]};}['_createSearchResultGroupRow'](_0x5f378f,_0x265c00){const _0x39c54d=new _0x13ab0e(this['locale']),_0x54b607=new _0x5495d5();_0x54b607['content']=_0x265c00,_0x54b607['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x539720=new _0x8fe7c();return _0x539720['text']=_0x5f378f,_0x39c54d['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x54b607,_0x539720]}),{'view':_0x39c54d,'highlightView':_0x539720};}['_createSearchResultActionRow'](_0x70ce83){const _0xcce4c4=new _0x13ab0e(this['locale']),_0x5530ff=new _0x8fe7c();return _0x5530ff['text']=_0x70ce83,_0xcce4c4['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x5530ff]}),{'view':_0xcce4c4,'highlightView':_0x5530ff};}['_createSearchResultContentView'](_0x142491,_0x197431){const _0xb744e0=new _0x13ab0e(this['locale']);return _0xb744e0['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x142491,_0x197431]}),_0xb744e0;}['_setupActionButtonExecution'](_0xabc47f,_0x4f29d1,_0x43ac24){_0xabc47f['on']('execute',()=>{_0x4f29d1['editing']['view']['focus'](),_0x4f29d1['commands']['execute']('aiQuickAction',_0x43ac24);});}['_createActionGroupButton'](_0x5194f2,_0x5234c0,_0x38da98){const _0x43ff1d=new _0x27607e(this['locale']),_0x45f719=new _0x2fcff1(),_0x5af841=new Gs(this['locale'],_0x45f719),_0xe07219=_0x5af841['bindTemplate'],_0x37bc84=this['_getPanelKeystroke'](_0x38da98),_0x5e3bd2=this['_createGroupActionsList'](_0x5194f2,_0x5234c0['actions'],_0x38da98);_0x5af841['set']({'label':_0x5234c0['label'],'withText':!0x0,'role':Ws,'icon':_0x5234c0['icon']??_0x17d053,'isEnabled':_0x5234c0['actions']['some'](_0x168b30=>_0x168b30['isEnabled'])}),_0x5af841['extendTemplate']({'on':{'mouseenter':_0xe07219['to'](()=>{this['_isSearchFocused']()||_0x5af841['focus']();})}});const _0x3a2069=new _0x551ec5(this['locale']);return _0x3a2069['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0xe07219['to'](_0x3fafb3=>{this['_handlePanelKeydown'](_0x3fafb3,_0x37bc84,_0x5af841,_0x3a2069);})}}),_0x5af841['bind']('isOn')['to'](_0x3a2069,'isVisible'),this['_bodyCollection']['add'](_0x3a2069),_0x3a2069['content']['add'](_0x5e3bd2),this['_setupGroupMenuBehavior'](_0x5af841,_0x3a2069),_0x43ff1d['children']['add'](_0x5af841),{'listItem':_0x43ff1d,'highlightView':_0x45f719};}['_createGroupActionsList'](_0x2a7bc4,_0xc1fdc7,_0xe604ca){const _0x79981d=new _0x5f5dca(this['locale']);return _0x79981d['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0xc1fdc7['forEach'](_0x14bf2b=>{const _0x340cbf=new _0x27607e(this['locale']),_0x235745=Zt({'editor':_0x2a7bc4,'action':_0x14bf2b,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x340cbf['children']['add'](_0x235745),_0xe604ca['focusTracker']['add'](_0x235745),_0x79981d['items']['add'](_0x340cbf);}),_0x79981d;}['_setupGroupMenuBehavior'](_0x3cbcfc,_0xe4e301){const _0x5f0759=_0x3cbcfc['bindTemplate'],_0x311e50=this['_getButtonKeystroke'](_0x3cbcfc);_0x3cbcfc['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x5f0759['to'](()=>{this['_showNestedPanel'](_0xe4e301,_0x3cbcfc);}),'mouseleave':_0x5f0759['to'](_0x5a78c4=>{const _0x1f1f69=_0x5a78c4['relatedTarget'];this['_isMovingToNestedMenu'](_0x1f1f69,_0xe4e301)||this['_hideNestedPanel'](_0xe4e301);}),'keydown':_0x5f0759['to'](_0x43b143=>{_0x43b143['key']==_0x311e50&&(this['_showNestedPanel'](_0xe4e301,_0x3cbcfc),_0xe4e301['content']['get'](0x0)['focus']());})}}),_0xe4e301['on']('render',()=>{_0xe4e301['element']?.['addEventListener']('mouseleave',_0xceb056=>{const _0x388ded=_0xceb056['relatedTarget'];_0x3cbcfc['element']?.['contains'](_0x388ded)||this['_isMovingToNestedMenu'](_0x388ded,_0xe4e301)||this['_hideNestedPanel'](_0xe4e301);});});}['_showNestedPanel'](_0x52be64,_0x59481c){this['_openNestedPanels']['forEach'](_0x47cbeb=>{_0x47cbeb!==_0x52be64&&_0x47cbeb['isVisible']&&_0x47cbeb['hide']();}),_0x52be64['show'](),_0x52be64['pin']({'positions':[_0x3bd02b['eastSouth']],'target':_0x59481c['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x52be64);}['_hideNestedPanel'](_0x4a17c3){_0x4a17c3['hide'](),this['_openNestedPanels']['delete'](_0x4a17c3);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x4b1881=>_0x4b1881['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x2ad463,_0x1ea3d5){if(!_0x2ad463)return!0x1;if(_0x1ea3d5['element']?.['contains'](_0x2ad463))return!0x0;const _0x50a107=_0x2ad463;return _0x50a107['closest']&&(null!==_0x50a107['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x50a107['closest']('.ck-ai-quick-actions-group-list')||null!==_0x50a107['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'](_0x2837ee){return'rtl'===_0x2837ee['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x2fbb1d){return'rtl'===_0x2fbb1d['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x17966c,_0x3cb7ff,_0x4b11be,_0x16e34d){_0x17966c['key']==_0x3cb7ff&&(_0x4b11be['focus'](),this['_hideNestedPanel'](_0x16e34d));}['_handleSearchResultButtonClick'](_0x5860cd){_0x5860cd['fire']('execute');}}function Xt(_0x38df0a){const {editor:_0x1c63b1,content:_0x4d728a,buttonDefinition:_0x4512ce,bodyCollection:_0x1dee38,hasSearch:_0x57e9fa=!0x1}=_0x38df0a;return()=>{const _0x1c113f=_0x1c63b1['locale'],_0x5e9c2e=_0xb2afd1(_0x1c113f);_0x5e9c2e['buttonView']['set']({'icon':_0x4512ce['icon']??_0x17d053,'label':_0x4512ce['label'],'tooltip':!0x0}),_0x5e9c2e['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x583ee7=new co(_0x1c63b1,_0x4d728a,_0x5e9c2e,_0x1dee38,_0x57e9fa);if(_0x5e9c2e['panelView']['children']['add'](_0x583ee7),_0x57e9fa){const _0x2004c3='ai-quick-actions-dropdown-selection';_0x5e9c2e['on']('change:isOpen',(_0x2e6af1,_0x284174,_0xba7cb0)=>{if(_0xba7cb0){if(_0x1c63b1['plugins']['has']('AIEditing')){const _0x3dbb9a=_0x1c63b1['plugins']['get'](D),_0x132d74=_0x1c63b1['model']['document']['selection'],_0x469e65=Array['from'](_0x132d74['getRanges']());_0x469e65['length']>0x0&&_0x3dbb9a['showFakeVisualSelection'](_0x469e65,_0x2004c3,!0x1,!0x0);}}else _0x1c63b1['plugins']['has']('AIEditing')&&_0x1c63b1['plugins']['get'](D)['hideFakeVisualSelection'](_0x2004c3),_0x583ee7['resetSearch']();});}return _0x5e9c2e;};}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(_0x4c5e06){return _0x4c5e06['CHAT']='CHAT',_0x4c5e06['ACTION']='ACTION',_0x4c5e06['REVIEW']='REVIEW',_0x4c5e06;}({}),Ga=function(_0x37eb54){return _0x37eb54['CHAT']='AIChat',_0x37eb54['ACTION']='AIActions',_0x37eb54['REVIEW']='AIReviewMode',_0x37eb54;}({});class ii extends _0x38fe65{static get['requires'](){return[te,q];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x5a542e=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x5a542e),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x186cd7){return function(_0x52718e){const _0x2057f4=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x52718e['uiLanguage']),_0x3c3f15=_0x2057f4||'English',_0x2d3c90=[{'id':'ask-ai','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Gt},{'id':'chat-commands','label':i(_0x52718e,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Gt,'actions':[{'id':'explain','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ee['replace']('%0',_0x3c3f15),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ie['replace']('%0',_0x3c3f15),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ne['replace']('%0',_0x3c3f15),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Bt},{'id':'continue','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Ft},{'id':'fix-grammar','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Wt},{'id':'adjust-length','label':i(_0x52718e,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x52718e,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Yt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x52718e,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Vt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x52718e,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x52718e,'AI_QUICK_ACTIONS_OTHER'),'icon':Jt,'actions':[]}];return _0x2d3c90;}(_0x186cd7);}async['_getDefaultAndCustomActions'](){const _0x3252d3=ii['getDefaultQuickActions'](this['editor']['locale']),_0x2e6f60=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x509a12=[];try{_0x509a12=await new It({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x30f506){const _0x37998b=new _0x459533('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x30f506});gt(_0x37998b['message']);}finally{const _0x367bce=_0x2e6f60['map'](_0x5128af=>({..._0x5128af,'icon':void 0x0}));_0x3252d3['find'](_0x243c23=>'other'===_0x243c23['id'])['actions']['push'](..._0x367bce),_0x3252d3['forEach'](_0x2aa601=>{if('actions'in _0x2aa601)_0x2aa601['actions']['forEach'](_0x4ef3fa=>{if(_0x4ef3fa['isEnabled']=!!_0x509a12['find'](_0x1b0be1=>_0x1b0be1['id']===_0x4ef3fa['model'])||void 0x0===_0x4ef3fa['model'],!_0x4ef3fa['isEnabled']){const _0x2b3b84=new _0x459533('ai-quick-actions-unavailable-model',this,{'actionId':_0x4ef3fa['id'],'modelId':_0x4ef3fa['model']});gt(_0x2b3b84['message']);}});else{if(_0x2aa601['isEnabled']=!!_0x509a12['find'](_0x52539b=>_0x52539b['id']===_0x2aa601['model'])||void 0x0===_0x2aa601['model'],!_0x2aa601['isEnabled']){const _0x1c64af=new _0x459533('ai-quick-actions-unavailable-model',this,{'actionId':_0x2aa601['id'],'modelId':_0x2aa601['model']});gt(_0x1c64af['message']);}}});}return _0x3252d3;}['_initializeQuickActionsComponentsAndCommands'](){const _0x22c3b7=new _0xb3f722(this['editor']['locale']);_0x22c3b7['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x22c3b7),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x22c3b7);}['_initializeQuickActionsDropdown'](_0x11a686){const _0x207500=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Xt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x17d053,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x11a686,'hasSearch':_0x207500}));}['_prepareQuickActionsDefinition'](_0x5993b7){this['_quickActionsDefinition']=_0x5993b7['map'](_0x2f98d4=>{if('actions'in _0x2f98d4){const _0x1372c1=_0x2f98d4;return{..._0x1372c1,'actions':_0x1372c1['actions']['map'](_0x49c85d=>{const {actions:_0x114039,..._0x227485}=_0x1372c1;return{..._0x49c85d,'parent':_0x227485};})['filter'](_0x304b1c=>this['_shouldIncludeAction'](_0x304b1c))};}return _0x2f98d4;})['filter'](_0x3f2c9e=>'actions'in _0x3f2c9e?_0x3f2c9e['actions']['length']>0x0:this['_shouldIncludeAction'](_0x3f2c9e));}['_shouldIncludeAction'](_0x32a0c0){const _0x2a7e29=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ga[_0x32a0c0['type']])&&!_0x2a7e29['includes'](_0x32a0c0['id'])&&!('CHAT'===_0x32a0c0['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x51a95d){this['_quickActionsDefinition']['forEach'](_0x40b2f4=>{if('actions'in _0x40b2f4){const _0x5001e7=Xt({'editor':this['editor'],'content':_0x40b2f4['actions'],'buttonDefinition':_0x40b2f4,'bodyCollection':_0x51a95d});this['editor']['ui']['componentFactory']['add'](_0x40b2f4['id'],_0x5001e7),_0x40b2f4['actions']['forEach'](_0x5209a3=>{const _0x41fa2a=Zt({'editor':this['editor'],'action':_0x5209a3});this['editor']['ui']['componentFactory']['add'](_0x5209a3['id'],_0x41fa2a);});}else{const _0x132249=Zt({'editor':this['editor'],'action':_0x40b2f4,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x40b2f4['id'],_0x132249);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x3aeab6=>{const _0x416164=new _0x399f5a(_0x3aeab6),_0x3e7d1d=i(_0x3aeab6,'AI_QUICK_ACTIONS_HEADING');_0x416164['buttonView']['set']({'label':_0x3e7d1d,'icon':_0x17d053});const _0xb66144=new _0x408ee4(_0x3aeab6);_0xb66144['set']({'ariaLabel':_0x3e7d1d,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x2694b7=>{if('actions'in _0x2694b7){const _0x2bbd2e=_0x2694b7,_0x36f4b4=new _0x1d2bc6(_0x3aeab6,_0x416164),_0x14a8d4=new _0x399f5a(_0x3aeab6),_0x1d88c6=new _0x408ee4(_0x3aeab6);_0x14a8d4['buttonView']['set']({'label':_0x2bbd2e['label'],'icon':_0x2bbd2e['icon']}),_0x2bbd2e['actions']['forEach'](_0x2d486f=>{const _0x942071=new _0x1d2bc6(_0x3aeab6,_0x14a8d4),_0x596857=new _0x19bfd7(_0x3aeab6);_0x596857['set']({'label':_0x2d486f['displayedPrompt'],'icon':_0x2d486f['icon'],'role':'menuitem','isEnabled':_0x2d486f['isEnabled']}),_0x596857['on']('execute',()=>{this['_executeQuickAction'](_0x2d486f);}),_0x596857['delegate']('execute')['to'](_0x14a8d4),_0x942071['children']['add'](_0x596857),_0x1d88c6['items']['add'](_0x942071);}),_0x14a8d4['panelView']['children']['add'](_0x1d88c6),_0x36f4b4['children']['add'](_0x14a8d4),_0xb66144['items']['add'](_0x36f4b4);}else{const _0xc568f=_0x2694b7,_0x7f8009=new _0x1d2bc6(_0x3aeab6,_0x416164),_0x5623b2=new _0x19bfd7(_0x3aeab6);_0x5623b2['set']({'label':_0xc568f['displayedPrompt'],'icon':_0xc568f['icon'],'role':'menuitem','isEnabled':_0xc568f['isEnabled']}),_0x5623b2['on']('execute',()=>{this['_executeQuickAction'](_0xc568f);}),_0x5623b2['delegate']('execute')['to'](_0x416164),_0x7f8009['children']['add'](_0x5623b2),_0xb66144['items']['add'](_0x7f8009);}});const _0xd22fae=Object['values'](Ga)['some'](_0x27ac21=>this['editor']['plugins']['has'](_0x27ac21));return _0x416164['set']({'isEnabled':_0xd22fae}),_0x416164['panelView']['children']['add'](_0xb66144),_0x416164;});}['_executeQuickAction'](_0x12288c){const _0x28ba7b=this['editor'];_0x28ba7b['editing']['view']['focus'](),_0x28ba7b['commands']['execute']('aiQuickAction',_0x12288c);const _0x54f780=_0x28ba7b['ui']['view']['menuBarView'];_0x54f780&&_0x54f780['close']&&_0x54f780['close']();}}class ci extends Lt{['execute'](_0x4594ee){switch(this['_expandSelectionIfCollapsed'](),_0x4594ee['type']){case Qt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x5d4ff8=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x459533('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5d4ff8});}this['_handleAIChatAction'](_0x4594ee);break;case Qt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x5457d6=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x459533('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5457d6});}this['_handleAIActionsAction'](_0x4594ee);break;case Qt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x41eb21=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x459533('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x41eb21});}this['_handleAIReviewAction'](_0x4594ee);}}async['_handleAIChatAction'](_0x56a95b){const _0x38d87a=this['editor']['plugins']['get']('AIChat'),_0x3dd4a8=this['editor']['plugins']['get']('AIChatController'),_0x1240dd=this['editor']['plugins']['get']('AITabs')['view'];if(_0x1240dd['isVisible']||(_0x1240dd['isVisible']=!0x0),'chat'!==_0x1240dd['activeTab']&&_0x1240dd['activateTab']('chat'),'ask-ai'===_0x56a95b['id'])_0x3dd4a8['removeSelectionFromChatContext'](),await _0x38d87a['addSelectionToChatContext'](),_0x38d87a['focusPromptInput']();else await _0x38d87a['startConversation'](),_0x3dd4a8['removeSelectionFromChatContext'](),await _0x38d87a['addSelectionToChatContext'](),_0x38d87a['focusPromptInput'](),await _0x38d87a['sendMessage']({'message':_0x56a95b['prompt']||_0x56a95b['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x56a95b['id']},'displayedPrompt':_0x56a95b['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x2199bf=this['editor'],_0x188f16=_0x2199bf['model']['document']['selection'];if(!_0x188f16['isCollapsed'])return;const _0x414593=_0x1bf09b(_0x188f16['getSelectedBlocks']())||_0x2199bf['model']['schema']['getLimitElement'](_0x188f16);_0x2199bf['model']['change'](_0xa149cf=>{_0xa149cf['setSelection'](_0x414593,'in');});}['_handleAIActionsActionLabel'](_0x3d04fa){return _0x3d04fa['parent']?.['label']&&'other'!==_0x3d04fa['parent']?.['id']?_0x3d04fa['parent']['label']+':\x20'+_0x3d04fa['displayedPrompt']:_0x3d04fa['displayedPrompt'];}async['_handleAIActionsAction'](_0x567fe9){const _0x3e2c2f=this['editor']['plugins']['get']('AIActions'),_0x304d7f=_0x567fe9['prompt']?{'userMessage':_0x567fe9['prompt'],'model':_0x567fe9['model']}:{'actionName':_0x567fe9['actionName']||_0x567fe9['id'],'args':_0x567fe9['args']},_0x53cb68=this['_handleAIActionsActionLabel'](_0x567fe9);await _0x3e2c2f['executeAction'](_0x304d7f,_0x53cb68,_0x567fe9['icon']);}async['_handleAIReviewAction'](_0x3c8510){console['log']('handleAIReviewAction',_0x3c8510);}}class ti extends _0x38fe65{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x506ec8=this['editor'],_0x11b38b=new ci(this['editor']);if(_0x506ec8['commands']['add']('aiQuickAction',_0x11b38b),_0x506ec8['plugins']['has']('AIChat')){const _0x349633=this['editor']['plugins']['get']('AIChat');_0x506ec8['model']['document']['selection']['on']('change:range',(_0x4695d1,_0x34e054)=>{_0x34e054['directChange']&&_0x349633['removeSelectionFromChatContext']();});}}}class Ge extends He{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x3834e7=this['documentContextContent']['children']['map'](_0x55a519=>({'node':_0x55a519,'id':At(_0x55a519,'data-id')})),_0x17aecd=this['parsedMergedContent']['children']['map'](_0x16f750=>({'node':_0x16f750,'id':At(_0x16f750,'data-id')||_0x3d9d4e()})),_0x1ae2c6=_0x14dd80(_0x3834e7,_0x17aecd,{'comparator':(_0x2bc405,_0x4e505c)=>_0x2bc405['id']==_0x4e505c['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x1ae2c6['length']&&_0x1ae2c6[_0x1ae2c6['length']-0x1]['removed'];)_0x1ae2c6['pop']();}const _0x400a7b=_0x1ae2c6['map'](_0xc37847=>{const _0xc2f427=_0xc37847['added']?'new':_0xc37847['removed']?'removed':'modified';return{'node':_0xc37847['value'][0x0]['node'],'type':_0xc2f427,'id':_0xc37847['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x400a7b,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x14e33c,_0x256f9e){return _0x256f9e;}}class W extends Fe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x41ca52){super(_0x41ca52),this['content']=_0x41ca52['content'],this['version']=_0x41ca52['version'],this['actionName']=_0x41ca52['actionName'],this['args']=_0x41ca52['args'],this['userMessage']=_0x41ca52['userMessage'],this['model']=_0x41ca52['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':Be['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x2bef85){const _0xb0893e=new Ge({'editor':this['editor'],'documentContextContent':this['content'],..._0x2bef85});return this['replies']['push'](_0xb0893e),_0xb0893e['delegate'](...ze)['to'](this),this['fire']('replyCreated',_0xb0893e),_0xb0893e;}}class Bn extends _0x3ccac8{constructor(_0x4eb59c,_0x3fb64f=!0x0,_0x219fbe=!0x0){super(_0x4eb59c),this['set']('isEnabled',!0x1),_0x3fb64f&&(this['applyButton']=this['_createButton'](i(_0x4eb59c,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x219fbe&&(this['suggestButton']=this['_createButton'](i(_0x4eb59c,'AI_BALLOON_SUGGEST_BUTTON'),_0x3fb64f?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x3fb64f,'showSuggestButton':_0x219fbe}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x8e66cb,showSuggestButton:_0x1ea7b7}){this['applyButton']&&(this['applyButton']['isVisible']=_0x8e66cb),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x1ea7b7);}['_createButton'](_0x53ef70,_0x232214){const _0x4bd2e5=new _0x4e2d9f(this['locale']);return _0x4bd2e5['set']({'label':_0x53ef70,'class':_0x232214,'isVisible':!0x0,'withText':!0x0}),_0x4bd2e5;}}class yn extends _0x13ab0e{constructor(_0x394aa3){super(_0x394aa3),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(_0x394aa3,'AI_DISCLAIMER_TEXT')}]}]});}}class Nn extends _0x13ab0e{constructor(_0x1a568b){super(_0x1a568b),this['set']('isVisible',!0x0);const _0x383724=new pi('small');_0x383724['isVisible']=!0x0;const _0x24272c=new _0x13ab0e(this['locale']);_0x24272c['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',_0x2ec6c0=>!_0x2ec6c0)]},'children':[_0x383724,_0x24272c]});}}class rt extends ls{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x1b5c3c,_0x1f3cd9){super(_0x1b5c3c),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x1f3cd9,this['_focusTracker']=new _0x39e72a(),this['_keystrokes']=new _0x2ecfe9(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x2ca20b({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x1562eb(),this['_addContentWrapper'](_0x1f3cd9),this['_addDisclaimerView'](),this['_addToolbar'](_0x1f3cd9),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'](_0x1f3cd9);});}['render'](){super['render']();for(const _0x23e7ec of this['_focusables'])this['_focusTracker']['add'](_0x23e7ec['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x3815ea){-0x1===_0x3815ea?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x4328c2){this['_isLoading']=_0x4328c2;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x5e5100){super['showError'](_0x5e5100),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x3d337e){super['showBlockingError'](_0x3d337e),this['setErrorState']();}['addMiniToolbarItem'](_0x2c40ec){this['_miniToolbarView']['items']['has'](_0x2c40ec)||this['_miniToolbarView']['items']['add'](_0x2c40ec);}['removeMiniToolbarItem'](_0x7964ee){this['_miniToolbarView']['items']['has'](_0x7964ee)&&this['_miniToolbarView']['items']['remove'](_0x7964ee);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x1a0f81,showSuggestButton:_0x40e5de}){_0x1a0f81=_0x1a0f81&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x40e5de=_0x40e5de&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x1a0f81,'showSuggestButton':_0x40e5de});}async['updateContent'](_0x246bd1){await this['_streamableContentView']['update'](_0x246bd1);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x11f18a){this['_contentWrapper']=new _0x13ab0e(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'](_0x11f18a['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new yn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x1fe71a,showSuggestButton:_0x365e24}){this['_toolbarView']=new Bn(this['locale'],_0x1fe71a,_0x365e24),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',(_0x582607,_0xb5fd36,_0x3cb104)=>!(_0x582607||_0xb5fd36||_0x3cb104)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x1fe71a,'showSuggestButton':_0x365e24}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x1aa26f){return this['_miniToolbarView']=new us(this['locale'],_0x1aa26f),this['_miniToolbarView']['delegate'](...ut)['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',(_0x37745a,_0x17b866)=>!(_0x37745a||_0x17b866)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Nn(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new as(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x429da1=new _0x4e2d9f(this['locale']),_0x58611d=new _0x4e2d9f(this['locale']),_0x4de01c=new Ln(this['locale']),_0x24ae0b=new _0x4e2d9f(this['locale']);_0x429da1['set']({'icon':_0x131fa2,'label':i(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x58611d['set']({'icon':_0x43ac1c,'tooltip':i(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x24ae0b['set']({'icon':_0x1d2a7b,'tooltip':i(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x429da1['bind']('isEnabled')['to'](this,'isBusy',_0x1427da=>!_0x1427da),_0x429da1['on']('execute',()=>{this['fire']('tryAgain');}),_0x58611d['bind']('isEnabled')['to'](this,'isBusy',_0x3e679b=>!_0x3e679b),_0x58611d['on']('execute',()=>{this['fire']('showPrevious');}),_0x24ae0b['bind']('isEnabled')['to'](this,'isBusy',_0x148c8f=>!_0x148c8f),_0x24ae0b['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x58611d,this['_navigationCounter']=_0x4de01c,this['_navigationNextButton']=_0x24ae0b,this['_navigationTryAgainButton']=_0x429da1;}['updateMiniToolbarButtons'](_0x101e85,_0x2df4c8){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x1f70c9=_0x101e85>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x1f70c9){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x59b500=_0x101e85-_0x2df4c8;this['_navigationCounter']['setInteractionCount'](_0x59b500+'/'+_0x101e85),this['_navigationPreviousButton']['isEnabled']=_0x2df4c8<_0x101e85-0x1,this['_navigationNextButton']['isEnabled']=_0x2df4c8>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'](_0x318c32){this['_isLoading']=_0x318c32;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x59d79e=this['_getScrollableElement']();_0x59d79e&&!this['_scrollManager']&&(this['_scrollManager']=new gi(_0x59d79e));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Ln extends _0x13ab0e{constructor(_0x4dab1e){super(_0x4dab1e);const _0x3c1dca=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x3c1dca['to']('interactionCount')}]});}['setInteractionCount'](_0x5dfbd6){this['set']('interactionCount',_0x5dfbd6);}}class ri extends _0x38fe65{static get['requires'](){return[q,_0x52fe49,D,Q,_0x18ff34];}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(_0x3cc284){super(_0x3cc284),this['_bodyCollection']=new _0xb3f722(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new z();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x426ec4,_0x21c71d,_0x14eb7c){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x514777,anchorData:_0x468db3}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x426ec4,_0x514777,_0x468db3,_0x21c71d,_0x14eb7c);}}const {modelFragment:_0x373884,anchorData:_0x1b9211}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x426ec4,_0x373884,_0x1b9211,_0x21c71d,_0x14eb7c);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x1726dd=this['editor']['plugins']['has']('TrackChanges');let _0xea4c62=this['editor']['config']['get']('ai.availableReplyActions')||[...ot];_0x1726dd||(_0xea4c62=_0xea4c62['filter'](_0x212084=>'insertSuggestion'!=_0x212084));const _0x4ffff8=this['editor']['commands']['get']('trackChanges'),_0x403a50=new rt(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x1726dd,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0xea4c62});return _0x403a50['bind']('isBusy')['to'](this),_0x4ffff8&&_0x403a50['bind']('isTrackChangesOn')['to'](_0x4ffff8,'value'),_0x403a50['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x403a50['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x403a50['on']('showNext',()=>{this['_navigateToNext']();}),_0x403a50;}['_getExecuteDataRegular'](){const _0xba3968=this['editor']['model']['document']['selection'];if(_0xba3968['isCollapsed']){const _0x2df94a=_0x1bf09b(_0xba3968['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0xba3968);this['editor']['model']['change'](_0x10e010=>{_0x10e010['setSelection'](_0x2df94a,'in');});}const _0x576e78=_0xba3968['getFirstRange'](),_0x39b70f=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0xba3968),_0x576e78['start'],_0x576e78['end']);this['_copyMarkersToFragment'](_0x39b70f,_0xba3968,{'isTableSelection':!0x1});const _0x1a43ef=_0xba3968['getFirstRange']()['start'],_0xefd9a2=new Map();let _0x3f5040=_0x39b70f;for(let _0x5a7864=0x0;_0x5a7864<_0x1a43ef['path']['length'];_0x5a7864++)_0xefd9a2['set'](_0x3f5040,_0x1a43ef['path'][_0x5a7864]),_0x3f5040=_0x3f5040['getChild'](0x0);return{'modelFragment':_0x39b70f,'anchorData':_0xefd9a2};}['_getExecuteDataInTable'](){const _0x2fe823=this['editor']['model']['document']['selection'],_0xea5efd=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x25c198=_0x2fe823['getFirstRange']()['start']['parent']['parent'],_0x94b48e=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x25c198),this['editor']['model']['createPositionAfter'](_0x25c198)),_0x1fa4d6=this['_wrapWithCommonAncestors'](_0xea5efd,_0x94b48e['start'],_0x94b48e['end']);this['_copyMarkersToFragment'](_0x1fa4d6,_0x2fe823,{'isTableSelection':!0x0});const _0x641e12=_0x2fe823['getFirstRange']()['start'],_0x1d29de=new Map();let _0x6bae60=_0x1fa4d6;for(let _0x357f1f=0x0;_0x357f1f<_0x641e12['path']['length'];_0x357f1f++)if(_0x1d29de['set'](_0x6bae60,_0x641e12['path'][_0x357f1f]),_0x357f1f<_0x641e12['path']['length']-0x1)_0x6bae60=_0x6bae60['getChild'](0x0);else{let _0x22769a=_0x6bae60['nextSibling'];for(;_0x22769a;)_0x1d29de['set'](_0x22769a,_0x641e12['path'][_0x357f1f]),_0x22769a=_0x22769a['nextSibling'];}return{'modelFragment':_0x1fa4d6,'anchorData':_0x1d29de};}async['_executeAction'](_0x41a50e,_0x396034,_0x16f0b7,_0x1fb4fa,_0x4657c7){const _0x519f99=this['editor']['plugins']['get'](D),_0x378bae=this['editor']['plugins']['get'](Q),_0x1f1d89=this['editor']['model']['document']['selection'],_0x1f8b07=await _0x519f99['modelToDataWithIds'](_0x396034),_0x4cec82=this['editor']['model']['document']['version'],_0x244fb5=[..._0x1f1d89['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0x378bae['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x1fb4fa,'icon':_0x4657c7||_0x17d053,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x244fb5,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x378bae),this['_interactionParams']={'action':_0x41a50e,'content':_0x1f8b07,'version':_0x4cec82,'aiBalloon':_0x378bae,'modelFragment':_0x396034,'anchorData':_0x16f0b7},this['_setupApplyListeners'](),this['listenTo'](_0x378bae,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x378bae,'dialogClosed',(_0x3e0095,{id:_0x13f330})=>{if('aiActionsBalloon'===_0x13f330){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x1a7a54=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x15fc90=_0x1a7a54['changeGroups'][0x0];_0x15fc90&&'pending'===_0x15fc90['state']&&_0x1a7a54['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x378bae);}}),this['_createInteraction'](_0x1f8b07,_0x4cec82,_0x378bae,_0x41a50e);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x12fafa,anchorData:_0x101d88}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x12fafa,_0x101d88,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x12fafa,_0x101d88,!0x0);});}['_wrapWithCommonAncestors'](_0x15c9d3,_0x3e4056,_0x2c6269){const _0x3505c7=this['editor']['model']['createRange'](_0x3e4056,_0x2c6269)['getCommonAncestor'](),_0x4500e3=_0x3505c7['is']('documentFragment')?[]:_0x3505c7['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x4500e3['length']){const _0x339562=_0x4500e3['map'](_0x700d5a=>_0x700d5a['_clone'](!0x1));for(let _0x12def7=0x1;_0x12def7<_0x339562['length'];_0x12def7++)_0x339562[_0x12def7-0x1]['_appendChild'](_0x339562[_0x12def7]);return _0x339562[_0x339562['length']-0x1]['_appendChild'](_0x15c9d3),new tt(_0x339562[0x0]);}return _0x15c9d3;}['_copyMarkersToFragment'](_0x31c1a3,_0x40b434,_0x46df2b={'isTableSelection':!0x1}){const _0x25ced4=this['editor']['model'],_0x188ae8=Array['from'](_0x40b434['getRanges']()),_0x458719=_0x40b434['getFirstRange']()['start'];for(const _0x5cea8b of _0x25ced4['markers']){if(_0x5cea8b['name']['startsWith'](R)||!_0x5cea8b['affectsData'])continue;const _0x35296b=_0x5cea8b['getRange']();if(!_0x188ae8['some'](_0x36010d=>_0x36010d['containsRange'](_0x35296b,!0x0)))continue;const _0x33970b=this['_regularCalculateMarkerPath'](_0x35296b['start'],_0x458719,_0x46df2b['isTableSelection']),_0xea0ab3=this['_regularCalculateMarkerPath'](_0x35296b['end'],_0x458719,_0x46df2b['isTableSelection']),_0x4c8b5e=_0x25ced4['createPositionFromPath'](_0x31c1a3,_0x33970b),_0x3fbd58=_0x25ced4['createPositionFromPath'](_0x31c1a3,_0xea0ab3);if(!_0x4c8b5e['isEqual'](_0x3fbd58)){const _0xd03a02=_0x25ced4['createRange'](_0x4c8b5e,_0x3fbd58);_0x31c1a3['markers']['set'](_0x5cea8b['name'],_0xd03a02);}}}['_regularCalculateMarkerPath'](_0x4babc1,_0x5bd067,_0x468999=!0x1){const _0x59ae5d=[..._0x4babc1['path']['slice']()];for(let _0x1cbc68=0x0;_0x1cbc68<Math['max'](_0x5bd067['path']['length'],_0x4babc1['path']['length']);_0x1cbc68++){const _0x4b0950=_0x5bd067['path'][_0x1cbc68]||0x0,_0x2b18f6=(_0x4babc1['path'][_0x1cbc68]||0x0)-_0x4b0950;if(_0x59ae5d[_0x1cbc68]=_0x2b18f6,0x0!==_0x2b18f6&&!_0x468999)break;}return _0x59ae5d;}async['_createInteraction'](_0x2e42af,_0x3a0c41,_0x35ae1e,_0x72ebdc){const _0x527fe1=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x72ebdc,'content':_0x2e42af,'version':_0x3a0c41,'aiBalloon':_0x35ae1e,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x495185=new W({'connector':this['_aiConnector'],'editor':_0x527fe1,'content':_0x2e42af,'version':_0x3a0c41,..._0x72ebdc});this['_interactions']['push'](_0x495185);const _0x27a1d5=(_0x272920,_0x5983d1=!0x1,_0x47f36e='streaming')=>this['_promiseQueue']['enqueue'](async _0x2206e8=>{try{const _0x1c753f=J({'editor':_0x527fe1,'changeGroups':_0x272920['changeGroups'],'documentContextContent':_0x272920['documentContextContent'],'showDiff':_0x5983d1,'trimUnchanged':!0x1});_0x1c753f['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x1c753f[0x0],'renderingStrategy':_0x47f36e,'abortSignal':_0x2206e8});}catch(_0x533666){if(this['_isAbortError'](_0x533666))return;throw _0x533666;}});this['_interaction']['on']('replyCreated',(_0x579d0f,_0xea174)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x27a1d5(_0xea174)['catch'](_0x43e638=>{this['_isAbortError'](_0x43e638)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x43e638),this['_setErrorState'](_0x495185));});}),this['_interaction']['on']('replyContentUpdated',(_0x5d7b9d,_0x886a8c)=>{_0x27a1d5(_0x886a8c)['catch'](_0x2d2d90=>{this['_isAbortError'](_0x2d2d90)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x2d2d90),this['_setErrorState'](_0x495185));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x1c8d34){this['_isAbortError'](_0x1c8d34)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x1c8d34),this['_setErrorState'](_0x495185));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x194331,{showDiff:_0x505d5b})=>{try{this['_balloonShowDiff']=_0x505d5b;const _0x148776=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x148776&&await _0x27a1d5(_0x148776,_0x505d5b,'static');}catch(_0x1bfd01){this['_isAbortError'](_0x1bfd01)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x1bfd01),this['_setErrorState'](_0x495185));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x224c39,{reply:_0x1bd8a6})=>{const _0x522a3e={'positiveCount':_0x1bd8a6['changeGroups']['filter'](_0x2b25eb=>'accepted'===_0x2b25eb['state'])['length'],'totalCount':_0x1bd8a6['changeGroups']['length']},_0x35c9c8=this['_interaction']['actionCallId'],_0x30ffee=this['_interaction']['actionName'];_0x30ffee?this['_aiConnector']['upsertAIActionRating'](_0x30ffee,_0x35c9c8,_0x522a3e):this['_aiConnector']['upsertCustomAIActionRating'](_0x35c9c8,_0x522a3e);}),this['_setLoadingState']();try{const _0x3cc34c=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x3cc34c;}catch(_0x21ac6c){if(this['_isAbortError'](_0x21ac6c))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x495185);}}['_applyChanges'](_0x289f9a,_0xf1b2c8,_0x1645ea){const _0x424aea=this['editor'];if(_0x1645ea&&!_0x424aea['plugins']['has']('TrackChanges'))throw new _0x459533('ai-no-track-changes',null);const _0x4db9fd=this['editor']['plugins']['get'](_0x18ff34),_0xd101e2=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0xd101e2||!_0xd101e2['replies']['length'])return;const _0xeb7080=_0xd101e2['replies'][_0xd101e2['replies']['length']-0x1],_0x5bd554=_0xeb7080['changeGroups'];_0xeb7080['setChangeGroupState'](0x0,'accepted');let _0x3a4a58=Z({'editor':_0x424aea,'reply':_0xeb7080,'interaction':_0xd101e2,'groups':_0x5bd554,'transform':!0x1,'documentCompare':_0x4db9fd,'documentCompareOptions':{'anchor':_0x424aea['model']['createPositionAt'](_0x289f9a,0x0),'markDeletions':_0x1645ea}});_0x3a4a58=this['_filterOperationsOutsideRange'](_0x3a4a58,_0xf1b2c8);for(const _0x45f8e2 of _0x3a4a58)this['_anchorOperation'](_0xf1b2c8,_0x45f8e2,_0x424aea['model']['document']['getRoot']());const _0x45b420=_0xd101e2['getDocumentContext']()['version'],_0x2794eb=_0x424aea['model']['document']['history']['getOperations'](_0x45b420),_0x95f690={'document':_0x424aea['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x53b5da=nt(_0x3a4a58,_0x2794eb,_0x95f690)['operationsA'];_0x424aea['model']['change'](_0x3ebf21=>{if(_0x3ebf21['setSelection'](_0x424aea['model']['document']['selection']['focus']),_0x1645ea)_0x424aea['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x53b5da);else{for(const _0x271728 of _0x53b5da)_0x271728['baseVersion']=_0x424aea['model']['document']['version'],Y(_0x424aea,_0x271728),_0x3ebf21['batch']['addOperation'](_0x271728),_0x424aea['model']['applyOperation'](_0x271728);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x2a2961,_0x4216a5){return _0x2a2961['filter'](_0x3d7d12=>{if('rename'==_0x3d7d12['type']){const _0x3cf567=_0x3d7d12['position']['nodeAfter'];return!_0x4216a5['has'](_0x3cf567);}if(_0x3d7d12['type']['indexOf']('Attribute')>-0x1){const _0x5c5287=_0x3d7d12['range']['start']['nodeAfter'];return!_0x4216a5['has'](_0x5c5287);}return!0x0;});}['_anchorOperation'](_0x47a82e,_0x183d81,_0x1420e6){const _0x56cd40=_0x183d81['clone']();for(const _0x1a156a in _0x183d81){const _0x4c885b=_0x183d81[_0x1a156a];_0x4c885b instanceof it?_0x183d81[_0x1a156a]=new it(_0x444976(_0x4c885b['start']),_0x444976(_0x4c885b['end'])):_0x4c885b instanceof st&&(_0x183d81[_0x1a156a]=_0x444976(_0x4c885b));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x56cd40['type'])){if(_0x56cd40['isDocumentOperation']=!0x1,_0x56cd40['baseVersion']=null,'remove'==_0x56cd40['type']){const _0x2bd4fd=_0x56cd40['sourcePosition'],_0x444028=_0x56cd40['howMany'];new et(_0x2bd4fd,_0x444028)['_execute']();}else _0x56cd40['_execute']();}function _0x444976(_0x314704){if('$graveyard'==_0x314704['root']['rootName'])return _0x314704;const _0x3f02fa=[];let _0x399b5c=_0x314704['root'];for(let _0x239f95=0x0;_0x239f95<_0x314704['path']['length'];_0x239f95++){const _0x28b02a=_0x47a82e['get'](_0x399b5c)||0x0;_0x3f02fa[_0x239f95]=_0x314704['path'][_0x239f95]+_0x28b02a,_0x399b5c=_0x399b5c['getChildAtOffset'](_0x314704['path'][_0x239f95]);}return new st(_0x1420e6,_0x3f02fa,_0x314704['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x25226f,content:_0x6a1271,version:_0x251696,aiBalloon:_0x42b670}=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'](_0x6a1271,_0x251696,_0x42b670,_0x25226f)['catch'](_0x2feb38=>{this['_isAbortError'](_0x2feb38)||console['error']('Error\x20refreshing\x20interaction:',_0x2feb38);});}['_isAbortError'](_0x37dacc){return!!_0x37dacc['message']&&_0x37dacc['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 _0x38b3b2=this['_interactions']['length'];this['_currentInteractionIndex']<_0x38b3b2-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x3ca95){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x3ca95;const _0x34bff1=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x34bff1)return;if(_0x34bff1['hasError'])return this['_setErrorState'](_0x34bff1),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x34bff1['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x261fcc=_0x34bff1['replies'][_0x34bff1['replies']['length']-0x1];if(_0x261fcc){const _0x25629a=this['editor'];try{const _0x31aadc=J({'editor':_0x25629a,'changeGroups':_0x261fcc['changeGroups'],'documentContextContent':_0x261fcc['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x426da6=>setTimeout(_0x426da6,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x31aadc[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x4f470d){this['_isAbortError'](_0x4f470d)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x4f470d);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x592791){const _0x4acbf8=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x4acbf8),_0x592791['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 Fa extends _0x38fe65{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x55576f){super(_0x55576f),_0x55576f['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class gr extends _0x13ab0e{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x152e07,_0x35b859){super(_0x152e07),this['id']=_0x35b859,this['set']('status','pending'),this['set']('changeId',_0x35b859),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',(_0x4750a4,_0x444443)=>{_0x444443&&_0x444443['target']&&'A'===_0x444443['target']['tagName']&&_0x444443['preventDefault'](),this['fire']('activateChange',{'id':_0x35b859,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x35b859,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x35b859,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x8aa8b9=new _0x13ab0e(this['locale']);return _0x8aa8b9['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',_0x1a8b44=>!_0x1a8b44)]}}),_0x8aa8b9;}['_createAcceptButtonView'](){const _0x10bb25=new _0x4e2d9f(this['locale']);return _0x10bb25['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x10bb25['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x30b12e=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x30b12e['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x192998=>'pending'!==_0x192998&&'accepted'!==_0x192998),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x334417=>'pending'===_0x334417),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x3781ce=>'accepted'===_0x3781ce)]}}),this['on']('change:status',(_0x35ec8a,_0x4abc21,_0x8b6f31)=>{_0x10bb25['isEnabled']='pending'===_0x8b6f31,'accepted'===_0x8b6f31&&(_0x10bb25['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x10bb25['icon']=_0x44dfa1);}),_0x10bb25;}['_createDismissButtonView'](){const _0x5e5e1c=new _0x4e2d9f(this['locale']);return _0x5e5e1c['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x5e5e1c['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x32d9be=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x32d9be['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x5b42a8=>'pending'!==_0x5b42a8&&'rejected'!==_0x5b42a8),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x935aaa=>'pending'===_0x935aaa),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x1a97a0=>'rejected'===_0x1a97a0)]}}),this['on']('change:status',(_0x5bf6f9,_0x237a71,_0x5ae228)=>{_0x5e5e1c['isEnabled']='pending'===_0x5ae228,'rejected'===_0x5ae228&&(_0x5e5e1c['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x5e5e1c['icon']=_0x57255f);}),_0x5e5e1c;}['_createInfoButtonView'](){const _0x392b18=new _0x4e2d9f(this['locale']);return _0x392b18['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':tc,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x392b18['bind']('isOn')['to'](this,'isInfoToggleOn',_0x1c0724=>_0x1c0724),_0x392b18['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x392b18;}['_createOutdatedButtonView'](){const _0x1842d3=new _0x4e2d9f(this['locale']);return _0x1842d3['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x45d10f,'withText':!0x0,'isEnabled':!0x1}),_0x1842d3['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x430315=>'outdated'!==_0x430315)],'disabled':'disabled'}}),_0x1842d3;}}class me extends _0x551ec5{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x488964,_0x2287e7){super(_0x488964),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']()),_0x2287e7['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x1e120e){this['resultItemView']['changeId']=_0x1e120e['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x1e120e['contentDiffed'];}['showBalloon'](_0x21e3f0,_0x354762,_0x56a5e6,_0x38dffb,_0x373221,_0x236514){const _0xd082b9=_0x354762();if(!_0xd082b9)return;this['updateContent'](_0x21e3f0),this['show']();const _0x41f06e=Array['from'](_0xd082b9['getClientRects']())['reverse'](),_0x2b02f3=this['_getPointedRectIndexFromEvent'](_0x56a5e6,_0x41f06e),_0x421ce9=_0x41f06e[_0x2b02f3??0x0];'click'===_0x38dffb?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x354762(),_0x2b02f3,_0x21e3f0['id'],_0x373221,_0x236514)||_0x421ce9})):'hover'===_0x38dffb&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x354762(),_0x2b02f3,_0x21e3f0['id'])||_0x421ce9}));}['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'](){_0x570ad6({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x3c8404=[this['element']];return this['_pinnedTargetElement']&&_0x3c8404['push'](this['_pinnedTargetElement']),_0x3c8404;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x3a8415=new _0x13ab0e();return this['resultItemView']=new gr(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x3a8415['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']]}]}),_0x3a8415;}['_getBestRectPositionOnClick'](_0x28f02c,_0x2dd641,_0xba480e,_0x12e6c2,_0x5efcba){if(!_0x28f02c)return null;const _0x19bf7b=this['position']['replace']('arrow_',''),_0xe5026b=Array['from'](_0x28f02c['getClientRects']());let _0x15b642,_0x4578c0=_0xe5026b['reverse']();return void 0x0!==_0x2dd641&&this['_isPinnedRectVisible'](_0x4578c0[_0x2dd641],_0x12e6c2,_0x5efcba)?(_0x15b642=_0x4578c0[_0x2dd641],this['_pinnedRectIndex']=_0x2dd641):this['_isPinnedRectVisible'](_0x4578c0[0x0],_0x12e6c2,_0x5efcba)&&void 0x0===_0x2dd641?_0x15b642=_0x4578c0[0x0]:(_0x4578c0='s'==_0x19bf7b[0x0]?[..._0xe5026b]['reverse']():_0xe5026b,_0x4578c0['forEach'](_0x32277e=>{this['_isPinnedRectVisible'](_0x32277e,_0x12e6c2,_0x5efcba)&&(_0x15b642=_0x32277e);})),this['_pinnedTargetChangeId']=_0xba480e,this['_pinnedTargetElement']=_0x28f02c,_0x15b642||_0x28f02c['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x1fd49e,_0x5ad740,_0x3f8ad5){if(!_0x1fd49e)return null;const _0x4e114e=Array['from'](_0x1fd49e['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x5ad740&&this['_pinnedTargetChangeId']!==_0x3f8ad5)return this['_pinnedRectIndex']=_0x5ad740,this['_pinnedTargetElement']=_0x1fd49e,this['_pinnedTargetChangeId']=_0x3f8ad5,_0x4e114e[_0x5ad740];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x3f8ad5){if(_0x1fd49e!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x4e114e[this['_pinnedRectIndex']];}return void 0x0!==_0x5ad740&&this['_pinnedTargetChangeId']!==_0x3f8ad5?(this['_pinnedRectIndex']=_0x5ad740,this['_pinnedTargetElement']=_0x1fd49e,this['_pinnedTargetChangeId']=_0x3f8ad5,_0x4e114e[_0x5ad740]):_0x1fd49e['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x4613b8,_0x2ad5f9){if(_0x4613b8)for(let _0x3eb6ef=0x0;_0x3eb6ef<_0x2ad5f9['length'];_0x3eb6ef++){const _0x2abcca=_0x2ad5f9[_0x3eb6ef];if(_0x4613b8['clientX']>=_0x2abcca['left']-0x3&&_0x4613b8['clientX']<=_0x2abcca['right']+0x3&&_0x4613b8['clientY']>=_0x2abcca['top']-0x3&&_0x4613b8['clientY']<=_0x2abcca['bottom']+0x3)return _0x3eb6ef;}}['_isPinnedRectVisible'](_0x1633dc,_0x483abd,_0x5e20f1){const _0x1a8894=new _0x473971(_0x1633dc),_0x2fa083=_0x483abd||document['documentElement'],_0xe57349=_0x1a8894['getIntersection'](_0x39de53(_0x5e20f1)),_0x6da9c0=new _0x473971(_0x2fa083)['getIntersection'](_0x1a8894);return!!(_0xe57349&&_0x6da9c0&&_0x1a8894['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Me extends _0x479a76{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[pt];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x57ad63){super(_0x57ad63),this['_bodyCollection']=new _0xb3f722(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 _0x7ede52=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x7ede52);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x52b2e6){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x5de2ee=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x52b2e6,_0x5de2ee);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x511cc4){_0x511cc4&&('error-general'!==_0x511cc4['status']?'error-chunk'!==_0x511cc4['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x16c689){this['_mainView']['addCheckRunResult'](_0x16c689);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x5ba9a5){this['_mainView']['showGeneralReviewCoreErrorView'](_0x5ba9a5??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x4ded9b,_0x25272a){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x4ded9b,_0x25272a);}['setActiveStateInResults'](_0x206658){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x29f74e=>{_0x29f74e['id']===_0x206658&&_0x29f74e['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x2844d3=>_0x2844d3['setItemAsInactive']());}['updateChangeState'](_0x364fbe,_0x36bfd7){'accepted'===_0x36bfd7||'rejected'===_0x36bfd7||'outdated'===_0x36bfd7?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x364fbe,_0x36bfd7):this['_mainView']['reviewCheckResultsView']['showResult'](_0x364fbe,_0x36bfd7);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x45fcc4,_0x33484d,_0x8d8e2d,_0x457dc1,_0x11293b,_0x57da9a){this['_balloonSuggestionView']['showBalloon'](_0x45fcc4,_0x33484d,_0x8d8e2d,_0x457dc1,_0x11293b,_0x57da9a);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x3d2322){const _0x15e74c=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0xe150f7=>_0xe150f7['id']===_0x3d2322);return _0x15e74c?_0x15e74c['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0x13ab0e{constructor(_0x8111a2){super(_0x8111a2),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x7822c5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x7822c5['if']('isVisible','ck-hidden',_0x32e477=>!_0x32e477)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x7822c5['to']('errorMessage')}]}]});}}class Ae extends _0x13ab0e{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x150f22,_0xcc4bdf){super(_0x150f22),this['reviewCoreHeader']=_0xcc4bdf['header'],this['generalErrorView']=new sh(_0x150f22),this['reviewCheckListView']=_0xcc4bdf['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0xcc4bdf['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0xcc4bdf['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'](_0x2d987e){this['reviewCheckResultsView']['addResult'](_0x2d987e),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'](_0xdd6d21){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0xdd6d21;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class _r extends _0x4e2d9f{constructor(_0x7fa3f6,_0x5ac8a9){super(_0x5ac8a9),this['set']({'label':_0x7fa3f6,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ve extends _0x27607e{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x5c392b,_0x493d9d){super(_0x5c392b),this['_contents']=_0x493d9d,this['_resultViews']=new _0x1562eb(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['_resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new bi(_0x5c392b),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 _0x514aca=this['_createCombinedSkeletonLoader'](),_0x3682e8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x3682e8['if']('isLoading','ck-ai_review__check-run_loading',_0x2f24fa=>_0x2f24fa),_0x3682e8['if']('isResultReady','ck-ai_review__check-run_ready',_0x330c7a=>_0x330c7a),_0x3682e8['if']('isVisible','ck-hidden',_0x148bbd=>!_0x148bbd)]},'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',_0x58844d=>_0x58844d)]},'children':this['_resultViews']},_0x514aca]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x2aae52){const _0x265a45=new gr(this['locale'],_0x2aae52['id']);_0x265a45['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x265a45),_0x265a45['resultResponseView']['element']['innerHTML']=_0x2aae52['contentDiffed'];}['hideResult'](_0x227620,_0x5ddf0b){if('pending'===_0x5ddf0b)return;const _0x16378d=this['_resultViews']['find'](_0x3bf3a4=>_0x3bf3a4['id']===_0x227620);_0x16378d&&(_0x16378d['status']=_0x5ddf0b,_0x16378d['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x49391e,_0x4f3fd3){if('pending'!==_0x4f3fd3)return;const _0x16f2bb=this['_resultViews']['find'](_0x1d5ff9=>_0x1d5ff9['id']===_0x49391e);_0x16f2bb&&(_0x16f2bb['status']=_0x4f3fd3,_0x16f2bb['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0xa59fe6,_0x26a41a){this['headerTitle']=_0xa59fe6,this['headerSubtitle']=_0x26a41a||'';}['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 ui(this['locale'],fi['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x3280d7=new _0x13ab0e(this['locale']),_0x3ff7ef=[];for(let _0x16deb4=0x0;_0x16deb4<0x10;_0x16deb4++){const _0x52685c=this['_createSkeletonLoader']();_0x52685c['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x3ff7ef['push'](_0x52685c);}return _0x3280d7['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x4ff88c=>!_0x4ff88c)]},'children':_0x3ff7ef}),_0x3280d7;}['_createErrorView'](){const _0x15c9ef=new _0x13ab0e(this['locale']),_0x9f2946=new _0x4e2d9f(this['locale']),t=this['locale']['t'];return _0x15c9ef['delegate']('retryReview')['to'](this),_0x9f2946['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x9f2946['on']('execute',()=>{this['fire']('retryReview');}),_0x15c9ef['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x49077=>!_0x49077),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x1004a7=>'chunk'===_0x1004a7)]},'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',_0x21a18a=>'chunk'===_0x21a18a)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0xea4350=>'general'!==_0xea4350)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x27af65=>'chunk'!==_0x27af65)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x9f2946]}),_0x15c9ef;}['_createCancelButtonView'](){const _0x44f3af=new _0x4e2d9f(this['locale']);return _0x44f3af['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x3d3372}),_0x44f3af['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5f303e=>_0x5f303e),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x17fbac=>_0x17fbac)]}}),_0x44f3af['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x44f3af;}['_createToggleDiffButtonView'](){const _0x51af9c=new _0x4e2d9f(this['locale']);_0x51af9c['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x51af9c['bind']('isEnabled')['to'](this,'isError',_0x28df40=>!_0x28df40),_0x51af9c['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x39beed=>!_0x39beed),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1ccd5e=>_0x1ccd5e)]}});const _0x5d681e=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x43d806=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x51af9c['bind']('isOn')['to'](this,'isToggleDiffOn',_0x34d9b7=>_0x34d9b7),_0x51af9c['bind']('icon')['to'](this,'isToggleDiffOn',_0x29152d=>_0x29152d?_0x344a06:_0x2721df),_0x51af9c['bind']('label')['to'](this,'isToggleDiffOn',_0xa4f256=>_0xa4f256?_0x5d681e:_0x43d806),_0x51af9c['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x51af9c;}['_createAcceptAllButtonView'](){const _0x2f4f02=new _0x4e2d9f(this['locale']);return _0x2f4f02['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x2f4f02['bind']('isEnabled')['to'](this,'isError',_0x419d20=>!_0x419d20),_0x2f4f02['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5ef62e=>!_0x5ef62e),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2bd69c=>_0x2bd69c)]}}),_0x2f4f02['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x2f4f02;}['_createExitReviewButtonView'](){const _0xacff5d=new _0x4e2d9f(this['locale']);return _0xacff5d['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0xacff5d['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x34a699=>!_0x34a699),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x50334c=>_0x50334c)]}}),_0xacff5d['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0xacff5d;}['_createResultHeaderView'](){const _0x538726=new _0x13ab0e(this['locale']),_0x3ac43f=this['_createTitleView']();return _0x538726['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x191df5=>_0x191df5)]},'children':[_0x3ac43f,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x538726;}['_createTitleView'](){const _0x5babec=new _0x13ab0e(this['locale']),_0x1eb41a=new pi();return _0x1eb41a['bind']('isVisible')['to'](this,'isResultReady',_0x5ac5ec=>!_0x5ac5ec),_0x5babec['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x1eb41a,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1ccf64=>_0x1ccf64)]},'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',_0x564959=>!_0x564959)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x5babec;}['_createFinishReviewButtonView'](){const _0x138dd6=new _r(i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x138dd6['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0xec24b9=>!_0xec24b9)]}}),_0x138dd6['delegate']('finishReview')['to'](this),_0x138dd6;}}class be extends _0x27607e{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x112983,_0x4140ab){super(_0x112983),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x4140ab['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x4140ab['headerText']);const _0x20c892=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x20c892['if']('isVisible','ck-hidden',_0x76d469=>!_0x76d469)]},'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':_0x4140ab['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x240bf1){const _0x419388=new _r(_0x240bf1,this['locale']);return _0x419388['delegate']('finishReview')['to'](this),_0x419388;}['_createResultHeaderView'](_0x55c4a8){const _0x18da6c=new _0x13ab0e(this['locale']);return _0x18da6c['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':_0x55c4a8}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x18da6c;}}class Dr extends _0x13ab0e{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x29979b,_0xda299f){super(_0x29979b),this['_defaultValue']=_0xda299f['default']||(_0xda299f['data']['length']>0x0?_0xda299f['data'][0x0]['id']:''),this['_defaultLabel']=_0xda299f['data']['find'](_0x57c4fb=>_0x57c4fb['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0xb2afd1(this['locale']);const _0x4307f3=this['_prepareListOptions'](_0xda299f['data']);_0x319e41(this['_dropdownView'],_0x4307f3,{'role':'menu','ariaLabel':_0xda299f['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1a8de3=>{_0x1a8de3['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x3106de=>{this['formValue']=_0x3106de['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x3106de['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'](_0x22a445=[]){const _0x176323=new _0x537dd4();this['resetToDefault']();for(const _0x3924f1 of _0x22a445){const _0x4de652=new _0x26835d({'label':_0x3924f1['label'],'withText':!0x0,'role':'menuitemradio','id':_0x3924f1['id'],'model':_0x3924f1});_0x4de652['bind']('isOn')['to'](this,'formValue',_0x12c57a=>_0x12c57a===_0x4de652['id']);const _0x25bc5b={'type':'button','model':_0x4de652};_0x176323['add'](_0x25bc5b);}return _0x176323;}}class cc extends _0x27607e{['_formItem']=null;constructor(_0x42b812,_0x5a8964,_0x4d935c){super(_0x42b812),this['argsKey']=_0x5a8964?.['argsKey'];if('dropdown'===_0x5a8964['formType'])this['_formItem']=new Dr(this['locale'],_0x5a8964);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x3f6f67=new _0x41c5ae(this['locale'],{'children':[this['_formItem']],'class':[_0x4d935c?'ck-form__row_with-submit':'']});_0x4d935c&&_0x3f6f67['children']['add'](_0x4d935c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x3f6f67]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class po extends _0x5eb035{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x27237f){super(_0x27237f),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x2ecfe9(),this['minRows']=po['MIN_ROWS'],this['maxRows']=po['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class rc extends _0x13ab0e{['focusTracker']=new _0x39e72a();['keystrokes']=new _0x2ecfe9();['focusCycler'];['_focusables']=new _0x1562eb();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x92b61d,_0x299bbe,_0x2d2019=!0x1){super(_0x92b61d),this['_check']=_0x299bbe,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x299bbe['defaultModel']?_0x299bbe['defaultModel']['id']:'',this['_defaultLabel']=_0x299bbe['defaultModel']?_0x299bbe['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x25e34(this['locale'],()=>new po(_0x92b61d)),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 _0x537dd4(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x2d2019),_0x319e41(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x41c5ae(this['locale'],{'children':[this['promptInputView']]}),new _0x41c5ae(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x35d360,_0x4968dd)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x4968dd()):_0x4968dd();}),this['focusCycler']=new _0x2ca20b({'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'](_0x4685cd=>{this['_focusables']['add'](_0x4685cd),this['focusTracker']['add'](_0x4685cd['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 _0x4b5cc1 of this['_getFormValidators']()){const _0x664bf0=_0x4b5cc1();if(_0x664bf0)return this['promptInputView']['errorText']=_0x664bf0,!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 _0x120a94=new _0x4e2d9f(this['locale']),t=this['locale']['t'];return _0x120a94['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x120a94['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x120a94;}['_createCancelButtonView'](){const _0xd6882a=new _0x4e2d9f(this['locale']),t=this['locale']['t'];return _0xd6882a['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0xd6882a['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5ba0a2=>{_0x5ba0a2['stopPropagation']();})}}),_0xd6882a['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0xd6882a;}['_setModelList'](_0xaf806d){this['_modelSelectionDropdownItems']['clear']();const _0x1c232c=this['_check']['models'];if(_0xaf806d)this['set']('modelDisplayMode','hidden');else{const _0x88428b=0x1===_0x1c232c['length'];this['set']('modelDisplayMode',_0x88428b?'name':'selector');}if(this['resetToDefault'](),_0x1c232c?.['length']){0x1===_0x1c232c['length']&&this['set']('activeModelName',_0x1c232c[0x0]['name']||_0x1c232c[0x0]['id']);for(const _0x32da3c of _0x1c232c){const _0x3006c9=new _0x26835d({'label':_0x32da3c['name'],'withText':!0x0,'role':'menuitemradio','id':_0x32da3c['id'],'model':_0x32da3c});_0x3006c9['bind']('isOn')['to'](this,'modelId',_0x56e2e4=>_0x56e2e4===_0x32da3c['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x3006c9,'labelView':new ko(this['locale'],_0x32da3c)});}}}['_createModelSelectionDropdown'](){const _0x5b9281=_0xb2afd1(this['locale']);return _0x5b9281['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x5b9281['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x5b9281['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x41daf6=>'selector'===_0x41daf6),this['listenTo'](_0x5b9281,'execute',_0x5bb552=>{this['modelId']=_0x5bb552['source']['model']['id'],_0x5b9281['buttonView']['label']=_0x5bb552['source']['label'];}),_0x5b9281;}['_createModelNameView'](){const _0x82659d=new _o(this['locale']);return _0x82659d['bind']('text')['to'](this,'activeModelName',_0x240a0b=>_0x240a0b??''),_0x82659d['bind']('isVisible')['to'](this,'modelDisplayMode',_0x295802=>'name'===_0x295802),_0x82659d;}['_createActionsFooterView'](){const _0xefc7d=new _0x13ab0e(this['locale']);return _0xefc7d['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']]}]}),_0xefc7d;}}class _o extends _0x13ab0e{constructor(_0x5c04c4){super(_0x5c04c4),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x4c8773=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x4c8773['if']('isVisible','ck-hidden',_0x36c094=>!_0x36c094)]},'children':[{'text':_0x4c8773['to']('text')}]});}}class ko extends _0x9d7a0a{constructor(_0x56eae4,_0x5c00d1){super();const _0x488fdd=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x488fdd['to']('style'),'id':_0x488fdd['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x488fdd['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x5c00d1['description']||'']}]}]});}}class ic extends _0x27607e{['_formItemsCollection']=new _0x1562eb();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x230e73,_0x343019,_0x10d939,_0x308671=!0x1){super(_0x230e73),this['_hideModels']=_0x308671,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x343019['isParameterized']);const _0x366c66=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',_0x3cf25e=>_0x3cf25e),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x3d7a5d=>_0x3d7a5d)],'style':{'--ck-ai-review-check-list-item-index':_0x10d939}},'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':_0x343019['title']}]},_0x366c66]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x343019['description']?[{'text':_0x343019['description']}]:[]}]}]},..._0x343019['isParameterized']?[this['_createParameterizedView'](_0x343019)]:[],...'custom'===_0x343019['id']?[this['_createCustomView'](_0x343019,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x343019['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x343019['id'],'args':_0x343019['useArgs']?_0x343019['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x570ad6({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x19ca68=>{_0x19ca68['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x2a6b80=new _0x5495d5();return _0x2a6b80['content']=_0x3d211d,_0x2a6b80['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x2a6b80;}['_createParameterizedView'](_0x57e6e7){const _0x57c83f=new _0x13ab0e(),_0x61c886=this['_createFormView'](_0x57e6e7);return _0x57c83f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x36875d=>!_0x36875d)]},'children':[_0x61c886]}),_0x57c83f;}['_createFormView'](_0x406f3a){const _0x49266b=new _0x13ab0e(),_0x2ed08f=Array['isArray'](_0x406f3a['options'])?_0x406f3a['options']:[],_0x23861e=new _0x4e2d9f(this['locale']),t=this['locale']['t'];_0x23861e['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x23861e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5674b1=>{_0x5674b1['stopPropagation']();})}}),_0x23861e['on']('execute',()=>{const _0x742060=[],_0x4ae658={};this['_formItemsCollection']['forEach'](_0x146f78=>{_0x742060['push'](_0x146f78['value']),_0x406f3a['useArgs']&&_0x406f3a['options']&&(_0x4ae658[_0x146f78['argsKey']]=_0x146f78['value']);}),this['fire']('runReviewCheck',{'id':_0x406f3a['id'],'params':_0x742060['length']?_0x742060:void 0x0,'args':Object['keys'](_0x4ae658)['length']?_0x4ae658:void 0x0});});const _0x4596eb=_0x2ed08f['length'];return _0x2ed08f['forEach']((_0x240630,_0x55a77e)=>{const _0x412a40=_0x55a77e===_0x4596eb-0x1;this['_formItemsCollection']['add'](new cc(this['locale'],_0x240630,_0x412a40?_0x23861e:null));}),_0x49266b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x49266b;}['_createCustomView'](_0xc438b6,_0x26add8=!0x1){return this['_customCheckView']=new rc(this['locale'],_0xc438b6,_0x26add8),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',_0x68b17=>!_0x68b17)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x2d2973,_0x50f9e6,_0x41884e)=>{_0x41884e||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class je extends _0x27607e{['_checkViews'];constructor(_0x23a36f){super(_0x23a36f),this['_checkViews']=new _0x1562eb(),this['_setupTemplate']();}['setChecks'](_0x52c90c,_0xcd6def=!0x1){this['_checkViews']['clear']();for(const [_0x5bde92,_0x3d40de]of _0x52c90c['entries']()){const _0x52b204=new ic(this['locale'],_0x3d40de,_0x5bde92,_0xcd6def);_0x52b204['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x52b204);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x528587 of this['_checkViews'])_0x528587 instanceof ic&&_0x528587['resetToDefault']();}['_setupTemplate'](){const _0x5ab366=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x5ab366['if']('isVisible','ck-hidden',_0x144788=>!_0x144788)]},'children':this['_checkViews']});}}class ge extends Me{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0xb484b5=this['context']['locale'],_0x1e76f9=new _0x41a033(_0xb484b5,{'label':i(_0xb484b5,'AI_REVIEW_MODE'),'icon':_0x42b4b2,'class':'ck-ai-header\x20ck-ai-header_review'});return new Ae(this['context']['locale'],{'header':_0x1e76f9,'list':new je(_0xb484b5),'results':new Ve(_0xb484b5,{'generalErrorText':i(_0xb484b5,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0xb484b5,{'headerText':i(_0xb484b5,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':i(_0xb484b5,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0xb484b5,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x1ff5c8=this['context']['plugins']['get']('AITabs');_0x1ff5c8['view']['on']('activateTab',(_0x38a19c,_0x1f2849)=>{'reviewMode'===_0x1f2849?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x1ff5c8['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x42b4b2,'order':0x0,'content':this['_mainView']});}}const fe='review-';class de extends _0x479a76{static get['requires'](){return[_0x18ff34,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(_0x55c3c6){super(_0x55c3c6),this['_domEmitter']=new(_0x2c2f77())(),this['_eventEmitter']=new(_0x5d3056())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x1003d1=T(this['context']);_0x1003d1['conversion']['for']('editingDowncast')['markerToElement']({'model':fe+'insert','view':(_0x3ca66f,{writer:_0x5d6319})=>{const _0x2ad64d=this['_markers']['get'](_0x3ca66f['markerName']),_0x220d15={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x2ad64d?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x3ca66f['markerName']};return _0x5d6319['createUIElement']('span',_0x220d15,function(_0x3fee38){const _0x31a21a=this['toDomElement'](_0x3fee38);return _0x31a21a['innerHTML']=_0x2ad64d?.['content']?.['asString']||'',_0x31a21a;});}}),_0x1003d1['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-only','view':_0x3d7205=>{const _0x2ec22c=this['_markers']['get'](_0x3d7205['markerName']),_0x3950d2=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x2ec22c?.['id']||'')&&_0x3950d2['push']('ck-ai_review__change_active'),{'classes':_0x3950d2,'attributes':{'data-marker-id':_0x3d7205['markerName']}};}}),_0x1003d1['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-context','view':_0x18e972=>{const _0x364645=this['_markers']['get'](_0x18e972['markerName']),_0x1b8643=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x364645?.['id']||'')&&_0x1b8643['push']('ck-ai_review__change_active'),{'classes':_0x1b8643,'attributes':{'data-marker-id':_0x18e972['markerName']}};}}),_0x1003d1['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-text','view':_0x34e176=>{const _0xaba302=this['_markers']['get'](_0x34e176['markerName']),_0x5cfe34=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0xaba302?.['id']||'')&&_0x5cfe34['push']('ck-ai_review__change_active'),{'classes':_0x5cfe34,'attributes':{'data-marker-id':_0x34e176['markerName']}};}}),_0x1003d1['conversion']['for']('dataDowncast')['markerToElement']({'model':fe+'suggestion-context','view':(_0x236b0d,{writer:_0xd58d97})=>_0xd58d97['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x236b0d['isOpening']?'start':'end')})}),_0x1003d1['conversion']['for']('downcast')['attributeToAttribute']({'model':Ct,'view':_0x35106c});const _0x299da4=_0x1003d1['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x299da4,'mouseup',(_0xf59968,_0x2ebb4b)=>{const _0x1cf17b=_0x2ebb4b['target'],_0x360c2b=this['_findMarkerElement'](_0x1cf17b);if(!_0x360c2b)return;const _0x572c24=_0x360c2b['getAttribute']('data-marker-id'),_0x4a2665=_0x572c24['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x572c24,'changeId':_0x4a2665,'markerElement':()=>this['_findMarkerElementById'](_0x572c24),'domEvent':_0x2ebb4b});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x299da4,'mouseover',(_0x4a901d,_0x564a32)=>{const _0x45e895=_0x564a32['target'],_0x5cb0b8=_0x564a32['relatedTarget'];let _0x4f4542=this['_findMarkerElement'](_0x45e895);if(!_0x4f4542&&_0x5cb0b8&&(_0x4f4542=this['_findMarkerElement'](_0x5cb0b8)),!_0x4f4542)return;const _0x25a768=_0x4f4542['getAttribute']('data-marker-id'),_0x35236a=_0x25a768['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x35236a,'markerElement':()=>this['_findMarkerElementById'](_0x25a768),'domEvent':_0x564a32});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x661314((_0x5d41c5,_0x2454ad)=>{const _0x5bf943=_0x2454ad['target'];if(this['_findMarkerElement'](_0x5bf943))return;_0x5bf943['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x1003d1['model']['document']['registerPostFixer'](_0x33cf67=>this['_validateMarkers'](_0x1003d1,_0x33cf67)),_0x1003d1['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x1003d1));}['getDocumentData'](){const _0x1bfcfd=this['context']['plugins']['get']('AIEditing'),_0x8a641d=T(this['context']),_0x89fcd3=_0x8a641d['model'],_0x1e4bbb=new tt();for(const _0x4a748a of _0x89fcd3['document']['getRoot']()['getChildren']()){const _0x2e037c=_0x4a748a['_clone'](!0x0);_0x1e4bbb['_appendChild'](_0x2e037c);}for(const _0x145bd6 of _0x89fcd3['markers'])_0x1e4bbb['markers']['set'](_0x145bd6['name'],this['_changeRangeOwnerDocument'](_0x145bd6['getRange']()['clone'](),_0x1e4bbb));const _0x1c462d=new _0x5445d5({'ignoreElementEnd':!0x0,'startPosition':_0x89fcd3['createPositionAt'](_0x1e4bbb,0x0)}),_0x1d2212=new Set(),_0xdff36c=new Map();for(const {item:_0x5c399e}of _0x1c462d){if(!_0x5c399e['is']('$textProxy'))continue;const _0x467db5=_0x5c399e['parent'];if(_0x467db5&&_0x467db5['is']('element')){const _0x45e0dc=this['_upsertDataId'](_0x467db5,()=>_0x1bfcfd['_nextDataId'](_0x1d2212));_0x1d2212['add'](_0x45e0dc);for(const _0x10b596 of _0x467db5['getChildren']())_0x10b596['is']('element')&&_0x1d2212['add'](this['_upsertDataId'](_0x10b596,()=>_0x1bfcfd['_nextDataId'](_0x1d2212)));let _0x2f0dad=_0x467db5;for(;_0x2f0dad['parent']&&!_0x2f0dad['parent']['is']('documentFragment');)_0x2f0dad=_0x2f0dad['parent'],_0x2f0dad['hasAttribute'](Ct)&&_0x2f0dad['_removeAttribute'](Ct);_0xdff36c['set'](_0x45e0dc,{'path':_0x467db5['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x2f0dad['_clone'](!0x0),_0x45e0dc,_0x8a641d['data'])}),_0x1c462d['jumpTo'](_0x89fcd3['createPositionAfter'](_0x467db5));}}return{'content':_0x8a641d['data']['processor']['toData'](_0x8a641d['data']['toView'](_0x1e4bbb)),'version':_0x8a641d['model']['document']['version'],'elements':_0xdff36c};}['diffContent'](_0x1fa460,_0x5916c9,_0x4c89ed=!0x1){const _0x10b59a=[],_0x5c0091=T(this['context']),_0x534494=_0x5c0091['data']['parse'](_0x5916c9,'$documentFragment'),_0x1acf48=_0x5c0091['data']['parse'](_0x1fa460,'$documentFragment'),_0x5b618f=_0x5c0091['model']['createPositionAt'](_0x1acf48,0x0);if(this['_haveSingleTopLevelElement'](_0x534494)){if(!this['_hasSameTopLevelElement'](_0x1acf48,_0x534494))return _0x10b59a;}else{const _0x1e45d3=_0x5c0091['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x1acf48,_0x1e45d3)||!this['_haveOnlyInlineContent'](_0x534494,_0x1e45d3))return _0x10b59a;}const _0x105311=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x1fa460,_0x5916c9,{'anchor':_0x5b618f,'markDeletions':!0x0})['getOperations']()['filter'](_0x4b980d=>'insert'===_0x4b980d['type']||'marker'===_0x4b980d['type']&&_0x4b980d['name']['startsWith']('$markedRemove')),_0x1d096f=this['_groupAdjacentOperations'](_0x105311),_0x138c78=[];if(_0x4c89ed){if(_0x1d096f['length']){const _0x199ef9=_0x1d096f[0x0]['operations'][0x0],_0x579841='insert'===_0x199ef9['type']?_0x199ef9['position']:_0x199ef9['newRange']['start'],_0xd9d140=this['_getPositionLimitingRange'](_0x579841,_0x5c0091,'inside'),_0x288419=_0xd9d140?_0x534494['getChild'](0x0)['getChildren']():_0x534494['getChildren'](),_0x1f1316=_0xd9d140||_0x5c0091['model']['createRangeIn'](_0x1acf48),_0x1cc55f=[new _0x4f8962('$markedRemove:synthetic'+_0x3d9d4e(),null,_0x1f1316,_0x5c0091['model']['document']['model']['markers'],!0x0,_0x5c0091['model']['document']['version']+0x1),new _0x1f1f5c(_0x1f1316['end'],_0x288419,_0x5c0091['model']['document']['version']+0x2)];_0x138c78['push']({'operations':_0x1cc55f,'operationsIsolated':_0x1cc55f,'groupOffset':0x0});}}else _0x138c78['push'](..._0x1d096f);let _0x585f0c=0x0;return _0x5c0091['model']['change'](_0x232eb2=>{for(let _0x2b2b0e=0x0;_0x2b2b0e<_0x138c78['length'];_0x2b2b0e++){const _0x1fcbe8=_0x138c78[_0x2b2b0e],_0x356f4e=_0x232eb2['createDocumentFragment']();for(const _0x446b7c of _0x1acf48['getChildren']())_0x232eb2['append'](_0x446b7c['_clone'](!0x0),_0x356f4e);for(const _0x3743bc of _0x1fcbe8['operationsIsolated'])if('insert'===_0x3743bc['type']){const _0x340f03=_0x3743bc;_0x340f03['baseVersion']=null,_0x340f03['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x340f03,_0x356f4e),_0x232eb2['batch']['addOperation'](_0x3743bc),_0x5c0091['model']['applyOperation'](_0x3743bc);const _0x2c3038='suggestion:insertion:id:authorId:'+_0x585f0c++,_0x291852=_0x5c0091['model']['createRange'](_0x340f03['position'],_0x340f03['position']['getShiftedBy'](_0x340f03['howMany']));_0x356f4e['markers']['set'](_0x2c3038,_0x291852);}else{if('marker'===_0x3743bc['type']&&_0x3743bc['name']['startsWith']('$markedRemove')){const _0x921116=_0x3743bc,_0x475712='suggestion:deletion:id:authorId:'+_0x585f0c++;this['_changeOperationOwnerDocument'](_0x921116,_0x356f4e),_0x356f4e['markers']['set'](_0x475712,_0x921116['newRange']);}}if(_0x4c89ed)_0x10b59a['push']({..._0x1fcbe8,'context':this['_createGetContentFn'](_0x1acf48,_0x5c0091['data']),'content':this['_createGetContentFn'](_0x1acf48,_0x5c0091['data'])});else{const _0x2ea946=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x1fcbe8['operationsIsolated'][0x0]),_0x356f4e),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x1fcbe8['operationsIsolated'][_0x1fcbe8['operationsIsolated']['length']-0x1]),_0x356f4e));_0x356f4e['markers']['set'](fe+'suggestion-context',new it(_0x2ea946['start'],_0x2ea946['end'])),_0x10b59a['push']({..._0x1fcbe8,'context':this['_createGetContextFn'](_0x356f4e,_0x5c0091['data'],{'ellipsisBefore':_0x2ea946['hasContentBefore'],'ellipsisAfter':_0x2ea946['hasContentAfter']}),'content':this['_createGetContentFn'](_0x356f4e,_0x5c0091['data'])});}}}),_0x10b59a;}['markChangePositionInEditorContent'](_0x178030,_0x5db057){if(!_0x178030['length'])return;const _0x2da3be=_0x178030[0x0]['parent']['id'],_0x50f4c8=_0x5db057['elements']['get'](_0x2da3be);if(!_0x50f4c8)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x2da3be);const _0x4acd59=_0x50f4c8['path'],_0x4c7734=T(this['context']),_0x3f220d=_0x4c7734['model']['document']['history']['getOperations'](_0x5db057['version']),_0x5c5c2f=[];for(const _0x1f5075 of _0x178030){const _0x3cb991=_0x1f5075['operationsIsolated']['map'](_0x210c27=>this['_translateOperationToEditorContent'](_0x210c27,_0x4acd59,_0x4c7734['model']['document']['getRoots']()[0x0]));if(!_0x3cb991||!_0x3cb991['length'])continue;const _0x299c21=_0x3cb991['every'](_0x500ce2=>'marker'===_0x500ce2['type']&&_0x500ce2['name']['startsWith']('$markedRemove')),_0x3b9d3a={'document':_0x4c7734['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x1352c1=nt(_0x3cb991,_0x3f220d,_0x3b9d3a)['operationsA'];for(const _0x51922f of _0x1352c1)if('insert'===_0x51922f['type']){const _0x3837a0=_0x51922f,_0x231db4=_0x3837a0['nodes'];_0x4c7734['model']['change'](_0x4da960=>{const _0x3fb116=_0x4da960['createDocumentFragment']();for(const _0x23ef9f of _0x231db4)_0x4da960['append'](_0x23ef9f['_clone'](!0x0),_0x3fb116);_0x5c5c2f['push']({'start':_0x3837a0['position'],'end':_0x3837a0['position'],'type':'insert','groupId':_0x1f5075['id'],'content':{'asString':this['_createGetContentFn'](_0x3fb116,_0x4c7734['data'])(),'asFragment':_0x3fb116}});});}else{if('marker'===_0x51922f['type']&&_0x51922f['name']['startsWith']('$markedRemove')){const _0x334232=_0x51922f;let _0x5da044='remove-text';if(_0x299c21){const _0xec4fe8=this['_findAdjacentContextDistance'](_0x334232['newRange']['start'],'backward',_0x4c7734['model']['schema']),_0x4b26a0=this['_findAdjacentContextDistance'](_0x334232['newRange']['end'],'forward',_0x4c7734['model']['schema']);if(_0xec4fe8||_0x4b26a0){const _0x224742=_0x334232['newRange']['start']['getShiftedBy'](-_0xec4fe8),_0x1b0f1d=_0x334232['newRange']['end']['getShiftedBy'](_0x4b26a0);_0x5c5c2f['push']({'start':_0x224742,'end':_0x1b0f1d,'groupId':_0x1f5075['id'],'type':'remove-context'});}else _0x5da044='remove-only';}_0x5c5c2f['push']({'start':_0x334232['newRange']['start'],'end':_0x334232['newRange']['end'],'groupId':_0x1f5075['id'],'type':_0x5da044});}}}this['_insertMarkers'](_0x5c5c2f);}['clearAllMarkers'](){const _0x2e57a5=T(this['context']);_0x2e57a5['model']['change'](_0x46bbf6=>{for(const _0x242c6a of this['_markers']['keys']())_0x2e57a5['model']['markers']['get'](_0x242c6a)&&_0x46bbf6['removeMarker'](_0x242c6a);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){T(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){T(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x50a759){const _0x6afb7c=T(this['context']),_0x41b959=_0x6afb7c['model'],_0x1b1488=_0x50a759['map'](_0x26636a=>this['_getMarkersDataForGroup'](_0x26636a))['flat']();_0x41b959['change'](_0x51f636=>{for(const _0x1b7f0d of _0x1b1488){const _0x3fc633=_0x6afb7c['model']['markers']['get'](_0x1b7f0d['id']);if(_0x3fc633){if('insert'===_0x1b7f0d['type']){if(!_0x1b7f0d['content'])continue;_0x41b959['insertContent'](_0x1b7f0d['content']['asFragment']||null,_0x3fc633['getRange']()['start']);}else'remove-text'!==_0x1b7f0d['type']&&'remove-only'!==_0x1b7f0d['type']||_0x41b959['deleteContent'](_0x41b959['createSelection'](_0x3fc633['getRange']()));_0x51f636['removeMarker'](_0x1b7f0d['id']),this['_markers']['delete'](_0x1b7f0d['id']);}}});}['rejectChange'](_0x5c7c5c){const _0x168aa2=T(this['context']),_0x59df38=this['_getMarkersDataForGroup'](_0x5c7c5c);_0x168aa2['model']['change'](_0x57370d=>{for(const _0x3ceb40 of _0x59df38)_0x57370d['removeMarker'](_0x3ceb40['id']),this['_markers']['delete'](_0x3ceb40['id']);});}['getEditor'](){return T(this['context']);}['getMarkerElementForChange'](_0x43dae5){const _0x4bbddb=Array['from'](this['_markers']['values']())['filter'](_0x5b47ae=>_0x5b47ae['groupId']===_0x43dae5);if(!_0x4bbddb['length'])return null;const _0x549cd1=0x1===_0x4bbddb['length']?_0x4bbddb[0x0]:this['_sortMarkers'](_0x4bbddb)[0x0],_0x106ae3=T(this['context'])['model']['markers']['get'](_0x549cd1['id']);if(!_0x106ae3)return null;return{'modelRange':_0x106ae3['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x549cd1['id'])};}['getContentElementForChange'](_0x4aa8e4){const _0x319773=Array['from'](this['_markers']['values']())['filter'](_0x374f76=>_0x374f76['groupId']===_0x4aa8e4);if(!_0x319773['length'])return null;const _0x11d355=0x1===_0x319773['length']?_0x319773[0x0]:this['_sortMarkers'](_0x319773)[0x0],_0x16e992=T(this['context']),_0x573b00=_0x16e992['model']['markers']['get'](_0x11d355['id']);if(!_0x573b00)return null;const _0x48c5b2=_0x573b00['getRange'](),_0x379c4a=_0x16e992['editing']['view']['getDomRoot']();if(!_0x379c4a||!_0x48c5b2)return null;let _0x4b2cf5=_0x48c5b2['start']['parent'];for(;_0x4b2cf5['parent']&&'$root'!==_0x4b2cf5['parent']['name'];)_0x4b2cf5=_0x4b2cf5['parent'];if(!_0x4b2cf5||!_0x4b2cf5['name'])return null;const _0x2e5527=_0x379c4a['querySelector']('[data-marker-id=\x22'+_0x11d355['id']+'\x22]');if(!_0x2e5527)return null;let _0xb77283=null;_0x16e992['model']['change'](_0x4b6a7e=>{_0xb77283=_0x4b6a7e['createDocumentFragment'](),_0x4b6a7e['append'](_0x4b2cf5['_clone'](!0x0),_0xb77283);});const _0x4096c4=_0x16e992['data']['toView'](_0xb77283)['getChild'](0x0);return _0x2e5527['closest'](_0x4096c4['name']);}['reactivateMarkers'](_0x15a9e6){const _0x69066c=this['_getMarkersDataForGroup'](_0x15a9e6);if(!_0x69066c['length'])return;const _0x5847a1=Array['from'](this['_activeMarkers'])['sort'](),_0x5f1544=Array['from'](new Set(_0x69066c['map'](_0x3f3993=>_0x3f3993['id'])))['sort']();_0x5847a1['join']('|')!==_0x5f1544['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x15a9e6));}['setMarkersInElementAsActive'](_0x4c0686){const _0x120de9=this['_getMarkersDataForGroup'](_0x4c0686);if(!_0x120de9['length'])return;const _0x50bdba=T(this['context']),_0x44e7e1=new Set(_0x120de9['map'](_0x13ed52=>_0x13ed52['id'])),_0x196416=Array['from'](_0x44e7e1['values']())['map'](_0x36a423=>_0x50bdba['model']['markers']['get'](_0x36a423))['filter'](_0x3bba95=>!!_0x3bba95);_0x44e7e1['forEach'](_0x192a61=>{this['_activeMarkers']['add'](_0x192a61);}),_0x50bdba['model']['change'](()=>{_0x196416['forEach'](_0x39df5c=>{_0x50bdba['editing']['reconvertMarker'](_0x39df5c);});});}['setAllMarkersAsInactive'](){const _0x42bfae=Array['from'](this['_activeMarkers']);if(!_0x42bfae['length'])return;this['_activeMarkers']['clear']();const _0x31f027=T(this['context']),_0x22ac78=_0x42bfae['map'](_0x5b513b=>_0x31f027['model']['markers']['get'](_0x5b513b))['filter'](_0x4870e8=>!!_0x4870e8);_0x31f027['model']['change'](()=>{_0x22ac78['forEach'](_0x45422b=>{_0x31f027['editing']['reconvertMarker'](_0x45422b);});});}['_getPositionLimitingRange'](_0x433f1e,_0x48eed9,_0x2e58d4='outside'){if(!_0x433f1e)return null;let _0x1212fc=_0x433f1e['parent'];for(;_0x1212fc&&_0x1212fc['parent']&&'$root'!==_0x1212fc['parent']['name']&&!_0x48eed9['model']['schema']['isLimit'](_0x1212fc)&&!_0x48eed9['model']['schema']['isBlock'](_0x1212fc);)_0x1212fc=_0x1212fc['parent'];if(!_0x1212fc||!_0x1212fc['name']||'$root'===_0x1212fc['name'])return null;let _0x3fc038=null;return _0x48eed9['model']['change'](_0x38ceec=>{_0x3fc038='inside'===_0x2e58d4?_0x38ceec['createRangeIn'](_0x1212fc):_0x38ceec['createRangeOn'](_0x1212fc);}),_0x3fc038;}['_validateMarkers'](_0x2c5f84,_0x1b2820){const _0x528c71=Array['from'](this['_markers']['keys']()),_0x5f2b24=new Map();for(const _0x18c3e9 of _0x528c71){const _0x341663=_0x2c5f84['model']['markers']['get'](_0x18c3e9);if(!_0x341663)continue;const _0x2f4d2b=_0x341663['getStart']()['path'][0x0];_0x5f2b24['has'](_0x2f4d2b)||_0x5f2b24['set'](_0x2f4d2b,[]),_0x5f2b24['get'](_0x2f4d2b)['push'](_0x341663);}const _0x80e1c6=new Set();for(const _0x22f981 of _0x2c5f84['model']['document']['differ']['getChanges']()){let _0x357224=-0x1,_0x5d5ac0=null;if('insert'===_0x22f981['type'])_0x5d5ac0=new it(_0x22f981['position'],_0x22f981['position']['getShiftedBy'](_0x22f981['length'])),_0x357224=_0x22f981['position']['path'][0x0];else{if('remove'!==_0x22f981['type'])continue;_0x5d5ac0=new it(_0x22f981['position']),_0x357224=_0x22f981['position']['path'][0x0];}const _0x498ff8=_0x5f2b24['get'](_0x357224)||[];if(_0x498ff8['length']){for(const _0xf40f6b of _0x498ff8)if(_0x5d5ac0['root']['rootName']===_0xf40f6b['getRange']()['root']['rootName']&&('insert'!==_0x22f981['type']||!_0x5d5ac0['containsRange'](_0xf40f6b['getRange']()))&&(_0x5d5ac0['isIntersecting'](_0xf40f6b['getRange']())||_0x5d5ac0['start']['isTouching'](_0xf40f6b['getRange']()['end'])||_0x5d5ac0['end']['isTouching'](_0xf40f6b['getRange']()['start']))){const _0xfd0505=this['_parseMarkerName'](_0xf40f6b['name']);Array['from'](this['_markers']['values']())['filter'](_0xac2753=>_0xac2753['groupId']===_0xfd0505['groupId'])['forEach'](_0x533d71=>_0x80e1c6['add'](_0x533d71['id']));}}}if(_0x80e1c6['size']){for(const _0x449f1d of _0x80e1c6)_0x1b2820['removeMarker'](_0x449f1d);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x27a9f4){for(const {name:_0x5a1397,data:_0x35f332}of _0x27a9f4['model']['document']['differ']['getChangedMarkers']()){if(!_0x5a1397['startsWith'](fe))continue;const _0x36f547=_0x35f332['oldRange'],_0x170a74=_0x35f332['newRange'],_0x1f70cd=_0x36f547&&'$graveyard'===_0x36f547['root']['rootName'],_0x22faa1=_0x170a74&&'$graveyard'===_0x170a74['root']['rootName'];if(_0x1f70cd&&_0x22faa1)continue;const _0x2806bf=this['_parseMarkerName'](_0x5a1397);this['_markers']['get'](_0x5a1397)&&(_0x22faa1||!_0x170a74?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x5a1397,'changeId':_0x2806bf['groupId']}):_0x1f70cd&&_0x170a74&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x5a1397,'changeId':_0x2806bf['groupId']}));}}['_parseMarkerName'](_0x4a409e){const _0x39c45c=_0x4a409e['split'](':'),_0x23e59b=(_0x39c45c[0x1]||'')['split']('_');return{'prefix':_0x39c45c[0x0],'groupId':_0x23e59b[0x0],'suffix':_0x23e59b[0x1]};}['_translateOperationToEditorContent'](_0x4afbe0,_0x173284,_0x52fe33){if('insert'===_0x4afbe0['type']){const _0x248866=_0x4afbe0;return new _0x1f1f5c(this['_changePosition'](_0x173284['concat'](_0x248866['position']['offset']),_0x52fe33),_0x248866['nodes'],_0x248866['baseVersion']);}if('marker'===_0x4afbe0['type']&&_0x4afbe0['name']['startsWith']('$markedRemove')){const _0x1cb0f4=_0x4afbe0;return new _0x4f8962(_0x1cb0f4['name'],_0x1cb0f4['oldRange'],this['_changeRange'](_0x1cb0f4['newRange'],_0x173284['concat'](_0x1cb0f4['newRange']['start']['offset']),_0x173284['concat'](_0x1cb0f4['newRange']['end']['offset']),_0x52fe33),_0x1cb0f4['_markers'],_0x1cb0f4['affectsData'],_0x1cb0f4['baseVersion']);}return _0x4afbe0;}['_groupAdjacentOperations'](_0x338cff){if(!_0x338cff['length'])return[];const _0x947f45=[];let _0x4a3fc5=0x0,_0x13e908=0x0,_0x3f5b34=[];for(let _0x3f468e=0x0;_0x3f468e<=_0x338cff['length'];_0x3f468e++){const _0x427c7b=_0x338cff[_0x3f468e],_0x597623=_0x338cff[_0x3f468e-0x1];!_0x427c7b||_0x597623&&!this['_getOperationEnd'](_0x597623)['isTouching'](this['_getOperationStart'](_0x427c7b))?(_0x947f45['push']({'operations':_0x3f5b34,'operationsIsolated':_0x3f5b34['map'](_0x2384c8=>this['_shiftOperation'](_0x2384c8['clone'](),-_0x13e908)),'groupOffset':_0x4a3fc5}),_0x3f5b34=_0x427c7b?[_0x427c7b]:[],_0x13e908+=_0x4a3fc5,_0x4a3fc5=0x0):_0x3f5b34['push'](_0x427c7b),_0x427c7b&&'insert'===_0x427c7b['type']&&(_0x4a3fc5+=_0x427c7b['howMany']);}return _0x947f45;}['_findAdjacentContextDistance'](_0x89af96,_0x3babf5,_0x2166c4,_0x148c49=0x1){const _0xc07b05=new _0x5445d5({'startPosition':_0x89af96,'direction':_0x3babf5});let _0x387bed=0x0;for(let _0x59ef17=0x0;_0x59ef17<_0x148c49;_0x59ef17++){let _0x2dd361=0x0,_0x3cd411=!0x1,_0x2cd319='forward'===_0x3babf5?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x3f1e32}of _0xc07b05)if(_0x3f1e32['is']('$textProxy')){const _0x496af7=_0x2cd319['exec'](_0x3f1e32['data']);if(_0x496af7&&_0x496af7['length']){if(_0x2dd361+='forward'===_0x3babf5?_0x496af7['index']+_0x496af7[0x0]['length']:_0x3f1e32['data']['length']-_0x496af7['index'],_0x496af7[0x0]['length']!==_0x3f1e32['data']['length'])break;_0x3cd411=!0x0,_0x2cd319='forward'===_0x3babf5?/^\w+/:/\w+$/;}else{if(_0x3cd411)break;_0x2dd361+=_0x3f1e32['offsetSize'];}}else{if(_0x3f1e32['is']('element')){_0x2166c4['isInline'](_0x3f1e32)&&!_0x3cd411&&(_0x2dd361+=0x1);break;}}_0x387bed+=_0x2dd361,_0xc07b05['jumpTo'](_0x89af96['getShiftedBy']('forward'===_0x3babf5?_0x387bed:-_0x387bed));}return _0x387bed;}['_getChangeContext'](_0x906df8,_0x288d62){const _0x33062c=T(this['context'])['model']['schema'],_0x5d9573=this['_findAdjacentContextDistance'](_0x906df8,'backward',_0x33062c,0x6),_0x5c55f1=this['_findAdjacentContextDistance'](_0x288d62,'forward',_0x33062c,0x6),_0xd08fd0=_0x906df8['getShiftedBy'](-_0x5d9573),_0x4f8185=_0x288d62['getShiftedBy'](_0x5c55f1);return{'start':_0xd08fd0,'end':_0x4f8185,'hasContentBefore':!_0xd08fd0['isAtStart'],'hasContentAfter':!_0x4f8185['isAtEnd']};}['_insertMarkers'](_0x57b683){const _0x206bb6=this['context']['plugins']['get']('AIEditing'),_0x93e3ee=new Set();T(this['context'])['model']['change'](_0x1e1e2d=>{for(const _0x5b5506 of _0x57b683){const _0x435b2d=''+fe+_0x5b5506['type']+':'+_0x5b5506['groupId']+'_'+_0x206bb6['_nextDataId'](_0x93e3ee);this['_markers']['set'](_0x435b2d,{'id':_0x435b2d,'groupId':_0x5b5506['groupId'],'type':_0x5b5506['type'],'content':_0x5b5506['content']}),_0x1e1e2d['addMarker'](_0x435b2d,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1e1e2d['createRange'](_0x5b5506['start'],_0x5b5506['end'])});}});}['_createGetContextFn'](_0x14cbfd,_0x4601d5,_0x39d464){let _0x4e7873='';return()=>{if(!_0x4e7873){const _0xae876c=_0x4601d5['toView'](_0x14cbfd,{'showSuggestionHighlights':!0x0});let _0x2929a5=_0xae876c['getChild'](0x0);if(_0x2929a5['is']('containerElement')||(_0x2929a5=_0xae876c),!_0x2929a5)return'';let _0x1bbcdc=!0x1;const _0xf3d9b1=[];for(const _0x18c3cf of _0x2929a5['getChildren']())_0x18c3cf['is']('element','span')&&_0x18c3cf['hasClass']('ck-ai_review-marker_context-end')&&(_0x1bbcdc=!0x1),_0x1bbcdc&&_0xf3d9b1['push'](_0x18c3cf),_0x18c3cf['is']('element','span')&&_0x18c3cf['hasClass']('ck-ai_review-marker_context-start')&&(_0x1bbcdc=!0x0);_0x2929a5['_removeChildren'](0x0,_0x2929a5['childCount']),_0x39d464?.['ellipsisBefore']&&_0x2929a5['_appendChild']('…'),_0x2929a5['_appendChild'](_0xf3d9b1),_0x39d464?.['ellipsisAfter']&&_0x2929a5['_appendChild']('…');const _0x1faaed=_0x4601d5['htmlProcessor']['domConverter']['viewToDom'](_0xae876c),_0x400faf=_0x4601d5['htmlProcessor']['htmlWriter']['getHtml'](_0x1faaed);_0x4e7873=_0x400faf;}return _0x4e7873;};}['_createGetContentFn'](_0x5aeaf4,_0x10bf72){let _0x5b4293='';return()=>(_0x5b4293||(_0x5b4293=_0x10bf72['stringify'](_0x5aeaf4,{'showSuggestionHighlights':!0x0})),_0x5b4293);}['_createGetContentUsingDataIdFn'](_0x1a5f37,_0x58b476,_0xc23390){let _0x346ba7='';return()=>{if(!_0x346ba7){const _0x260814=_0xc23390['toView'](new tt(_0x1a5f37)),_0x496e13=_0xc23390['htmlProcessor']['domConverter']['viewToDom'](_0x260814)['querySelector']('[data-id=\x22'+_0x58b476+'\x22]');_0x346ba7=_0x496e13?.['outerHTML']||'';}return _0x346ba7;};}['_findMarkerElement'](_0x3b5a22,_0x46c35=0x5){let _0x5ed06e=_0x3b5a22,_0x16090f=null;for(let _0x2e8045=0x0;_0x2e8045<_0x46c35&&_0x5ed06e;_0x2e8045++){if(!_0x5ed06e['className']){_0x5ed06e=_0x5ed06e['parentElement'];continue;}if(!(''+_0x5ed06e['className'])['includes']('ck-ai_review-marker_')){_0x5ed06e=_0x5ed06e['parentElement'];continue;}if(!_0x5ed06e['getAttribute']('data-marker-id'))break;_0x16090f=_0x5ed06e;break;}return _0x16090f;}['_findMarkerElementById'](_0x1566ff){const _0x4d5c00=T(this['context']),_0x2a35e5=_0x4d5c00['model']['markers']['get'](_0x1566ff);return _0x2a35e5?_0x11ff21(_0x4d5c00['editing'],_0x2a35e5):null;}['_getMarkersDataForGroup'](_0x479257){return Array['from'](this['_markers']['values']())['filter'](_0x2ac19d=>_0x2ac19d['groupId']===_0x479257);}['_getOperationStart'](_0x3b4cc3){return'insert'===_0x3b4cc3['type']?_0x3b4cc3['position']:_0x3b4cc3['newRange']['start'];}['_getOperationEnd'](_0x591ae8,_0x4635c9=!0x1){return'insert'===_0x591ae8['type']?_0x4635c9?_0x591ae8['position']:_0x591ae8['position']['getShiftedBy'](_0x591ae8['howMany']):_0x591ae8['newRange']['end'];}['_shiftOperation'](_0x59fbef,_0x1dde17){return'insert'===_0x59fbef['type']?_0x59fbef['position']=_0x59fbef['position']['getShiftedBy'](_0x1dde17):'marker'===_0x59fbef['type']&&_0x59fbef['newRange']&&(_0x59fbef['newRange']=new it(_0x59fbef['newRange']['start']['getShiftedBy'](_0x1dde17),_0x59fbef['newRange']['end']['getShiftedBy'](_0x1dde17))),_0x59fbef;}['_changeOperationOwnerDocument'](_0x7eeb1d,_0x4d08a8){'insert'===_0x7eeb1d['type']?_0x7eeb1d['position']=this['_changePositionOwnerDocument'](_0x7eeb1d['position'],_0x4d08a8):'marker'===_0x7eeb1d['type']&&_0x7eeb1d['newRange']&&(_0x7eeb1d['newRange']=this['_changeRangeOwnerDocument'](_0x7eeb1d['newRange'],_0x4d08a8));}['_changePositionOwnerDocument'](_0x21838b,_0x474bd1){return new st(_0x474bd1,_0x21838b['path']);}['_changeRangeOwnerDocument'](_0x1ce6dc,_0x5a9e82){return new it(this['_changePositionOwnerDocument'](_0x1ce6dc['start'],_0x5a9e82),this['_changePositionOwnerDocument'](_0x1ce6dc['end'],_0x5a9e82));}['_changePosition'](_0x4c07fe,_0x2c5456){return new st(_0x2c5456,[..._0x4c07fe]);}['_changeRange'](_0xe2fdfc,_0x3b6a06,_0x56aa2e,_0x27ccc6){return new it(this['_changePosition'](_0x3b6a06,_0x27ccc6),this['_changePosition'](_0x56aa2e,_0x27ccc6));}['_sortMarkers'](_0x44924c){const _0x100e9f=_0x378a5a=>{switch(_0x378a5a){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x44924c['sort']((_0x38facb,_0x583be6)=>_0x100e9f(_0x38facb['type'])-_0x100e9f(_0x583be6['type']));}['_hasSameTopLevelElement'](_0x534599,_0x75b7d6){const _0x4d8cca=_0x534599['getChild'](0x0),_0x142aeb=_0x75b7d6['getChild'](0x0);return!(!_0x4d8cca||!_0x142aeb)&&((!_0x4d8cca['is']('element')||!_0x142aeb['is']('element')||_0x4d8cca['name']===_0x142aeb['name'])&&!(_0x4d8cca['is']('element')&&!_0x142aeb['is']('element')||!_0x4d8cca['is']('element')&&_0x142aeb['is']('element')));}['_haveSingleTopLevelElement'](_0x10778d){return 0x1===_0x10778d['childCount'];}['_haveOnlyInlineContent'](_0x1d3913,_0x2f0797){for(const _0x2d0d75 of _0x1d3913['getChildren']())if(_0x2d0d75['is']('element')&&!_0x2f0797['isInline'](_0x2d0d75))return!0x1;return!0x0;}['_upsertDataId'](_0xf81d45,_0xff0010){let _0x22121e=_0xf81d45['getAttribute'](Ct);return _0x22121e||(_0x22121e=_0xff0010(),_0xf81d45['_setAttribute'](Ct,_0x22121e)),_0x22121e;}}class Zs extends _0x5d3056(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x8130f3,contentNew:_0x38d9a2,contentInitial:_0x2c10d8,documentVersion:_0x460986}){super(),this['id']=_0x8130f3,this['contentNew']=_0x38d9a2,this['contentInitial']=_0x2c10d8,this['documentVersion']=_0x460986;}}class th extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x491cf2,_0x8c2eb9,_0x240eb7){super(),this['id']=_0x491cf2,this['parent']=_0x240eb7,this['_data']=_0x8c2eb9,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 eh extends ts(){['id']=_0x3d9d4e();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x2a508a,_0xb332c,_0x2bd30b,_0x26c419,_0x2bf828){super(),this['_sourceCheck']=_0xb332c,this['_documentData']=_0x2a508a,this['_aiConnector']=_0x2bd30b,this['_reviewParams']=_0x26c419,this['_reviewArgs']=_0x2bf828,this['on']('change:status',(_0x31e06d,_0x379ae7,_0x4342f9)=>{'aborted'==_0x4342f9&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x4342f9,'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'](_0x8681cd=>'pending'===_0x8681cd['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x553fea){this['_documentData']=_0x553fea;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x1583ec=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x241cb5 of _0x1583ec)'unmodified'!==_0x241cb5['data']['operation']&&('error'!==_0x241cb5['data']['operation']?'review-metadata'!==_0x241cb5['event']?this['_addReviewCheckResult'](_0x241cb5['data']['dataId'],_0x241cb5['data']['textDelta']):this['callId']=_0x241cb5['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(_0x55e788){this['_currentError']=_0x55e788,_0x55e788 instanceof Error&&_0x55e788['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'](_0x56d1c0,_0x49bd91){const _0x17d527=this['_results']['get'](_0x56d1c0);if(!_0x17d527)return;if(0x0===_0x49bd91['length'])return;const _0xa08b8=[];_0x49bd91['forEach']((_0x16d052,_0x2203c5)=>{const _0x426870=new th(_0x17d527['id']+'-'+_0x2203c5,_0x16d052,_0x17d527);_0x426870['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x426870,'status':_0x426870['status']});}),_0x426870['on']('change:isActivated',()=>{_0x426870['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x426870}):this['fire']('reviewCheckResultDeactivated',{'change':_0x426870});}),this['_changes']['push'](_0x426870),_0xa08b8['push'](_0x426870);}),this['fire']('reviewCheckResultReady',{'changes':_0xa08b8,'result':_0x17d527,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x26e871){const _0x4af1c9=this['_changes']['find'](_0x56f8e6=>_0x56f8e6['id']===_0x26e871);return!(!_0x4af1c9||'pending'!==_0x4af1c9['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x1237bd=>!0x0===_0x1237bd['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x315082=>'pending'===_0x315082['status']);}['getChangeById'](_0x232e87){return this['_changes']['find'](_0x41a839=>_0x41a839['id']===_0x232e87);}['markAllChangesAsAccepted'](){for(const _0x11fd59 of this['_changes'])'pending'===_0x11fd59['status']&&(_0x11fd59['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x42c229){const _0x17ab70=this['_changes']['find'](_0x559c27=>_0x559c27['id']===_0x42c229);_0x17ab70&&'pending'===_0x17ab70['status']&&(_0x17ab70['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x13c6ce){const _0x1a8d7c=this['_changes']['find'](_0xd44187=>_0xd44187['id']===_0x13c6ce);_0x1a8d7c&&'pending'===_0x1a8d7c['status']&&(_0x1a8d7c['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x3fa626){const _0x14bc0d=this['_changes']['find'](_0x310068=>_0x310068['id']===_0x3fa626);_0x14bc0d&&'pending'===_0x14bc0d['status']&&(_0x14bc0d['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x19df48){const _0x5d24a2=this['_changes']['find'](_0x88d8ba=>_0x88d8ba['id']===_0x19df48);_0x5d24a2&&'outdated'===_0x5d24a2['status']&&(_0x5d24a2['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x3cfb07){this['_changes']['filter'](_0x4b3bb2=>_0x4b3bb2['isActivated']&&_0x4b3bb2['id']!==_0x3cfb07)['forEach'](_0x1c56d6=>{_0x1c56d6['isActivated']=!0x1;});const _0x2785e0=this['_changes']['find'](_0x1ed035=>_0x1ed035['id']===_0x3cfb07);_0x2785e0&&'pending'===_0x2785e0['status']&&(_0x2785e0['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x697fcc=>_0x697fcc['isActivated'])['forEach'](_0x16c17f=>{_0x16c17f['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x485b39){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x3489e7;if(_0x485b39){const _0x157e2f=this['_changes']['find'](_0x454260=>_0x454260['id']===_0x485b39);if(_0x157e2f&&_0x157e2f['isRated'])return;_0x157e2f&&(_0x3489e7=_0x157e2f['parent']['id'],_0x157e2f['isRated']=!0x0);}const _0x5120b1={'positiveCount':this['_changes']['filter'](_0x5e7015=>'accepted'===_0x5e7015['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x5120b1,this['callId'],_0x3489e7);}['_addReviewCheckResult'](_0x4c9cac,_0x3194b3){const _0x233e15=this['_documentData']['elements']['get'](_0x4c9cac);if(!_0x233e15)return;const _0x3ff321=_0x233e15['getContent']();if(_0x3ff321===_0x3194b3)return;const _0x5111ce=new Zs({'id':_0x4c9cac,'contentInitial':_0x3ff321,'contentNew':_0x3194b3,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x5111ce['id'],_0x5111ce),this['fire']('reviewCheckResultAdded',{'result':_0x5111ce,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x1eab9a=>'pending'===_0x1eab9a['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x3c3728=>'pending'===_0x3c3728['status'])['length']&&(this['status']='finished'));}}class si extends eh{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0xce31af=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x48ce54=0x0;_0x48ce54<this['_reviewParams']['length'];_0x48ce54++){if(!this['_reviewParams'][_0x48ce54]||!this['_sourceCheck']['options'][_0x48ce54])continue;const _0x2bf2fe=this['_sourceCheck']['options'][_0x48ce54],_0x2d0cc9=_0x2bf2fe['data']?.['find'](_0x53ffd8=>_0x53ffd8['id']===this['_reviewParams'][_0x48ce54]);_0x2d0cc9&&_0xce31af['push'](_0x2d0cc9['label']);}return _0xce31af['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x415ec5,_0x1652d0,_0x37ef54){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x1652d0,_0x415ec5,_0x37ef54);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ve extends _0x479a76{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[q];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0x53e00f,_0x57a60f)=>{const _0x1cd6f6=this['_aiReviewCheckList']['getCheckById'](_0x57a60f['id']);if(_0x1cd6f6){this['_onReviewCheckRun'](_0x57a60f),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x57a60f,_0x1cd6f6),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x4dbd7f,_0xaa3087)=>{switch(_0xaa3087['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0xaa3087);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 _0x459533('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x459533('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'!==_0xaa3087['status']&&'error-chunk'!==_0xaa3087['status']&&'error-general'!==_0xaa3087['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x5d4b41,_0x4c8d1b)=>{if(!this['_currentReviewCheckRun'])throw new _0x459533('ai-review-mode-no-current-check-run',this);const _0x237c48=this['_diffContent'](_0x4c8d1b['result']['contentInitial'],_0x4c8d1b['result']['contentNew']);_0x4c8d1b['source']['addResultChanges'](_0x4c8d1b['result']['id'],_0x237c48);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x404751,_0x37bc16)=>{for(const _0xbeaad8 of _0x37bc16['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0xbeaad8);this['_markChangePositionInEditorContent'](_0x37bc16['changes'],_0x37bc16['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x4c7e73,_0x3525ff)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x3525ff['change']['id'],_0x3525ff['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x304f5f,_0x3174bd)=>{this['_onReviewCheckResultActivated'](_0x3174bd);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x475a34){_0x475a34 instanceof Error&&_0x475a34['message']['includes']('ai-request-aborted')||(_0x475a34 instanceof _0x459533?this['_logError'](_0x475a34):this['_logError'](new _0x459533('ai-review-mode-check-run-failed',this,void 0x0,_0x475a34)));}}else this['_logError'](new _0x459533('ai-review-mode-source-check-not-found',this,{'checkId':_0x57a60f['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 _0x583fa2=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x583fa2['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x583fa2['map'](_0x5ca985=>_0x5ca985['id']));const _0xec3201=this['_currentReviewCheckRun'];_0xec3201['markAllChangesAsAccepted'](),_0xec3201['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x2c2b76,_0x4c0226)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4c0226['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x4c0226['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x4c0226['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4c0226['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x327fb3,_0x1a33e6)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x1a33e6['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x1a33e6['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x1a33e6['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x1a33e6['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',(_0x501d61,_0x3ad6be)=>{this['_onActivateChange'](_0x3ad6be);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x55d0cc,_0x59cf1f)=>{this['_onDeactivateChange'](_0x59cf1f);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x153eeb,_0x275cfc)=>{this['_onChangeMarkerClicked'](_0x153eeb,_0x275cfc);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x2447ec,_0x3c7814)=>{this['_onChangeMarkerHovered'](_0x2447ec,_0x3c7814);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x496106,_0x4177a7)=>{this['_onChangeMarkerRemoved'](_0x496106,_0x4177a7);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x2c498f,_0x39a47d)=>{this['_onChangeMarkerRestored'](_0x2c498f,_0x39a47d);});}['_createReviewCheckRun'](_0x266985,_0x689b9b){return new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x689b9b,this['_aiConnector'],_0x266985['params'],_0x266985['args']);}['_onChangeMarkerRemoved'](_0xdd0f16,_0x19698a){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x19698a['changeId']);}['_onChangeMarkerRestored'](_0x1b057d,_0x923015){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x923015['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x1c2af0=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x1c2af0&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x5d26cf=this['_aiReviewCoreEditing']['getEditor']();_0x5d26cf&&_0x5d26cf['editing']['view']['change'](_0x270e27=>{const _0x14cfaf=_0x5d26cf['editing']['view']['document']['getRoot']();_0x270e27['removeClass']('ck-ai_review-diff',_0x14cfaf),_0x270e27['removeClass']('ck-ai_review-highlights',_0x14cfaf),_0x270e27['removeClass']('ck-ai-translate-mode-content',_0x14cfaf);});}['_getTranslationWithDefault'](_0x1614dd,_0x17868b){const _0x373501=i(this['context']['locale'],_0x1614dd);return _0x373501===_0x1614dd?_0x17868b:_0x373501;}['_logError'](_0x375f08,_0x281727=!0x1){gt(_0x375f08['message']),_0x281727||(_0x375f08['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x19cc1e){if('content'===this['_changeActivationSource']){const _0x4b99e6=this['_aiReviewCoreUi']['getChangeElement'](_0x19cc1e);_0x4b99e6&&_0x3df2b3(_0x4b99e6['closest']('.ck-ai_review__check-run-result')||_0x4b99e6);}else{if('panel'===this['_changeActivationSource']){const _0x4ede77=this['_getChangeContentElement'](_0x19cc1e);if(!_0x4ede77)return;_0x53c419({'target':_0x4ede77,'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 Ys{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x3d244a){this['id']=_0x3d244a['id'],this['commandId']=_0x3d244a['commandId'],this['title']=_0x3d244a['title'],this['description']=_0x3d244a['description'],this['isParameterized']=_0x3d244a['isParameterized'],this['useArgs']=_0x3d244a['useArgs'],this['options']=_0x3d244a['options'],this['args']=_0x3d244a['args'];}}class vo extends ts(){['_checks']=[];['setupChecks'](_0x5e9062){this['_checks']=_0x5e9062['map'](_0x29f01f=>new Ys(_0x29f01f));}get['checks'](){return this['_checks'];}['getCheckById'](_0x3e5e41){return this['checks']['find'](_0x3fb330=>_0x3fb330['id']===_0x3e5e41);}['removeCheckById'](_0x1280b3){this['_checks']=this['_checks']['filter'](_0x35e884=>_0x35e884['id']!==_0x1280b3);}}class ke extends Ys{['_models']=[];['_defaultModel']=null;constructor(_0x317243,_0x50a7dd,_0x2261fe){super(_0x317243),this['_models']=_0x50a7dd,this['_defaultModel']=_0x2261fe;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Ie extends Ys{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x4dba45,_0x48e6ca,_0x270ba0){super(_0x4dba45),this['prompt']=_0x4dba45['prompt'],this['model']=_0x4dba45['model'],this['model']?this['_defaultModel']=_0x48e6ca['find'](_0x1a0f51=>_0x1a0f51['id']===this['model'])||null:this['_defaultModel']=_0x270ba0;}get['defaultModel'](){return this['_defaultModel'];}}class _e extends vo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x3a2d93,_0x5e3f31,_0x1a5e51){super(),this['_allModels']=_0x3a2d93,this['_recommendedModels']=_0x5e3f31,this['_defaultModel']=_0x1a5e51;}['setupChecks'](_0x5463c8){this['_checks']=_0x5463c8['map'](_0x49c223=>!0x0===_0x49c223['isExtra']?new Ie(_0x49c223,this['_allModels'],this['_defaultModel']):'custom'===_0x49c223['id']?new ke(_0x49c223,this['_recommendedModels'],this['_defaultModel']):new Ys(_0x49c223));}}class Ce extends eh{['_prompt'];['_model'];constructor(_0x395264,_0x1d4051,_0x142190,_0x5a4fd5,_0x32ecfb){super(_0x142190,_0x5a4fd5,_0x32ecfb),this['_prompt']=_0x395264,this['_model']=_0x1d4051;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x3d6c53,_0x3fac66,_0x5819c6){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x3fac66,_0x3d6c53,_0x5819c6);}}class Re extends Ce{get['subTitle'](){return'';}set['prompt'](_0x404380){this['_prompt']=_0x404380;}set['model'](_0x7b221){this['_model']=_0x7b221;}}class pe extends ve{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x315f6e){super(_0x315f6e),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',we['map'](_0xf4ce46=>_0xf4ce46['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x499617,_0xe137a9)=>{this['_isDiffOn']=_0xe137a9['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0xb63c0,_0x2b8a7c){return _0xb63c0['isCustom']?new Ce(_0xb63c0['args']['prompt'],_0xb63c0['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x2b8a7c,this['_aiConnector']):_0x2b8a7c['isExtra']?new Re(_0x2b8a7c['prompt'],_0x2b8a7c['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x2b8a7c,this['_aiConnector']):new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x2b8a7c,this['_aiConnector'],_0xb63c0['params'],_0xb63c0['args']);}['_onReviewCheckResultActivated'](_0xdcaf7e){this['_aiReviewCoreUi']['setActiveStateInResults'](_0xdcaf7e['change']['id']),this['_scrollToChange'](_0xdcaf7e['change']['id']);const _0x4ec2fa=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0xdcaf7e['change']['id']);if(!_0x4ec2fa)return;const _0x501366=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0xdcaf7e['change'],()=>_0x4ec2fa['getElement'](),void 0x0,'click',_0x501366?.['editing']?.['view']?.['getDomRoot'](),_0x501366?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0xdcaf7e['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x1f85aa){this['_currentReviewCheckRun']&&'click'===_0x1f85aa['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x1f85aa['id']));}['_onDeactivateChange'](_0x5a9684){this['_currentReviewCheckRun']&&'balloon'===_0x5a9684['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x2fb9c5,_0x22766c){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x22766c['changeId']);const _0x5218fd=this['_currentReviewCheckRun']['getChangeById'](_0x22766c['changeId']);if(!_0x5218fd)return;const _0x4d7219=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x5218fd,_0x22766c['markerElement'],_0x22766c['domEvent'],'click',_0x4d7219?.['editing']?.['view']?.['getDomRoot'](),_0x4d7219?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x2bbbd0,_0x454414){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x52fa5b=this['_currentReviewCheckRun']['getChangeById'](_0x454414['changeId']);if(!_0x52fa5b)return;const _0x3f1cd9=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x52fa5b,_0x454414['markerElement'],_0x454414['domEvent'],'hover',_0x3f1cd9?.['editing']?.['view']?.['getDomRoot'](),_0x3f1cd9?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x2ac25d){const _0x1ebd71=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x2ac25d);return _0x1ebd71?_0x1ebd71['getElement']():null;}['_markChangePositionInEditorContent'](_0x33b377,_0x260190){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x33b377,_0x260190);}['_diffContent'](_0x17dd49,_0x477ec6){return this['_aiReviewCoreEditing']['diffContent'](_0x17dd49,_0x477ec6);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x531810){const _0x2e1adf=this['_aiReviewCoreEditing']['getEditor']();_0x531810?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x2e1adf&&_0x2e1adf['editing']['view']['change'](_0x571fa4=>{const _0xc9be20=_0x2e1adf['editing']['view']['document']['getRoot']();for(const _0x2c96a1 of _0xc9be20['getClassNames']())_0x2c96a1['startsWith']('ck-ai_review-')&&_0x571fa4['removeClass'](_0x2c96a1,_0xc9be20);_0x571fa4['addClass'](_0x531810?'ck-ai_review-diff':'ck-ai_review-highlights',_0xc9be20);});}async['_getChecksList'](){const _0x3416e3=[...we,...this['_getExtraChecks']()],_0x326e39=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x326e39,_0x3416e3);let _0x21808a=_0x3416e3;this['_hasDefaultAvailableCommands']||(_0x21808a=_0x326e39['map'](_0x297e5c=>_0x3416e3['find'](_0x48c4b2=>_0x48c4b2['id']===_0x297e5c))['filter'](_0x42b137=>!!_0x42b137)),_0x21808a=_0x21808a['map'](_0x35ee70=>_0x35ee70['isExtra']?_0x35ee70:this['_translateReviewCheck'](_0x35ee70));const _0x587d02=_0x21808a['some'](_0x33d3e0=>_0x33d3e0['isExtra']||'custom'===_0x33d3e0['id']);let _0x5bed57=[],_0x2cb6ed=[],_0xf67f0d=null;if(_0x587d02){const _0x18745b=await this['_getModels']();_0x5bed57=_0x18745b['all'],_0x2cb6ed=_0x18745b['recommended'],_0xf67f0d=_0x18745b['default'];}const _0x5aaa33=new _e(_0x5bed57,_0x2cb6ed,_0xf67f0d);return _0x5aaa33['setupChecks'](_0x21808a),_0x587d02&&this['_filterChecksWithMissingModel'](_0x5aaa33),_0x5aaa33;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x1d44ad=>({'id':_0x1d44ad['id'],'commandId':_0x1d44ad['id'],'title':_0x1d44ad['label'],'description':_0x1d44ad['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x1d44ad['prompt'],'model':_0x1d44ad['model']}));}['_logErrorForNonExistentChecks'](_0x47b6ad,_0x15cc8a){const _0x32821e=_0x47b6ad['filter'](_0x4cf7b5=>!_0x15cc8a['some'](_0x4b9e97=>_0x4b9e97['id']===_0x4cf7b5));_0x32821e['length']&&this['_logError'](new _0x459533('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x32821e['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x27bb22=new It({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x27bb22['getAll'](),'recommended':await _0x27bb22['getAvailableModels'](),'default':await _0x27bb22['getDefault']()};}catch(_0x5142d1){return this['_logError'](new _0x459533('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x5142d1)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x224686){const _0x4f8501='AI_REVIEW_CHECK_'+_0x224686['id']['toUpperCase']()['replaceAll']('-','_'),_0xb4f49f={..._0x224686,'title':this['_getTranslationWithDefault'](_0x4f8501+'_TITLE',_0x224686['title']),'description':this['_getTranslationWithDefault'](_0x4f8501+'_DESCRIPTION',_0x224686['description'])};return _0x224686['options']&&(_0xb4f49f['options']=_0x224686['options']['map'](_0x46b1c0=>({..._0x46b1c0,'label':this['_getTranslationWithDefault'](_0x4f8501+'_OPTIONS_LABEL',_0x46b1c0['label']||''),'data':_0x46b1c0['data']?_0x46b1c0['data']['map'](_0x64adb=>({..._0x64adb,'label':this['_getTranslationWithDefault'](_0x4f8501+'_OPTIONS_DATA_'+_0x64adb['id']['toUpperCase'](),_0x64adb['label'])})):void 0x0}))),_0xb4f49f;}['_filterChecksWithMissingModel'](_0x11124a){const _0x324a22=[];_0x11124a['checks']['forEach'](_0x647485=>{(_0x647485 instanceof Ie&&!_0x647485['defaultModel']||_0x647485 instanceof ke&&!_0x647485['models']['length'])&&_0x324a22['push'](_0x647485['id']);}),_0x324a22['length']&&_0x324a22['forEach'](_0x5be64d=>{_0x11124a['removeCheckById'](_0x5be64d),this['_logError'](new _0x459533('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x5be64d}),!0x0);});}}class Ka extends _0x479a76{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 Ys{get['apiId'](){return'translate';}}class Pe extends vo{['setupChecks'](_0x14830c){this['_checks']=_0x14830c['map'](_0x32c98d=>new jr(_0x32c98d));}}class Se extends si{['_title'];constructor(_0xd6e779,_0x2b7d10,_0x519ec1,_0x22c8cb,_0x5b0621,_0x3233f6){super(_0xd6e779,_0x2b7d10,_0x519ec1,_0x5b0621,_0x3233f6),this['_title']=_0x22c8cb;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ve{static get['pluginName'](){return'AITranslateController';}constructor(_0x37499e){super(_0x37499e),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'](_0x1e6bf1,_0x4f40fa){return new Se(this['_aiReviewCoreEditing']['getDocumentData'](),_0x4f40fa,this['_aiConnector'],i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x1e6bf1['params'],_0x1e6bf1['args']);}['_onReviewCheckResultActivated'](_0x598aa9){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x598aa9['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x598aa9['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x5ba26e){this['_currentReviewCheckRun']&&('hover'===_0x5ba26e['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x5ba26e['id'])),'click'===_0x5ba26e['uiInteraction']&&this['_scrollToChange'](_0x5ba26e['id']));}['_onDeactivateChange'](_0x6ecf02){this['_currentReviewCheckRun']&&'panel'===_0x6ecf02['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x464aaf,_0x2f7337){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x2f7337['changeId']),this['_scrollToChange'](_0x2f7337['changeId']));}['_onChangeMarkerHovered'](_0x375d9c,_0x945804){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x945804['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x945804['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x308ec3){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x308ec3);}['_markChangePositionInEditorContent'](_0xc0d0f4,_0x4df54e){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0xc0d0f4,_0x4df54e);}['_diffContent'](_0x297d49,_0x1561fb){return this['_aiReviewCoreEditing']['diffContent'](_0x297d49,_0x1561fb,!0x0);}['_onReviewCheckRun'](){const _0x427324=this['_aiReviewCoreEditing']['getEditor']();_0x427324&&_0x427324['editing']['view']['change'](_0x369300=>{const _0x407a20=_0x427324['editing']['view']['document']['getRoot']();for(const _0x50f334 of _0x407a20['getClassNames']())(_0x50f334['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x50f334)&&_0x369300['removeClass'](_0x50f334,_0x407a20);_0x369300['addClass']('ck-ai-translate-mode-content',_0x407a20);});}async['_getChecksList'](){const _0x3a0e61=[],_0x30a8b6=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x26c2b8 of _0x30a8b6)_0x3a0e61['push']({'title':_0x26c2b8['label'],'id':_0x26c2b8['id'],'commandId':_0x26c2b8['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x26c2b8['id']}});const _0x365a1d=new Pe();return _0x365a1d['setupChecks'](this['_translateChecks'](_0x3a0e61)),_0x365a1d;}['_translateChecks'](_0x4038d8){return _0x4038d8['map'](_0x19a323=>{const _0x463d2b='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x19a323['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x19a323,'title':this['_getTranslationWithDefault'](_0x463d2b,_0x19a323['title'])};});}}class Le extends Ve{constructor(_0x433e98,_0x3f003e){super(_0x433e98,_0x3f003e),this['on']('set:isLoading',(_0x56a7d4,_0x1e5272,_0x145a31)=>{_0x145a31&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x242f81,_0x32db95,_0x254a8f)=>{_0x254a8f&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x189160=super['_createAcceptAllButtonView']();return _0x189160['set']('label',i(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x189160;}['_createExitReviewButtonView'](){const _0x3e1ed9=super['_createExitReviewButtonView']();return _0x3e1ed9['set']('label',i(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x3e1ed9;}}class Ne extends je{['_setupTemplate'](){const _0x1e823e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x1e823e['if']('isVisible','ck-hidden',_0x32cc88=>!_0x32cc88)]},'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',_0x1e823e['if']('isVisible','ck-hidden',_0x3d2c85=>!_0x3d2c85)]},'children':this['_checkViews']}]});}}class tr extends Me{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x5793ba=this['context']['locale'],_0x4ea4d1=new _0x41a033(_0x5793ba,{'label':i(_0x5793ba,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x5b2e29,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x3d944d=new Ae(_0x5793ba,{'header':_0x4ea4d1,'list':new Ne(_0x5793ba),'results':new Le(_0x5793ba,{'generalErrorText':i(_0x5793ba,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x5793ba,{'headerText':i(_0x5793ba,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':i(_0x5793ba,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x5793ba,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x3d944d['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x3d944d;}['registerTab'](){const _0x133378=this['context']['plugins']['get']('AITabs');_0x133378['view']['on']('activateTab',(_0x372e88,_0x251e43)=>{'translate'===_0x251e43?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x133378['view']['addTab']({'id':'translate','buttonLabel':i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x5b2e29,'order':0x0,'content':this['_mainView']});}}class Wa extends _0x479a76{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,$n as AIAssistant,n as AIAssistantUI,Q as AIBalloon,Ma as AIChat,at as AIChatController,ht as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,Va as AIChatShortcuts,ct as AIChatUI,q as AIConnector,D as AIEditing,Ba as AIEditorIntegration,Qt as AIQuickActionType,Fa as AIQuickActions,ii as AIQuickActionsUI,er as AIRequestError,Ys as AIReviewCheck,Zs as AIReviewCheckResult,eh as AIReviewCheckRun,Ka as AIReviewMode,ve as AIReviewModeController,de as AIReviewModeEditing,ge as AIReviewModeUI,pt as AITabs,ye as AITextAdapter,qt as AIToggleButtonUI,Wa as AITranslate,rr as AITranslateController,tr as AITranslateUI,Xn as AWSTextAdapter,Qn as OpenAITextAdapter,E as ShowAIAssistantCommand,io as ToggleAICommand,Hs as createResizeButton,qn as getDefaultAICommands};
23
+ import{Plugin as _0x53f6d2,Command as Lt,ContextPlugin as _0x5dcf5b,Editor as _0x39b2a6}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x1c808a,IconCheck as _0x386c9f,IconError as _0x27052d,IconSubmit as _0x4d010f,IconAIHistory as Ht,IconMagicWand as _0x5a8842,IconRobotPencil as _0x22be60,IconMaximize as _0x58d6c6,IconMinimize as _0xd6b3a0,IconShowChangesOn as _0x576a77,IconShowChangesOff as _0x47ae5e,IconDocument as _0x545232,IconBoxWithCross as _0x37bcd5,IconBoxWithCheck as _0x32af33,IconBoxWithMarker as _0x3cb7ec,IconInfo as tc,IconLoupe as _0x3d0ec3,IconCancel as _0x12f0df,IconStop as _0x45f60c,IconAIChat as Et,IconPlus as _0x18a571,IconPin as _0x1d01b4,IconThreeHorizontalDots as _0x36ac21,IconChevronDown as _0x5ef844,IconChevronUp as _0x57c1ba,IconOutdated as _0x4ea3ef,IconEye as _0x3f74ad,IconEyeCrossedOut as _0x442060,IconChevronRight as _0x2a08e8,IconAIReview as _0x31c506,IconAITranslate as _0x4cfcba}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x677d44,CKEditorError as _0x25c351,ObservableMixin as ts,global as _0x1385df,isVisible as _0x3e9e44,Rect as _0x5002e3,Collection as _0x405f09,FocusTracker as _0x50d771,KeystrokeHandler as _0x407d91,first as _0x22aa77,toArray as _0x5453e9,EmitterMixin as _0xa7ecb2,logWarning as _0x1c9a23,logError as _0x2d18bd,scrollViewportToShowTarget as _0x517478,scrollAncestorsToShowTarget as _0x2d39e3,ResizeObserver as _0x54df55,_isMotionReduced as mt,getConstrainedViewportRect as _0x3e4f1d,DomEmitterMixin as _0x30e617}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x50bbb8,ButtonView as _0x1d1b95,View as _0x1f054a,SpinnerView as _0x17fe29,IconView as _0x152087,AutocompleteView as _0x9be194,ListView as _0xc6bdf6,ListItemGroupView as _0x2b2d84,ListItemView as _0x2a0bb9,ButtonLabelView as _0x34171b,FocusCycler as _0x18b3f0,createLabeledTextarea as _0x2dda8d,Dialog as _0x2dc660,createDropdown as _0x290605,addMenuToDropdown as _0x51e2e4,MenuBarMenuView as _0x36bad0,MenuBarMenuListItemButtonView as _0x229d28,DialogViewPosition as _0x22ba1a,MenuBarMenuListView as _0x1388e9,MenuBarMenuListItemView as _0x134620,BodyCollection as _0x1c4f1c,BalloonPanelView as _0x10e1b3,clickOutsideHandler as _0x1d6ed3,addListToDropdown as _0x46fef8,UIModel as _0x53ecce,submitHandler as _0x5b1132,LabeledFieldView as _0x1e4591,createLabeledInputText as _0x4b3e4e,FormHeaderView as _0x337d54,HighlightedTextView as _0x5ecd8f,ViewCollection as _0x44a698,FileDialogButtonView as _0x34ca85,InputTextView as _0x3ca17d,SearchTextView as _0x1877d1,ListItemButtonView as _0x3abefb,ButtonLabelWithHighlightView as _0x5707f9,DropdownMenuPanelPositioningFunctions as _0x7bd7ce,BalloonToolbar as te,FormRowView as _0x57479f,TextareaView as _0x380d9b}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x293bc2,ClipboardMarkersUtils as _0x36cf6}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x1d6dc5,ViewDataTransfer as _0x3d063b,ViewUpcastWriter as _0x3e9e59,Matcher as _0x3839bf,_DetachOperation as lt,_insertIntoModelNodeList as _0x2aeeda,_removeFromModelNodeList as to,ModelRange as dt,transformOperationSets as xt,ViewDowncastWriter as Ot,ModelDocumentFragment as jt,ModelPosition as Dt,ModelTreeWalker as _0x31a869,MarkerOperation as _0x1c5019,InsertOperation as _0x23db8e}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x419c4b,escape as _0x4ae586,escapeRegExp as _0x1afc1d,debounce as _0x21c87d}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x251854,InvokeModelWithResponseStreamCommand as _0x62fa9,InvokeModelCommand as _0x43fbb4}from'@aws-sdk/client-bedrock-runtime';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x296793}from'htmlparser2';import{isTag as _0x441935,findOne as gt,getParent as _0x2c5477,findAll as _0x5b5fc9,removeElement as _0x210a44,replaceElement as _0x46022b,prepend as _0x45d87d,prependChild as _0x2cb06e,appendChild as _0x1854ba,append as _0x40b605,find as _0x408f6d,isComment as _0x2a0cb6,getChildren as _0xf7fac1,textContent as _0x593e8e}from'domutils';import _0xc63f4e from'dom-serializer';import{Document as _t,Element as _0x38e3db,Text as _0x4fdfd5,cloneNode as _0x26f51,isDocument as _0x528e78,isText as _0x99d146,NodeWithChildren as _0x513cab}from'domhandler';import{MarkdownGfmMdToHtml as _0x52cc6d}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x783893,DocumentCompare as ot,DATA_ID_MODEL_ATTRIBUTE as nt,ConfirmMixin as _0x25cea9,LateFocusDropdownButtonView as _0x36a822,getAllMarkersDomElementsSorted as _0x19636f,SuggestionsConversion as Nt,DATA_ID_VIEW_ATTRIBUTE as _0xfbb69e,getMarkerDomElement as _0x470cd1}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x2b41ab}from'es-toolkit';import _0x4c0a39 from'morphdom';import{IconWeb as _0x26bf07,IconClose as _0x186d14,IconDocument as _0x1ef80c,IconSelection as _0x1f3474,IconFileUpload as _0x107670,IconLink as _0x9a2128,IconBulb as _0x782cf1,IconAI as _0x2e776a,IconPreviousArrow as _0x37ead0,IconCheck as _0xa99da,IconDocumentOutline as _0x4791e0,IconPaperClip as _0x4db22d,IconBrowseFiles as _0x1c54d4,IconDropdownArrow as _0x264f12,IconAIChat as _0x315ea9,IconAIReview as _0x1a4041,IconAITranslate as Vt,IconAIAskAI as _0x5591e5,IconThumbUp as _0x4d8f3a,IconThumbDown as _0x23728d,IconCopy as _0x353d3e,IconShowChangesOff as _0x44ac4f,IconShowChangesOn as _0x42f8e1,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 _0x1b9a26,IconNextArrow as _0xa5f5aa}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x36b77a}from'diff';const V='_ungrouppedCommands';function f(_0x3c2777,_0x28a553){const _0x130f13=(0x0,_0x28a553['t'])('Other');return _0x3c2777['length']?'groupId'in _0x3c2777[0x0]?_0x3c2777:[{'groupId':V,'groupLabel':_0x130f13,'order':0x1/0x0,'commands':_0x3c2777}]:[{'groupId':V,'groupLabel':_0x130f13,'order':0x1/0x0,'commands':[]}];}const Kn=globalThis['DataTransfer'],A='ai-ui';class d extends _0x53f6d2{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2c1d3f}=this,_0x5799d1=['ck-fake-ai-selection'];_0x2c1d3f['config']['get']('ai.assistant.useTheme')&&_0x5799d1['push']('ck-ai-assistant-ui_theme'),_0x2c1d3f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':A,'view':{'classes':_0x5799d1,'priority':0xc}}),_0x2c1d3f['conversion']['for']('editingDowncast')['markerToElement']({'model':A,'view':(_0x12e730,{writer:_0x313ac0})=>{if(!_0x12e730['markerRange']['isCollapsed'])return null;const _0x21636b=_0x313ac0['createUIElement']('span');return _0x313ac0['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x21636b),_0x21636b;}});}['afterInit'](){!async function(_0x55830f){const _0x4a8f0e=_0x4dff35([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]),_0x51b5c4=0x3dffc4e1,_0x2b13d5=0x3df84781^_0x51b5c4,_0x276af6=window[_0x4dff35([0x44,0x61,0x74,0x65])][_0x4dff35([0x6e,0x6f,0x77])](),_0x4d2c08=_0x55830f[_0x4dff35([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x242f1a=new window[(_0x4dff35([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x24788b=>{_0x4d2c08[_0x4dff35([0x6f,0x6e,0x63,0x65])](_0x4dff35([0x72,0x65,0x61,0x64,0x79]),_0x24788b);}),_0x51c3af={[_0x4dff35([0x6b,0x74,0x79])]:_0x4dff35([0x45,0x43]),[_0x4dff35([0x75,0x73,0x65])]:_0x4dff35([0x73,0x69,0x67]),[_0x4dff35([0x63,0x72,0x76])]:_0x4dff35([0x50,0x2d,0x32,0x35,0x36]),[_0x4dff35([0x78])]:_0x4dff35([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]),[_0x4dff35([0x79])]:_0x4dff35([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]),[_0x4dff35([0x61,0x6c,0x67])]:_0x4dff35([0x45,0x53,0x32,0x35,0x36])},_0x232d99=_0x4d2c08[_0x4dff35([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x4dff35([0x67,0x65,0x74])](_0x4dff35([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x30c844(){let _0x53d6f2,_0x4a6628=null,_0xf09f6e=null;try{if(_0x232d99==_0x4dff35([0x47,0x50,0x4c]))return _0x4dff35([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x53d6f2=_0x2a9b1b(),!_0x53d6f2)return _0x4dff35([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x53d6f2[_0x4dff35([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0xf09f6e=_0x3a8285(_0x53d6f2[_0x4dff35([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x53d6f2[_0x4dff35([0x6a,0x74,0x69])])),await _0x407ece()?_0xf06ce8()?_0x5e1d5b()?_0x4dff35([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x52888f()?(_0x53d6f2[_0x4dff35([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4dff35([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4a6628=_0x4f1669(_0x4dff35([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x6cecc4()):_0x4dff35([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x4dff35([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x4dff35([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x4dff35([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5e1d5b(){const _0xb71cf5=[_0x4dff35([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x4dff35([0x74,0x72,0x69,0x61,0x6c])][_0x4dff35([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x53d6f2[_0x4dff35([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x276af6/0x3e8:0xe10*_0x2b13d5;return _0x53d6f2[_0x4dff35([0x65,0x78,0x70])]<_0xb71cf5;}function _0xf06ce8(){const _0x4fbd08=_0x53d6f2[_0x4dff35([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x4fbd08&&(!!_0x4fbd08[_0x4dff35([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4dff35([0x2a]))||!!_0x4fbd08[_0x4dff35([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4dff35([0x41,0x49])));}function _0x52888f(){const _0x17093b=_0x53d6f2[_0x4dff35([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x17093b||0x0==_0x17093b[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x17c09b}=new URL(window[_0x4dff35([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x17093b[_0x4dff35([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x17c09b))return!0x0;const _0x12aaaa=_0x17c09b[_0x4dff35([0x73,0x70,0x6c,0x69,0x74])](_0x4dff35([0x2e]));return _0x17093b[_0x4dff35([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1393c0=>_0x1393c0[_0x4dff35([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4dff35([0x2a])))[_0x4dff35([0x6d,0x61,0x70])](_0x265eeb=>_0x265eeb[_0x4dff35([0x73,0x70,0x6c,0x69,0x74])](_0x4dff35([0x2e])))[_0x4dff35([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x6b6c42=>_0x6b6c42[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x12aaaa[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4dff35([0x6d,0x61,0x70])](_0x52245f=>Array(_0x12aaaa[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x52245f[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4dff35([0x66,0x69,0x6c,0x6c])](_0x52245f[0x0]===_0x4dff35([0x2a])?_0x4dff35([0x2a]):'')[_0x4dff35([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x52245f))[_0x4dff35([0x73,0x6f,0x6d,0x65])](_0x1e2755=>_0x12aaaa[_0x4dff35([0x65,0x76,0x65,0x72,0x79])]((_0x3bd8e0,_0x16f910)=>_0x1e2755[_0x16f910]===_0x3bd8e0||_0x1e2755[_0x16f910]===_0x4dff35([0x2a])));}function _0x6cecc4(){return _0x4a6628&&_0xf09f6e?new window[(_0x4dff35([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x301d3e,_0x160bff)=>{_0x4a6628[_0x4dff35([0x74,0x68,0x65,0x6e])](_0x301d3e,_0x160bff),_0xf09f6e[_0x4dff35([0x74,0x68,0x65,0x6e])](_0x5c4350=>{_0x5c4350!=_0x4dff35([0x56,0x61,0x6c,0x69,0x64])&&_0x301d3e(_0x5c4350);},_0x160bff);}):_0x4a6628||_0xf09f6e||_0x4dff35([0x56,0x61,0x6c,0x69,0x64]);}}function _0x3a8285(_0x3b8cb7,_0x2f1a50){return new window[(_0x4dff35([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x27f365=>{if(_0x103fe8())return _0x27f365(_0x4dff35([0x56,0x61,0x6c,0x69,0x64]));_0x41d381(),_0x4d2c08[_0x4dff35([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x4dff35([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x1f8c59=!0x1;const _0x1023f2=_0x677d44();function _0x52df2e(_0x3af977){return!!_0x3af977&&(typeof _0x3af977===_0x4dff35([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x3af977===_0x4dff35([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x3af977[_0x4dff35([0x74,0x68,0x65,0x6e])]===_0x4dff35([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x3af977[_0x4dff35([0x63,0x61,0x74,0x63,0x68])]===_0x4dff35([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x5197a6(_0x42a814){_0x2bd694(_0x42a814)[_0x4dff35([0x74,0x68,0x65,0x6e])](_0x2559d9=>{if(!_0x2559d9||_0x2559d9[_0x4dff35([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x4dff35([0x6f,0x6b]))return _0x4dff35([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x59573a(_0x5c23f2(_0x1023f2+_0x2f1a50))!=_0x2559d9[_0x4dff35([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x4dff35([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x4dff35([0x56,0x61,0x6c,0x69,0x64]);})[_0x4dff35([0x74,0x68,0x65,0x6e])](_0x49002f=>(_0x230b9c(),_0x49002f),()=>{const _0x3e6407=_0x59acda();return null==_0x3e6407?(_0x230b9c(),_0x4dff35([0x56,0x61,0x6c,0x69,0x64])):_0x4dff35(_0x276af6-_0x3e6407>(0x19f340e1^_0x51b5c4)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x4dff35([0x74,0x68,0x65,0x6e])](_0x27f365)[_0x4dff35([0x63,0x61,0x74,0x63,0x68])](()=>{_0x27f365(_0x4dff35([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2304d6=0x3dc92a61^_0x51b5c4;function _0x230b9c(){const _0x937f5b=_0x4dff35([0x6c,0x6c,0x63,0x74,0x2d])+_0x59573a(_0x5c23f2(_0x3b8cb7)),_0xd0498=_0x47edcc(_0x59573a(window[_0x4dff35([0x4d,0x61,0x74,0x68])][_0x4dff35([0x63,0x65,0x69,0x6c])](_0x276af6/_0x2304d6)));window[_0x4dff35([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4dff35([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x937f5b,_0xd0498);}function _0x59acda(){const _0x4d417a=_0x4dff35([0x6c,0x6c,0x63,0x74,0x2d])+_0x59573a(_0x5c23f2(_0x3b8cb7)),_0x58789e=window[_0x4dff35([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4dff35([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4d417a);return _0x58789e?window[_0x4dff35([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x47edcc(_0x58789e),0x10)*_0x2304d6:null;}function _0x2bd694(_0x243723){return new window[(_0x4dff35([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x55a3dc,_0x32e5c5)=>{_0x243723[_0x4dff35([0x74,0x68,0x65,0x6e])](_0x55a3dc,_0x32e5c5),window[_0x4dff35([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x32e5c5,0x3dfe1021^_0x51b5c4);});}}_0x4d2c08[_0x4dff35([0x6f,0x6e])](_0x4dff35([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x61fcf6,_0x233ce2)=>{if(_0x233ce2[0x0]!=_0x3b8cb7)return _0x27f365(_0x4dff35([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x233ce2[0x1]={..._0x233ce2[0x1],[_0x4dff35([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x1023f2};},{[_0x4dff35([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4dff35([0x68,0x69,0x67,0x68])}),_0x4d2c08[_0x4dff35([0x6f,0x6e])](_0x4dff35([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x49b178=>{_0x52df2e(_0x49b178[_0x4dff35([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x1f8c59=!0x0,_0x5197a6(_0x49b178[_0x4dff35([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x4dff35([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4dff35([0x6c,0x6f,0x77])}),_0x242f1a[_0x4dff35([0x74,0x68,0x65,0x6e])](()=>{_0x1f8c59||_0x27f365(_0x4dff35([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x103fe8(){return _0x4d2c08[_0x4dff35([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4dff35([0x76,0x69,0x65,0x77])][_0x4dff35([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x4dff35([0x61,0x75,0x74,0x6f]);}function _0x41d381(){_0x4d2c08[_0x4dff35([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4dff35([0x76,0x69,0x65,0x77])][_0x4dff35([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x4dff35([0x61,0x75,0x74,0x6f]);}}function _0x4f1669(_0x4af0f1){const _0x43b235=[new window[(_0x4dff35([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3330e0=>setTimeout(_0x3330e0,0x3df6fa2d^_0x51b5c4)),_0x242f1a[_0x4dff35([0x74,0x68,0x65,0x6e])](()=>new window[(_0x4dff35([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3b27fa=>{let _0x3dc79b=0x0;_0x4d2c08[_0x4dff35([0x6d,0x6f,0x64,0x65,0x6c])][_0x4dff35([0x6f,0x6e])](_0x4dff35([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x48c8bb,_0x34c33a)=>{_0x34c33a[0x0][_0x4dff35([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x3dc79b++,_0x3dc79b==(0x3dffc109^_0x51b5c4)&&(_0x3b27fa(),_0x48c8bb[_0x4dff35([0x6f,0x66,0x66])]());});}))];return window[_0x4dff35([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x4dff35([0x72,0x61,0x63,0x65])](_0x43b235)[_0x4dff35([0x74,0x68,0x65,0x6e])](()=>_0x4af0f1);}async function _0x1cb707(){await _0x242f1a,_0x4d2c08[_0x4dff35([0x6d,0x6f,0x64,0x65,0x6c])][_0x4dff35([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x108418,_0x4d2c08[_0x4dff35([0x6d,0x6f,0x64,0x65,0x6c])][_0x4dff35([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x108418,_0x4d2c08[_0x4dff35([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x4dff35([0x6d,0x6f,0x64,0x65,0x6c]));}function _0xda49d5(_0x30401d){const _0x39db6b=_0x53efd2();_0x4d2c08[_0x39db6b]=_0x4dff35([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x30401d,_0x30401d!=_0x4dff35([0x56,0x61,0x6c,0x69,0x64])&&_0x1cb707();}function _0x53efd2(){const _0x3cb100=window[_0x4dff35([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x4dff35([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x4dff35([0x6e,0x6f,0x77])]())[_0x4dff35([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x4dff35([0x2e]),'');let _0x356a2f=_0x4dff35([0x6e]);for(let _0x5615d5=0x0;_0x5615d5<_0x3cb100[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5615d5+=0x2){let _0x5be6c6=window[_0x4dff35([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3cb100[_0x4dff35([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5615d5,_0x5615d5+0x2));_0x5be6c6>=_0x4a8f0e[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x5be6c6-=_0x4a8f0e[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x356a2f+=_0x4a8f0e[_0x5be6c6];}return _0x356a2f;}function _0x2a9b1b(){const _0x38adcd=_0x232d99[_0x4dff35([0x73,0x70,0x6c,0x69,0x74])](_0x4dff35([0x2e]));if(0x3!=_0x38adcd[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x5d92e1(_0x38adcd[0x1]);function _0x5d92e1(_0x1504a2){const _0x24a573=_0x5171ff(_0x1504a2);return _0x24a573&&_0x290168()?_0x24a573:null;function _0x290168(){const _0x29b6af=_0x24a573[_0x4dff35([0x6a,0x74,0x69])],_0x422075=window[_0x4dff35([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x29b6af[_0x4dff35([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x29b6af[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2df9f2={..._0x24a573,[_0x4dff35([0x6a,0x74,0x69])]:_0x29b6af[_0x4dff35([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x29b6af[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2df9f2[_0x4dff35([0x76,0x63])],_0x5c23f2(_0x2df9f2)==_0x422075;}}}async function _0x407ece(){let _0x32b360=!0x0;try{const _0x1a5be0=_0x232d99[_0x4dff35([0x73,0x70,0x6c,0x69,0x74])](_0x4dff35([0x2e])),[_0x3fec85,_0x579823,_0x20a4b0]=_0x1a5be0;return _0x5e4f94(_0x3fec85),await _0x4f9bbc(_0x3fec85,_0x579823,_0x20a4b0),_0x32b360;}catch{return!0x1;}function _0x5e4f94(_0x504d19){const _0x40ce10=_0x5171ff(_0x504d19);_0x40ce10&&_0x40ce10[_0x4dff35([0x61,0x6c,0x67])]==_0x4dff35([0x45,0x53,0x32,0x35,0x36])||(_0x32b360=!0x1);}async function _0x4f9bbc(_0x4b3e08,_0x4a2397,_0x36651f){const _0x1854d6=window[_0x4dff35([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x4dff35([0x66,0x72,0x6f,0x6d])](_0x375b43(_0x36651f),_0xbcf6f1=>_0xbcf6f1[_0x4dff35([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x583eff=new window[(_0x4dff35([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x4dff35([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4b3e08+_0x4dff35([0x2e])+_0x4a2397),_0x2c57bc=window[_0x4dff35([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x4dff35([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x2c57bc)return;const _0x5a61e4=await _0x2c57bc[_0x4dff35([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x4dff35([0x6a,0x77,0x6b]),_0x51c3af,{[_0x4dff35([0x6e,0x61,0x6d,0x65])]:_0x4dff35([0x45,0x43,0x44,0x53,0x41]),[_0x4dff35([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x4dff35([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x4dff35([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x2c57bc[_0x4dff35([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x4dff35([0x6e,0x61,0x6d,0x65])]:_0x4dff35([0x45,0x43,0x44,0x53,0x41]),[_0x4dff35([0x68,0x61,0x73,0x68])]:{[_0x4dff35([0x6e,0x61,0x6d,0x65])]:_0x4dff35([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x5a61e4,_0x1854d6,_0x583eff)||(_0x32b360=!0x1);}}function _0x5171ff(_0xcc576e){return _0xcc576e[_0x4dff35([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x4dff35([0x65,0x79]))?JSON[_0x4dff35([0x70,0x61,0x72,0x73,0x65])](_0x375b43(_0xcc576e)):null;}function _0x375b43(_0x92b5c6){return window[_0x4dff35([0x61,0x74,0x6f,0x62])](_0x92b5c6[_0x4dff35([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x4dff35([0x2b]))[_0x4dff35([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x4dff35([0x2f])));}function _0x5c23f2(_0x406c3f){let _0x32a97d=0x1505;function _0x2bf04b(_0x503e9a){for(let _0x12573d=0x0;_0x12573d<_0x503e9a[_0x4dff35([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x12573d++){const _0x34b044=_0x503e9a[_0x4dff35([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x12573d);_0x32a97d=(_0x32a97d<<0x5)+_0x32a97d+_0x34b044,_0x32a97d&=_0x32a97d;}}function _0x378707(_0x57b085){Array[_0x4dff35([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x57b085)?_0x57b085[_0x4dff35([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x378707):_0x57b085&&typeof _0x57b085==_0x4dff35([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x4dff35([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x57b085)[_0x4dff35([0x73,0x6f,0x72,0x74])]()[_0x4dff35([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x48870c,_0x3d20cf])=>{_0x2bf04b(_0x48870c),_0x378707(_0x3d20cf);}):_0x2bf04b(window[_0x4dff35([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x57b085));}return _0x378707(_0x406c3f),_0x32a97d>>>0x0;}function _0x59573a(_0x3bd00f){return _0x3bd00f[_0x4dff35([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x4dff35([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x4dff35([0x30]));}function _0x47edcc(_0x12bc35){return _0x12bc35[_0x4dff35([0x73,0x70,0x6c,0x69,0x74])]('')[_0x4dff35([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x4dff35([0x6a,0x6f,0x69,0x6e])]('');}function _0x108418(){}function _0x4dff35(_0x56f7d5){return _0x56f7d5['map'](_0x14c4c5=>String['fromCharCode'](_0x14c4c5))['join']('');}_0xda49d5(await _0x30c844());}(this);}['showFakeVisualSelection'](){const _0x2d3df5=this['editor']['model'];_0x2d3df5['change'](_0x10d437=>{const _0x12c92a=_0x2d3df5['document']['selection']['getRanges']();let _0x2680a6=0x0;for(const _0x3dd47a of _0x12c92a){const _0x23c185=A+':'+_0x2680a6;if(_0x2d3df5['markers']['has'](_0x23c185))_0x10d437['updateMarker'](_0x23c185,{'range':_0x3dd47a});else{if(_0x3dd47a['start']['isAtEnd']){const _0x1dd374=_0x3dd47a['start']['getLastMatchingPosition'](({item:_0x1a85be})=>!_0x2d3df5['schema']['isContent'](_0x1a85be),{'boundaries':_0x3dd47a});_0x10d437['addMarker'](_0x23c185,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x10d437['createRange'](_0x1dd374,_0x3dd47a['end'])});}else _0x10d437['addMarker'](_0x23c185,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3dd47a});}_0x2680a6++;}});}['hideFakeVisualSelection'](){const _0x1eed33=this['editor']['model'],_0x370065=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](A));_0x370065['length']&&_0x1eed33['change'](_0x5f1bd3=>{_0x370065['forEach'](_0x30c7fb=>{_0x5f1bd3['removeMarker'](_0x30c7fb);});});}['insertContent'](_0x596008,_0x14f7fa){const _0x511181=this['_getAISelection'](),_0x2d37e4=_0x14f7fa||_0x511181['getFirstRange']();this['editor']['model']['canEditAt'](_0x2d37e4)&&this['editor']['model']['change'](_0x5b2b1c=>{this['hideFakeVisualSelection'](),_0x14f7fa||this['_resetContentOfSelectedTableCells'](_0x5b2b1c,_0x511181),this['_pasteHTMLUsingClipboard']({'insertAt':_0x2d37e4,'writer':_0x5b2b1c,'html':_0x596008});});}['insertContentBelow'](_0xb1891f){const {model:_0x5513f6}=this['editor'],_0x51b079=this['_getAISelection']();_0x5513f6['change'](()=>{const _0x2be0dc=this['_prepareTableInsertBelowPosition'](_0xb1891f,_0x51b079)||this['_getDefaultInsertBelowPosition'](_0x51b079);this['insertContent'](_0xb1891f,_0x2be0dc);});}['_getAISelection'](){const _0x459efb=this['editor']['model'],_0x476da4=Array['from'](_0x459efb['markers']['getMarkersGroup'](A))['map'](_0x56e993=>_0x56e993['getRange']());return _0x459efb['createSelection'](_0x476da4);}['_pasteHTMLUsingClipboard']({writer:_0x40440b,html:_0x3bed48,insertAt:_0xe28855}){const {view:_0x20b212}=this['editor']['editing'],_0x525430=this['editor']['plugins']['get'](_0x293bc2),_0x13d8c9=new Kn();_0x13d8c9['setData']('text/html',_0x3bed48);const _0x575be8=new ClipboardEvent('paste',{'clipboardData':_0x13d8c9}),_0x119c2a=new _0x1d6dc5(_0x20b212,_0x575be8,{'dataTransfer':new _0x3d063b(_0x13d8c9)});_0x40440b['setSelection'](_0xe28855);const _0x5ab8cb=(_0x121cc,_0x458e92)=>{_0x458e92['resultRange']&&_0x40440b['setSelection'](_0x458e92['resultRange']);};_0x525430['once']('contentInsertion',_0x5ab8cb,{'priority':'lowest'}),_0x20b212['document']['fire']('paste',_0x119c2a),_0x525430['off']('contentInsertion',_0x5ab8cb);}['_getDefaultInsertBelowPosition'](_0x17ba37){const {model:_0xa86bc2}=this['editor'],_0x14ce7e=Array['from'](_0x17ba37['getSelectedBlocks']());return _0x14ce7e['length']?_0xa86bc2['createPositionAfter'](_0x14ce7e['pop']()):_0x17ba37['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x486b54,_0x380912){const {model:_0x446122,plugins:_0x45f53a}=this['editor'];if(_0x45f53a['has']('TableUtils')){const _0x1bb44c=_0x45f53a['get']('TableUtils')['getSelectedTableCells'](_0x380912);if(_0x1bb44c['length']){const _0x4238fe=this['_getTableRowCountFromContent'](_0x486b54),_0x419edc=this['_createEmptyTableRows'](_0x1bb44c,_0x4238fe);return _0x446122['createPositionAt'](_0x419edc,0x0);}}return null;}['_getTableRowCountFromContent'](_0x58850f){const _0x4f28eb=this['editor']['plugins']['get']('TableUtils'),_0xcc4976=this['editor']['data']['parse'](_0x58850f),_0x220c84=Array['from'](_0xcc4976['getChildren']())['filter'](_0x3b8790=>_0x3b8790['is']('element','table'));let _0x417a6e=0x0;return _0x220c84['forEach'](_0x1ee85b=>{_0x417a6e+=_0x4f28eb['getRows'](_0x1ee85b);}),_0x417a6e;}['_createEmptyTableRows'](_0x3f261c,_0x14b3b5){const _0x1153cc=this['editor']['plugins']['get']('TableUtils'),_0x443a1c=_0x1153cc['getRowIndexes'](_0x3f261c),_0x3b9a71=_0x1153cc['getColumnIndexes'](_0x3f261c),_0x2dc2a7=_0x443a1c['last']+0x1,_0x49c1a4=_0x3b9a71['first'],_0x490feb=_0x3f261c[0x0]['findAncestor']('table');for(let _0x45afbb=0x0;_0x45afbb<_0x14b3b5;_0x45afbb++)_0x1153cc['insertRows'](_0x490feb,{'at':_0x2dc2a7});return _0x490feb['getChild'](_0x2dc2a7)['getChild'](_0x49c1a4);}['_resetContentOfSelectedTableCells'](_0x4b9738,_0x162ad9){const {plugins:_0x552eaf}=this['editor'],{model:_0x1893f2}=_0x4b9738;if(!_0x552eaf['has']('TableUtils'))return;_0x552eaf['get']('TableUtils')['getSelectedTableCells'](_0x162ad9)['length']&&_0x1893f2['deleteContent'](_0x162ad9);}}class $ extends _0x53f6d2{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x25c351('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x129770){super(_0x129770),this['name']='AIRequestError';}}function Wn(_0x255c0c,_0x588424,_0x4a51d1){const t=_0x255c0c['t'];switch(_0x588424){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',_0x4a51d1);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4a51d1);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'},_0x4a51d1);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_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x588424;}}class D extends Lt{['_commandDefinitions'];constructor(_0x5f5285,_0x411e66){super(_0x5f5285),this['_commandDefinitions']=_0x411e66,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x330e19,_0x3ccc7f,_0x432e3b)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x432e3b));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x116605,_0x58bf81,_0x3636f1)=>{this['enabledCommandsIds']=_0x3636f1?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x307c85=this['editor']['model'];this['_hasContext']=function(_0x395e8f){const _0x3319ca=_0x395e8f['document']['selection'];return _0x3319ca['isCollapsed']?0x0!==[..._0x3319ca['getSelectedBlocks']()]['length']&&![..._0x3319ca['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x395e8f['hasContent'](_0x3319ca['getFirstRange']());}(_0x307c85);const _0x495e72=_0x307c85['document']['selection'],_0x565da2=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x4ab921 of _0x495e72['getRanges']())for(const _0x47f4f6 of _0x4ab921['getItems']())if(_0x47f4f6['is']('element')&&_0x565da2['includes'](_0x47f4f6['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x22ac2e='',_0x5c84f5='',_0x572f13='custom'){this['editor']['plugins']['get'](g)['showUI'](_0x22ac2e,_0x5c84f5,_0x572f13);}}function ns(_0x44a5af,_0x30732b){const _0x1e9fb4=new Set();for(const _0x4d982f of _0x44a5af['values']())(_0x30732b||!0x1===_0x4d982f['requiresContent'])&&_0x1e9fb4['add'](_0x4d982f['id']);return Array['from'](_0x1e9fb4);}const hs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class N extends/* #__PURE__ -- @preserve */
24
+ ts(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x386a82,_0x3c6eda,_0x14b3dd){super(),this['editor']=_0x386a82,this['textAdapter']=_0x3c6eda,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x14b3dd,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4c77c0,_0x35f7b3,_0x4cdf6a)=>{this['view']['value']=this['_sanitizeHTML'](_0x4cdf6a);}),this['listenTo'](this['view'],'submitPrompt',(_0x58ee73,_0x2abd88)=>{const _0x2b38e2=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x2abd88,_0x2b38e2,'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:_0x4aa6dc,query:_0x4cfe17,htmlContent:_0x1cd3b1,label:_0x567ae,mainActionLabel:_0x2c6018}){this['view']['prompt']=_0x567ae,this['view']['mainAction']=_0x2c6018,this['initialContext']=_0x1cd3b1,_0x4cfe17&&(this['view']['isRendered']?this['_handleQuery'](_0x4cfe17,_0x1cd3b1,_0x4aa6dc,_0x567ae):this['view']['once']('render',()=>{this['_handleQuery'](_0x4cfe17,_0x1cd3b1,_0x4aa6dc,_0x567ae);}));}['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'](_0x29e00f,_0x5c1514,_0x1fb68f,_0x3ca8dc){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x5c1514,this['previousQuery']=_0x29e00f,this['previousLabel']=_0x3ca8dc||_0x29e00f,this['previousActionId']=_0x1fb68f,new Promise(_0x2de23c=>{this['textAdapter']['makeRequest']({'query':_0x29e00f,'context':_0x5c1514,'onData':_0x46f6e7=>{this['currentResponse']=_0x46f6e7,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x1fb68f})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x167040=>{_0x167040 instanceof er?this['view']['handleError'](_0x167040['message']):this['view']['handleError'](),_0x2de23c();})['finally'](()=>{this['stopProcessing'](),_0x2de23c();});});}['_parseAndNormalizeContent'](_0x218bf1,_0x542ada=!0x1){const _0x276f08=hs['exec'](_0x218bf1);_0x218bf1=_0x276f08?_0x218bf1['substring'](_0x276f08[0x1]['length']):_0x218bf1['length']<0x64&&!_0x542ada?'':this['_stripMarkdownSyntax'](_0x218bf1);const _0x1fabcc=this['_domParser']['parseFromString'](_0x218bf1,'text/html');if(_0x276f08){const _0x431fc7=Array['from'](_0x1fabcc['body']['childNodes']);_0x431fc7['reverse']();for(const _0x228181 of _0x431fc7){if(_0x228181['nodeType']==Node['ELEMENT_NODE'])break;_0x228181['remove']();}}const _0x1bac21=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x1fabcc['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x1bac21);const _0x21331e=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x22c1ff=this['editor']['data']['toModel'](_0x1bac21);return _0x21331e||_0x22c1ff['markers']['clear'](),this['editor']['data']['stringify'](_0x22c1ff);}['_normalizeResponseHeadings'](_0x207bd3){const _0x3b4820=new _0x3e9e59(this['editor']['editing']['view']['document']),_0x36f6c4=new _0x3839bf({'name':/^h[1-5]$/}),_0x12c2e5=[];let _0x8300ed=!0x1;for(const _0x639eac of _0x207bd3)_0x639eac['is']('element')&&_0x36f6c4['match'](_0x639eac)&&(_0x12c2e5['push'](_0x639eac),'h1'==_0x639eac['name']&&(_0x8300ed=!0x0));if(_0x8300ed){for(const _0x5189c3 of _0x12c2e5)_0x3b4820['rename']('h'+(parseInt(_0x5189c3['name'][0x1])+0x1),_0x5189c3);}}['_isH1TagSupportEnabled'](){const {data:_0x296784,editing:_0x3fa6bc}=this['editor'],_0x4413b8=_0x296784['htmlProcessor']['toView']('<h1></h1>'),_0x5c9f6f=_0x296784['toView'](_0x296784['toModel'](_0x4413b8));return!!_0x3fa6bc['view']['domConverter']['viewToDom'](_0x5c9f6f)['querySelector']('h1');}['_sanitizeHTML'](_0x321951){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x321951),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x429f75){const _0xe31999=_0x429f75['trim']();return _0xe31999['startsWith']('```html')?_0xe31999['endsWith']('```')?_0xe31999['substring'](0x7,_0xe31999['length']-0x3):_0xe31999['substring'](0x7):_0x429f75;}}const H={'REPLACE':'replace','INSERT':'insert'};class Pr extends _0x50bbb8{constructor(_0x4a0243){super(_0x4a0243),this['set']('isVisible',!0x1),this['set']('mainAction',H['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xade139=>Wn(_0x4a0243,'AI_'+_0xade139['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Wn(_0x4a0243,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Wn(_0x4a0243,'Try\x20again')),this['stopButton']=this['_createButton'](Wn(_0x4a0243,'Stop'));const _0x3c382d=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3c382d['if']('isVisible','ck-hidden',_0x224116=>!_0x224116)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x583eb4,_0x4e7421){const _0x48878c=new _0x1d1b95(this['locale']);return _0x48878c['set']({'label':_0x583eb4,'class':_0x4e7421||'','isVisible':!0x0,'withText':!0x0}),_0x48878c;}}class Ir extends _0x1f054a{['contentFieldView'];['copyButtonView'];constructor(_0x4ea038,_0x229677=''){super(_0x4ea038),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x56b9e0=this['bindTemplate'];this['contentFieldView']=new Yn(_0x4ea038,_0x229677),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x56b9e0['if']('isVisible','ck-hidden',_0x33cc56=>!_0x33cc56)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x56b9e0['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 _0x3952f2=!0x1;this['on']('change:value',(_0xc1742c,_0x57c85f,_0x4a7414)=>{const _0x7d8001=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x4a7414),this['isProcessing']&&_0x7d8001&&!_0x3952f2&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x58afe2,_0x15d5f7,_0x21aa94)=>{_0x3952f2=!0x1,_0x21aa94?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3952f2=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3952f2=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1b30bb=this['locale'],_0x4eb9cf=new _0x1d1b95(this['locale']),_0x2d3c4b='ck-ai-form__copy-button';return _0x4eb9cf['set']({'label':Wn(_0x1b30bb,'Copy'),'icon':_0x1c808a,'class':_0x2d3c4b,'tooltip':!0x0}),_0x4eb9cf['bind']('isVisible')['to'](this,'value',_0xa2a356=>!!_0xa2a356),_0x4eb9cf['bind']('isEnabled')['to'](this,'isProcessing',_0x1dea2d=>!_0x1dea2d),_0x4eb9cf['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4eb9cf['icon']=_0x386c9f,_0x4eb9cf['class']=_0x2d3c4b+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4eb9cf['icon']=_0x1c808a,_0x4eb9cf['class']=_0x2d3c4b;},0x3e8);}),_0x4eb9cf;}['_copyHTMLToClipboard'](_0x5a1c76){const {window:_0x261551,document:_0x52576c}=_0x1385df;if(_0x261551['ClipboardItem']){const {Blob:_0x4e0ec9,ClipboardItem:_0x2f36a2}=_0x261551,_0x5215e8=[new _0x2f36a2({'text/html':new _0x4e0ec9([_0x5a1c76['innerHTML']],{'type':'text/html'}),'text/plain':new _0x4e0ec9([_0x5a1c76['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x5215e8);}else{const _0x47b689=_0x52576c['createElement']('div');_0x47b689['style']['position']='absolute',_0x47b689['style']['left']='-9999px',_0x47b689['innerHTML']='<span>[</span>'+_0x5a1c76['innerHTML']+'<span>]</span>',_0x52576c['body']['appendChild'](_0x47b689);const _0x1253d7=_0x52576c['createRange']();_0x1253d7['setStartAfter'](_0x47b689['firstElementChild']),_0x1253d7['setEndBefore'](_0x47b689['lastElementChild']);const _0x12801e=_0x261551['getSelection']();_0x12801e['removeAllRanges'](),_0x12801e['addRange'](_0x1253d7),_0x52576c['execCommand']('copy'),_0x47b689['remove']();}}}class Yn extends _0x1f054a{constructor(_0x33eecd,_0x5b4f03=''){super(_0x33eecd),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x5b4f03,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x569817){this['element']['innerHTML']=_0x569817;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0xa01d8c=new _0x1f054a(),_0x3b67a5=this['locale'],_0x230c41=new _0x17fe29();return _0x230c41['isVisible']=!0x0,_0xa01d8c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x230c41,{'text':Wn(_0x3b67a5,'AI\x20is\x20writing...')}]}),_0xa01d8c['render'](),_0xa01d8c;}}class Vr extends _0x1f054a{constructor(_0x3fbbf7,_0x378cf2=''){super(_0x3fbbf7);const _0x5ab4b0=new _0x152087(),_0x50fea4=this['bindTemplate'];this['set']('text',_0x378cf2),_0x5ab4b0['content']=_0x27052d,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x5ab4b0,{'text':_0x50fea4['to']('text')}]});}}class Cr extends _0x9be194{['submitButtonView'];['showHistoryButtonView'];constructor(_0xba567c,_0x1a32d2){super(_0xba567c,_0x1a32d2),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',(_0x4c3628,_0x931905)=>{_0x4c3628['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x931905());});}['_createSubmitButton'](){const _0x264407=new _0x1d1b95(this['locale']),_0x161dee=this['locale'];return _0x264407['set']({'icon':_0x4d010f,'label':Wn(_0x161dee,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x264407['on']('execute',()=>{this['submit']();}),_0x264407['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x3b16cd,_0x338dae)=>!_0x3b16cd&&_0x338dae),_0x264407;}['_createShowHistoryButton'](){const _0xe69e58=new _0x1d1b95(this['locale']),_0x571bde=this['resultsView'],_0x5a567c=this['locale'];_0xe69e58['set']({'label':Wn(_0x5a567c,'History'),'withText':!0x1,'icon':Ht,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0xe69e58['bind']('isOn')['to'](_0x571bde,'isVisible'),_0xe69e58['bind']('isEnabled')['to'](this,'isEnabled'),_0xe69e58['on']('execute',()=>{_0x571bde['isVisible']=!_0x571bde['isVisible'],_0x571bde['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x2ccd04=()=>{_0x1385df['window']['requestAnimationFrame'](()=>{if(_0x3e9e44(this['element'])){const _0x304bd8=new _0x5002e3(this['queryView']['fieldView']['element']),_0x523643=_0x304bd8['width'],_0x21691a='rtl'===_0x5a567c['uiLanguageDirection']?'left':'right';_0x304bd8['excludeScrollbarsAndBorders'](),_0xe69e58['element']['style'][_0x21691a]=_0x523643-_0x304bd8['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x2ccd04),this['on']('render',_0x2ccd04),_0xe69e58;}['submit'](){const _0xffd4f9=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0xffd4f9);}['focus'](_0x2270dd){-0x1===_0x2270dd?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Hr extends _0xc6bdf6{['historyGroupView'];['clearHistoryButton'];constructor(_0x57d876){super(_0x57d876),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x2b2d84(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Wn(_0x57d876,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x553c9a=0x0;for(const _0xda6e95 of this['items'])_0x553c9a+=_0xda6e95['items']['length'];return{'resultsCount':_0x553c9a,'totalItemsCount':_0x553c9a};}['_createClearHistoryButton'](){const _0x5cb440=this['locale'],_0x2b5cd2=new _0x1d1b95(this['locale']);return _0x2b5cd2['set']({'label':'('+Wn(_0x5cb440,'Clear')+')','withText':!0x0}),_0x2b5cd2['on']('execute',()=>this['fire']('clearHistory')),_0x2b5cd2;}}class Rr extends _0x2a0bb9{constructor(_0x1cc2ba){super();const _0x27a748=new _0x34171b(),_0x2d7fbd=new _0x1d1b95(this['locale'],_0x27a748);this['children']['add'](_0x2d7fbd),_0x2d7fbd['set']({'label':_0x1cc2ba['prompt'],'withText':!0x0}),_0x2d7fbd['on']('execute',()=>{this['fire']('execute',{'value':_0x419c4b(_0x1cc2ba['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Br extends _0x405f09{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x3a6e61,_0x47edfa)=>{const _0x96fef3=go(_0x47edfa['prompt']);for(const _0x4fb880 of this)if(_0x4fb880!=_0x47edfa&&go(_0x4fb880['prompt'])===_0x96fef3){this['remove'](_0x4fb880);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x221f09=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x221f09));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x3d790e=>_0x3d790e)));}}function go(_0x2ec383){return _0x2ec383['toLowerCase']()['trim']();}class P extends _0x1f054a{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1ba538,_0x2099b8,_0x4b9b03=''){super(_0x1ba538),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',H['REPLACE']),this['_promptHistory']=new Br(),this['errorView']=new Vr(_0x1ba538),this['contentArea']=new Ir(_0x1ba538,_0x4b9b03),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 _0x50d771(),this['keystrokes']=new _0x407d91(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x18b3f0({'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 _0x175fe0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x2099b8],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x175fe0['if']('isError','ck-hidden',_0xc15907=>!_0xc15907)]},'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'](_0x16d6a4=0x1){-0x1===_0x16d6a4?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 _0x1d5d38=this['locale'],_0x311729=new Cr(_0x1d5d38,{'queryView':{'label':Wn(_0x1d5d38,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x2dda8d,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Wn(_0x1d5d38,'Empty\x20history'),'secondary':Wn(_0x1d5d38,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x311729['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1dbd0d,_0x1b1e11)=>_0x1dbd0d&&!_0x1b1e11),this['listenTo'](_0x311729,'submit',(_0x27aed0,_0x546f29)=>{this['prompt']=_0x546f29;const _0x50f24e=_0x4ae586(_0x546f29);this['fire']('submitPrompt',_0x50f24e),_0x546f29['trim']()&&this['_promptHistory']['add']({'prompt':_0x50f24e},0x0);},{'priority':'high'}),_0x311729;}['_createHistoryView'](){const _0x3c6af2=new Hr(this['locale']);return _0x3c6af2['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Rr),_0x3c6af2['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3c6af2;}['_createToolbar'](){const _0x517b06=new Pr(this['locale']);return _0x517b06['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4641a7,_0x409094,_0x567b52)=>_0x4641a7&&!_0x409094&&!!_0x567b52),_0x517b06['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x517b06['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x365995,_0x375b45,_0x573780)=>_0x365995&&!_0x375b45&&!!_0x573780),_0x517b06['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x517b06['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1511be,_0x34b6f9)=>_0x1511be&&!_0x34b6f9),_0x517b06['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x517b06['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x517b06['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x517b06;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x5ca0c5=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Wn(_0x5ca0c5,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x15282d){const _0x2ac650=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x15282d||Wn(_0x2ac650,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const k=globalThis['DataTransfer'];class g extends _0x53f6d2{['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[_0x36cf6,d,$,_0x2dc660];}constructor(_0x2757a3){super(_0x2757a3),_0x2757a3['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2757a3['config']['define']('ai.assistant.contentAreaCssClass',''),_0x2757a3['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2757a3['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x5978b1}=this;this['_aiAdapter']=_0x5978b1['plugins']['get']($),this['_dialog']=_0x5978b1['plugins']['get'](_0x2dc660),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x3183b2=new D(_0x5978b1,Array['from'](this['_commandDefinitions']['values']()));_0x5978b1['commands']['add']('showAIAssistant',_0x3183b2),_0x5978b1['ui']['componentFactory']['add']('aiCommands',_0x27497e=>{const _0x28342c=_0x290605(_0x27497e);return _0x28342c['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x28342c['buttonView']['set']({'label':Wn(_0x27497e,'AI\x20Commands'),'icon':_0x5a8842,'tooltip':!0x0}),_0x28342c['on']('execute',_0x4609c2=>this['_onExecute'](_0x4609c2['source']['id'])),_0x51e2e4(_0x28342c,_0x5978b1['ui']['view']['body'],function(_0x3e470e){const _0xb772c6=f(_0x3e470e['config']['get']('ai.assistant.commands'),_0x3e470e['locale']),_0xbb535f=G(_0x3e470e,_0xb772c6)['filter'](_0x3287a8=>_0x3287a8['commands']['length']);if(0x1===_0xbb535f['length'])return G(_0x3e470e,_0xbb535f[0x0]['commands'])['map'](_0x2a0808=>({'id':_0x2a0808['id'],'label':_0x2a0808['label']}));return _0xbb535f['map'](_0x4c939f=>{const {groupId:_0x20819f,groupLabel:_0x2739d0,commands:_0x27a0f5}=_0x4c939f,_0x50ecbb=G(_0x3e470e,_0x27a0f5)['map'](_0x47ace8=>({'id':_0x47ace8['id'],'label':_0x47ace8['label']}));return{'id':_0x20819f,'menu':_0x2739d0||_0x20819f,'children':_0x50ecbb};});}(_0x5978b1),{'ariaLabel':Wn(_0x27497e,'AI\x20Commands')}),_0x28342c['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x3183b2['on']('change:enabledCommandsIds',_0x3683ef),_0x28342c['menuView']['once']('render',_0x3683ef),_0x28342c;function _0x3683ef(){_0x28342c['isEnabled']=_0x3183b2['enabledCommandsIds']['length']>0x0;for(const _0x1f80dc of _0x28342c['menuView']['buttons'])_0x1f80dc['isEnabled']=_0x3183b2['enabledCommandsIds']['includes'](_0x1f80dc['id']);}}),_0x5978b1['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4aeb38=>{const _0x11bdfa=new _0x36bad0(_0x4aeb38);_0x11bdfa['buttonView']['set']({'label':Wn(_0x4aeb38,'AI\x20Commands'),'icon':_0x5a8842}),_0x11bdfa['bind']('isEnabled')['to'](_0x3183b2,'enabledCommandsIds',_0x57a970=>_0x57a970['length']>0x0);const _0x372dd6=f(_0x5978b1['config']['get']('ai.assistant.commands'),_0x4aeb38);return this['_populateMenuBarMenu'](_0x3183b2,_0x11bdfa,_0x372dd6,_0x4d30f3=>this['_onExecute'](_0x4d30f3)),_0x11bdfa;}),_0x5978b1['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x36fd34=this['_createAIAssistantUIButton'](_0x1d1b95);return _0x36fd34['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x36fd34;}),_0x5978b1['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x138afb=this['_createAIAssistantUIButton'](_0x229d28);return _0x138afb['set']({'role':'menuitemcheckbox'}),_0x138afb;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x338f95=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0xafcf44;for(const _0x155753 in _0x338f95){const _0x53cc21=_0x155753,_0x469750=_0x338f95[_0x53cc21];if('aiLicenseKeyValid'==_0x469750||'aiLicenseKeyInvalid'==_0x469750||'aiLicenseKeyExpired'==_0x469750||'aiLicenseKeyDomainLimit'==_0x469750||'aiLicenseKeyNotAllowed'==_0x469750||'aiLicenseKeyEvaluationLimit'==_0x469750||'aiLicenseKeyUsageLimit'==_0x469750){delete _0x338f95[_0x53cc21],_0xafcf44=_0x469750,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0xafcf44&&_0x338f95['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0xafcf44&&_0x338f95['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0xafcf44&&_0x338f95['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0xafcf44&&_0x338f95['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0xafcf44&&_0x338f95['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0xafcf44&&_0x338f95['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x1ff097='',_0x118658='',_0x7fc26b='custom'){const _0x461544=this['editor'],_0x3b774a=_0x461544['editing']['view'],_0x105c3f=_0x461544['plugins']['get'](d),_0x276e30=_0x461544['plugins']['get'](_0x36cf6);_0x105c3f['showFakeVisualSelection']();const _0x31dfe3=new k(),_0x3587f7=new ClipboardEvent('copy',{'clipboardData':_0x31dfe3}),_0x442394=new _0x3d063b(_0x31dfe3),_0x1121be=new _0x1d6dc5(_0x3b774a,_0x3587f7,{'dataTransfer':_0x442394});_0x276e30['_forceMarkersCopy']('comment',()=>{_0x3b774a['document']['fire']('copy',_0x1121be);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new N(_0x461544,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x5b59d8=_0x442394['getData']('text/html');const _0x5ef09c=_0x461544['model']['document']['selection'],_0x2bcc4b=Array['from'](_0x5ef09c['getRanges']());0x1===_0x2bcc4b['length']&&_0x2bcc4b[0x0]['isFlat']&&!_0x5ef09c['getSelectedElement']()&&''!==_0x5b59d8['replace'](/&nbsp;/g,'')['trim']()&&(_0x5b59d8='<p>'+_0x5b59d8+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x7fc26b,'query':_0x1ff097,'htmlContent':_0x5b59d8,'label':_0x118658,'mainActionLabel':H[_0x461544['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x22be60,'title':Wn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x22ba1a['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x105c3f['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x459672=new Map(),_0x3b099e=f(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x28681e of _0x3b099e)for(const _0x2a510f of _0x28681e['commands'])_0x459672['set'](_0x2a510f['id'],{..._0x2a510f,'groupId':_0x28681e['groupId'],'groupLabel':_0x28681e['groupLabel']||_0x28681e['groupId']});return _0x459672;}['_createAIAssistantUIButton'](_0x3747d8){const _0x7f3768=this['editor'],_0x5460de=_0x7f3768['commands']['get']('showAIAssistant'),_0x2ebe5c=new _0x3747d8(_0x7f3768['locale']);return _0x2ebe5c['set']({'label':Wn(_0x7f3768['locale'],'AI\x20Assistant'),'icon':_0x22be60,'isToggleable':!0x0}),_0x2ebe5c['bind']('isEnabled')['to'](_0x5460de),_0x2ebe5c['bind']('isOn')['to'](this['_dialog'],'id',_0x5c98e1=>'aiAssistant'===_0x5c98e1),this['listenTo'](_0x2ebe5c,'execute',()=>{_0x2ebe5c['isOn']?this['hideUI']():_0x5460de['execute']();}),_0x2ebe5c;}['_initView'](){const _0x3e8feb=this['editor']['plugins']['get'](d);this['_formView']=new P(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',()=>{_0x3e8feb['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x3e8feb['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x37063c,ui:{ariaLiveAnnouncer:_0x57d00b}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x5bb915,_0x5b74ae,_0x482407)=>{const _0x96f591=this['_aiAssistantController']['currentContext'];_0x482407?_0x57d00b['announce'](Wn(_0x37063c,'AI\x20is\x20writing')):_0x96f591&&_0x57d00b['announce'](Wn(_0x37063c,'Generated\x20content:\x20%0',_0x96f591),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x15eee0,_0x440dd8,_0x57d247)=>{if(_0x57d247){const _0x1559af=this['_formView']['errorView']['text'];_0x57d00b['announce'](Wn(_0x37063c,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x1559af));}});}['_onExecute'](_0x393e5a){const _0x5809a9=this['_commandDefinitions']['get'](_0x393e5a),_0x49738c=this['editor'],_0xa1f46d=_0x49738c['model']['document']['selection'],_0x2b235f=_0x49738c['commands']['get']('showAIAssistant'),_0x16ef8d=_0x49738c['plugins']['get'](d),_0x17d869=''+(_0x5809a9['groupId']!==V?_0x5809a9['groupLabel']+':\x20':'')+_0x5809a9['label'];if(!0x1!==_0x5809a9['requiresContent']&&_0xa1f46d['isCollapsed']){const _0x22b7e9=_0x22aa77(_0xa1f46d['getSelectedBlocks']())||_0x49738c['model']['schema']['getLimitElement'](_0xa1f46d);_0x49738c['model']['change'](_0x11ba05=>{_0x11ba05['setSelection'](_0x22b7e9,'in');});}_0x16ef8d['showFakeVisualSelection'](),_0x2b235f['execute'](_0x5809a9['prompt'],_0x17d869,'command:'+_0x393e5a);}['_populateMenuBarMenu'](_0x1ffd98,_0x1c654d,_0x468ad9,_0x55c341){const _0x3d5d7b=this['editor'],_0x263551=_0x3d5d7b['locale'],_0x489027=new _0x1388e9(_0x263551),_0x457be6=G(_0x3d5d7b,_0x468ad9)['filter'](_0x5caabc=>_0x5caabc['commands']['length']);0x1===_0x457be6['length']?this['_getMenuBarGroupButtons']({'command':_0x1ffd98,'commands':_0x457be6[0x0]['commands'],'parentMenuView':_0x1c654d,'onExecute':_0x55c341})['forEach'](_0x59733c=>_0x489027['items']['add'](_0x59733c)):_0x457be6['forEach'](({groupId:_0x185aa9,groupLabel:_0x2ca877,commands:_0x987f91})=>{const _0x1e0efa=new _0x134620(_0x263551,_0x1c654d),_0x2a15d8=new _0x36bad0(_0x263551),_0xb90eb5=new _0x1388e9(_0x263551),_0x33c37f=this['_getMenuBarGroupButtons']({'command':_0x1ffd98,'commands':_0x987f91,'parentMenuView':_0x2a15d8,'onExecute':_0x55c341});_0x2a15d8['buttonView']['set']({'label':_0x2ca877||_0x185aa9}),_0x2a15d8['delegate']('execute')['to'](_0x1c654d),_0xb90eb5['items']['addMany'](_0x33c37f),_0x2a15d8['panelView']['children']['add'](_0xb90eb5),_0x1e0efa['children']['add'](_0x2a15d8),_0x489027['items']['add'](_0x1e0efa);}),_0x1c654d['panelView']['children']['add'](_0x489027);}['_getMenuBarGroupButtons']({command:_0x388c2a,commands:_0x1ec3ea,parentMenuView:_0x3cd484,onExecute:_0xa41b6d}){const _0x54b270=this['editor'],_0x2e6895=_0x54b270['locale'];return G(_0x54b270,_0x1ec3ea)['map'](_0x27fd00=>{const _0xd4e562=new _0x134620(_0x2e6895,_0x3cd484),_0x375bba=new _0x229d28(_0x2e6895);return _0x375bba['set']({'label':_0x27fd00['label']}),_0x375bba['delegate']('execute')['to'](_0x3cd484),_0x375bba['on']('execute',()=>_0xa41b6d(_0x27fd00['id'])),_0x375bba['bind']('isEnabled')['to'](_0x388c2a,'enabledCommandsIds',_0x4dad85=>_0x4dad85['includes'](_0x27fd00['id'])),_0xd4e562['children']['add'](_0x375bba),_0xd4e562;});}}function q(_0x1d0eee,_0x218b42){return void 0x0!==_0x1d0eee['order']&&void 0x0===_0x218b42['order']?0x1:void 0x0===_0x1d0eee['order']&&void 0x0!==_0x218b42['order']?-0x1:void 0x0!==_0x1d0eee['order']&&void 0x0!==_0x218b42['order']?_0x1d0eee['order']-_0x218b42['order']:0x0;}function G(_0x138053,_0x104abc){_0x104abc['sort'](q);const _0x50e70b={},_0x1903d7=[];for(const _0x4f48c0 of _0x104abc)if(void 0x0!==_0x4f48c0['order']){if(_0x4f48c0['order']in _0x50e70b)throw new _0x25c351('ai-commands-config-order-collision',_0x138053,{'conflictingDefinitions':[_0x4f48c0,_0x50e70b[_0x4f48c0['order']]]});_0x50e70b[_0x4f48c0['order']]=_0x4f48c0,_0x1903d7['splice'](_0x4f48c0['order'],0x0,_0x4f48c0);}else _0x1903d7['push'](_0x4f48c0);return _0x1903d7;}class $n extends _0x53f6d2{static get['requires'](){return[g,d];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x29a4ae){super(_0x29a4ae);const _0x51e5ea=_0x29a4ae['config'],_0x24ea81=_0x29a4ae['locale'];_0x51e5ea['define']('ai.assistant.preserveComments',!0x0),_0x51e5ea['define']('ai.assistant.commands',qn(_0x24ea81)),_0x51e5ea['define']('ai.assistant.extraCommandGroups',[]),_0x51e5ea['define']('ai.assistant.removeCommands',[]);let _0x45d853=f(_0x51e5ea['get']('ai.assistant.commands'),_0x24ea81);const _0x26acfe=_0x51e5ea['get']('ai.assistant.extraCommandGroups'),_0x5840e2=_0x51e5ea['get']('ai.assistant.removeCommands');_0x26acfe['forEach'](_0x10931c=>{const _0x591d5c=_0x45d853['find'](_0x4683b1=>_0x4683b1['groupId']===_0x10931c['groupId']);_0x591d5c?_0x591d5c['commands']=_0x591d5c['commands']['concat'](_0x10931c['commands']):_0x45d853['push'](_0x10931c);}),_0x45d853=_0x45d853['filter'](_0x19d4e1=>!_0x5840e2['includes'](_0x19d4e1['groupId'])),_0x45d853['forEach'](_0x408815=>{_0x408815['commands']=_0x408815['commands']['filter'](_0x4bffed=>!_0x5840e2['includes'](_0x4bffed['id']));}),_0x51e5ea['set']('ai.assistant.commands',_0x45d853);}}function qn(_0x470269){return[{'groupId':'editOrReview','groupLabel':Wn(_0x470269,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Wn(_0x470269,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Wn(_0x470269,'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':Wn(_0x470269,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Wn(_0x470269,'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':Wn(_0x470269,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Wn(_0x470269,'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':Wn(_0x470269,'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':Wn(_0x470269,'Change\x20tone'),'commands':[{'id':'professional','label':Wn(_0x470269,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Wn(_0x470269,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Wn(_0x470269,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Wn(_0x470269,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Wn(_0x470269,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Wn(_0x470269,'Change\x20style'),'commands':[{'id':'business','label':Wn(_0x470269,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Wn(_0x470269,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Wn(_0x470269,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Wn(_0x470269,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Wn(_0x470269,'Translate'),'commands':[{'id':'translateEnglish','label':Wn(_0x470269,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Wn(_0x470269,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Wn(_0x470269,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Wn(_0x470269,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Wn(_0x470269,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Wn(_0x470269,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Wn(_0x470269,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Wn(_0x470269,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ye extends _0x53f6d2{['abortController'];static get['requires'](){return[$];}constructor(_0x533a20){super(_0x533a20),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get']($)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x4c8c6d){return this['sendRequest'](_0x4c8c6d)['catch'](_0x48905c=>{if(_0x48905c instanceof er)return Promise['reject'](_0x48905c);if('AbortError'==_0x48905c['name'])return Promise['resolve']();throw console['error'](_0x48905c),new _0x25c351('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x3d1608,_0x29ba2d){const _0x5d725f=this['editor']['locale'],_0x3960d0={'Content-Type':'application/json'};if('object'==typeof _0x3d1608)Object['assign'](_0x3960d0,_0x3d1608);else{if(_0x3d1608)try{const _0x139835=await _0x3d1608(_0x29ba2d);Object['assign'](_0x3960d0,_0x139835);}catch{return Promise['reject'](new er(Wn(_0x5d725f,'AI_ERROR_GET_HEADERS')));}}return _0x3960d0;}async['_prepareRequestParameters'](_0x13e7a7,_0x3531a0){const _0x13cc82=this['editor']['locale'];if('object'==typeof _0x13e7a7)return _0x13e7a7;try{return await _0x13e7a7(_0x3531a0);}catch{return Promise['reject'](new er(Wn(_0x13cc82,'AI_ERROR_GET_PARAMETERS')));}}}class Qn extends ye{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x113e9b){super(_0x113e9b),_0x113e9b['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x113e9b['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x113e9b['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x113e9b['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x113e9b['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x113e9b['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x43051b,context:_0x579425,onData:_0x48584b,actionId:_0x5517e2}){const _0x2d3cc8=this['editor']['locale'],_0x38bfa9=await this['prepareMessages'](_0x43051b,_0x579425,_0x5517e2),_0x47f0af=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5517e2),_0xb1e29a=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5517e2),_0x5dcac7={'messages':_0x38bfa9,..._0xb1e29a},_0x2fd6b5={'method':'POST','headers':_0x47f0af,'body':JSON['stringify'](_0x5dcac7),'signal':this['abortController']['signal']},_0x100db3=await fetch(this['_apiUrl'],_0x2fd6b5);if(_0x100db3['ok'])return _0xb1e29a['stream']?await this['_readStreamableResponse'](_0x100db3,_0x48584b):await this['_readStaticResponse'](_0x100db3,_0x48584b),Promise['resolve']();{const _0x416092=await _0x100db3['text']();return _0x416092['includes']('context_length_exceeded')?Promise['reject'](new er(Wn(_0x2d3cc8,'AI_ERROR_CONTEXT_LENGTH'))):_0x416092['includes']('Moderation')?Promise['reject'](new er(Wn(_0x2d3cc8,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x416092));}}async['prepareMessages'](_0x5f0667,_0x3f5786,_0x4a32f8){let _0x48c0f0,_0x5ec8bc;return _0x3f5786?(_0x48c0f0='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.',_0x5ec8bc='Instruction:\x0a'+_0x5f0667+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3f5786):(_0x48c0f0='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.',_0x5ec8bc=_0x5f0667),[{'role':'system','content':_0x48c0f0},{'role':'user','content':_0x5ec8bc}];}async['_readStreamableResponse'](_0x59fb90,_0x7ec06c){const _0x2a0c3c=_0x59fb90['body']['getReader'](),_0x3916f7=new TextDecoder();let _0x103690='',_0x361023='',_0x27b56c='',_0x4d7b49=!0x1;for(;!_0x4d7b49;){const {done:_0x210620,value:_0x379128}=await _0x2a0c3c['read'](),_0x5cbe11=_0x103690+_0x3916f7['decode'](_0x379128);let _0x23164b='';_0x4d7b49=_0x210620;try{_0x23164b=this['_cleanUpData'](_0x5cbe11),_0x103690='';}catch{_0x103690=_0x5cbe11;continue;}_0x361023+=_0x23164b,!_0x4d7b49&&this['_isBufferIncomplete'](_0x361023)||_0x361023&&(_0x27b56c+=_0x361023,_0x361023='',_0x7ec06c(_0x27b56c));}return Promise['resolve']();}async['_readStaticResponse'](_0x43a54a,_0xc6a82d){return _0xc6a82d((await _0x43a54a['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x326010){const _0x54b2e5=_0x326010['split']('<')['length']!==_0x326010['split']('>')['length'],_0x2eba58=_0x326010['length']<0x1e;return _0x54b2e5&&_0x2eba58;}['_cleanUpData'](_0x4938ac){return _0x4938ac['split'](/\n(?![^{]*\})/g)['map'](_0x4ad448=>_0x4ad448['replace']('data:\x20',''))['filter'](_0x3a8132=>_0x3a8132&&_0x3a8132['length']>0x0&&'[DONE]'!==_0x3a8132)['map'](_0x2f7777=>{const {choices:_0x535a70}=JSON['parse'](_0x2f7777);if(_0x535a70[0x0]?.['delta']?.['content'])return _0x535a70[0x0]['delta']['content'];})['filter'](_0x41f0c7=>_0x41f0c7)['join']('');}}class Xn extends ye{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x30c07d){super(_0x30c07d),_0x30c07d['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x30c07d['config']['define']('ai.assistant.adapter.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x30c07d['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x30c07d['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x30c07d['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x30c07d['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x4371d9,context:_0x5c33e5,onData:_0x518b65,actionId:_0x172248}){const {model:_0x49dcfa,stream:_0x1f6c54,..._0xec3a24}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x172248),_0x1f6ab9={'prompt':await this['preparePrompt'](_0x4371d9,_0x5c33e5,_0x49dcfa,_0x172248),..._0xec3a24};this['_apiUrl']?await this['_processProxyRequest'](_0x1f6ab9,_0x49dcfa,_0x1f6c54,_0x518b65,_0x172248):await this['_processAWSRequest'](_0x1f6ab9,_0x49dcfa,_0x1f6c54,_0x518b65);}async['preparePrompt'](_0x463ac4,_0x3e95dd,_0x64b7e3,_0x827936){let _0x2d324a,_0x2c9107;return _0x3e95dd?(_0x2d324a='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.',_0x2c9107='Instruction:\x0a'+_0x463ac4+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3e95dd):(_0x2d324a='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.',_0x2c9107=_0x463ac4),'meta.llama'==this['getModelFamily'](_0x64b7e3)?'<<SYS>>\x0a'+_0x2d324a+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2c9107+'\x0a[/INST]':'Human:\x0a'+_0x2d324a+'\x0a'+_0x2c9107+'\x0a\x0aAssistant:';}['getModelFamily'](_0x48a128){if(/^anthropic\.claude/['test'](_0x48a128))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x48a128))return'ai21.j2';if(/^cohere\.command/['test'](_0x48a128))return'cohere.command';if(/^meta\.llama/['test'](_0x48a128))return'meta.llama';throw new er(Wn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x48a128));}async['_processProxyRequest'](_0x46b708,_0x214676,_0x208213,_0x195316,_0x506faa){const _0xbf8e50={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x506faa),'body':JSON['stringify']({..._0x46b708,'model':_0x214676,'stream':_0x208213}),'signal':this['abortController']['signal']},_0x23e890=await fetch(this['_apiUrl'],_0xbf8e50);_0x208213?await this['_readStreamableResponse'](_0x23e890,_0x214676,_0x195316):await this['_readStaticResponse'](_0x23e890,_0x214676,_0x195316);}async['_processAWSRequest'](_0x58f810,_0x22fa61,_0xe6dfb9,_0xe642d8){const _0x46f538=new _0x251854(this['_bedrockClientConfig']),_0x1f3e1b={'body':JSON['stringify'](_0x58f810),'contentType':'application/json','accept':'application/json','modelId':_0x22fa61};let _0x5ad226;if(_0xe6dfb9){const _0x560cec=new _0x62fa9(_0x1f3e1b);_0x5ad226=await _0x46f538['send'](_0x560cec,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x5ad226,_0x22fa61,_0xe642d8);}else{const _0x4e44e0=new _0x43fbb4(_0x1f3e1b);_0x5ad226=await _0x46f538['send'](_0x4e44e0,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x5ad226,_0x22fa61,_0xe642d8);}}async['_readAsyncIterableResponse'](_0x33fc8b,_0x4157f6,_0x589952){const _0x33a98e=_0x33fc8b['body'],_0x2c5495=new TextDecoder('utf-8');let _0x21fef1='';for await(const _0x14dc00 of _0x33a98e)if(_0x14dc00['chunk']){const _0x2ae1fa=_0x2c5495['decode'](_0x14dc00['chunk']['bytes']),_0x4867a2=JSON['parse'](_0x2ae1fa);_0x21fef1+=this['_getGeneratedText'](_0x4867a2,_0x4157f6),_0x589952(_0x21fef1);}return Promise['resolve']();}async['_readStreamableResponse'](_0x5ef8cb,_0x13ce87,_0x570a7f){const _0x53ad34=_0x5ef8cb['body'],_0x4e466d=new TextDecoder('utf-8'),_0x11fe8e=_0x53ad34['getReader']();let _0x509f2b='',_0x116f41='',_0x270a1b=!0x1;for(;!_0x270a1b;){const {done:_0x1e4bb8,value:_0x6f28b7}=await _0x11fe8e['read']();if(_0x270a1b=_0x1e4bb8,_0x270a1b)break;const _0x330a15=(_0x509f2b+_0x4e466d['decode'](_0x6f28b7))['split']('\x0a')['map'](_0x5cd764=>{try{return _0x509f2b='',JSON['parse'](_0x5cd764);}catch{return _0x509f2b=_0x5cd764,null;}})['filter'](_0x5271ce=>null!==_0x5271ce);_0x330a15['length']&&(_0x116f41+=_0x330a15['map'](_0x143eaf=>this['_getGeneratedText'](_0x143eaf,_0x13ce87))['join'](''),_0x570a7f(_0x116f41));}return Promise['resolve']();}async['_readStaticResponse'](_0x1abdb5,_0x34a7f1,_0x5bc730){let _0x4c8fa2;return _0x4c8fa2=_0x1abdb5 instanceof Response?await _0x1abdb5['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x1abdb5['body'])),(_0x5bc730(this['_getGeneratedText'](_0x4c8fa2,_0x34a7f1)),Promise['resolve']());}['_getGeneratedText'](_0x37002b,_0x66e1f0){switch(this['getModelFamily'](_0x66e1f0)){case'anthropic.claude':return _0x37002b['completion'];case'ai21.j2':return _0x37002b['completions'][0x0]['data']['text'];case'cohere.command':return _0x37002b['generations'][0x0]['text'];case'meta.llama':return _0x37002b['generation'];}}}class ia extends _0x1d1b95{constructor(_0x313f64,_0x184712={}){super(_0x313f64),this['isToggleable']=!0x0,this['set']('side',_0x184712['side']||'top');const _0x16435b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x5453e9(_0x184712['class']||[]),_0x16435b['to']('side',_0x25e38c=>'ck-tab-button_'+_0x25e38c),_0x16435b['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x1f054a{['children'];constructor(_0x455f66,_0x435b3c={}){super(_0x455f66);const _0x2dc611=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x5453e9(_0x435b3c['class']||[]),_0x2dc611['to']('class'),_0x2dc611['if']('isVisible','ck-hidden',_0xb79a73=>!_0xb79a73)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x1f054a{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x2463c0,_0x532c30={}){super(_0x2463c0),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x532c30['side']||'top'),this['set']('isMaximized',!0x1);const _0x2d3f29=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x5453e9(_0x532c30['class']||[]),_0x2d3f29['to']('side',_0x8deb32=>'ck-tabs_'+_0x8deb32),_0x2d3f29['to']('class'),_0x2d3f29['to']('isMaximized',_0x5dee31=>_0x5dee31?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x2d3f29['to']('side',_0x367cf3=>'ck-tabs__buttons-container_'+_0x367cf3)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x2d3f29['to']('side',_0x46974f=>'ck-tabs__panels-container_'+_0x46974f)]},'children':this['panelViews']},..._0x5453e9(_0x532c30['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x1132ad){const _0x47024f=this['_tabs']['get'](_0x1132ad);return _0x47024f||null;}['addTab'](_0x339fab){const _0x1689c5=this['_setupButton']({'id':_0x339fab['id'],'label':_0x339fab['buttonLabel'],'icon':_0x339fab['buttonIcon'],'order':_0x339fab['order']}),_0x2e6c11=new ea(this['locale']);return _0x2e6c11['render'](),_0x339fab['content']&&_0x2e6c11['children']['add'](_0x339fab['content']),this['panelViews']['add'](_0x2e6c11),this['_tabs']['set'](_0x339fab['id'],{'button':_0x1689c5,'panel':_0x2e6c11,'order':void 0x0!==_0x339fab['order']?_0x339fab['order']:null}),this['fire']('addTab:'+_0x339fab['id'],{'id':_0x339fab['id'],'button':_0x1689c5,'panel':_0x2e6c11}),null===this['activeTab']?this['activateTab'](_0x339fab['id']):this['_hidePanel'](_0x339fab['id']),{'button':_0x1689c5,'panel':_0x2e6c11};}['activateTab'](_0x100472){if(null!==_0x100472&&!this['getTab'](_0x100472))throw new _0x25c351('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x100472});this['activeTab']!==_0x100472&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x100472,_0x100472&&this['_showPanel'](_0x100472),this['fire']('activateTab:'+_0x100472,_0x100472));}['showTab'](_0x5815a4){if(!this['getTab'](_0x5815a4))throw new _0x25c351('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x5815a4});this['_showPanel'](_0x5815a4),this['_showButton'](_0x5815a4),this['fire']('show:'+_0x5815a4,_0x5815a4);}['hideTab'](_0x77b13c){if(!this['getTab'](_0x77b13c))throw new _0x25c351('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x77b13c});const _0x34d22c=this['activeTab'];this['_hidePanel'](_0x77b13c),this['_hideButton'](_0x77b13c);const _0x5f068b=this['getTabIds']();_0x34d22c===_0x77b13c&&_0x5f068b['length']>0x1&&this['activateTab'](_0x5f068b['find'](_0x593e87=>_0x593e87!==_0x77b13c)),this['fire']('hide:'+_0x77b13c,_0x77b13c);}['_getPanel'](_0x4d381a){const _0x4b2c14=this['_tabs']['get'](_0x4d381a);return _0x4b2c14?_0x4b2c14['panel']:null;}['_showPanel'](_0x2aab56){null!==this['activeTab']&&this['activeTab']!==_0x2aab56||this['_getPanel'](_0x2aab56)['show']();}['_hidePanel'](_0x52e285){const _0x2413bc=this['_getPanel'](_0x52e285);_0x2413bc['isVisible']&&(this['activeTab']===_0x52e285&&(this['activeTab']=null),_0x2413bc['hide']());}['_getButton'](_0x3bfc93){const _0x4b5502=this['_tabs']['get'](_0x3bfc93);return _0x4b5502?_0x4b5502['button']:null;}['_showButton'](_0x3db3eb){this['_getButton'](_0x3db3eb)['show']();}['_hideButton'](_0xe2c901){this['_getButton'](_0xe2c901)['hide']();}['_setupButton'](_0x30dc1d){const _0x2ddceb=new ia(this['locale'],{'side':this['side']}),_0xdc418c=this['buttonViews'];if(_0x2ddceb['set']({'label':_0x30dc1d['label'],'icon':_0x30dc1d['icon'],'tooltip':!0x0,'withText':!0x0}),_0x2ddceb['bind']('isOn')['to'](this,'activeTab',_0x5c905a=>_0x5c905a===_0x30dc1d['id']),_0x2ddceb['bind']('side')['to'](this,'side'),_0x30dc1d['order']){const _0x12c06a=[...this['_tabs']]['reduce']((_0x1c5a40,_0x17517e)=>{const _0x133a1e=_0x17517e[0x0],{order:_0x17ddf1}=_0x17517e[0x1];return!_0x17ddf1||_0x17ddf1>_0x30dc1d['order']?_0x1c5a40:_0x17ddf1>=_0x1c5a40['order']?{'id':_0x133a1e,'order':_0x17ddf1}:_0x1c5a40;},{'id':'','order':0x0}),_0x5cb823=_0xdc418c['getIndex'](this['_getButton'](_0x12c06a['id']));_0xdc418c['add'](_0x2ddceb,_0x5cb823+0x1);}else _0xdc418c['add'](_0x2ddceb);return _0x2ddceb['on']('execute',()=>{this['activateTab'](_0x30dc1d['id']);}),_0x2ddceb;}}const ni=['overlay','sidebar','custom'],oi=['left','right'];class hi extends ss{constructor(_0xa25e2f,_0x588476={}){super(_0xa25e2f,_0x588476),this['set']('type',_0x588476['type']||'sidebar'),this['set']('side',_0x588476['side']||'right'),this['set']('isVisible',_0x588476['visibleByDefault']??!0x0);const _0x11ed6a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x11ed6a['if']('type','ck-ai-tabs__overlay',_0x575fd9=>'overlay'===_0x575fd9),_0x11ed6a['if']('type','ck-ai-tabs__sidebar',_0x1af938=>'sidebar'===_0x1af938),_0x11ed6a['if']('isVisible','ck-hidden',_0x3168d8=>!_0x3168d8)]}}),this['buttonViews']['on']('add',(_0x219a1d,_0x40c377)=>{_0x40c377['set']('withText',!0x1);});}}class it extends _0x5dcf5b{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x77f7ff){super(_0x77f7ff);const _0x3c288b=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x3c288b)throw new _0x25c351('ai-tabs-configuration-not-found');if(void 0x0!==_0x3c288b['showResizeButton']&&(this['showResizeButton']=_0x3c288b['showResizeButton']),'sidebar'!==_0x3c288b['type']&&'overlay'!==_0x3c288b['type']||_0x3c288b['side']&&(this['side']=_0x3c288b['side']),'sidebar'===_0x3c288b['type']){if(this['container']=_0x3c288b['element'],this['set']('type','sidebar'),!this['container'])throw new _0x25c351('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x3c288b['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===_0x3c288b['visibleByDefault']||_0x3c288b['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 _0x39b2a6&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x5dff08){if(_0x5dff08&&this['type']!==_0x5dff08){if(!ni['includes'](_0x5dff08))throw new _0x25c351('ai-tabs-unsupported-ui-type');this['type']=_0x5dff08;}}['switchSide'](_0x415fb0){if(_0x415fb0&&this['side']!==_0x415fb0){if(!oi['includes'](_0x415fb0))throw new _0x25c351('ai-tabs-unsupported-ui-side');this['side']=_0x415fb0;}}['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 _0x5dcf5b{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4b3708){super(_0x4b3708),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 _0x4f1a33=this['context']['plugins']['get']('CloudServices');if(!_0x4f1a33['token'])throw new _0x25c351('ai-missing-token',this);this['_token']=_0x4f1a33['token'];}['startConversation'](_0x11cbaf,_0x864ea){const _0xe9c216=this['_sendApiRequest']('/conversations','POST',{'id':_0x11cbaf,'group':_0x864ea});return{'getConversation':async()=>(await _0xe9c216['request'])['json'](),'abortController':_0xe9c216['abortController']};}['queryAssistant']({message:_0x5725a5,conversationId:_0x36c1aa,parts:_0x21b452,capabilities:_0x4cd695,model:_0x2052c7,attributes:_0x9b87e6}){const _0x346929={'prompt':_0x5725a5,'content':_0x21b452,'model':_0x2052c7,..._0x4cd695&&{'capabilities':_0x4cd695},..._0x9b87e6&&{'attributes':_0x9b87e6}},_0x47099d=this['_sendApiRequest']('/conversations/'+_0x36c1aa+'/messages','POST',_0x346929);return{'getStream':async()=>{const _0x279cfa=(await _0x47099d['request'])['body'];return this['_getStreamReader'](_0x279cfa);},'abortController':_0x47099d['abortController']};}['executeCustomAction']({content:_0x468a85,message:_0x26983c,model:_0x427ac2,outputFormat:_0x35fa37}){const _0x2697a5={'content':[{'type':'text','content':_0x468a85}],'prompt':_0x26983c,'model':_0x427ac2,'outputFormat':_0x35fa37},_0x3faf7c=this['_sendApiRequest']('/actions/custom/calls','POST',_0x2697a5);return{'getStream':async()=>{const _0x21534e=(await _0x3faf7c['request'])['body'];return this['_getStreamReader'](_0x21534e);},'abortController':_0x3faf7c['abortController']};}['executeAction']({actionName:_0x2568ca,content:_0x570766,args:_0x14085c}){const _0x193158={'content':[{'type':'text','content':_0x570766}],'args':_0x14085c},_0x26704c=this['_sendApiRequest']('/actions/system/'+_0x2568ca+'/calls','POST',_0x193158);return{'getStream':async()=>{const _0x3edac2=(await _0x26704c['request'])['body'];return this['_getStreamReader'](_0x3edac2);},'abortController':_0x26704c['abortController']};}['uploadFile'](_0x4f2e93,_0x17d1ec,_0x40867d){const _0x19e52b=new FormData();_0x19e52b['append']('file',_0x17d1ec,_0x17d1ec['name']),_0x40867d&&_0x19e52b['append']('attributes',JSON['stringify'](_0x40867d));const _0x325223=this['_sendApiRequest']('/conversations/'+_0x4f2e93+'/files','POST',_0x19e52b);return{'getId':async()=>(await _0x325223['request'])['json'](),'abortController':_0x325223['abortController']};}['fetchDocument'](_0x4c9839,_0x305a12){const _0x57fdf0=this['_sendApiRequest']('/conversations/'+_0x4c9839+'/documents/'+_0x305a12,'GET');return{'getDocument':async()=>(await _0x57fdf0['request'])['json'](),'abortController':_0x57fdf0['abortController']};}['uploadDocument'](_0x414836,_0x1d327d,_0x11610a){const _0x4d869c={'content':_0x1d327d};_0x11610a&&(_0x4d869c['attributes']=_0x11610a);const _0x501a31=this['_sendApiRequest']('/conversations/'+_0x414836+'/documents','POST',_0x4d869c);return{'getId':async()=>(await _0x501a31['request'])['json'](),'abortController':_0x501a31['abortController']};}['fetchConversations'](_0x382923,_0x4bc395={}){const _0x7ebd8f=new URLSearchParams();_0x7ebd8f['append']('group',_0x382923),_0x7ebd8f['append']('excludeEmpty',!0x1!==_0x4bc395['excludeEmpty']?'true':'false'),_0x7ebd8f['append']('limit',_0x4bc395['limit']?_0x4bc395['limit']['toString']():'100'),_0x7ebd8f['append']('sortBy',_0x4bc395['sortBy']?_0x4bc395['sortBy']:'createdAt'),_0x7ebd8f['append']('order',_0x4bc395['order']?_0x4bc395['order']:'desc');const _0x50d5e3=this['_sendApiRequest']('/conversations?'+_0x7ebd8f['toString'](),'GET');return{'getConversations':async()=>{const _0x2fdd68=await _0x50d5e3['request'];return(await _0x2fdd68['json']())['items'];},'abortController':_0x50d5e3['abortController']};}['deleteConversation'](_0x5ea35d){const _0x43e840=this['_sendApiRequest']('/conversations/'+_0x5ea35d,'DELETE');return{'execute':async()=>{await _0x43e840['request'];},'abortController':_0x43e840['abortController']};}['updateConversation'](_0xfebc04,_0x5d2fe1){const _0x2d92c9=this['_sendApiRequest']('/conversations/'+_0xfebc04,'PATCH',_0x5d2fe1);return{'getResult':async()=>(await _0x2d92c9['request'],_0x5d2fe1),'abortController':_0x2d92c9['abortController']};}['fetchConversation'](_0x5d84a1){const _0x2778a1=this['_sendApiRequest']('/conversations/'+_0x5d84a1,'GET');return{'getConversation':async()=>(await _0x2778a1['request'])['json'](),'abortController':_0x2778a1['abortController']};}['fetchConversationMessages'](_0x561ae9){const _0x54fa1f=this['_sendApiRequest']('/conversations/'+_0x561ae9+'/messages','GET');return{'getMessages':async()=>{const _0x3a8553=await _0x54fa1f['request'];return(await _0x3a8553['json']())['items'];},'abortController':_0x54fa1f['abortController']};}['uploadUrl'](_0x2c04d3,_0x82a8c8,_0x56b9b9){const _0x125c14=this['_sendApiRequest']('/conversations/'+_0x2c04d3+'/web-resources','POST',{'url':_0x82a8c8,'attributes':_0x56b9b9});return{'getId':async()=>(await _0x125c14['request'])['json'](),'abortController':_0x125c14['abortController']};}['getModels'](_0x4d2a54='en'){const _0x130c6e=new URLSearchParams();_0x130c6e['append']('language',_0x4d2a54);const _0x4ed64d='/models/1?'+_0x130c6e['toString'](),_0x42408e=this['_sendApiRequest'](_0x4ed64d,'GET');return{'list':async()=>await(await _0x42408e['request'])['json'](),'abortController':_0x42408e['abortController']};}['deleteFile'](_0x1e572c,_0x4a4570){const _0x55e331=this['_sendApiRequest']('/conversations/'+_0x1e572c+'/files/'+_0x4a4570,'DELETE');return{'execute':async()=>{await _0x55e331['request'];},'abortController':_0x55e331['abortController']};}['deleteDocument'](_0x30e020,_0x1a6e1c){const _0x4e244a=this['_sendApiRequest']('/conversations/'+_0x30e020+'/documents/'+_0x1a6e1c,'DELETE');return{'execute':async()=>{await _0x4e244a['request'];},'abortController':_0x4e244a['abortController']};}['deleteWebResource'](_0x22952c,_0x28a3d){const _0x4ddb63=this['_sendApiRequest']('/conversations/'+_0x22952c+'/web-resources/'+_0x28a3d,'DELETE');return{'execute':async()=>{await _0x4ddb63['request'];},'abortController':_0x4ddb63['abortController']};}['callSystemReview']({reviewName:_0xe9a3df,content:_0x3a403b,args:_0x193261}){const _0x2639d6=this['_sendApiRequest']('/reviews/system/'+_0xe9a3df+'/calls','POST',{'content':[{'type':'text','content':_0x3a403b}],'args':_0x193261});return{'getStream':async()=>{const _0xd4430c=(await _0x2639d6['request'])['body'];return this['_getStreamReader'](_0xd4430c);},'abortController':_0x2639d6['abortController']};}['callCustomReview']({content:_0x3fc8a7,prompt:_0x506ae8,model:_0x2d9d22}){const _0x431f27=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x3fc8a7}],'prompt':_0x506ae8,'model':_0x2d9d22});return{'getStream':async()=>{const _0x5b286a=(await _0x431f27['request'])['body'];return this['_getStreamReader'](_0x5b286a);},'abortController':_0x431f27['abortController']};}['upsertAIChatRating'](_0x1a0d2d,_0x49f690,_0x5d07f2){const _0x5be8c8=this['_sendApiRequest']('/conversations/'+_0x1a0d2d+'/messages/'+_0x49f690+'/ratings','PUT',{'positiveCount':_0x5d07f2['positiveCount'],'totalCount':_0x5d07f2['totalCount'],'modificationId':_0x5d07f2['modificationId']});return{'execute':async()=>{await _0x5be8c8['request'];},'abortController':_0x5be8c8['abortController']};}['upsertAIActionRating'](_0x5a5a82,_0x49cd64,_0x44ba4d){const _0x3cc655=this['_sendApiRequest']('/actions/system/'+_0x5a5a82+'/calls/'+_0x49cd64+'/ratings','PUT',{'positiveCount':_0x44ba4d['positiveCount'],'totalCount':_0x44ba4d['totalCount']});return{'execute':async()=>{await _0x3cc655['request'];},'abortController':_0x3cc655['abortController']};}['upsertCustomAIActionRating'](_0x2fdb2e,_0x2d7adc){const _0x42e00a=this['_sendApiRequest']('/actions/custom/calls/'+_0x2fdb2e+'/ratings','PUT',{'positiveCount':_0x2d7adc['positiveCount'],'totalCount':_0x2d7adc['totalCount']});return{'execute':async()=>{await _0x42e00a['request'];},'abortController':_0x42e00a['abortController']};}['upsertAIReviewRating'](_0x5e19ba,_0x54b6e0,_0x2e4c50,_0x473f14){const _0x32c17d=this['_sendApiRequest']('/reviews/system/'+_0x5e19ba+'/calls/'+_0x54b6e0+'/ratings','PUT',{'positiveCount':_0x2e4c50['positiveCount'],'totalCount':_0x2e4c50['totalCount'],'dataId':_0x473f14});return{'execute':async()=>{await _0x32c17d['request'];},'abortController':_0x32c17d['abortController']};}['upsertCustomAIReviewRating'](_0x33b7dc,_0x279efa,_0x31ae5b){const _0x4fde50=this['_sendApiRequest']('/reviews/custom/calls/'+_0x33b7dc+'/ratings','PUT',{'positiveCount':_0x279efa['positiveCount'],'totalCount':_0x279efa['totalCount'],'dataId':_0x31ae5b});return{'execute':async()=>{await _0x4fde50['request'];},'abortController':_0x4fde50['abortController']};}['_sendApiRequest'](_0x35b77e,_0x469678,_0x5601fa){const _0x35c460=new AbortController(),_0x5f3907=_0x5601fa instanceof FormData,_0x4b9584={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x5601fa&&!_0x5f3907&&(_0x4b9584['Content-Type']='application/json');const _0x21e9a4={'method':_0x469678,'headers':_0x4b9584,'signal':_0x35c460['signal']};return _0x5601fa&&(_0x21e9a4['body']=_0x5f3907?_0x5601fa:JSON['stringify'](_0x5601fa)),{'request':fetch(''+this['_apiUrl']+_0x35b77e,_0x21e9a4)['catch'](_0x5d5199=>{this['_handleError'](_0x5d5199);})['then'](_0x2138c2=>_0x2138c2['ok']?_0x2138c2:_0x2138c2['json']()['then'](_0x3e6f2e=>{throw{'url':this['_apiUrl'],'path':_0x35b77e,'method':_0x469678,'body':_0x5601fa,'status':(_0x2138c2||{})['status'],'statusText':(_0x2138c2||{})['statusText'],'code':_0x3e6f2e['code'],'message':_0x3e6f2e['message'],'traceId':_0x3e6f2e['traceId']};})),'abortController':_0x35c460};}async*['_getStreamReader'](_0x4e6514){const _0x301092=[],_0x1d8f5e=_0x4e6514['getReader'](),_0xbda487=$t({'onError':_0x11168e=>{this['_handleError'](_0x11168e);},'onEvent':_0x56042d=>{_0x56042d['data']=JSON['parse'](_0x56042d['data']),_0x301092['push'](_0x56042d);}});try{let _0x34e092=!0x1;for(;!_0x34e092;){const {done:_0x22d804,value:_0x74e135}=await _0x1d8f5e['read']();_0x22d804&&(_0x34e092=!0x0),_0xbda487['feed'](this['_decoder']['decode'](_0x74e135,{'stream':!0x0})),yield*_0x301092,_0x301092['length']=0x0;}}catch(_0x4f0d48){this['_handleError'](_0x4f0d48);}finally{_0x1d8f5e['releaseLock'](),_0xbda487['reset']();}}['_handleError'](_0x5e63e7){if(_0x5e63e7 instanceof _0x25c351)throw _0x5e63e7;if(_0x5e63e7 instanceof Error&&'AbortError'===_0x5e63e7['name'])throw new _0x25c351('ai-request-aborted',this,{'originalError':_0x5e63e7});throw new _0x25c351('ai-request-failed',this,{'originalError':_0x5e63e7});}}function h(_0x2cd485,_0x49ab7d,_0x4297f3){const t=_0x2cd485['t'];switch(_0x49ab7d){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'},_0x4297f3);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.'},_0x4297f3);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.'},_0x4297f3);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.'},_0x4297f3);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'},_0x4297f3);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x4297f3);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'},_0x4297f3);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.'},_0x4297f3);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.'},_0x4297f3);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.'},_0x4297f3);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.'},_0x4297f3);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'},_0x4297f3);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.'},_0x4297f3);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 _0x49ab7d;}}function Hs(_0x2862dc,_0x3bc5fb){const _0x57cd5e=new _0x1d1b95(_0x2862dc),_0x5e0772=h(_0x2862dc,'AI_TABS_LABEL_MINIMIZE'),_0x278070=h(_0x2862dc,'AI_TABS_LABEL_MAXIMIZE');return _0x57cd5e['set']({'withText':!0x1,'icon':_0x58d6c6,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary'}),_0x57cd5e['bind']('label')['to'](_0x3bc5fb,'isMaximized',_0x1d515e=>_0x1d515e?_0x5e0772:_0x278070),_0x57cd5e['bind']('icon')['to'](_0x3bc5fb,'isMaximized',_0x249974=>_0x249974?_0xd6b3a0:_0x58d6c6),_0x57cd5e['bind']('isOn')['to'](_0x3bc5fb,'isMaximized'),_0x57cd5e['on']('execute',()=>{_0x3bc5fb['fire']('resizeTabs');}),_0x57cd5e;}function Ui(_0x4039fb){return _0x296793(_0x4039fb);}function pt(_0x32ff60){return _0xc63f4e(_0x32ff60);}function It(_0x25babc,_0x25e912,_0x4ac9ba){const _0x3f5231=null!==_0x25e912?_0x3f2b18=>_0x3f2b18['attribs'][_0x25babc]===_0x25e912:_0x4b5562=>Boolean(_0x4b5562['attribs'][_0x25babc]);return gt(_0x315ad8=>_0x441935(_0x315ad8)&&_0x3f5231(_0x315ad8),_0x4ac9ba);}function Fi(_0x4dd307,_0xf02569,_0x791169){const _0x96f015=null!==_0xf02569?_0x223acc=>_0x223acc['attribs'][_0x4dd307]===_0xf02569:_0x680a9e=>Boolean(_0x680a9e['attribs'][_0x4dd307]);return _0x5b5fc9(_0x537c9d=>_0x441935(_0x537c9d)&&_0x96f015(_0x537c9d),_0x791169);}function ut(_0x11456e,_0x1e1793){return _0x11456e&&_0x441935(_0x11456e)?_0x11456e['attribs'][_0x1e1793]:null;}function Zi(_0x34cebe,_0x5358c6,_0x1217e4){_0x441935(_0x34cebe)&&(null===_0x1217e4?delete _0x34cebe['attribs'][_0x5358c6]:_0x34cebe['attribs'][_0x5358c6]=_0x1217e4);}function Ki(_0x29a790,_0xdbfe60,_0x522cc3){const _0x1c48b5=_0xdbfe60['cloneNode'](!0x0);'beforebegin'===_0x522cc3?_0x45d87d(_0x29a790,_0x1c48b5):'afterbegin'===_0x522cc3?_0x2cb06e(_0x29a790,_0x1c48b5):'beforeend'===_0x522cc3?_0x1854ba(_0x29a790,_0x1c48b5):'afterend'===_0x522cc3&&_0x40b605(_0x29a790,_0x1c48b5);}function Pi(_0x15c9c6){const _0x2dc4d7=[];let _0xafe620=_0x15c9c6;for(;_0xafe620;)_0xafe620=_0x2c5477(_0xafe620),_0xafe620&&_0x2dc4d7['push'](_0xafe620);return _0x2dc4d7;}function zn(_0x13ea87){return _0x13ea87['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Es(_0x524b37){let _0x1c2fb6=0x0;for(;_0x524b37['parentNode'];)_0x524b37=_0x524b37['parentNode'],_0x1c2fb6++;return _0x1c2fb6;}function Bs(_0x16daf0){const _0x42bd2d=[];let _0x137ddc=_0x16daf0['nextSibling'];for(;_0x137ddc;)_0x42bd2d['push'](_0x137ddc),_0x137ddc=_0x137ddc['nextSibling'];_0x42bd2d['forEach'](_0xbe9d7f=>{_0x210a44(_0xbe9d7f);});}class Li extends/* #__PURE__ -- @preserve */
25
+ ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x52cc6d();}['convertMarkdownToHTML'](_0x3c603a){const _0x439850=this['_m2html']['parse'](_0x3c603a);return this['parseAndNormalizeHTML'](_0x439850);}['parseAndNormalizeHTML'](_0x3e0b7e){return this['_parseHTML'](_0x3e0b7e);}['_parseHTML'](_0x381a69){const _0x2e017c=Ui('<dummy>'+_0x381a69['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x2e017c['children']=_0x2e017c['children'][0x0]['children'],_0x2e017c;}}class Wi extends/* #__PURE__ -- @preserve */
26
+ ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x4b5a72){super(),this['_generateUid']=_0x4b5a72||_0x677d44;}['merge'](_0x190ec9,_0x4b27f2,_0x1d9f5b){const _0x3ac277=_0x190ec9['cloneNode'](!0x0);if(0x0===_0x4b27f2['childNodes']['length']){const _0x3e5e1d=[];return Fi('data-id','new-element',_0x3ac277)['forEach'](_0x2f88c0=>{const _0x484cbd=this['_generateUid']();Zi(_0x2f88c0,'data-id',_0x484cbd),_0x3e5e1d['push'](_0x484cbd);}),this['_removeSpecialComments'](_0x3ac277),{'parsedContent':_0x3ac277,'newNodeIds':_0x3e5e1d,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x1d9f5b&&_0x1d9f5b['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x3ac277),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Fi('data-id',null,_0x4b27f2)['map'](_0x1e7c49=>ut(_0x1e7c49,'data-id'))['filter'](_0x2f4dfd=>!!_0x2f4dfd));let _0x5b2136=-0x1,_0x30d025=!0x1;const _0x51d8c0=_0x3ac277['childNodes'],_0x3228a7=Array['from'](_0x51d8c0)['filter'](_0x57afdd=>!(0x3===_0x57afdd['nodeType']&&''===pt(_0x57afdd)['trim']())),_0x3e2610=_0x3228a7['length'];for(let _0x54d5c9=0x0;_0x54d5c9<_0x3e2610;_0x54d5c9++){const _0x15d72e=_0x3228a7[_0x54d5c9],_0x51be83=_0x3228a7[_0x54d5c9+0x1];if(this['_isNewNode'](_0x15d72e)){if(-0x1===_0x5b2136&&(_0x5b2136=_0x54d5c9),this['_markWrappedElements'](_0x15d72e),!this['_isNewNode'](_0x51be83)){const [_0x341061,_0x433e22]=this['_findReferenceNode'](_0x15d72e,_0x30d025,_0x4b27f2);if(_0x341061){const _0x5ec900=Array['from'](_0x3228a7)['slice'](_0x5b2136,_0x54d5c9+0x1);this['_insertNodes'](_0x341061,_0x5ec900,_0x433e22),_0x5b2136=-0x1;}}}else{if(this['_isExistingContentComment'](_0x15d72e))_0x30d025=!0x0;else{if(this['_isExistingNode'](_0x15d72e)){const _0x270330=ut(_0x15d72e,'data-id');if(_0x270330&&this['_existingDataIds']['has'](_0x270330)){const _0x365cb5=It('data-id',_0x270330,_0x4b27f2);this['_replaceNode'](_0x365cb5,_0x15d72e);}if(this['_touchedNodesState']['removedIds']['includes'](_0x270330)){const _0x51aa73=this['_touchedNodesState']['removedIds']['indexOf'](_0x270330);this['_touchedNodesState']['removedIds']['splice'](_0x51aa73,0x1);}}else{if(this['_isDelNode'](_0x15d72e)){const _0x16fd7b=ut(_0x15d72e,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x16fd7b)||this['_storeDeletedElementIds'](_0x15d72e);}}}}}for(const _0x67257e of this['_touchedNodesState']['removedIds']){const _0x3015f3=It('data-id',_0x67257e,_0x4b27f2);if(_0x3015f3){if(_0x1d9f5b&&_0x1d9f5b['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x67257e;const _0x38cf6f=_0x1d9f5b['replaceRemovedWith']['cloneNode'](!0x0);Zi(_0x38cf6f,'data-id',_0x67257e),Zi(_0x38cf6f,'data-removed','true'),_0x46022b(_0x3015f3,_0x38cf6f);}else _0x210a44(_0x3015f3);}}if(Fi('data-wrapped-id',null,_0x4b27f2)['forEach'](_0x18e4f1=>{const _0x163787=It('data-id',ut(_0x18e4f1,'data-wrapped-id'),_0x4b27f2);var _0x13ed3b,_0x2a1b01;_0x163787&&(_0x2a1b01=_0x18e4f1,_0x210a44(_0x13ed3b=_0x163787),_0x46022b(_0x2a1b01,_0x13ed3b));}),Fi('data-id','new-element',_0x4b27f2)['forEach'](_0x5a7792=>{const _0x1a5cb7=this['_getUid'](_0x5a7792);Zi(_0x5a7792,'data-id',_0x1a5cb7),this['_touchedNodesState']['newIds']['push'](_0x1a5cb7);}),this['_removeSpecialComments'](_0x4b27f2),_0x1d9f5b&&_0x1d9f5b['markUnstableElements']&&this['_markUnstableElements'](_0x4b27f2,_0x1d9f5b['markUnstableElementsDepth']||0x0),_0x1d9f5b&&_0x1d9f5b['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x4d0193=It('data-id',this['_touchedNodesState']['lastTouchedId'],_0x4b27f2);for(;_0x4d0193;)Bs(_0x4d0193),_0x4d0193=_0x4d0193['parentNode'];}return{'parsedContent':_0x4b27f2,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x381ac2,_0x3c9d8b,_0x346ab8){for(const _0x58572a of _0x3c9d8b){const _0x174aaf=this['_getUid'](_0x58572a);Zi(_0x58572a,'data-id',_0x174aaf),this['_touchedNodesState']['newIds']['push'](_0x174aaf),this['_touchedNodesState']['lastTouchedId']=_0x174aaf;}const _0x1422f3='afterbegin'===_0x346ab8||'afterend'===_0x346ab8?_0x3c9d8b['reverse']():_0x3c9d8b;for(const _0x588e27 of _0x1422f3)Ki(_0x381ac2,_0x588e27,_0x346ab8);}['_replaceNode'](_0x549516,_0x3ba126){if(!_0x549516)return;if(_0x414b47=_0x3ba126,zn(pt(_0x549516))===zn(pt(_0x414b47)))return;var _0x414b47;const _0x52fb3c=this['_getUid'](_0x549516);Zi(_0x3ba126,'data-id',_0x52fb3c),this['_touchedNodesState']['modifiedIds']['push'](_0x52fb3c),this['_touchedNodesState']['lastTouchedId']=_0x52fb3c,_0x46022b(_0x549516,_0x3ba126['cloneNode'](!0x0));}['_findReferenceNode'](_0x18ead5,_0x1b82f4,_0xd7777f){const _0x430f14=this['_findPrevElementWithDataId'](_0x18ead5,!0x1);if(_0x430f14){const _0x206822=this['_getNodeDataId'](_0x430f14),_0xb12810=It('data-id',_0x206822,_0xd7777f);if(_0xb12810)return[_0xb12810,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x206822);}const _0x152a35=this['_findNextElementWithDataId'](_0x18ead5,!0x1);if(_0x152a35){const _0x4e9d9d=this['_getNodeDataId'](_0x152a35),_0x473c1d=It('data-id',_0x4e9d9d,_0xd7777f);if(_0x473c1d)return[_0x473c1d,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x4e9d9d);}return _0x1b82f4?_0x18ead5['nextSibling']?this['_findFallbackReferenceNode'](_0x18ead5,_0xd7777f):[_0xd7777f['childNodes'][_0xd7777f['childNodes']['length']-0x1],'afterend']:[_0xd7777f['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x1d5173,_0x13a42a){const _0x3eac28=[],_0x47cd1d=this['_findPrevElementWithDataId'](_0x1d5173,!0x0);if(_0x47cd1d){const _0x1afce7=It('data-id',this['_getNodeDataId'](_0x47cd1d),_0x13a42a);_0x1afce7&&_0x3eac28['push']([_0x1afce7,'afterend']);}const _0x4c037b=this['_findNextElementWithDataId'](_0x1d5173,!0x0);if(_0x4c037b){const _0x571cb7=It('data-id',this['_getNodeDataId'](_0x4c037b),_0x13a42a);_0x571cb7&&_0x3eac28['push']([_0x571cb7,'beforebegin']);}if(_0x3eac28['length']>0x1)return Es(_0x3eac28[0x0][0x0])<=Es(_0x3eac28[0x1][0x0])?_0x3eac28[0x0]:_0x3eac28[0x1];return 0x1===_0x3eac28['length']?_0x3eac28[0x0]:[_0x13a42a['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x575973,_0x1260d0){let _0x56f87b=_0x575973['nextSibling'],_0x21bfee=null,_0x50a9d1=!0x1;for(;_0x56f87b;){if(_0x2a0cb6(_0x56f87b)){if(this['_isDelNode'](_0x56f87b)&&(_0x21bfee=_0x56f87b),this['_isExistingContentComment'](_0x56f87b)&&_0x1260d0&&!_0x50a9d1){_0x50a9d1=!0x0,_0x56f87b=_0x56f87b['nextSibling'];continue;}break;}const _0x2fc1ff=ut(_0x56f87b,'data-id');if(_0x2fc1ff&&'new-element'!==_0x2fc1ff&&this['_existingDataIds']['has'](_0x2fc1ff)){_0x21bfee=_0x56f87b;break;}_0x56f87b=_0x56f87b['nextSibling'];}return _0x21bfee;}['_findPrevElementWithDataId'](_0x51549d,_0x131789){let _0xc6fd07=_0x51549d['previousSibling'],_0x54adf0=null,_0xda1029=!0x1;for(;_0xc6fd07;){if(_0x2a0cb6(_0xc6fd07)){if(this['_isDelNode'](_0xc6fd07)&&(_0x54adf0=_0xc6fd07),this['_isExistingContentComment'](_0xc6fd07)&&_0x131789&&!_0xda1029){_0xda1029=!0x0,_0xc6fd07=_0xc6fd07['previousSibling'];continue;}break;}const _0x38773e=ut(_0xc6fd07,'data-id');if(_0x38773e&&'new-element'!==_0x38773e&&this['_existingDataIds']['has'](_0x38773e)){_0x54adf0=_0xc6fd07;break;}_0xc6fd07=_0xc6fd07['previousSibling'];}return _0x54adf0;}['_markWrappedElements'](_0x5e0b11){_0x441935(_0x5e0b11)&&Fi('data-id',null,_0x5e0b11)['forEach'](_0x260384=>{this['_isExistingNode'](_0x260384)&&!this['_hasWrappedParent'](_0x260384)&&(Zi(_0x260384,'data-wrapped-id',ut(_0x260384,'data-id')),Zi(_0x260384,'data-id',null));});}['_getNodeDataId'](_0x2b464e){if(!_0x2b464e)return null;if(_0x441935(_0x2b464e))return ut(_0x2b464e,'data-id');if(_0x2a0cb6(_0x2b464e)){const _0x2ca602=pt(_0x2b464e)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x2ca602&&_0x2ca602[0x1])return _0x2ca602[0x1];}return null;}['_storeDeletedElementIds'](_0x5425c3){if(_0x2a0cb6(_0x5425c3)){const _0x25603b=pt(_0x5425c3)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x25603b&&_0x25603b[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x25603b[0x1]);}}['_getUid'](_0x3894d4){return this['_isExistingNode'](_0x3894d4)?ut(_0x3894d4,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x4701a6){(function(_0x44eef6){return _0x408f6d(_0x3f5018=>_0x2a0cb6(_0x3f5018),_0x44eef6,!0x0,0x1/0x0);}(_0x4701a6)['filter'](_0x3c9c84=>this['_isDelNode'](_0x3c9c84)||this['_isExistingContentComment'](_0x3c9c84))['forEach'](_0x378e19=>{_0x210a44(_0x378e19);}));}['_markLastTagElementUnstable'](_0x16637d){const _0x302c72=_0x16637d['childNodes'],_0x1aa1c2=_0x302c72[_0x302c72['length']-0x1];_0x1aa1c2&&_0x441935(_0x1aa1c2)&&Zi(_0x1aa1c2,'data-unstable','true');}['_markUnstableElements'](_0x28685d,_0x3244b7){const _0x35f2ce=It('data-unstable','true',_0x28685d);if(!_0x35f2ce)return;const _0xca2a37=Pi(_0x35f2ce)['slice'](0x0,-0x1),_0x1a75c8=_0xca2a37['length'];let _0x142690=_0x35f2ce;if(_0x1a75c8>_0x3244b7){let _0x3f497b=_0x1a75c8,_0x4dc3c8=null;for(;_0x3f497b>_0x3244b7&&_0x3f497b>=0x0;)_0x3f497b--,_0x4dc3c8=_0xca2a37[_0x3f497b];_0x4dc3c8&&(_0x142690=_0x4dc3c8,Zi(_0x35f2ce,'data-unstable',null),Zi(_0x4dc3c8,'data-unstable','true'));}else{if(_0x1a75c8<_0x3244b7){let _0x3d0450=_0x1a75c8,_0x2e13e8=_0x35f2ce;for(;_0x3d0450<_0x3244b7;){const _0x17ea96=_0x2e13e8['childNodes']['filter'](_0x50914a=>_0x441935(_0x50914a));if(0x0===_0x17ea96['length'])break;_0x3d0450++,_0x2e13e8=_0x17ea96[_0x17ea96['length']-0x1];}_0x2e13e8&&(_0x142690=_0x2e13e8,Zi(_0x35f2ce,'data-unstable',null),Zi(_0x2e13e8,'data-unstable','true'));}}let _0x4a81b7=_0x142690;for(;_0x4a81b7;){for(;_0x4a81b7['nextSibling'];)_0x4a81b7=_0x4a81b7['nextSibling'],_0x441935(_0x4a81b7)&&Zi(_0x4a81b7,'data-unstable','true');_0x4a81b7=_0x4a81b7['parentNode'];}}['_isNewNode'](_0x2f429e){return Boolean('new-element'===ut(_0x2f429e,'data-id'));}['_isExistingNode'](_0x2283bf){return Boolean((ut(_0x2283bf,'data-id')||'')['length']>0x0&&'new-element'!==ut(_0x2283bf,'data-id'));}['_isDelNode'](_0x319faa){return!!_0x319faa&&Boolean(_0x2a0cb6(_0x319faa)&&pt(_0x319faa)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x65f58){let _0x13e5b9=_0x65f58['parentNode'];for(;_0x13e5b9;){if(ut(_0x13e5b9,'data-wrapped-id'))return!0x0;_0x13e5b9=_0x13e5b9['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x4cffc2){return Boolean(_0x2a0cb6(_0x4cffc2)&&pt(_0x4cffc2)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function kt({editor:_0x2544de,changeGroups:_0x207690,documentContextContent:_0x2683c8,showDiff:_0x57417a,trimUnchanged:_0x24591a=!0x0}){return _0x207690['map'](_0x271355=>{const _0x3284ad=new _t([]),_0x5f471a=new _t([]);for(const _0x114d32 of _0x271355['changes'])if(_0x57417a&&'removed'==_0x114d32['type']||_0x5f471a['children']['push'](_0x114d32['node']['cloneNode'](!0x0)),'new'!=_0x114d32['type']&&(_0x57417a||'removed'!=_0x114d32['type'])){const _0x4fbdfc=gt(_0x31d69a=>ut(_0x31d69a,'data-id')==_0x114d32['id'],_0x2683c8,!0x0);_0x4fbdfc&&_0x3284ad['children']['push'](_0x4fbdfc['cloneNode'](!0x0));}const {content:_0x69fa3e,hasChanges:_0x22b829}=function(_0x5cb73d,_0x4f1ec0,_0x339316,_0x254b46,_0x132e61=!0x0){const _0x86e196=_0x5cb73d['plugins']['get']('DocumentCompare'),_0x37530e=pt(_0x4f1ec0),_0xec5c90=pt(_0x339316),_0x172696=_0x5cb73d['data']['parse'](_0x37530e,'$root'),_0x546260=_0x5cb73d['model']['createPositionAt'](_0x172696,0x0),_0x51f7da=_0x86e196['getDiff'](_0x37530e,_0xec5c90,{'anchor':_0x546260,'markDeletions':_0x254b46}),_0x103338=_0x51f7da['getOperations']();if(0x0==_0x103338['length'])return{'content':_0x4f1ec0['cloneNode'](!0x0),'hasChanges':!0x1};_0x254b46?function(_0x4860a3,_0x19cc75,_0x33e59f){if(0x0==_0x4860a3['length'])return;const _0x55f7b2=_0x33e59f['plugins']['get']('DocumentCompare'),_0x5283a0=_0x33e59f['plugins']['get']('SuggestionsConversion');_0x33e59f['model']['change'](_0x442792=>{const _0x5ab74b=new Set();for(let _0x15c8e2=0x0;_0x15c8e2<_0x4860a3['length'];_0x15c8e2++){const _0x1b4ab5=_0x4860a3[_0x15c8e2];if(_0x1b4ab5['baseVersion']=null,_0x1b4ab5['isDocumentOperation']=!0x1,_0x55f7b2['isMarkedRemoveOperation'](_0x1b4ab5)){const _0x43f651=_0x783893(_0x1b4ab5['newRange'],_0x33e59f['model']),_0x479b13='suggestion:deletion:'+_0x677d44()+':$aiSuggestion';_0x19cc75['markers']['set'](_0x479b13,_0x43f651);}else switch(_0x1b4ab5['type']){case'rename':{if(_0x1b4ab5['oldName']==_0x1b4ab5['newName'])break;_0x442792['batch']['addOperation'](_0x1b4ab5),_0x33e59f['model']['applyOperation'](_0x1b4ab5);const _0x590842='$elementName',_0x3789a1=_0x1b4ab5['position'],_0x3dedba=_0x33e59f['model']['createRange'](_0x3789a1,_0x33e59f['model']['createPositionAt'](_0x3789a1['nodeAfter'],'end')),_0x380669='suggestion:attribute:'+_0x590842+':'+_0x677d44()+':$aiSuggestion';_0x19cc75['markers']['set'](_0x380669,_0x3dedba);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x1b4ab5['oldValue']==_0x1b4ab5['newValue'])break;_0x442792['batch']['addOperation'](_0x1b4ab5),_0x33e59f['model']['applyOperation'](_0x1b4ab5);const _0xb81ec=_0x1b4ab5['key'];if(!_0x5283a0['isRegisteredAttribute'](_0xb81ec))break;const _0x52b7fb=_0x783893(_0x1b4ab5['range'],_0x33e59f['model']),_0x1e9d85='suggestion:attribute:'+_0xb81ec+':'+_0x677d44()+':$aiSuggestion';_0x19cc75['markers']['set'](_0x1e9d85,_0x52b7fb);break;}case'insert':{_0x442792['batch']['addOperation'](_0x1b4ab5),_0x33e59f['model']['applyOperation'](_0x1b4ab5);if(_0x4860a3[_0x15c8e2+0x1]&&'move'==_0x4860a3[_0x15c8e2+0x1]['type']){no(_0x19cc75,_0x1b4ab5);break;}const _0x572809=_0x1b4ab5['position'],_0xb3727c=_0x1b4ab5['howMany'],_0x370bb3=_0x783893(_0x33e59f['model']['createRange'](_0x572809,_0x572809['getShiftedBy'](_0xb3727c)),_0x33e59f['model']),_0x1bc0ac='suggestion:insertion:'+_0x677d44()+':$aiSuggestion';_0x19cc75['markers']['set'](_0x1bc0ac,_0x370bb3);break;}case'split':{_0x442792['batch']['addOperation'](_0x1b4ab5),_0x33e59f['model']['applyOperation'](_0x1b4ab5);const _0x57a9e6=_0x1b4ab5['splitPosition'],_0xf3139c=_0x1b4ab5['moveTargetPosition'],_0x1fedd5=_0x33e59f['model']['createRange'](_0x57a9e6,_0xf3139c),_0x146718='suggestion:insertion:'+_0x677d44()+':$aiSuggestion';_0x19cc75['markers']['set'](_0x146718,_0x1fedd5);break;}case'move':{_0x442792['batch']['addOperation'](_0x1b4ab5),_0x33e59f['model']['applyOperation'](_0x1b4ab5),_0x4860a3[_0x15c8e2-0x1]&&'insert'==_0x4860a3[_0x15c8e2-0x1]['type']&&no(_0x19cc75,_0x1b4ab5);const _0x596b9c=_0x1b4ab5['getMovedRangeStart'](),_0x2e014f=_0x1b4ab5['howMany'];for(let _0x388cca=0x0;_0x388cca<_0x2e014f;_0x388cca++){const _0x491ba6=_0x596b9c['getShiftedBy'](_0x388cca)['nodeAfter'];_0x5ab74b['add'](_0x491ba6);}break;}case'remove':{const _0x402d8d=_0x1b4ab5['sourcePosition'],_0xe263af=_0x1b4ab5['howMany'],_0x4c6d57=new lt(_0x402d8d,_0xe263af);_0x442792['batch']['addOperation'](_0x4c6d57),_0x33e59f['model']['applyOperation'](_0x4c6d57);break;}}}for(const _0x5b8d61 of _0x5ab74b){const _0x5cc21a=_0x33e59f['model']['createRangeOn'](_0x5b8d61),_0x66a157='suggestion:formatBlock:$fakeWrap:'+_0x677d44()+':$aiSuggestion';_0x19cc75['markers']['set'](_0x66a157,_0x783893(_0x5cc21a,_0x33e59f['model']));}});}(_0x103338,_0x172696,_0x5cb73d):_0x5cb73d['model']['change'](_0x58b7b2=>{for(const _0x7d1fd4 of _0x103338)if('remove'==_0x7d1fd4['type']){const _0x4022e8=_0x7d1fd4['sourcePosition'],_0x530c22=_0x7d1fd4['howMany'],_0x124fed=new lt(_0x4022e8,_0x530c22);_0x58b7b2['batch']['addOperation'](_0x124fed),_0x5cb73d['model']['applyOperation'](_0x124fed);}else{if('marker'==_0x7d1fd4['type']){const _0xbccddb=_0x7d1fd4['name'],_0x328a7e=_0x7d1fd4['newRange'];null!==_0x328a7e?_0x172696['markers']['set'](_0xbccddb,_0x328a7e):_0x172696['markers']['delete'](_0xbccddb);}else _0x7d1fd4['baseVersion']=null,_0x7d1fd4['isDocumentOperation']=!0x1,_0x58b7b2['batch']['addOperation'](_0x7d1fd4),_0x5cb73d['model']['applyOperation'](_0x7d1fd4);}});if(_0x132e61){const _0x24fb4c=ct(_0x5cb73d,_0x103338,_0x172696);ht(_0x5cb73d['model'],_0x24fb4c),function(_0x5d3ea6,_0xd85127){const _0x39e100=_0xd85127['getFirstRange']()['start'];let _0x5d76f8=_0xd85127['getFirstRange']()['end'];const _0x527a40=_0x39e100['root'];(_0x5d76f8['textNode']||_0x5d76f8['nodeAfter']&&_0x5d76f8['nodeAfter']['is']('$text'))&&(_0x2aeeda(_0x5d76f8,'...'),_0x5d76f8=_0x5d76f8['getShiftedBy'](0x3)),(_0x39e100['textNode']||_0x39e100['nodeBefore']&&_0x39e100['nodeBefore']['is']('$text'))&&(_0x2aeeda(_0x39e100,'...'),function(_0x17bcb1,_0x22daba,_0x34cc6f){for(let [_0x31fec5,_0xb207bb]of _0x17bcb1['markers']){const _0x41140a=_0xb207bb['_getTransformedByInsertion'](_0x22daba,_0x34cc6f,!0x1);_0xb207bb=_0x41140a[0x0],_0x17bcb1['markers']['set'](_0x31fec5,_0xb207bb);}}(_0x527a40,_0x39e100,0x3),_0x39e100['parent']==_0x5d76f8['parent']&&(_0x5d76f8=_0x5d76f8['getShiftedBy'](0x3)));const _0x2fd4c3=_0x5d3ea6['createRange'](_0x5d3ea6['createPositionAt'](_0x527a40,0x0),_0x39e100),_0x591b07=_0x5d3ea6['createRange'](_0x5d76f8,_0x5d3ea6['createPositionAt'](_0x527a40,'end')),_0x1f9d98=[..._0x2fd4c3['getMinimalFlatRanges'](),..._0x591b07['getMinimalFlatRanges']()];_0x1f9d98['reverse']();for(const _0x3b5c26 of _0x1f9d98)to(_0x3b5c26),Jn(_0x527a40,_0x3b5c26);}(_0x5cb73d['model'],_0x24fb4c);}const _0x917e9b=_0x5cb73d['data']['stringify'](_0x172696,{'showSuggestionHighlights':!0x0});return{'content':Ui(_0x917e9b),'hasChanges':!0x0};}(_0x2544de,_0x3284ad,_0x5f471a,_0x57417a,_0x24591a);return{'type':_0x271355['changes'][0x0]['type'],'index':_0x271355['index'],'content':_0x69fa3e,'hasChanges':_0x22b829};});}function no(_0x43f8d7,_0x467736){for(const [_0x11dfe8,_0x5f080c]of _0x43f8d7['markers']){const _0xc5a6d3=dt['_createFromRanges'](_0x5f080c['getTransformedByOperation'](_0x467736));_0x43f8d7['markers']['set'](_0x11dfe8,_0xc5a6d3);}}function ct(_0x31c51d,_0x4119ae,_0x3d379c){const _0x4c985a=_0x31c51d['plugins']['get']('DocumentCompare');let _0x2ba13c=_0x31c51d['model']['createPositionAt'](_0x3d379c,Number['POSITIVE_INFINITY']),_0xe3d778=_0x31c51d['model']['createPositionAt'](_0x3d379c,0x0);for(const _0x52cd7f of _0x4119ae){let _0x3bcd54,_0xb9d8b4;if(_0x4c985a['isMarkedRemoveOperation'](_0x52cd7f))_0x3bcd54=_0x52cd7f['newRange']['start'],_0xb9d8b4=_0x52cd7f['newRange']['end'];else switch(_0x2ba13c=_0x2ba13c['getTransformedByOperation'](_0x52cd7f),_0xe3d778=_0xe3d778['getTransformedByOperation'](_0x52cd7f),_0x52cd7f['type']){case'rename':_0x3bcd54=_0x52cd7f['position'],_0xb9d8b4=_0x3bcd54['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x3bcd54=_0x52cd7f['range']['start'],_0xb9d8b4=_0x52cd7f['range']['end'];break;case'insert':_0x3bcd54=_0x52cd7f['position'],_0xb9d8b4=_0x3bcd54['getShiftedBy'](_0x52cd7f['howMany']);break;case'split':_0x3bcd54=_0x52cd7f['splitPosition'],_0xb9d8b4=_0x52cd7f['moveTargetPosition'];break;case'merge':{const _0x347e3e=_0x52cd7f['targetPosition']['path']['slice'](0x0,-0x1);_0x3bcd54=_0x31c51d['model']['createPositionFromPath'](_0x3d379c,_0x347e3e),_0xb9d8b4=_0x3bcd54['getShiftedBy'](0x1);break;}case'remove':{const _0x10fcc0=_0x52cd7f['howMany'],_0x3249eb=_0x52cd7f['sourcePosition']['_getTransformedByInsertion'](_0x52cd7f['targetPosition'],_0x10fcc0),_0x44c9d3=_0x52cd7f['getMovedRangeStart']();'remove'==_0x52cd7f['type']?(_0x3bcd54=_0x3249eb,_0xb9d8b4=_0x3249eb):(_0x3bcd54=_0x44c9d3,_0xb9d8b4=_0x44c9d3['getShiftedBy'](_0x10fcc0));break;}}_0x3bcd54&&_0x3bcd54['isBefore'](_0x2ba13c)&&(_0x2ba13c=_0x3bcd54['clone'](),_0x2ba13c['stickiness']='toNone'),_0xb9d8b4&&_0xb9d8b4['isAfter'](_0xe3d778)&&(_0xe3d778=_0xb9d8b4['clone'](),_0xe3d778['stickiness']='toNone');}return _0x31c51d['model']['createSelection'](_0x31c51d['model']['createRange'](_0x2ba13c,_0xe3d778));}function ht(_0x286ead,_0x19ef4a){ro(_0x286ead,_0x19ef4a,'forward');const _0x2082fa=_0x19ef4a['getFirstRange']();_0x19ef4a['setTo']([]),_0x19ef4a['setTo'](_0x2082fa,{'backward':!0x0}),ro(_0x286ead,_0x19ef4a,'backward');}function ro(_0x362390,_0x4f75fa,_0x56bba8){let _0x59c393=0x14;for(;_0x59c393;){_0x362390['modifySelection'](_0x4f75fa,{'unit':'word','direction':_0x56bba8}),_0x59c393--;const _0x2aecce=_0x4f75fa['focus']['forward'==_0x56bba8?'nodeBefore':'nodeAfter'];if(_0x2aecce&&_0x2aecce['is']('element')&&_0x362390['schema']['isBlock'](_0x2aecce)&&_0x362390['schema']['isObject'](_0x2aecce))break;}}function Jn(_0x4dc337,_0x43895c){for(const [_0x3b9802,_0x126b62]of _0x4dc337['markers']){const _0x3c1301=_0x126b62['_getTransformedByDeletion'](_0x43895c['start'],_0x43895c['end']['offset']-_0x43895c['start']['offset']);null!=_0x3c1301?_0x4dc337['markers']['set'](_0x3b9802,_0x3c1301):_0x4dc337['markers']['delete'](_0x3b9802);}}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:_0x1e5025,content:_0x118e33='',isDone:_0x443131=!0x1,interactionId:_0x5f4694,areActionsDisabled:_0x36a1e0,documentContextContent:_0x5317f3,editor:_0x4d94a4,id:_0x23ee1d}){super(),this['id']=_0x23ee1d||_0x677d44(),this['interactionId']=_0x5f4694,this['type']=_0x1e5025,this['areActionsDisabled']=!!_0x36a1e0,this['editor']=_0x4d94a4,this['aiResponseParser']=new Li(),this['aiResponseApplier']=new Wi(),this['documentContextContent']=Ui(_0x5317f3||''),this['set']('isDone',_0x443131),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x118e33);}['appendContent'](_0x3d8030){this['set']('content',this['content']+_0x3d8030);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x37c68a,_0x1f4998){this['changeGroups'][_0x37c68a]['state']=_0x1f4998,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x37c68a,'state':_0x1f4998});}['getContentParts']({showDiff:_0xa23cc1,groupIndex:_0xe3b4be}){if(!this['editor'])throw new _0x25c351('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x41b5a3=this['_getCachedContentParts'](_0xa23cc1,_0xe3b4be);if(_0x41b5a3)return _0x41b5a3;let _0x4a993a=[];if(void 0x0===_0xe3b4be)_0x4a993a=this['changeGroups'];else{const _0x3d090b=this['changeGroups']['find'](({index:_0x304144})=>_0x304144===_0xe3b4be);if(!_0x3d090b)throw new _0x25c351('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0xe3b4be});_0x4a993a=[_0x3d090b];}const _0x356ff4=kt({'editor':this['editor'],'showDiff':_0xa23cc1,'changeGroups':_0x4a993a,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0xa23cc1,_0x356ff4),_0x356ff4;}['_getCachedContentParts'](_0x2149c0,_0x3bf652){const _0x3ba59e=_0x2149c0?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x3ba59e]['length'])return null;const _0x290949=this['cachedSuggestionContentParts'][_0x3ba59e];if(void 0x0===_0x3bf652)return _0x290949['length']>0x0&&_0x290949['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x2149c0,null),null):_0x2b41ab(_0x290949);{const _0xc12044=_0x290949['find'](({index:_0x311e37})=>_0x311e37===_0x3bf652);if(_0xc12044)return[_0x2b41ab(_0xc12044)];}return null;}['_setCachedContentParts'](_0x3e8b61,_0x5a7854){const _0x55797b=_0x3e8b61?'withDiff':'withoutDiff';_0x5a7854?_0x5a7854['forEach'](_0x5f1402=>{const _0x1012fd=this['cachedSuggestionContentParts'][_0x55797b],_0xc47819=_0x1012fd['find'](({index:_0x4292fa})=>_0x4292fa===_0x5f1402['index']);if(_0xc47819){const _0xbdfe5e=_0x1012fd['indexOf'](_0xc47819);_0x1012fd['splice'](_0xbdfe5e,0x1,_0x5f1402);}else _0x1012fd['push'](_0x5f1402);}):this['cachedSuggestionContentParts'][_0x55797b]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x5e3ae9=this['changeGroups'];this['updateChangeGroups']();const _0x37f96b=this['_getDifferentChangeGroups'](_0x5e3ae9,this['changeGroups']);(_0x37f96b['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x37f96b),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x13156e,_0x50d2a4){const _0x2de2f5=[];for(const _0xf2e49e of _0x50d2a4){const _0x58fe4d=_0x13156e[_0xf2e49e['index']];_0x58fe4d?_0x58fe4d['changes']['length']!==_0xf2e49e['changes']['length']?_0x2de2f5['push'](_0xf2e49e):_0x58fe4d['changes']['forEach']((_0x150d62,_0x27bfa8)=>{const _0x1b4ba4=_0xf2e49e['changes'][_0x27bfa8];_0x150d62['id']!==_0x1b4ba4['id']&&_0x2de2f5['push'](_0xf2e49e);}):_0x2de2f5['push'](_0xf2e49e);}return _0x2de2f5;}['updateChangeGroups'](){const _0x468759=new _0x38e3db('p',{},[new _0x38e3db('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x4fdfd5(h(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x1d5fe8=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x468759,'cutAfterLastChange':!this['isDone']});if(!_0x1d5fe8['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x1d5fe8['parsedContent'];let _0x58b1f2=[];if(_0x5b5fc9(_0x4473c5=>{const _0x3b39ee=ut(_0x4473c5,'data-id');if(!_0x3b39ee||!_0x1207d5(_0x3b39ee))return!0x1;const _0x342eb6=[_0x4473c5,...Pi(_0x4473c5)]['at'](-0x2);if(_0x4473c5!=_0x342eb6){const _0x4155f1=ut(_0x342eb6,'data-id');_0x1207d5(_0x4155f1)||(_0x58b1f2['push']({'node':_0x342eb6,'id':_0x4155f1,'type':'modified'}),_0x1d5fe8['modifiedNodeIds']['push'](_0x4155f1));}else _0x1d5fe8['modifiedNodeIds']['includes'](_0x3b39ee)?_0x58b1f2['push']({'node':_0x4473c5,'type':'modified','id':_0x3b39ee}):_0x1d5fe8['newNodeIds']['includes'](_0x3b39ee)?_0x58b1f2['push']({'node':_0x4473c5,'type':'new','id':_0x3b39ee,'anchorId':ut(_0x4473c5['previousSibling'],'data-id')}):_0x58b1f2['push']({'node':_0x4473c5,'type':'removed','id':_0x3b39ee});return!0x0;},this['parsedMergedContent']),_0x58b1f2=_0x58b1f2['filter'](({node:_0x19d86d})=>[...Pi(_0x19d86d),_0x19d86d]['every'](_0x1b6bec=>!ut(_0x1b6bec,'data-unstable'))),0x0==_0x58b1f2['length'])return;const _0x354cca=[[_0x58b1f2[0x0]]];for(let _0x3703b6=0x1;_0x3703b6<_0x58b1f2['length'];_0x3703b6++){const _0x2ebaaf=_0x354cca[_0x354cca['length']-0x1],_0x386a1c=_0x2ebaaf[_0x2ebaaf['length']-0x1];_0x58b1f2[_0x3703b6]['node']['previousSibling']==_0x386a1c['node']&&'modified'!=_0x58b1f2[_0x3703b6]['type']&&'modified'!=_0x386a1c['type']?_0x2ebaaf['push'](_0x58b1f2[_0x3703b6]):_0x354cca['push']([_0x58b1f2[_0x3703b6]]);}for(const _0x1adeaf of _0x354cca){const _0x32da46=_0x1adeaf[0x0],_0x30bc9d=_0x1adeaf[_0x1adeaf['length']-0x1],_0x23d8e2=_0x3c6c02(_0x32da46['node']['previousSibling']);_0x23d8e2&&_0x1adeaf['unshift'](_0x23d8e2);const _0x353455=_0x3c6c02(_0x30bc9d['node']['nextSibling']);_0x353455&&_0x1adeaf['push'](_0x353455);}function _0x1207d5(_0x652775){return _0x1d5fe8['modifiedNodeIds']['includes'](_0x652775)||_0x1d5fe8['newNodeIds']['includes'](_0x652775)||_0x1d5fe8['removedNodeIds']['includes'](_0x652775);}function _0x3c6c02(_0x2a017f){if(_0x2a017f&&ut(_0x2a017f,'data-id')&&!ut(_0x2a017f,'data-unstable')){const _0x368775=ut(_0x2a017f,'data-id');if(!_0x1207d5(_0x368775))return{'node':_0x2a017f,'type':'context','id':_0x368775};}return null;}this['changeGroups']=_0x354cca['map']((_0x2f03d9,_0x4727eb)=>({'changes':_0x2f03d9,'state':'pending','index':_0x4727eb}));}}const ze=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class os extends _0xa7ecb2(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x3ff4f6,editor:_0x22081b}){super(),this['id']=_0x677d44(),this['connector']=_0x3ff4f6,this['isStopped']=!0x0,this['editor']=_0x22081b;}async['start'](){const _0x10693d=[];let _0x774d7e,_0xc88c67,_0x182ca4;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x2d9416=await this['currentRequest']['getStream']();for await(const _0x602d82 of _0x2d9416){if(this['isStopped'])return;if('error'==_0x602d82['event'])return void this['fire']('error',{'error':new _0x25c351('ai-chat-interaction-error',this)});switch(_0x602d82['event']){case'message-metadata':this['messageId']=_0x602d82['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x602d82['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x602d82['data']['conversationTitle'],!0x0);break;case'source':_0x10693d['push'](_0x602d82['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'](),_0x774d7e='modification-delta'==_0x602d82['event']?'modification':'text',_0xc88c67='modification-delta'==_0x602d82['event']?_0x602d82['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x774d7e&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x774d7e,'interactionId':this['id'],'id':_0xc88c67}),'modification'==_0x774d7e&&(this['currentReply']['sources']=_0x10693d['splice'](0x0))),this['currentReply']['appendContent'](_0x602d82['data']['textDelta']);break;case'mcp-tool-result':_0x182ca4=JSON['parse'](_0x602d82['data']['result']),this['_handleToolResultData']({'toolName':_0x602d82['data']['toolName'],'data':_0x182ca4['data'],'attributes':_0x182ca4['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x602d82['data']['toolName'],'data':_0x602d82['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x10693d['length']>0x0&&(this['currentReply']['sources']=_0x10693d['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x3db956){return this['replies']['find'](_0x6830a5=>_0x6830a5['id']===_0x3db956);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x21fb1b=>_0x21fb1b['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x1d39b7){const _0x478f24=new xi({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x1d39b7});return this['replies']['push'](_0x478f24),_0x478f24['delegate'](...ze)['to'](this),this['fire']('replyCreated',_0x478f24),_0x478f24;}['setConversationTitle'](_0x644b0c,_0x3e485a=!0x1){this['fire']('setConversationTitle',_0x644b0c,_0x3e485a);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0xa9f3e0){this['fire']('toolDataReceived',{'type':'result','toolName':_0xa9f3e0['toolName'],'data':structuredClone(_0xa9f3e0['data']||{}),'attributes':structuredClone(_0xa9f3e0['attributes']||{})},this);}['_handleToolNotificationData'](_0x7c5063){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x7c5063['toolName'],'data':structuredClone(_0x7c5063['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Fe=function(_0x3726ce){return _0x3726ce['TOOL']='mcp-tool-context',_0x3726ce['FILE']='file',_0x3726ce['DOCUMENT']='document',_0x3726ce['URL']='web-resource',_0x3726ce['TEXT']='text',_0x3726ce['SELECTION']='selection',_0x3726ce;}({}),Oe=function(_0x1d12ef){return _0x1d12ef['TEXT']='text',_0x1d12ef['MARKDOWN']='markdown',_0x1d12ef['HTML']='html',_0x1d12ef;}({});const $e=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']]),Je=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class He extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x402377,config:_0x39acaa,ownerId:_0x125bce}){super(),this['_connector']=_0x402377,this['_config']=_0x39acaa,this['_ownerId']=_0x125bce;}['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'](_0x512563){const _0x119370=await this['_createContextItemFromContent'](_0x512563);return this['_addToConversationContextItem'](_0x119370),'current-document'===_0x119370['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x119370;}async['_createContextItemFromContent'](_0x5e11b8){if(_0x5e11b8['type']===Fe['DOCUMENT']){const _0x378f76=await this['_connector']['fetchDocument'](this['_ownerId'],_0x5e11b8['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x5e11b8['type'],'content':_0x378f76['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x378f76['attributes']?.['version'],'sessionId':_0x378f76['attributes']?.['sessionId']};}if(_0x5e11b8['type']===Fe['TOOL'])return{'id':_0x5e11b8['id'],'uiId':_0x5e11b8['id'],'label':_0x5e11b8['data']?.['label']||_0x5e11b8['id'],'type':Fe['TOOL'],'mcpServerName':_0x5e11b8['mcpServerName'],'toolName':_0x5e11b8['toolName'],'data':_0x5e11b8['data']||{}};return{'id':_0x5e11b8['id'],'uiId':_0x5e11b8['id'],'label':_0x5e11b8['attributes']?.['label']||_0x5e11b8['name']||_0x5e11b8['url']||_0x5e11b8['id'],'type':_0x5e11b8['type'],..._0x5e11b8?.['attributes']?.['resourceId']?{'resourceId':_0x5e11b8['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x839a){const _0x12f2d1=this['_pendingContextItems']['get'](_0x839a);_0x12f2d1?.['isReadOnly']||this['_removeContextItem'](_0x839a);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x58a8f5 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x58a8f5['uiId']);const _0x4f5331=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x4f5331&&this['_addContextItem']({..._0x4f5331,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x1c4a0a){for(const _0x6d520f of _0x1c4a0a['values']())this['_addToConversationContextItem'](_0x6d520f);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'](_0x5c4bfe){return Array['from'](_0x5c4bfe['values']())['map'](_0x584cbc=>this['_mapContextItemToRequestData'](_0x584cbc))['filter'](_0x2bd831=>null!==_0x2bd831);}async['addFilesToContext'](_0x214453,_0x45bc8e,_0x317935=Fe['FILE']){const _0x2bc8c8='files-'+_0x677d44();this['_startUploadOperation'](_0x2bc8c8);try{await Promise['all'](_0x214453['map'](async _0x1977b7=>{const _0x496cbe='file-'+_0x677d44(),_0x1f1822=_0x4ae586(_0x1977b7['name']);try{this['_addContextItem']({'type':_0x317935,'label':_0x45bc8e?.['label']||_0x1f1822,'uiId':_0x496cbe,'resourceId':_0x45bc8e?.['resourceId']},!0x0);const _0x1a1999=this['_connector']['uploadFile'](this['_ownerId'],_0x1977b7,_0x45bc8e);this['_ongoingUploads']['set'](_0x496cbe,_0x1a1999['abortController']);const {id:_0x47778d}=await _0x1a1999['getId']();this['_ongoingUploads']['delete'](_0x496cbe),this['_finishContextItemLoading']({'type':_0x317935,'id':_0x47778d,'label':_0x45bc8e?.['label']||_0x1f1822,'uiId':_0x496cbe,'resourceId':_0x45bc8e?.['resourceId']},!0x1);}catch(_0xdad72e){this['_ongoingUploads']['delete'](_0x496cbe);if(!(_0xdad72e instanceof _0x25c351&&_0xdad72e['message']['startsWith']('ai-request-aborted'))){const _0xd90706=$e['get'](_0xdad72e['code'])||'ai-chat-file-upload-failed',_0x120676=new _0x25c351(_0xd90706,null,{'fileName':_0x1f1822,..._0xdad72e});_0x120676['stack']=_0xdad72e['stack'],this['fire']('error',{'error':_0x120676});}this['_removeContextItem'](_0x496cbe);}}));}finally{this['_finishUploadOperation'](_0x2bc8c8);}}['addCurrentDocumentToContext'](_0x5d23b9){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x3df0bb={'type':Fe['DOCUMENT'],'uiId':'current-document','label':_0x5d23b9,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x3df0bb);}async['updateCurrentDocument'](_0x38f5c0,_0x307f11,_0x4a35a6,_0x3eb5bf){const _0x3816b1=this['_pendingContextItems']['get']('current-document');if(_0x3816b1&&_0x38f5c0){_0x3816b1['selection']=_0x3eb5bf?_0x3eb5bf['map'](_0x11b76f=>({'start':_0x11b76f['start'],'end':_0x11b76f['end']})):[];try{if(_0x3816b1['version']===_0x307f11)return;const {id:_0x2f1ea9}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x38f5c0,{'version':_0x307f11,'sessionId':_0x4a35a6})['getId']();_0x3816b1['id']=_0x2f1ea9,_0x3816b1['content']=_0x38f5c0,_0x3816b1['version']=_0x307f11,_0x3816b1['sessionId']=_0x4a35a6;}catch(_0x354112){const _0x859fa0=new _0x25c351('ai-chat-document-upload-failed',null);_0x859fa0['stack']=_0x354112['stack'],this['fire']('error',{'error':_0x859fa0});}}}['addSelectionToContext'](_0x2bffa6){this['_addContextItem']({'type':Fe['SELECTION'],'label':_0x2bffa6,'uiId':'selection','content':_0x2bffa6});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x36e9ed,_0x4ae064){const _0x2debf2='url-'+_0x677d44();this['_startUploadOperation'](_0x2debf2);const _0x69a65b='url-'+_0x677d44();try{this['_addContextItem']({'type':Fe['URL'],'label':_0x4ae064?.['label']||_0x36e9ed,'uiId':_0x69a65b,'resourceId':_0x4ae064?.['resourceId']},!0x0);const _0x33acca=this['_connector']['uploadUrl'](this['_ownerId'],_0x36e9ed,_0x4ae064);this['_ongoingUploads']['set'](_0x69a65b,_0x33acca['abortController']);const {id:_0x573f41}=await _0x33acca['getId']();this['_ongoingUploads']['delete'](_0x69a65b),this['_finishContextItemLoading']({'type':Fe['URL'],'id':_0x573f41,'label':_0x4ae064?.['label']||_0x36e9ed,'uiId':_0x69a65b,'resourceId':_0x4ae064?.['resourceId']},!0x1);}catch(_0x2f14c2){this['_ongoingUploads']['delete'](_0x69a65b),(_0x2f14c2['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x25c351('ai-chat-url-upload-failed',this,{'url':_0x36e9ed,'originalError':_0x2f14c2}),'url':_0x36e9ed}),this['_removeContextItem'](_0x69a65b));}finally{this['_finishUploadOperation'](_0x2debf2);}}['addToolItemToContext'](_0x1181df){_0x1181df['id']=_0x1181df['id']??_0x677d44()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x1181df['uiId'],_0x1181df),this['fire']('contextItemAdded',{'contextItem':_0x1181df,'isLoading':!0x1});}async['loadSourceResources'](_0x552fe8,_0x2b5493,_0x397ee7){const _0x30f58c=this['_addContextOptionsState']['sources']['find'](_0x1ad02c=>_0x1ad02c['id']===_0x552fe8);if(!_0x30f58c)return this['fire']('error',{'error':new _0x25c351('ai-chat-source-not-found',this,{'sourceId':_0x552fe8}),'sourceId':_0x552fe8}),[];try{const _0x3cede5=(await _0x30f58c['getResources'](_0x2b5493))['map'](_0x20c9be=>{const _0x24cef8=this['_isResourceInContext'](_0x20c9be['id']);return{..._0x20c9be,'isInContext':_0x24cef8};});return _0x30f58c['resources']=_0x3cede5,this['fire']('sourceResourcesLoaded',{'sourceId':_0x552fe8,'source':_0x30f58c,'resources':_0x3cede5,'uid':_0x397ee7}),_0x3cede5;}catch(_0x2aeb06){return this['fire']('error',{'error':new _0x25c351('ai-chat-source-resources-load-failed',this,{'sourceId':_0x552fe8,'originalError':_0x2aeb06}),'sourceId':_0x552fe8,'sourceLabel':_0x30f58c['label']}),[];}}async['addResourceToContext'](_0x1a368f,_0x3f2ae5){if(this['_isResourceInContext'](_0x3f2ae5['id']))return;let _0x377cc7=_0x3f2ae5['data'];if(!_0x377cc7&&_0x1a368f['getData'])try{_0x377cc7=await _0x1a368f['getData'](_0x3f2ae5['id']);}catch(_0x882358){return void this['fire']('error',{'error':new _0x25c351('ai-chat-resource-load-failed',this,{'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id'],'originalError':_0x882358}),'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id']});}if(_0x377cc7)switch(_0x3f2ae5['type']){case Fe['URL']:if('string'!=typeof _0x377cc7)return void this['fire']('error',{'error':new _0x25c351('ai-chat-context-invalid-data',this,{'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id'],'expectedType':'string','actualType':typeof _0x377cc7}),'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id']});await this['addUrlToContext'](_0x377cc7,{'label':_0x3f2ae5['label'],'resourceId':_0x3f2ae5['id']});break;case Fe['FILE']:if(!(_0x377cc7 instanceof File))return void this['fire']('error',{'error':new _0x25c351('ai-chat-context-invalid-data',this,{'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id'],'expectedType':'File','actualType':typeof _0x377cc7}),'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id']});await this['addFilesToContext']([_0x377cc7],{'label':_0x3f2ae5['label'],'resourceId':_0x3f2ae5['id']});break;case Fe['TEXT']:if('object'!=typeof _0x377cc7||!('content'in _0x377cc7)||!('type'in _0x377cc7))return void this['fire']('error',{'error':new _0x25c351('ai-chat-context-invalid-data',this,{'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x377cc7}),'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id']});_0x377cc7=He['_convertTextResourceToFile'](_0x377cc7,_0x3f2ae5['label']),await this['addFilesToContext']([_0x377cc7],{'label':_0x3f2ae5['label'],'resourceId':_0x3f2ae5['id']},Fe['TEXT']);break;case Fe['TOOL']:break;default:this['fire']('error',{'error':new _0x25c351('ai-chat-context-unsupported-type',this,{'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id'],'resourceType':_0x3f2ae5['type']}),'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id']});}else this['fire']('error',{'error':new _0x25c351('ai-chat-resource-no-data',this,{'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id']}),'resourceId':_0x3f2ae5['id'],'sourceId':_0x1a368f['id']});}static['_convertTextResourceToFile'](_0x2b5c90,_0x4cdc97){switch(_0x2b5c90['type']){case Oe['MARKDOWN']:return new File([_0x2b5c90['content']],_0x4cdc97,{'type':'text/markdown'});case Oe['HTML']:return new File([_0x2b5c90['content']],_0x4cdc97,{'type':'text/html'});default:return new File([_0x2b5c90['content']],_0x4cdc97,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x38d5b6){switch(_0x38d5b6['type']){case Fe['FILE']:return{'type':Fe['FILE'],'id':_0x38d5b6['id']};case Fe['URL']:return{'type':Fe['URL'],'id':_0x38d5b6['id']};case Fe['DOCUMENT']:return{'type':Fe['DOCUMENT'],'id':_0x38d5b6['id'],..._0x38d5b6['selection']?.['length']&&{'selection':_0x38d5b6['selection']}};case Fe['TEXT']:return{'type':Fe['FILE'],'id':_0x38d5b6['id']};case Fe['TOOL']:{const _0x6b9f16=_0x38d5b6;return{'type':Fe['TOOL'],'mcpServerName':_0x6b9f16['mcpServerName'],'toolName':_0x6b9f16['toolName'],'data':_0x6b9f16['data'],'id':_0x6b9f16['id']};}default:return null;}}['_addContextItem'](_0x9c58d3,_0xbc8db2=!0x1){if(this['_pendingContextItems']['set'](_0x9c58d3['uiId'],_0x9c58d3),_0x9c58d3['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x9c58d3,'isLoading':_0xbc8db2}),'current-document'===_0x9c58d3['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x9c58d3['resourceId']){const _0x1aea47=this['_findSourceIdsByResourceId'](_0x9c58d3['resourceId']);_0x1aea47&&_0x1aea47['forEach'](_0x500866=>{this['_updateResourceInContextState'](_0x500866,_0x9c58d3['resourceId'],!0x0);});}}['_removeContextItem'](_0x539141){const _0x2090b5=this['_pendingContextItems']['get'](_0x539141),_0xe0a648=this['_ongoingUploads']['get'](_0x539141);if(_0xe0a648&&(_0xe0a648['abort'](),this['_ongoingUploads']['delete'](_0x539141)),_0x2090b5?.['resourceId']){const _0x1068f3=this['_findSourceIdsByResourceId'](_0x2090b5['resourceId']);_0x1068f3&&_0x1068f3['forEach'](_0xe9f6b=>{this['_updateResourceInContextState'](_0xe9f6b,_0x2090b5['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x539141),this['fire']('contextItemRemoved',{'uiId':_0x539141,'type':_0x2090b5?.['type']}),'current-document'===_0x539141&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x29d1a8,_0x1ff0d3){if(this['_pendingContextItems']['has'](_0x29d1a8['uiId'])&&(this['_pendingContextItems']['set'](_0x29d1a8['uiId'],_0x29d1a8),this['fire']('contextItemLoadingEnded',{'contextItem':_0x29d1a8,'isLoading':_0x1ff0d3}),_0x29d1a8['resourceId'])){const _0x1d669f=this['_findSourceIdsByResourceId'](_0x29d1a8['resourceId']);_0x1d669f&&_0x1d669f['forEach'](_0x301d0=>{this['_updateResourceInContextState'](_0x301d0,_0x29d1a8['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x395657){this['_conversationContextItems']['set'](_0x395657['uiId'],_0x395657);}['_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'](_0x1ff5ed=>({..._0x1ff5ed,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x1e9829=>({..._0x1e9829,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x3df7f3=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x3df7f3,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x44b619){for(const _0x5cecbf of this['_pendingContextItems']['values']())if(_0x5cecbf['resourceId']===_0x44b619)return!0x0;for(const _0x436f83 of this['_conversationContextItems']['values']())if(_0x436f83['resourceId']===_0x44b619)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x4b17ab){const _0x438985=[];for(const _0x5e6f19 of this['_addContextOptionsState']['sources']){_0x5e6f19['resources']['find'](_0xe46925=>_0xe46925['id']===_0x4b17ab)&&_0x438985['push'](_0x5e6f19['id']);}return 0x0===_0x438985['length']?null:_0x438985;}['_updateResourceInContextState'](_0x5415be,_0x736ca9,_0x5cf437){const _0x16b8b9=this['_addContextOptionsState']['sources']['find'](_0x2aa112=>_0x2aa112['id']===_0x5415be);if(!_0x16b8b9)return;const _0x1f1850=_0x16b8b9['resources']['find'](_0xcf790c=>_0xcf790c['id']===_0x736ca9);_0x1f1850&&(_0x1f1850['isInContext']=_0x5cf437,this['fire']('resourceStateChanged',{'sourceId':_0x5415be,'resourceId':_0x736ca9,'isInContext':_0x5cf437}));}['_startUploadOperation'](_0x3ed64e){this['_ongoingUploadOperations']['set'](_0x3ed64e,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x26903f){this['_ongoingUploadOperations']['delete'](_0x26903f),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Ge=['capabilitiesUpdated'];class Be extends _0xa7ecb2(){['_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'](_0x42e77d){const _0x56bfb6={};return _0x42e77d&&_0x42e77d['isWebSearchEnabled']&&(_0x56bfb6['webSearch']={}),_0x42e77d&&_0x42e77d['isReasoningEnabled']&&(_0x56bfb6['reasoning']={}),_0x56bfb6;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x529482){_0x529482!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x529482,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x2ad146){_0x2ad146!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x2ad146,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ke extends os{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x5cb419){super(_0x5cb419),this['conversationId']=_0x5cb419['conversationId'],this['contextItems']=_0x5cb419['contextItems'],this['capabilities']=_0x5cb419['capabilities'],this['userMessage']=_0x5cb419['userMessage'],this['model']=_0x5cb419['model'],this['attributes']=_0x5cb419['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':He['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Be['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class st extends _0xa7ecb2(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x55aa90){super(),this['options']=_0x55aa90,this['connector']=_0x55aa90['connector'],this['chatModels']=_0x55aa90['chatModels'],this['id']=_0x55aa90['conversationId'],this['isFromHistory']=_0x55aa90['isFromHistory'];}async['init'](_0x1187d5){try{this['chatContext']=new He({'connector':this['connector'],'config':_0x1187d5,'ownerId':this['id']}),this['chatContext']['delegate'](...Je)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Be(),this['chatCapabilities']['delegate'](...Ge)['to'](this),this['chatCapabilities']['init']();const _0x1783f1=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x1783f1});const _0x4f6310=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x4f6310&&await this['setModel'](_0x4f6310);}catch(_0x5acb18){const _0x262b0b=new _0x25c351('ai-chat-conversation-init-failed',null,{'message':_0x5acb18['message']||_0x5acb18});_0x262b0b['stack']=_0x5acb18['stack'],this['fire']('error',{'error':_0x262b0b});}}async['start'](){if(this['isStarted'])throw new _0x25c351('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x25c351('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x35739d}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x35739d,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x1aa9ce){const _0x10e6bd=new _0x25c351('ai-chat-conversation-start-failed',null,{'message':_0x1aa9ce['message'],'conversationId':this['id']});throw _0x10e6bd['stack']=_0x1aa9ce['stack'],this['fire']('error',{'error':_0x10e6bd}),_0x10e6bd;}}async['load'](_0x21dac5,_0x45c67e){try{const _0x34b369=await this['connector']['fetchConversation'](_0x21dac5)['getConversation'](),_0xea10fe=await this['connector']['fetchConversationMessages'](_0x21dac5)['getMessages'](),_0x16f2de=_0xea10fe[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x34b369['id'],'title'in _0x34b369?this['fire']('setConversationTitle',_0x34b369['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x2caa61=(await this['chatModels']['getAll']())['find'](_0x28bd83=>_0x28bd83['id']['toLowerCase']()===_0x16f2de['toLowerCase']());return this['selectedModel']=_0x2caa61,this['fire']('modelSelected',{'selectedModel':_0x2caa61,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0xea10fe,_0x45c67e,_0x16f2de),this['currentInteraction']=void 0x0,this;}catch(_0x3e7ea0){const _0x320d71=new _0x25c351('ai-chat-conversation-init-from-id-failed',null,{'message':_0x3e7ea0['message'],'conversationId':_0x21dac5});throw _0x320d71['stack']=_0x3e7ea0['stack'],this['fire']('error',{'error':_0x320d71}),_0x320d71;}}async['_processMessagesToInteractions'](_0x361842,_0x4cc86a,_0x178428){let _0xb39702;for(const _0x3a006e of _0x361842)if('user'===_0x3a006e['role']){const _0x207083=await this['_extractContextItems'](_0x3a006e),_0x299295={'isReasoningEnabled':Object['hasOwn'](_0x3a006e['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x3a006e['capabilities'],'webSearch')};_0xb39702=this['createInteraction']({'userMessage':_0x3a006e['prompt'],'contextItems':_0x207083,'capabilities':_0x299295,'modelId':_0x178428,'attributes':_0x3a006e['attributes']}),this['currentInteraction']=_0xb39702,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x3a006e['role']&&_0xb39702){const _0x30dfe9=[];for(const _0xf10248 of _0x3a006e['content'])switch(_0xf10248['type']){case'text':case'modification':{const _0x52f96d=_0xb39702['getDocumentContext']()?.['sessionId']!==_0x4cc86a;_0xb39702['currentReply']=_0xb39702['createReply']({'type':_0xf10248['type'],'isDone':!0x0,'interactionId':_0xb39702['id'],'areActionsDisabled':_0x52f96d}),_0xb39702['currentReply']['appendContent'](_0xf10248['content']),_0x30dfe9['length']>0x0&&(_0xb39702['currentReply']['sources']=_0x30dfe9['splice'](0x0));break;}case'url':_0x30dfe9['push'](_0xf10248);break;case'mcp-tool-result':{const {data:_0x190b48,attributes:_0x526bb2}=JSON['parse'](_0xf10248['content']);_0xb39702['_handleToolResultData']({'toolName':_0xf10248['toolName'],'data':_0x190b48,'attributes':_0x526bb2});break;}}}}}async['_extractContextItems'](_0xfc65ae){const _0x2c82b6=new Map();if(!_0xfc65ae['content'])return _0x2c82b6;for(const _0x3bce62 of _0xfc65ae['content']){const _0x17c98c=await this['chatContext']['populateFromMessage'](_0x3bce62);_0x17c98c&&_0x2c82b6['set'](_0x17c98c['id'],_0x17c98c);}return _0x2c82b6;}async['handleUserInteraction']({userMessage:_0x2207af,attributes:_0x50bc59}){if(!this['isStarted'])throw new _0x25c351('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x25c351('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x16bade=this['chatContext']['getPendingContextItems'](),_0x51171b=this['chatCapabilities']['getCapabilitiesConfig'](),_0x42f0e6=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x2207af,'contextItems':_0x16bade,'capabilities':_0x51171b,'modelId':_0x42f0e6,'attributes':_0x50bc59}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x55d0e8){if(_0x55d0e8 instanceof _0x25c351)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x55d0e8});else{const _0x53f995=$e['get'](_0x55d0e8['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x25c351(_0x53f995,null,{'error':_0x55d0e8})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0xea7fc1,contextItems:_0x5af465,capabilities:_0x16a1c9,modelId:_0x557a9f,attributes:_0x48d92e}){const _0x547a29=new Ke({'userMessage':_0xea7fc1,'contextItems':_0x5af465,'capabilities':_0x16a1c9,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x557a9f,'attributes':_0x48d92e});return _0x547a29['delegate'](...ze)['to'](this),this['interactions']['push'](_0x547a29),this['fire']('interactionCreated',_0x547a29),_0x547a29;}['getInteraction'](_0x42c326){return this['interactions']['find'](_0x197f88=>_0x197f88['id']===_0x42c326);}['removeInteraction'](_0x36b724){const _0x261695=this['getInteraction'](_0x36b724);_0x261695&&(_0x261695['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x261695),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x1cdc4a){this['chatContext']['addCurrentDocumentToContext'](_0x1cdc4a);}async['updateCurrentDocumentInContext']({content:_0x17699e,version:_0x2fb1ec,sessionId:_0x29ec9e,selections:_0xb70b64}){await this['chatContext']['updateCurrentDocument'](_0x17699e,_0x2fb1ec,_0x29ec9e,_0xb70b64);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x2a462f){this['chatContext']['addSelectionToContext'](_0x2a462f);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0xe73299){this['chatContext']['addFilesToContext'](_0xe73299);}['addUrlToContext'](_0x3aefdd){this['chatContext']['addUrlToContext'](_0x3aefdd);}['addToolItemToContext'](_0x3c33f0){this['chatContext']['addToolItemToContext'](_0x3c33f0);}['addResourceToContext'](_0x5da821,_0x29e946){this['chatContext']['addResourceToContext'](_0x5da821,_0x29e946);}['loadSourceResources'](_0x21519b,_0x54103,_0x217d55){return this['chatContext']['loadSourceResources'](_0x21519b,_0x54103,_0x217d55);}['removeFromContext'](_0xf53298){this['chatContext']['removeFromContext'](_0xf53298);}['setWebSearch'](_0x84c0d7){this['chatCapabilities']['setWebSearch'](_0x84c0d7);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x123fe2){this['chatCapabilities']['setReasoning'](_0x123fe2);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x49b0c5){_0x49b0c5?!0x1===await this['chatModels']['isAvailable'](_0x49b0c5)&&(_0x1c9a23('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x49b0c5}),_0x49b0c5=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x1c9a23('ai-chat-conversation-set-model-null',{'conversation':this}),_0x49b0c5=(await this['chatModels']['getAvailableModels']())[0x0]),_0x49b0c5['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x49b0c5,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x49b0c5}));}}class et extends _0xa7ecb2(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x52ed3f,config:_0x33b300,locale:_0x4393ef}){super(),this['_connector']=_0x52ed3f,this['_config']=_0x33b300,this['_locale']=_0x4393ef;}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 _0x1cb3df=await this['getAll']();let _0x40f703;return _0x40f703=this['_availableModels']?this['_filterModels'](_0x1cb3df,this['_availableModels']):_0x1cb3df['filter'](_0x54e235=>_0x54e235['recommended']),_0x40f703;}async['getModel'](_0x2d5acb){const _0xd8c862=await this['getAll']();if(!_0xd8c862['length'])return null;if(_0x2d5acb){const _0x192db8=this['_getModelById'](_0xd8c862,_0x2d5acb);if(_0x192db8)return _0x192db8;_0x1c9a23('ai-chat-model-id-unrecognized',{'modelId':_0x2d5acb,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0xeec13e=await this['getAvailableModels']();if(!_0xeec13e['length'])return null;if(this['_defaultModelId']){const _0x3463d6=this['_getModelById'](_0xeec13e,this['_defaultModelId']);if(_0x3463d6)return _0x3463d6;_0x1c9a23('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0xeec13e[0x0]['id']});}return _0xeec13e[0x0];}async['isAvailable'](_0x151a2d){return(await this['getAvailableModels']())['some'](_0x2a13ae=>_0x2a13ae['name']===_0x151a2d['name']&&_0x2a13ae['provider']===_0x151a2d['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0xeb0f37=this['_locale']['uiLanguage']||'en',_0x5f1fc9=this['_connector']['getModels'](_0xeb0f37),_0x47c7a2=await _0x5f1fc9['list']();this['_modelList']=_0x47c7a2['items']['map'](_0x2f1a77=>Bi(_0x2f1a77)?{..._0x2f1a77,'name':h(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x2f1a77);}catch(_0x5b79bb){throw _0x2d18bd('ai-models-unable-to-retrieve',{'error':_0x5b79bb}),_0x5b79bb;}return[...this['_modelList']];}['_filterModels'](_0x52e404,_0x193a85){let _0x11ea09;if(_0x193a85){_0x11ea09=[];const _0xc6961a=new Set(),_0x4cc9e0='string'==typeof _0x193a85?[_0x193a85['toLocaleLowerCase']()]:_0x193a85['map'](_0x443d17=>_0x443d17['toLocaleLowerCase']());for(const _0x5d9237 of _0x4cc9e0)for(const _0x4ce499 of _0x52e404)!_0xc6961a['has'](_0x4ce499['id'])&&this['_isMatchingFilter'](_0x4ce499,_0x5d9237)&&(_0x11ea09['push'](_0x4ce499),_0xc6961a['add'](_0x4ce499['id']));}else _0x11ea09=_0x52e404;return _0x11ea09;}['_isMatchingFilter'](_0x5a0a3d,_0x3fa534){const _0x2b856d=_0x5a0a3d['id']['toLocaleLowerCase'](),_0x51285e=_0x5a0a3d['name']['toLocaleLowerCase'](),_0x1e14a1=_0x5a0a3d['provider']['toLocaleLowerCase']();return _0x2b856d===_0x3fa534||_0x51285e===_0x3fa534||Bi(_0x5a0a3d)&&'auto'===_0x3fa534||_0x1e14a1===_0x3fa534||_0x2b856d['startsWith'](_0x3fa534);}['_getModelById'](_0xf3075a,_0x2ab44c){return _0xf3075a['find'](_0x495161=>Bi(_0x495161)&&'auto'===_0x2ab44c?_0x495161:_0x495161['id']===_0x2ab44c)||null;}}function Bi(_0xbf70a4){return _0xbf70a4['id']['startsWith']('agent');}function c(_0x1e1388){if(_0x1e1388 instanceof _0x39b2a6)return _0x1e1388;if(_0x1e1388?.['editors']&&_0x1e1388['editors']['get'](0x0))return _0x1e1388['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.'),_0x1e1388['editors']['get'](0x0);throw new _0x25c351('ai-get-editor-from-context-no-editor');}function at({editor:_0x42e2ca,interaction:_0x46cbb0,reply:_0x52f478,groups:_0x2328d7,transform:_0xb42ecd,documentCompare:_0x224cc5,documentCompareOptions:_0x10b788}){const _0x5c8cc7=_0x46cbb0['getDocumentContext']();if(!_0x5c8cc7)return[];const _0xf8ebfc=_0x5c8cc7['content'],_0x978f=_0x5c8cc7['version'],_0x16847b=_0x52f478['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x504e90}of _0x2328d7){const _0x1f311b=_0x504e90['filter'](_0x30e1ff=>'new'!=_0x30e1ff['type'])['map'](_0x1c1ab3=>It('data-id',_0x1c1ab3['id'],_0x16847b)),_0x86a592=_0x504e90['filter'](_0x44070d=>'removed'!=_0x44070d['type'])['map'](_0x45add1=>_0x45add1['node']['cloneNode'](!0x0));let _0x24fa8e=null;if(_0x1f311b['length']){_0x24fa8e=_0x1f311b[0x0]['previousSibling'];for(let _0x571fe6=0x0;_0x571fe6<_0x1f311b['length'];_0x571fe6++)_0x210a44(_0x1f311b[_0x571fe6]);}if(_0x86a592['length']){_0x24fa8e||(_0x504e90[0x0]['anchorId']?_0x24fa8e=It('data-id',_0x504e90[0x0]['anchorId'],_0x16847b):(_0x24fa8e=_0x86a592['shift'](),_0x2cb06e(_0x16847b,_0x24fa8e)));for(let _0x2056c0=0x0;_0x2056c0<_0x86a592['length'];_0x2056c0++)_0x40b605(_0x24fa8e,_0x86a592[_0x2056c0]),_0x24fa8e=_0x86a592[_0x2056c0];}}const _0x57add7=pt(_0x16847b),_0x5b7c4a=_0x224cc5['getDiff'](_0xf8ebfc,_0x57add7,_0x10b788)['getOperations']();if(_0xb42ecd){const _0x378a93=_0x42e2ca['model']['document']['history']['getOperations'](_0x978f),_0x157f86={'document':_0x42e2ca['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return xt(_0x5b7c4a,_0x378a93,_0x157f86)['operationsA'];}return _0x5b7c4a;}function rt(_0x5eaec8,_0x58047f){if('marker'!=_0x58047f['type'])return;const _0x4f4ba7=_0x5eaec8['model']['markers']['get'](_0x58047f['name']);_0x4f4ba7&&(_0x58047f['oldRange']=_0x4f4ba7['getRange']());}class S extends _0x5dcf5b{['_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 _0x1c4f1c(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 _0x540ae9=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x41666a,_0x501aad)=>{this['_handleUIUserMessage']({'userMessage':_0x501aad});}),this['listenTo'](_0x540ae9,'resizedTabs',(_0x49d779,_0xaf3f6c)=>{this['_setIsMaximized'](_0xaf3f6c);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x540ae9['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',(_0x2bd943,_0x47d151)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x47d151));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x5781f0,_0x54c9b3)=>{this['activeConversation']?.['addUrlToContext'](_0x54c9b3);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x266c0b,_0x56196f)=>{_0x56196f['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x161586,_0x3531e2)=>{this['activeConversation']?.['addResourceToContext'](_0x3531e2['source'],_0x3531e2['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x2dc175,_0x2fef0a)=>{this['_removeFromContext'](_0x2fef0a);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x39f967,_0x4296e2)=>{this['activeConversation']?.['loadSourceResources'](_0x4296e2['sourceId'],_0x4296e2['query'],_0x4296e2['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x51cb54,_0x1854c8)=>{this['activeConversation']?.['setModel'](_0x1854c8);}),this['listenTo'](this['_aiChatUi'],'like',(_0x1d162b,{replyId:_0x3444a7})=>{console['log']('Liked\x20response',_0x3444a7);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0xad7715,{replyId:_0x5aa59a})=>{console['log']('Disliked\x20response',_0x5aa59a);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x4dc4c8,_0x3f7b4c)=>{this['_insertSuggestion'](_0x3f7b4c);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x35c5c1,{replyId:_0xaf9715,partIndex:_0x3b41c9})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0xaf9715,_0x3b41c9);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x2f48b9,{replyId:_0x2e1d42,partIndex:_0x51ec9f})=>{const _0x34138a=this['_getDocumentRangeForReplyChanges'](_0x2e1d42,_0x51ec9f);_0x34138a&&'$graveyard'!=_0x34138a['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x34138a['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x5b622c,_0x598448)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x598448);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x269a8a,{replyId:_0x32eaf6,showDiff:_0x4e265f})=>{const {reply:_0xdd31ca}=this['getInteractionAndReplyById'](_0x32eaf6),_0x32305a=_0xdd31ca['getContentParts']({'showDiff':_0x4e265f});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0xdd31ca['id'],'parts':_0x32305a,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x4a4de6,{replyId:_0x21034d,partIndex:_0x147409})=>{this['_rejectSuggestion']({'replyId':_0x21034d,'partIndex':_0x147409}),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:_0x4d2a34,partIndex:_0x1ed686}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x55d986}=this['getInteractionAndReplyById'](_0x4d2a34),_0x57f8a2=_0x55d986['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x1ed686});this['_aiChatBalloon']['updateContent']({'part':_0x57f8a2[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x1c7c7b,partIndex:_0xdc3b25}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x1c7c7b,'partIndex':_0xdc3b25}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x3b46d0,partIndex:_0x2de61d}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x3b46d0,'partIndex':_0x2de61d}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x443f98,partIndex:_0x572e2e}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x443f98,'partIndex':_0x572e2e}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x1b83ec,partIndex:_0x57834a}=this['_currentPreviewedChangeGroup'],_0x451d08=this['_getPresentableSiblingContentPartIndex'](_0x1b83ec,_0x57834a,'next');null!==_0x451d08&&this['_openBalloonFor'](_0x1b83ec,_0x451d08);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x11a29a,partIndex:_0x5e3e64}=this['_currentPreviewedChangeGroup'],_0x543396=this['_getPresentableSiblingContentPartIndex'](_0x11a29a,_0x5e3e64,'previous');null!==_0x543396&&this['_openBalloonFor'](_0x11a29a,_0x543396);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x11b15e,{id:_0x36ed29})=>{if('aiChatBalloon'!==_0x36ed29)return;const {replyId:_0x5aa8dd,partIndex:_0x39b4b0}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x5aa8dd,'index':_0x39b4b0,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof _0x39b2a6?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0xedc983,_0x310f72)=>{_0x310f72['on']('ready',()=>{this['_integrateEditor'](_0x310f72);});});const _0x57a168=this['context']['config']['get']('ai.chat.initialConversation');let _0x2f0ebe=_0x57a168;if('lastCreated'!=_0x57a168||(_0x2f0ebe=await this['_getLastCreatedConversationId'](),_0x2f0ebe))return'new'==_0x2f0ebe?this['_startConversationSafely']():this['loadConversation'](_0x2f0ebe);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x38aea5){const _0x3e2eec=c(this['context']);if(!_0x3e2eec['plugins']['has']('TrackChanges'))throw new _0x25c351('ai-no-track-changes',null);const _0x106c8c=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x43f03b,interaction:_0x3f1323}=this['getInteractionAndReplyById'](_0x38aea5['replyId']),_0xaa91d9=this['_getDocumentRangeForReplyChanges'](_0x38aea5['replyId'],_0x38aea5['partIndex']),_0x530cf4=void 0x0!==_0x38aea5['partIndex']?[_0x43f03b['changeGroups'][_0x38aea5['partIndex']]]:_0x43f03b['changeGroups']['filter'](_0xe51dca=>'pending'==_0xe51dca['state']),_0x70b7d4=_0x530cf4['map'](_0x120c53=>_0x43f03b['changeGroups']['indexOf'](_0x120c53));if(!_0xaa91d9||'$graveyard'==_0xaa91d9['range']['root']['rootName'])return void _0x70b7d4['forEach'](_0x134fd1=>_0x43f03b['setChangeGroupState'](_0x134fd1,'outdated'));_0x70b7d4['forEach'](_0x1e5bf8=>_0x43f03b['setChangeGroupState'](_0x1e5bf8,'accepted'));const _0x5917a3=at({'editor':_0x3e2eec,'reply':_0x43f03b,'interaction':_0x3f1323,'groups':_0x530cf4,'transform':!0x0,'documentCompare':_0x106c8c,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x1b469f;_0xaa91d9&&this['_scrollToSuggestionRange'](_0xaa91d9['range']),_0x3e2eec['model']['change'](_0x5e5d4f=>{_0x1b469f=_0x5e5d4f['batch'],_0x3e2eec['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x5917a3),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x1b469f,{'interactionId':_0x3f1323['id'],'replyId':_0x43f03b['id'],'indexes':_0x70b7d4['slice']()}),this['_updateRatings'](_0x43f03b);}['_applySuggestion'](_0x1d8c94){const _0x40b534=c(this['context']),_0x455ec9=this['context']['plugins']['get'](ot),{reply:_0x16fabe,interaction:_0x27b026}=this['getInteractionAndReplyById'](_0x1d8c94['replyId']),_0x348aab=this['_getDocumentRangeForReplyChanges'](_0x1d8c94['replyId'],_0x1d8c94['partIndex']),_0x47c2e8=void 0x0!==_0x1d8c94['partIndex']?[_0x16fabe['changeGroups'][_0x1d8c94['partIndex']]]:_0x16fabe['changeGroups']['filter'](_0x4d9304=>'pending'==_0x4d9304['state']),_0x1036a0=_0x47c2e8['map'](_0x261e5a=>_0x16fabe['changeGroups']['indexOf'](_0x261e5a));if(!_0x348aab||'$graveyard'==_0x348aab['range']['root']['rootName'])return void _0x1036a0['forEach'](_0x31e025=>_0x16fabe['setChangeGroupState'](_0x31e025,'outdated'));_0x1036a0['forEach'](_0x239e13=>_0x16fabe['setChangeGroupState'](_0x239e13,'accepted'));const _0x58dc4d=at({'editor':_0x40b534,'reply':_0x16fabe,'interaction':_0x27b026,'groups':_0x47c2e8,'transform':!0x0,'documentCompare':_0x455ec9,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x54ad6d;_0x348aab&&this['_scrollToSuggestionRange'](_0x348aab['range']),_0x40b534['model']['change'](_0x3a1011=>{_0x54ad6d=_0x3a1011['batch'];for(const _0x11a93b of _0x58dc4d)_0x11a93b['baseVersion']=_0x40b534['model']['document']['version'],rt(_0x40b534,_0x11a93b),_0x3a1011['batch']['addOperation'](_0x11a93b),_0x40b534['model']['applyOperation'](_0x11a93b);}),this['_batchToChanges']['set'](_0x54ad6d,{'interactionId':_0x27b026['id'],'replyId':_0x16fabe['id'],'indexes':_0x1036a0['slice']()}),this['_updateRatings'](_0x16fabe);}['_rejectSuggestion'](_0x1b6af5){const {reply:_0x5de01c}=this['getInteractionAndReplyById'](_0x1b6af5['replyId']);_0x5de01c['setChangeGroupState'](_0x1b6af5['partIndex'],'rejected');}['_openBalloonFor'](_0x55d187,_0x5690a2){if(!this['_aiChatBalloon'])return;const {reply:_0x5c1a07}=this['getInteractionAndReplyById'](_0x55d187),_0x49b82e=_0x5c1a07['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x19e50a,_0x4bd5a6;if(void 0x0!==_0x5690a2?(_0x4bd5a6=_0x49b82e['find'](_0x5a25ed=>_0x5a25ed['index']==_0x5690a2),_0x19e50a=_0x4bd5a6?.['index']):(_0x4bd5a6=_0x49b82e[0x0],_0x19e50a=_0x4bd5a6['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x55d187&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x19e50a)return;const _0x4caebf=this['_getUserPresentableContentPartDocumentRange'](_0x55d187,_0x5c1a07,_0x4bd5a6);if(!_0x4caebf)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x55d187,'partIndex':_0x19e50a},this['_scrollToSuggestionRange'](_0x4caebf,!0x0);const _0x10f092=this['_getPresentableSiblingContentPartIndex'](_0x55d187,_0x19e50a,'next');this['_aiChatBalloon']['updateContent']({'part':_0x4bd5a6,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x19e50a,'title':h(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x19e50a+0x1)['toString']()),'showRotator':null!==_0x10f092,'ranges':[_0x4caebf],'areActionsDisabled':_0x5c1a07['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x55d187,_0x19e50a),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x55d187,'index':_0x19e50a,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x3f528c,_0x38b958,_0x4567d5){const {reply:_0x4643fb}=this['getInteractionAndReplyById'](_0x3f528c),_0x552f61=_0x4643fb['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x552f61['length'])return null;const _0x2db74c=_0x552f61['findIndex'](_0x4be2b1=>_0x4be2b1['index']==_0x38b958),_0x4c3b8b='next'==_0x4567d5?0x1:-0x1;let _0x16e229=_0x552f61['at']((_0x2db74c+_0x4c3b8b)%_0x552f61['length'])['index'],_0x3c8d4f=_0x552f61[_0x16e229];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x3f528c,_0x4643fb,_0x3c8d4f);){if(_0x16e229=_0x552f61['at']((_0x16e229+_0x4c3b8b)%_0x552f61['length'])['index'],_0x16e229===_0x2db74c)return null;_0x3c8d4f=_0x552f61[_0x16e229];}return _0x16e229;}['_getUserPresentableContentPartDocumentRange'](_0x3499bb,_0x2ea043,_0x2d253b){const _0x227224=_0x2ea043['changeGroups'];if(!_0x2d253b['hasChanges'])return null;const _0x49590c=_0x227224['find'](_0x4fd885=>_0x4fd885['index']==_0x2d253b['index']);if('pending'!==_0x49590c?.['state'])return null;const _0x139d16=this['_getDocumentRangeForReplyChanges'](_0x3499bb,_0x2d253b['index']);if(!_0x139d16)return null;const {range:_0x2db6de,currentIndex:_0x112944}=_0x139d16;return'$graveyard'==_0x2db6de['root']['rootName']?(_0x2ea043['setChangeGroupState'](_0x112944,'outdated'),null):_0x139d16['range'];}['_getDocumentRangeForReplyChanges'](_0x2eb181,_0x217218){const _0xb0d7d8=c(this['context']),{reply:_0x40a2f0,interaction:_0x294b1b}=this['getInteractionAndReplyById'](_0x2eb181),_0x3380fa=_0x40a2f0['changeGroups']['filter'](_0x50cd80=>'pending'==_0x50cd80['state']),_0x198760=_0x3380fa['map'](_0x1474c9=>_0x40a2f0['changeGroups']['indexOf'](_0x1474c9));void 0x0===_0x217218&&(_0x217218=_0x198760[0x0]);const _0x187e1b=_0x198760['indexOf'](_0x217218);if(-0x1==_0x187e1b)return null;const _0x2b55c3=_0x3380fa[_0x187e1b],_0x410c9b=new _t([]),_0x3c8cda=new _t([]);for(const _0x4d2c8a of _0x2b55c3['changes'])if('removed'!=_0x4d2c8a['type']&&_0x3c8cda['children']['push'](_0x4d2c8a['node']['cloneNode'](!0x0)),'new'!=_0x4d2c8a['type']){const _0x161152=gt(_0x4859ea=>ut(_0x4859ea,'data-id')==_0x4d2c8a['id'],_0x40a2f0['documentContextContent'],!0x0);_0x410c9b['children']['push'](_0x161152['cloneNode'](!0x0));}if(0x0==_0x410c9b['children']['length']){if(_0x2b55c3['changes'][0x0]['anchorId']){const _0x33b104=It('data-id',_0x2b55c3['changes'][0x0]['anchorId'],_0x40a2f0['documentContextContent']);_0x410c9b['children']['unshift'](_0x33b104['cloneNode'](!0x0)),_0x3c8cda['children']['unshift'](_0x33b104['cloneNode'](!0x0)),_0x33b104['nextSibling']&&(_0x410c9b['children']['push'](_0x33b104['nextSibling']['cloneNode'](!0x0)),_0x3c8cda['children']['push'](_0x33b104['nextSibling']['cloneNode'](!0x0)));}else{const _0x2d74b2=_0x40a2f0['documentContextContent']['children'][0x0];if(!_0x2d74b2)return null;_0x410c9b['children']['push'](_0x2d74b2['cloneNode'](!0x0)),_0x3c8cda['children']['push'](_0x2d74b2['cloneNode'](!0x0));}}const _0x33f058=_0x294b1b['getDocumentContext'](),_0x46d0ac=_0xb0d7d8['data']['parse'](_0x33f058['content']),_0x4f1dae=pt(_0x410c9b),_0x39a699=_0xb0d7d8['data']['parse'](_0x4f1dae),_0x5b0e1e=_0xb0d7d8['data']['parse'](_0x4f1dae),_0x37c6a8=_0xb0d7d8['model']['createPositionAt'](_0x39a699,0x0),_0x1fa4a3=pt(_0x3c8cda),_0x5c0254={'anchor':_0x37c6a8,'markDeletions':!0x1},_0x5bf455=_0xb0d7d8['plugins']['get'](ot)['getDiff'](_0x4f1dae,_0x1fa4a3,_0x5c0254)['getOperations']();if(!_0x5bf455['length'])return null;_0xb0d7d8['model']['change'](_0x2439b1=>{for(const _0x109e2c of _0x5bf455)if('remove'==_0x109e2c['type']){const _0x9d39f6=_0x109e2c['sourcePosition'],_0x544694=_0x109e2c['howMany'],_0x3d2acf=new lt(_0x9d39f6,_0x544694);_0x2439b1['batch']['addOperation'](_0x3d2acf),_0xb0d7d8['model']['applyOperation'](_0x3d2acf);}else'marker'!==_0x109e2c['type']&&(_0x109e2c['baseVersion']=null,_0x109e2c['isDocumentOperation']=!0x1,_0x2439b1['batch']['addOperation'](_0x109e2c),_0xb0d7d8['model']['applyOperation'](_0x109e2c));});const _0x300e61=ct(_0xb0d7d8,_0x5bf455,_0x39a699);ht(_0xb0d7d8['model'],_0x300e61);const _0x4a2e10=_0x300e61['getFirstRange']()['start']['path']['slice'](),_0x166955=_0x300e61['getFirstRange']()['end']['path']['slice'](),_0x509be1=[];let _0x5997bf=_0x39a699,_0x3031e7=_0x5b0e1e;for(let _0x574d60=0x0;_0x574d60<_0x166955['length'];_0x574d60++){const _0x23cf5f=_0x5997bf['maxOffset']-_0x166955[_0x574d60];_0x509be1[_0x574d60]=_0x3031e7['maxOffset']-_0x23cf5f,_0x5997bf=_0x5997bf['getChildAtOffset'](_0x166955[_0x574d60]),_0x3031e7=_0x3031e7['getChildAtOffset'](_0x509be1[_0x574d60]);}const _0x4467da=_0xb0d7d8['model']['createRange'](_0xb0d7d8['model']['createPositionFromPath'](_0x5b0e1e,_0x4a2e10),_0xb0d7d8['model']['createPositionFromPath'](_0x5b0e1e,_0x509be1)),_0x17400c=_0x5b0e1e['getChild'](0x0)['getAttribute'](nt),_0x66b07a=Array['from'](_0x46d0ac['getChildren']())['find'](_0x409b3c=>_0x409b3c['getAttribute'](nt)==_0x17400c)['getPath'](),_0x51128a=_0x4467da['start']['path']['slice'](),_0x32d8ad=_0x4467da['end']['path']['slice']();_0x51128a[0x0]=_0x66b07a[0x0]+_0x51128a[0x0],_0x32d8ad[0x0]=_0x66b07a[0x0]+_0x32d8ad[0x0];let _0x340489=_0xb0d7d8['model']['createRange'](_0xb0d7d8['model']['createPositionFromPath'](_0xb0d7d8['model']['document']['getRoot'](),_0x51128a),_0xb0d7d8['model']['createPositionFromPath'](_0xb0d7d8['model']['document']['getRoot'](),_0x32d8ad));const _0x4ac660=_0xb0d7d8['model']['document']['history']['getOperations'](_0x33f058['version']);for(const _0x5d07cc of _0x4ac660)_0x340489=dt['_createFromRanges'](_0x340489['getTransformedByOperation'](_0x5d07cc));return{'range':_0x340489,'currentIndex':_0x217218};}['_integrateEditor'](_0xcd2065){if(!_0xcd2065['plugins']['has']('Undo'))return;const _0x2af199=_0xcd2065['commands']['get']('undo'),_0x1daaf7=_0xcd2065['commands']['get']('redo');this['listenTo'](_0x2af199,'revert',(_0x34863c,_0x1ecb71,_0x282d2b)=>{const _0x3d93d0=this['_batchToChanges']['get'](_0x1ecb71);if(!_0x3d93d0)return;const _0x3baf46=this['activeConversation']['getInteraction'](_0x3d93d0['interactionId'])['getReply'](_0x3d93d0['replyId']);_0x3d93d0['indexes']['forEach'](_0x1145a0=>_0x3baf46['setChangeGroupState'](_0x1145a0,'pending')),this['_batchToChanges']['delete'](_0x1ecb71),this['_batchToChanges']['set'](_0x282d2b,_0x3d93d0);}),this['listenTo'](_0x1daaf7,'revert',(_0x3d32a6,_0xb26ba6,_0x219136)=>{const _0x450305=this['_batchToChanges']['get'](_0xb26ba6);if(!_0x450305)return;const _0x49a3d8=this['activeConversation']['getInteraction'](_0x450305['interactionId'])['getReply'](_0x450305['replyId']);_0x450305['indexes']['forEach'](_0x3e093e=>_0x49a3d8['setChangeGroupState'](_0x3e093e,'accepted')),this['_batchToChanges']['delete'](_0xb26ba6),this['_batchToChanges']['set'](_0x219136,_0x450305);});}async['loadConversation'](_0x2c9445){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'](_0x2c9445)['getConversation'](),await this['_startConversationSafely'](_0x2c9445),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x2c9445,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x1492c5){this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x2c9445}),this['_logError'](new _0x25c351('ai-chat-conversation-not-found',this,{'error':_0x1492c5}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0x4aba3e=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x8fe66e=await _0x4aba3e['getConversations']();return _0x8fe66e['length']?_0x8fe66e[0x0]['id']:'new';}catch(_0x234c7c){return this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x677d44()}),this['_logError'](new _0x25c351('ai-chat-conversation-init-failed',this,{'error':_0x234c7c})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x49bbda){this['activeConversation']['id']===_0x49bbda&&this['_startConversationSafely']();}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](h(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x566313=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x566313),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x3275d0,attributes:_0x17a4cf}){await this['_handleUIUserMessage']({'userMessage':_0x3275d0,'attributes':_0x17a4cf});}['getGroupId'](){const _0x260ed4=this['context']['config']['get']('collaboration.channelId');if(!_0x260ed4)throw new _0x25c351('ai-chat-missing-channel-id',this);return _0x260ed4;}async['_startConversationSafely'](_0xc18b94){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0xc18b94);}catch(_0xdd571b){this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0xc18b94||_0x677d44()}),console['error'](_0xdd571b),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x5a824c){let _0x2c1a33;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x5a824c||!this['activeConversation']?_0x2c1a33=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x2c1a33=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x2405c2=this['getGroupId'](),_0x40438f=_0x5a824c||_0x677d44();this['activeConversation']=new st({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x2c1a33,'conversationId':_0x40438f,'group':_0x2405c2,'getEditor':()=>c(this['context']),'isFromHistory':!!_0x5a824c}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x8b5007,_0x169a28)=>{this['_aiChatUi']['createConversation'](_0x169a28),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x5a824c||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x21404f,_0x1cf1fd)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x1cf1fd['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x13576b,_0x3a0a85)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x3a0a85);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x161eeb=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x161eeb);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x4e2732=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x4e2732);}),this['activeConversation']['on']('webSearchFinished',(_0x18f4d3,_0x26d20b)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x26d20b,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x1c9036,_0x213fb7)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x213fb7,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x4a89d4,_0x133df0)=>{this['_aiChatUi']['removeFeedInteraction'](_0x133df0['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x14c18f,_0x4aeff1,_0x2f7c79)=>{this['updateConversationTitle'](_0x4aeff1,_0x2f7c79);}),this['activeConversation']['on']('replyCreated',(_0x23f101,_0x515c88)=>{'text'===_0x515c88['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x515c88):this['_aiChatUi']['addFeedItemAISuggestion'](_0x515c88);}),this['activeConversation']['on']('replyContentUpdated',async(_0x90c63e,_0x27198f)=>{await this['_updateReplyContent']({'reply':_0x27198f});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x32af7c,{reply:_0x57439a,index:_0x4ed220,state:_0x2b6557})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x57439a['id'],'index':_0x4ed220,'state':_0x2b6557}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x57439a['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x4ed220&&this['_aiChatBalloon']?.['setState'](_0x2b6557);}),this['activeConversation']['on']('contextItemAdded',(_0x35f367,_0x1c9052)=>{if(this['_aiChatUi']['addContextItem'](_0x1c9052['contextItem'],_0x1c9052['isLoading']),'selection'===_0x1c9052['contextItem']['type']){const _0x46a8e4=[...c(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x46a8e4,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x54751a,_0x3fc7e7)=>{this['_aiChatUi']['removeContextItem'](_0x3fc7e7['uiId']),'current-document'==_0x3fc7e7['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x3fc7e7['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x3c44c9,_0x59ef08)=>{this['_aiChatUi']['setContextItemLoading'](_0x59ef08['contextItem']['uiId'],_0x59ef08['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x18ca7d,_0x24a65f)=>{this['_aiChatUi']['setConversationContext'](_0x24a65f['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x423402,_0x5b5bb8)=>{this['_aiChatUi']['setAddContextOptions'](_0x5b5bb8['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x1771d1,_0x2da1f5)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x2da1f5['sourceId'],_0x2da1f5['source'],_0x2da1f5['resources'],_0x2da1f5['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x648c48,_0x204c37)=>{this['_aiChatUi']['updateResourceState'](_0x204c37['sourceId'],_0x204c37['resourceId'],_0x204c37['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x12e388,_0x273099)=>{this['_aiChatUi']['updateCapabilities'](_0x273099);}),this['activeConversation']['on']('modelSelected',async(_0x3e5533,_0x51892c)=>{const _0x3939d3=(await this['_aiChatModels']['getAll']())['find'](_0x111f5e=>_0x111f5e['id']===_0x51892c['selectedModel']['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x3939d3,_0x51892c['isDisabled']);}),this['activeConversation']['on']('error',(_0x2a45f9,{error:_0x31e257,interactionId:_0x17c5e8,fileName:_0x40d2ed,url:_0x5b83b3,sourceId:_0x3ced76,sourceLabel:_0x51560f})=>{const _0x27d5f3=_0x17c5e8?_0x17c5e8+':'+_0x677d44():_0x677d44();_0x31e257['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':h(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x27d5f3}):_0x31e257['message']['startsWith']('ai-chat-conversation-init-failed')||_0x31e257['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x27d5f3}),this['_logError'](_0x31e257)):_0x31e257['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x40d2ed),'id':_0x27d5f3}):_0x31e257['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x5b83b3),'id':_0x27d5f3}):_0x31e257['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x27d5f3}):_0x31e257['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x27d5f3}):_0x31e257['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x3ced76&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x3ced76),this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x51560f||'source'),'id':_0x27d5f3}),this['_logError'](_0x31e257)):_0x31e257['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x27d5f3}),this['_logError'](_0x31e257)):_0x31e257['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x27d5f3}),this['_logError'](_0x31e257)):_0x31e257['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x27d5f3}),this['_logError'](_0x31e257)):_0x31e257['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x27d5f3}),this['_logError'](_0x31e257)):_0x31e257['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x27d5f3}),this['_logError'](_0x31e257)):_0x31e257['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x27d5f3}),this['_logError'](_0x31e257)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':h(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x27d5f3}),this['_logError'](_0x31e257));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x5a824c||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x456ff5,attributes:_0x3e0e6d}){if(!this['activeConversation'])throw new _0x25c351('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x497224=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x497224);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x456ff5,'attributes':_0x3e0e6d});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x42cac7){this['_aiChatUi']['setIsMaximized'](_0x42cac7);}['_logError'](_0x30d153){_0x2d18bd(_0x30d153['message']);}['_removeFromContext'](_0x560ddd){this['activeConversation']?.['removeFromContext'](_0x560ddd);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x455ece){const [_0xd8d7f2,_0x1355e0]=_0x455ece['split'](':'),_0x5ce0ee=this['activeConversation']['getInteraction'](_0xd8d7f2),_0x1a422a=_0x5ce0ee['getReply'](_0x1355e0);return{'interaction':_0x5ce0ee,'reply':_0x1a422a};}['_scrollToSuggestionRange'](_0x4185fa,_0x125b97=!0x1){const _0x3bdc6b=c(this['context']),_0x74a5b2={'target':_0x3bdc6b['editing']['view']['domConverter']['viewRangeToDom'](_0x3bdc6b['editing']['mapper']['toViewRange'](_0x4185fa)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x125b97};_0x125b97&&(_0x74a5b2['alignToTop']=!0x0),_0x517478(_0x74a5b2);}['updateConversationTitle'](_0x1862ff,_0x1872d2=!0x1){this['_aiChatUi']['setConversationTitle'](_0x1862ff||h(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x1872d2);}async['_updateReplyContent']({reply:_0x7b47f1,renderingStrategy:_0xa74464}){const {id:_0x5b0052,interactionId:_0xc7eb0d,isDone:_0x47fc56,type:_0x657d0c,parsedContent:_0x12a82d}=_0x7b47f1,_0x38f942=_0xc7eb0d+':'+_0x5b0052;if('modification'===_0x657d0c){const _0x449124=_0x7b47f1['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x38f942,'parts':_0x449124,'renderingStrategy':_0xa74464,'isDone':_0x47fc56});}else'text'===_0x657d0c&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x38f942,'parsedContent':_0x12a82d,'renderingStrategy':_0xa74464,'isDone':_0x47fc56});_0x47fc56&&_0x7b47f1['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x38f942,_0x7b47f1['sources']);}async['_stopLastInteraction'](){const _0x36d3cb=this['activeConversation']?.['lastInteraction'];_0x36d3cb&&(_0x36d3cb['stop'](),this['_aiChatUi']['stopInteraction'](_0x36d3cb));}async['_flushLastInteractionUI'](){const _0x3604d0=this['activeConversation']?.['lastInteraction'];if(_0x3604d0){for await(const _0x4730f2 of _0x3604d0['replies'])await this['_updateReplyContent']({'reply':_0x4730f2,'renderingStrategy':'static'});}}['_updateRatings'](_0x5ddf24){const _0x5f465d={'positiveCount':_0x5ddf24['changeGroups']['filter'](_0x44123e=>'accepted'===_0x44123e['state'])['length'],'totalCount':_0x5ddf24['changeGroups']['length'],'modificationId':_0x5ddf24['id']},_0x3d8885=this['activeConversation']['getInteraction'](_0x5ddf24['interactionId'])['messageId'];_0x3d8885&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x3d8885,_0x5f465d);}['_registerToolDataCallback'](_0x50f2b1){let _0x323a2c=null,_0x41493a=null;this['on']('toolDataReceived',(_0x4b2ac3,_0x110cda,_0x2cb15c)=>{_0x2cb15c['id']!==_0x323a2c&&(_0x323a2c=_0x2cb15c['id'],_0x41493a=this['_getAIChatInteractionAPI'](_0x2cb15c)),_0x50f2b1(_0x110cda,_0x41493a);});}['_getAIChatInteractionAPI'](_0x5e1d2a){const _0x2f1f73=this['_aiChatUi'],_0x213d98=()=>{_0x5e1d2a['resetWebSearchState'](),_0x5e1d2a['resetReasoningState'](),_0x2f1f73['clearLoadingMessage']();},_0x45a928=()=>{_0x5e1d2a['currentReply']&&(_0x5e1d2a['currentReply']['done'](),_0x5e1d2a['currentReply']=void 0x0);};return{'insertTextReply':(_0x428a05,_0x141c9e)=>{_0x45a928(),_0x213d98();const _0x2c1e01=_0x5e1d2a['currentReply']=_0x5e1d2a['createReply']({'type':'text','interactionId':_0x5e1d2a['id'],'content':_0x428a05,'id':_0x141c9e||_0x677d44()});return _0x45a928(),_0x2c1e01;},'insertCustomElement':async(_0x45227d,_0xee401f)=>(_0x45a928(),_0x213d98(),_0x2f1f73['addFeedItemCustomElement'](_0x45227d,_0xee401f||_0x677d44())),'setLoadingMessage':_0x375982=>{_0x2f1f73['setLoadingMessage'](_0x375982);},'clearLoadingMessage':()=>{_0x2f1f73['clearLoadingMessage']();}};}}const o='ai-selection';class s extends _0x5dcf5b{constructor(_0x505de9){super(_0x505de9),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 _0x18d87e=c(this['context']),_0x298d54=_0x18d87e['plugins']['has']('RealTimeCollaborationClient')&&_0x18d87e['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x298d54||_0x677d44();}return this['_sessionId'];}async['getDocumentData'](){const _0xd5d954=c(this['context']),_0x124dd8=_0xd5d954['model'],_0x552821=_0xd5d954['data']['toView'](_0x124dd8['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x577d87=new Ot(_0xd5d954['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x552821,_0x577d87);let _0x40eb37=await this['_getDocumentDataStringFromView'](_0x552821);const _0x408f58=this['_getMarkersInDocumentOrder'](),_0x669e8c=[];for(const _0x23a0be of _0x408f58){const _0x257942='<'+_0x23a0be['name']+':start></'+_0x23a0be['name']+':start>',_0x4f71f8=_0x40eb37['indexOf'](_0x257942);_0x40eb37=_0x40eb37['substring'](0x0,_0x4f71f8)+_0x40eb37['substring'](_0x4f71f8+_0x257942['length']);const _0x2d6458='<'+_0x23a0be['name']+':end></'+_0x23a0be['name']+':end>',_0x1c0cd0=_0x40eb37['indexOf'](_0x2d6458);_0x40eb37=_0x40eb37['substring'](0x0,_0x1c0cd0)+_0x40eb37['substring'](_0x1c0cd0+_0x2d6458['length']),_0x669e8c['push']({'markerName':_0x23a0be['name'],'start':_0x4f71f8,'end':_0x1c0cd0,'htmlFragment':_0x40eb37['substring'](_0x4f71f8,_0x1c0cd0)});}return{'content':_0x40eb37,'version':_0xd5d954['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x669e8c};}async['afterInit'](){this['context']instanceof _0x39b2a6?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x12c0a3,_0x2aa621)=>{_0x2aa621['on']('ready',()=>{this['_integrateEditor'](_0x2aa621);});});}['_setOutputDataProcessor'](_0x1bea76){this['_outputDataProcessor']=_0x1bea76;}async['_getDocumentDataStringFromView'](_0x45d9f6){let _0x22bf1b;const _0x4141ff=c(this['context']);if(this['_outputDataProcessor']){const _0x136f3b=_0x4141ff['data']['processor']['domConverter']['viewToDom'](_0x45d9f6),_0x3e994e=await this['_outputDataProcessor'](_0x136f3b);_0x22bf1b=_0x4141ff['data']['processor']['htmlWriter']['getHtml'](_0x3e994e);}else _0x22bf1b=_0x4141ff['data']['processor']['toData'](_0x45d9f6);return _0x22bf1b;}['_integrateEditor'](_0xf88211){_0xf88211['conversion']['for']('editingDowncast')['markerToHighlight']({'model':o,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0xf88211['conversion']['for']('dataDowncast')['markerToElement']({'model':o,'view':(_0x40e7c3,{writer:_0x52deef,options:_0xe4ed8b})=>_0xe4ed8b['convertAiChatSelectionMarker']?_0x52deef['createUIElement'](_0x40e7c3['markerName']+':'+(_0x40e7c3['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x473c69,_0x59c7c3,_0x48bb0a=!0x1,_0x29ed0e=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x29ed0e)return!0x1;const _0x27f4d4=c(this['context'])['model'];return _0x27f4d4['change'](_0x47401a=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x59c7c3,this['_displayedFakeSelectionLocked']=_0x48bb0a;let _0xe901b6=0x0;for(let _0x5c7f54 of _0x473c69){const _0x47e21e=o+':'+_0xe901b6;if(_0x5c7f54['start']['isAtEnd']){const _0x22b50b=_0x5c7f54['start']['getLastMatchingPosition'](({item:_0x429123})=>!_0x27f4d4['schema']['isContent'](_0x429123),{'boundaries':_0x5c7f54});_0x5c7f54=_0x47401a['createRange'](_0x22b50b,_0x5c7f54['end']);}_0x47401a['addMarker'](_0x47e21e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5c7f54}),_0xe901b6++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x4f2937){if(this['_displayedFakeSelectionId']!=_0x4f2937)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x3c4be1=c(this['context']),_0x1630ff=_0x3c4be1['model']['markers']['getMarkersGroup'](o);return _0x3c4be1['model']['change'](_0x182e4b=>{for(const _0x224dce of _0x1630ff)_0x182e4b['removeMarker'](_0x224dce);}),!0x0;}async['modelToDataWithIds'](_0x2705f5){const _0x498dc4=c(this['context']),_0x2d9f39=_0x498dc4['data']['toView'](_0x2705f5),_0x310cf4=new Ot(_0x498dc4['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x2d9f39,_0x310cf4),this['_getDocumentDataStringFromView'](_0x2d9f39);}['_setDataIdsOnChildren'](_0xd2ba1,_0xed47ac){let _0x45c445=!0x1;const _0x2a63b6=new Set();for(const _0x1b2263 of _0xd2ba1['getChildren']()){const _0x3792ac=_0x1b2263['is']('emptyElement')||_0x1b2263['is']('containerElement');if(!_0x1b2263['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x1b2263,_0xed47ac)||_0x3792ac)&&(_0xed47ac['setAttribute']('data-id',this['_nextDataId'](_0x2a63b6),_0x1b2263),_0x45c445=!0x0);}return _0x45c445;}['_nextDataId'](_0x29dbd8){let _0x9a435e;do{_0x9a435e='';for(let _0x15052b=0x0;_0x15052b<0x4;_0x15052b++)_0x9a435e+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x29dbd8['has'](_0x9a435e));return _0x29dbd8['add'](_0x9a435e),_0x9a435e;}['getSelectionText'](){const {model:_0x404fbd}=c(this['context']),_0x1ec88e=_0x404fbd['document']['selection'],_0x2251a5=[];for(const _0x4fde61 of _0x1ec88e['getRanges']())for(const _0x2c721a of _0x4fde61['getItems']())_0x2c721a['is']('$textProxy')?_0x2251a5['push'](_0x2c721a['data']):_0x2c721a['is']('element')&&_0x2251a5['length']>0x0&&'\x20'!==_0x2251a5[_0x2251a5['length']-0x1]&&_0x2251a5['push']('\x20');return _0x2251a5['length']?'\x22'+_0x2251a5['join']('')['trim']()+'\x22':h(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_getMarkersInDocumentOrder'](){const _0x3d0e97=c(this['context'])['model'];return Array['from'](_0x3d0e97['markers']['getMarkersGroup'](o))['sort']((_0x195cb0,_0x412e26)=>_0x195cb0['getStart']()['isBefore'](_0x412e26['getStart']())?-0x1:_0x195cb0['getStart']()['isAfter'](_0x412e26['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(_0x364607){this['options']={'delay':_0x364607['delay']??0x14,'textNodeStyle':_0x364607['textNodeStyle'],'onStreamUpdate':_0x364607['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x4b88be,targetElement:_0x3a8233,abortSignal:_0x234d66}){this['isStreaming']&&this['stop'](),_0x234d66?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x26f51(_0x4b88be,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x2c38b1=0x0;_0x2c38b1<this['currentIndex'];_0x2c38b1++)this['nodesList'][_0x2c38b1]['shouldBeStreamed']=!0x0;do{const _0x32623b=Date['now'](),_0x5e9c52=this['nodesList'][this['currentIndex']],_0x1f0e1e=_0x32623b-this['lastUpdateTime'];if(_0x5e9c52){_0x5e9c52['shouldBeStreamed']=!0x0;let _0x53ae15=_0x5e9c52['parent'];for(;_0x53ae15;)_0x53ae15['shouldBeStreamed']=!0x0,_0x53ae15=_0x53ae15['parent'];}if(_0x1f0e1e<this['options']['delay'])try{const {promise:_0x23101b,abortController:_0x2ed545}=Os(this['options']['delay']-_0x1f0e1e);this['timeoutAbortController']=_0x2ed545,await _0x23101b;}catch(_0x4eb604){return;}_0x4c0a39(_0x3a8233,'<'+_0x3a8233['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x3a8233['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:_0x384bbf}){Array['from'](_0x384bbf['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x570190=>{_0x570190['replaceWith'](_0x570190['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x13cbe4){let _0x20ec3f='';if(function(_0xa947b1){return _0x528e78(_0xa947b1);}(_0x13cbe4)){for(const _0x3b8470 of _0x13cbe4['children'])_0x20ec3f+=this['renderNode'](_0x3b8470);}else{if(Us(_0x13cbe4)){if(!_0x13cbe4['shouldBeStreamed'])return'';const _0x1efed7=_0x13cbe4,_0xdf61a1=Object['entries'](_0x1efed7['attribs'])['map'](([_0x2e53d5,_0x3cb5d3])=>_0x2e53d5+'=\x22'+_0x3cb5d3+'\x22')['join']('\x20');_0x20ec3f+='<'+_0x1efed7['tagName']+(_0xdf61a1?'\x20'+_0xdf61a1:'')+'>';for(const _0x292cdf of _0xf7fac1(_0x1efed7))_0x20ec3f+=this['renderNode'](_0x292cdf);_0x20ec3f+='</'+_0x1efed7['tagName']+'>';}else{if(!Ls(_0x13cbe4))return'';if(!_0x13cbe4['shouldBeStreamed'])return'';!function(_0xa87972){if(!_0xa87972['parent']||!Us(_0xa87972['parent']))return!0x1;if(!Ts['includes'](_0xa87972['parent']['tagName']))return!0x1;return!_0x593e8e(_0xa87972)['match'](/^\s*[<>]\s*$/);}(_0x13cbe4)?_0x20ec3f+=_0xc63f4e(_0x13cbe4):_0x20ec3f+=_0xc63f4e(new _0x38e3db('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x13cbe4]));}}return _0x20ec3f;}['getParsedDocumentNodeList'](){const _0x1162a2=[];return function(_0x5449ce,_0x3a01cf){const _0x382871=_0x4f2305=>{if(_0x3a01cf(_0x4f2305),_0x4f2305 instanceof _0x513cab)for(let _0x15fb8e=0x0;_0x15fb8e<_0x4f2305['children']['length'];_0x15fb8e++){const _0x447087=_0x4f2305['children'][_0x15fb8e];_0x382871(_0x447087);}};for(let _0x5dd36e=0x0;_0x5dd36e<_0x5449ce['children']['length'];_0x5dd36e++)_0x382871(_0x5449ce['children'][_0x5dd36e]);}(this['document'],_0x6c5f91=>{if(Ls(_0x6c5f91)){const _0x56b05d=this['splitTextNodeIntoWordNodes'](_0x6c5f91);_0x56b05d['length']&&_0x1162a2['push'](..._0x56b05d);}_0x6c5f91['isWordSplitSource']||_0x6c5f91['isWordSplitResult']||_0x1162a2['push'](_0x6c5f91);}),_0x1162a2;}['splitTextNodeIntoWordNodes'](_0x1f134d){if(_0x1f134d['isWordSplitSource']||_0x1f134d['isWordSplitResult'])return[];const _0x28ab87=_0x593e8e(_0x1f134d)['match'](/(?:\s*\S+\s*)/g),_0x542cfa=[];if(_0x28ab87&&_0x28ab87['length']>0x1){for(const _0x34af38 of _0x28ab87){const _0x609ac0=new _0x4fdfd5(_0x34af38);_0x609ac0['isWordSplitResult']=!0x0,_0x45d87d(_0x1f134d,_0x609ac0),_0x542cfa['push'](_0x609ac0);}_0x1f134d['isWordSplitSource']=!0x0,_0x210a44(_0x1f134d);}return _0x542cfa;}}const Ts=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Ls(_0x23557b){return _0x99d146(_0x23557b);}function Us(_0x59e2ae){return _0x441935(_0x59e2ae);}function Os(_0x3b1c75){const _0x2077f6=new AbortController();return{'promise':new Promise((_0x492745,_0x8c7301)=>{const _0x125342=setTimeout(_0x492745,_0x3b1c75);_0x2077f6['signal']['addEventListener']('abort',()=>{clearTimeout(_0x125342),_0x8c7301();});}),'abortController':_0x2077f6};}class Fr extends _0x1f054a{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x23b6e9){super();const _0x4d9878=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']=_0x23b6e9,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x4d9878['if']('isDone','ck-ai-chat__feed__item_done'),_0x4d9878['if']('isVisible','ck-hidden',_0x3e9558=>!_0x3e9558),'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'](_0x63ba15=>{_0x63ba15['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x79f6a3,_0x2d6c8a,_0x288a9a){await this['htmlStreamer']['stream']({'document':_0x79f6a3,'targetElement':_0x2d6c8a,'abortSignal':_0x288a9a});}}class oa extends _0x1f054a{['showChangesToggleView'];constructor(_0x4cc094,_0x5165ee){super(_0x4cc094),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Zn(_0x4cc094),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':h(_0x4cc094,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x5165ee['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x22b59b=>_0x22b59b?_0x576a77:_0x47ae5e),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0xa69641=new _0x152087();_0xa69641['content']=_0x545232,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x5165ee['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0xa69641,{'tag':'span','children':[h(_0x4cc094,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Zn extends _0x1d1b95{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const Or={'accepted':_0x32af33,'rejected':_0x37bcd5,'outdated':_0x37bcd5};class ps extends _0x1f054a{['stateIconView'];constructor(_0x421f63){super(_0x421f63);const _0x110254=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new Nr(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x110254['to']('state',_0x3fcb25=>'ck-ai-suggestion__content-part-state_'+_0x3fcb25),_0x110254['if']('isVisible','ck-hidden',_0x4af13f=>!_0x4af13f)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x110254['to']('state',_0x504f30=>{switch(_0x504f30){case'accepted':return h(_0x421f63,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return h(_0x421f63,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return h(_0x421f63,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x332a8c){this['state']=_0x332a8c;}}class Nr extends _0x152087{constructor(){super(),this['set']('state','accepted'),this['content']=Or[this['state']],this['on']('change:state',()=>{this['content']=Or[this['state']];});}}class us extends _0x50bbb8{['_applyButton'];['_suggestButton'];constructor(_0x31658a,_0x50cc68,_0x3e86d7){super(_0x31658a);const _0x666fdc=Boolean(_0x3e86d7);this['set']('isEnabled',!_0x666fdc),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x3212ee=[];if(_0x666fdc){const _0x1efdb4=new _0x1d1b95(_0x31658a);_0x1efdb4['set']({'label':h(_0x31658a,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc}),_0x3212ee['push'](_0x1efdb4);}else{_0x50cc68['includes']('applySuggestion')&&(this['_applyButton']=new _0x1d1b95(_0x31658a),this['_applyButton']['set']({'label':h(_0x31658a,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x32af33}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x3212ee['push'](this['_applyButton'])),_0x50cc68['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x1d1b95(_0x31658a),this['_suggestButton']['set']({'label':h(_0x31658a,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3cb7ec}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x3212ee['push'](this['_suggestButton']));const _0xabde53=new _0x1d1b95(_0x31658a);_0xabde53['set']({'label':h(_0x31658a,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x37bcd5}),_0xabde53['bind']('isEnabled')['to'](this),_0xabde53['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x3212ee['push'](_0xabde53);}this['items']['addMany'](_0x3212ee);const _0x2c6150=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x2c6150['if']('isVisible','ck-hidden',_0x59d5ae=>!_0x59d5ae)]}});}['setButtonsVisibility']({showApplyButton:_0x34fb7d,showSuggestButton:_0x4df64f}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x34fb7d),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x4df64f);}}class vn extends _0x1f054a{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x2584c2,{part:_0x30d365,uiIndex:_0x2f264d,availableActions:_0x216fcc,areActionsDisabled:_0x99a506}){super(_0x2584c2),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new us(_0x2584c2,_0x216fcc,_0x99a506),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x30d365['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x30d365['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x30d365['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new ps(_0x2584c2),this['titleLabelView']=new Sn(_0x2584c2,_0x2f264d),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',(_0x1247b4,_0x429fee,_0x5bce95,_0x5dedb5)=>{'pending'===_0x5dedb5?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x5bce95?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x5bce95),this['children']['add'](this['stateView']));});}}class Sn extends _0x1f054a{constructor(_0x44343a,_0x1017b9){super(_0x44343a),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[h(_0x44343a,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x1017b9['toString']())]});}}class cs extends _0x1f054a{['htmlStreamer'];constructor(_0x141dcc){super(_0x141dcc),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:_0x505a96,renderingStrategy:_0x1b63c7,abortSignal:_0x4509a7}){'streaming'===_0x1b63c7?await this['htmlStreamer']['stream']({'document':_0x505a96['content'],'targetElement':this['element'],'abortSignal':_0x4509a7}):this['element']['innerHTML']=pt(_0x505a96['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0x1f054a{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x397934,{part:_0xd9ad4e,uiIndex:_0x5a6bd5,areActionsDisabled:_0x44cae6,availableActions:_0x2c5e17}){super(_0x397934);const _0x4a6ee5=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x528729=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x44cae6;};this['on']('change:state',_0x528729),this['on']('change:isDone',_0x528729),_0x528729(),this['_children']=this['createCollection'](),this['_headerView']=new vn(_0x397934,{'part':_0xd9ad4e,'uiIndex':_0x5a6bd5,'availableActions':_0x2c5e17,'areActionsDisabled':_0x44cae6}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...W)['to'](this),this['_streamableContentView']=new cs(_0x397934),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x4a6ee5['to']('state',_0x2f785d=>'ck-ai-suggestion__body__content-part_'+_0x2f785d),_0x4a6ee5['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x4a6ee5['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x4a6ee5['if']('isVisible','ck-hidden',_0x52feea=>!_0x52feea)]},'children':this['_children'],'on':{'mouseenter':_0x4a6ee5['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0xd9ad4e['index']});}),'mouseleave':_0x4a6ee5['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0xd9ad4e['index']});}),'click':_0x4a6ee5['to'](_0x1b6798=>{const _0x8462c2=_0x1b6798['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x8462c2)&&this['fire']('showChangeInText',{'index':_0xd9ad4e['index']});})}});}async['updateContent']({part:_0x4cf443,renderingStrategy:_0x3f02b1,showUnchangedParts:_0x52892b=!0x1,abortSignal:_0x5aa816}){this['partDefinition']=_0x4cf443,this['isVisible']=this['partDefinition']['hasChanges']||_0x52892b,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x4cf443,'renderingStrategy':_0x3f02b1,'abortSignal':_0x5aa816});}['markAsDone'](){this['isDone']=!0x0;}}class St extends _0xa7ecb2(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x5bc66f){const _0xbd1e41=this['createTask'](_0x5bc66f);return this['queue']['push'](_0xbd1e41),this['_processQueue'](),_0xbd1e41['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(_0x3f4af5=>{this['once']('_queueEmpty',()=>{_0x3f4af5();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x20f41e=this['queue']['shift']();try{await _0x20f41e['callback'](this['_abortController']['signal']),_0x20f41e['resolve']();}catch(_0x36283a){_0x20f41e['reject'](_0x36283a);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x53a3a4){let _0x7d6bdc,_0x341879;const _0x42447a=new Promise((_0x50b81c,_0x4fc8b0)=>{_0x7d6bdc=_0x50b81c,_0x341879=_0x4fc8b0;});return{'callback':_0x53a3a4,'resolve':_0x7d6bdc,'reject':_0x341879,'completePromise':_0x42447a};}}class Ze extends Fr{constructor(_0x124230){super(_0x124230),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x124230['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x4d5e07){this['element']['innerHTML']=_0x4d5e07;}}const J=['applySuggestion','insertSuggestion'];class ra extends _0x1f054a{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x385848,_0x2279f6=[...J],_0x1c6798){super(_0x385848);const _0x5df8c1=this['bindTemplate'],_0xfeda=Boolean(_0x1c6798);if(this['set']('isEnabled',!_0xfeda),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0xfeda){const _0x526667=new _0x1d1b95(_0x385848);_0x526667['set']({'label':h(_0x385848,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':tc});const _0x4aa903=new _0x1f054a(_0x385848);_0x4aa903['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[h(_0x385848,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x526667]}]}),this['children']['add'](_0x4aa903);}else this['_applyChangesButton']=new _0x1d1b95(_0x385848),this['_applyChangesButton']['set']({'label':h(_0x385848,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x2279f6['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x1d1b95(_0x385848),this['_insertSuggestionsButton']['set']({'label':h(_0x385848,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x2279f6['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'](_0x4bc786=>{_0x4bc786['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',_0x5df8c1['if']('isVisible','ck-hidden',_0x543f01=>!_0x543f01)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x4b503e){this['isVisible']=_0x4b503e;}['_switchButtonLabelsPlurality'](_0x72d58){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x72d58?(this['_applyChangesButton']['label']=h(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=h(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=h(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=h(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class Sr extends _0x1f054a{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x57c985,_0x5bd41c){super(_0x57c985),this['bodyCollection']=_0x5bd41c,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',_0x49d87a=>!_0x49d87a)]},'children':this['children']});const _0x5408c4=new _0x1f054a(this['locale']),_0x409fdf=new _0x152087();_0x409fdf['content']=_0x26bf07,_0x5408c4['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x409fdf,{'tag':'span','children':[{'text':h(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x5408c4),this['_setupBalloonPanel'](_0x57c985);}['addSource'](_0x53020f){this['children']['add'](new qr(this['locale'],_0x53020f,this['balloonPanelView']));}['_setupBalloonPanel'](_0x5c69ae){this['balloonPanelView']=new _0x10e1b3(_0x5c69ae),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class qr extends _0x1d1b95{['balloonPanelView'];['source'];constructor(_0x7d2ca4,_0x5cfda6,_0x1eb16d){super(_0x7d2ca4),this['source']=_0x5cfda6,this['balloonPanelView']=_0x1eb16d,this['set']({'label':_0x5cfda6['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x1cfdf5=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x1cfdf5['to'](()=>{window['open'](_0x5cfda6['url'],'_blank');}),'mouseenter':_0x1cfdf5['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x1cfdf5['to'](()=>{this['_hideTooltip']();})}}),_0x5cfda6['favicon']){const _0x2bb444=new _0x1f054a(_0x7d2ca4);_0x2bb444['setTemplate']({'tag':'img','attributes':{'src':_0x5cfda6['favicon']||_0x26bf07,'alt':_0x5cfda6['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x2bb444);}else this['set']('icon',_0x26bf07);}['_createTooltipContentView'](_0x16e417,_0x9e81b0){const _0x12ab68=new _0x1f054a(_0x16e417),_0x4d0e3c=[];let _0xab99c2;_0x9e81b0?.['favicon']?(_0xab99c2=new _0x1f054a(_0x16e417),_0xab99c2['setTemplate']({'tag':'img','attributes':{'src':_0x9e81b0['favicon'],'alt':_0x9e81b0['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0xab99c2=new _0x152087(),_0xab99c2['content']=_0x26bf07,_0xab99c2['extendTemplate']({'attributes':{'alt':_0x9e81b0['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x4d0e3c['push'](_0xab99c2);const _0x25ede8=new _0x1f054a(_0x16e417);_0x25ede8['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x9e81b0['url']},'children':[{'text':new URL(_0x9e81b0['url'])?.['hostname']}]}),_0x4d0e3c['push'](_0x25ede8);const _0x2edf96=new _0x1f054a(_0x16e417);_0x2edf96['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x4d0e3c});const _0x4bf864=new _0x1f054a(_0x16e417);return _0x4bf864['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x9e81b0['title']['length']>0x190?_0x9e81b0['title']['substring'](0x0,0x190)+'...':_0x9e81b0['title']}]}),_0x12ab68['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x2edf96,_0x4bf864]}),_0x12ab68;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x10e1b3['defaultPositions']['northArrowSouth'],_0x10e1b3['defaultPositions']['northArrowSouthWest'],_0x10e1b3['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 _0x11e0e8=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x11e0e8);}}class ca extends _0x1f054a{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x3b67f7,_0x43362f){super(_0x3b67f7);const {areActionsDisabled:_0x140f65,showUnchangedParts:_0x2d1726,availableActions:_0x41e78f}=_0x43362f;this['_areActionsDisabled']=_0x140f65,this['_showUnchangedParts']=_0x2d1726,this['_availableActions']=_0x41e78f,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new St(),this['_emptyPartsWarningView']=new Ze({'id':'empty-parts-warning','initialContent':h(_0x3b67f7,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x3b67f7,_0x43362f['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sr(this['locale'],_0x43362f['bodyCollection']),_0x43362f['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:_0x38d69f,renderingStrategy:_0x2f2b48,abortSignal:_0x45ff7c}){this['_children']['length']?_0x38d69f['forEach'](_0xa7d82a=>{const _0x224aef=this['_cachedContentParts']['findIndex'](_0x201d30=>_0x201d30['index']==_0xa7d82a['index']);-0x1===_0x224aef?this['_cachedContentParts']['push'](_0xa7d82a):this['_cachedContentParts'][_0x224aef]=_0xa7d82a;}):this['_cachedContentParts']=_0x38d69f;const _0x2c1352=this['_showUnchangedParts']?_0x38d69f:_0x38d69f['filter'](_0x75b0a2=>_0x75b0a2['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x2c1352['length']>0x1);for(const _0x2b9c7e of _0x2c1352)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x441aaf=>{let _0x47d399=this['getPartView'](_0x2b9c7e['index']);_0x47d399||(_0x47d399=new na(this['locale'],{'part':_0x2b9c7e,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x47d399['delegate'](...W)['to'](this),this['_children']['add'](_0x47d399),this['hasPendingParts']=!0x0),await _0x47d399['updateContent']({'part':_0x2b9c7e,'renderingStrategy':_0x2f2b48,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x441aaf}),_0x47d399['markAsDone']();});return _0x45ff7c?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x4e0293,_0x3453c7){const _0x4b4631=this['getPartView'](_0x4e0293);_0x4b4631&&(_0x4b4631['state']=_0x3453c7),this['hasPendingParts']='pending'==_0x3453c7||Array['from'](this['_children'])['some'](_0x1937c9=>'pending'==_0x1937c9['state']);}['setPartActive'](_0x18da6a,_0x13688e){if(!0x1===_0x18da6a){for(const _0x27b9e8 of this['_children'])_0x27b9e8['isActive']=!0x1;}else{const _0x2c12a6=this['getPartView'](_0x18da6a);_0x2c12a6&&(_0x2c12a6['isActive']=_0x13688e);}}['updateSources'](_0x3f0172){_0x3f0172['forEach'](_0x2b578c=>this['_sourcesView']['addSource'](_0x2b578c)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x363dad){return this['_children']['find'](_0xda2f93=>_0xda2f93['partDefinition']['index']==_0x363dad)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x37bd4d=!this['_cachedContentParts']['find'](({hasChanges:_0xe3f892})=>_0xe3f892),_0x401850=!!this['_cachedContentParts']['find'](({hasChanges:_0x25e7a2})=>!_0x25e7a2);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x401850,_0x37bd4d?this['_emptyPartsWarningView']['setContent'](h(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](h(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x111494=>_0x111494['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x88b4b8=>_0x88b4b8['partDefinition']['hasChanges'])['length']>0x0;}}class gn extends _0x1f054a{['bodyView'];['children'];['headerView'];constructor(_0x448005,_0x40c895,_0x3e3c5e){super(_0x448005);const {showDiff:_0x7346d8,areActionsDisabled:_0x1d0ef6,showUnchangedParts:_0x525ef8,availableActions:_0xcb90b9}=_0x40c895;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new oa(_0x448005,{'showDiff':_0x7346d8}),this['headerView']['on']('toggleShowChanges',(_0x43b1fc,_0x57592c)=>{this['areChangesVisible']=_0x57592c['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x57592c['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new ca(_0x448005,{'areActionsDisabled':_0x1d0ef6,'showUnchangedParts':!!_0x525ef8,'availableActions':_0xcb90b9,'bodyCollection':_0x3e3c5e}),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'](_0xe2fc27){await this['bodyView']['updateContentParts'](_0xe2fc27);}['updateSources'](_0x32f8e3){this['bodyView']['updateSources'](_0x32f8e3);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Qe extends Fr{['containerView'];constructor(_0x3aafa8,_0x6d767,_0x194f4d){super(_0x6d767),this['set']('isTrackChangesOn',!0x1),this['containerView']=new gn(_0x3aafa8,{'showDiff':_0x6d767['showDiff'],'areActionsDisabled':_0x6d767['areActionsDisabled'],'availableActions':_0x6d767['availableActions']},_0x194f4d),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x3798a5,_0x45a488)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x45a488['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',(_0x6275b,{index:_0x4254b3})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x4254b3});}),this['containerView']['on']('applySuggestion',(_0x1d15f1,{index:_0x5ebe52}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x5ebe52});}),this['containerView']['on']('insertSuggestion',(_0x4d2c64,{index:_0x51d813}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x51d813});}),this['containerView']['on']('rejectSuggestion',(_0x465853,{index:_0x35d2f1})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x35d2f1});}),this['containerView']['on']('mouseOverSuggestion',(_0x53ce37,{index:_0x1674bc})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1674bc});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x2fcfb3,{index:_0x2577c0})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2577c0});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x53f03f){await this['containerView']['updateContent'](_0x53f03f);}['updatePartState'](_0x240d23,_0x4a98d4){this['containerView']['bodyView']['updatePartState'](_0x240d23,_0x4a98d4);}['setPartActive'](_0xeeb7d6,_0xa0c1a5){!0x1===_0xeeb7d6?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0xeeb7d6,_0xa0c1a5);}['updateSources'](_0x780a2b){this['containerView']['updateSources'](_0x780a2b);}['getPartView'](_0x44a42b){return this['containerView']['bodyView']['getPartView'](_0x44a42b);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class Xe extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x182ce5,_0x391b90,_0x14aa92){super(_0x391b90),this['_bodyCollection']=_0x14aa92,this['locale']=_0x182ce5,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x1f054a(),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':Ui(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x75f12c,renderingStrategy:_0x423dc8,abortSignal:_0x575f60}){'streaming'===_0x423dc8?await this['streamIntoElement'](_0x75f12c,this['replyContainer']['element'],_0x575f60):this['replyContainer']['element']['innerHTML']=_0xc63f4e(_0x75f12c);}['updateSources'](_0x7a2ce3){const _0x5a74f2=new Sr(this['locale'],this['_bodyCollection']);_0x5a74f2['children']['addMany'](_0x7a2ce3['map'](_0x5f4fb0=>new qr(this['locale'],_0x5f4fb0,_0x5a74f2['balloonPanelView']))),_0x5a74f2['isVisible']=!0x0,this['children']['add'](_0x5a74f2);}}class mi extends _0x17fe29{constructor(_0x22df11=void 0x0){super();const _0x1c494b=_0x22df11?'ck-ai-spinner_'+_0x22df11:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x1c494b]}});}}const xn={'file':_0x107670,'document':_0x1ef80c,'web-resource':_0x9a2128,'text':_0x107670,'selection':_0x1f3474,'mcp-tool-context':_0x1ef80c},Ur='ck-ai-chat-context-chip',Wr='ck-ai-chat-context-chip_wide',Yr='ck-ai-chat-context-chip_document',$r='ck-ai-chat-context-chip__label',Qr='ck-ai-chat-context-chip__type-icon',Xr='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class Vo extends _0x1d1b95{constructor(_0x4ba266,_0x3bdb8a,_0x95dc33,_0x5d7f15,_0x5e45cf=!0x1){super(_0x4ba266),this['_isAnimationOnEnterEnabled']=_0x5d7f15,this['_initializeProperties'](_0x3bdb8a,_0x95dc33,_0x5e45cf),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'](_0x248a5b,_0x49af7b,_0x4fb3bc){this['set']('label',_0x248a5b['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x248a5b['type']),this['set']('id',_0x248a5b['uiId']),this['set']('readonly',_0x49af7b),this['set']('isLoading',_0x4fb3bc);}['_setupTemplate'](){const _0x3656f2=this['_createIconView'](),_0x1c67ac=this['_createRemoveButton'](),_0x45e2a4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x45e2a4),'children':this['_createTemplateChildren'](_0x3656f2,_0x1c67ac,_0x45e2a4)});}['_createTemplateAttributes'](_0x3c5798){return{'class':[Ur,_0x3c5798['if']('itemType',Yr,_0x500938=>'document'==_0x500938),_0x3c5798['if']('itemType',Wr,_0x39c2b2=>'selection'==_0x39c2b2)],'data-cke-tooltip-text':_0x3c5798['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':Xr};}['_createTemplateChildren'](_0x513573,_0x33e04f,_0x23f7cc){const _0x15fc39=this['_createLabelElement'](_0x23f7cc),_0x1d6894=this['_createLoaderIcon']();return this['readonly']?[_0x513573,_0x15fc39]:[_0x513573,_0x1d6894,_0x15fc39,_0x33e04f];}['_createLabelElement'](_0x2124ff){return{'tag':'span','attributes':{'class':$r},'children':[{'text':_0x2124ff['to']('label')}]};}['_createRemoveButton'](){const _0x2db379=new _0x1d1b95(this['locale']);return _0x2db379['set']({'label':h(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x186d14}),this['_setupRemoveButtonEvent'](_0x2db379),_0x2db379;}['_setupRemoveButtonEvent'](_0x532fbb){_0x532fbb['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x593624=this['bindTemplate'],_0x4077ec=new _0x152087();return _0x4077ec['content']=xn[this['itemType']],_0x4077ec['extendTemplate']({'attributes':{'class':[Qr,_0x593624['if']('isLoading','ck-hidden',_0x2f540c=>_0x2f540c)]}}),_0x4077ec;}['_handleAnimationEndOnce'](_0x2f8cd8,_0xa6a807){if(!_0x2f8cd8)return;const _0x563e42=()=>{_0xa6a807(),_0x2f8cd8['removeEventListener']('animationend',_0x563e42),_0x2f8cd8['removeEventListener']('webkitAnimationEnd',_0x563e42);};_0x2f8cd8['addEventListener']('animationend',_0x563e42),_0x2f8cd8['addEventListener']('webkitAnimationEnd',_0x563e42);}['_createLoaderIcon'](){const _0xb3f8af=new mi('small');return _0xb3f8af['bind']('isVisible')['to'](this,'isLoading',_0xd94bd=>_0xd94bd),_0xb3f8af;}}function In(_0x217834){if(!_0x217834)return _0x217834;if(_0x217834['length']<=0x78)return _0x217834;const _0x3c4633=_0x217834['slice'](0x0,0x78),_0x5267e4=_0x3c4633['lastIndexOf']('\x20');return(_0x5267e4>0x0?_0x3c4633['slice'](0x0,_0x5267e4):_0x3c4633)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Ro{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x4a53f3,_0x4f6758,_0x525fba,_0x5997da,_0xd6211a){this['_locale']=_0x4a53f3,this['_visibleChips']=_0x4f6758,this['_config']={...hn,..._0x525fba,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x525fba['cssClasses']}},this['_overflowChips']=new _0x405f09(),this['_bodyCollection']=_0x5997da,this['_parentView']=_0xd6211a||null;}['setContainerElement'](_0x558875){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x558875,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 _0x2895d5=[...this['_visibleChips'],...this['_overflowChips']],_0x3850f8=this['_createCalculationContainer'](),_0x1088d7=this['_calculateOverflowInContainer'](_0x3850f8,_0x2895d5),_0x361b01=_0x3850f8['_ancestorsToRestore'];_0x361b01&&this['_restoreAncestorVisibility'](_0x361b01),_0x3850f8['remove'](),this['_applyOverflowResults'](_0x2895d5,_0x1088d7);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x1d6ed3({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x4131cc=new _0x1d1b95(this['_locale']);_0x4131cc['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x5ab5ae=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x5ab5ae['push'](this['_config']['cssClasses']['controlsButton']),_0x4131cc['extendTemplate']({'attributes':{'class':_0x5ab5ae}}),_0x4131cc;}['_createShowMoreBalloonPanelView'](){const _0x10f8b4=new _0x10e1b3(this['_locale']);return _0x10f8b4['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x10f8b4),_0x10f8b4;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x110677=>{_0x110677['disableAnimationOnEnter']();});const _0x4a4015=new _0x1f054a(this['_locale']);_0x4a4015['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x4a4015);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x3b17be=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x3b17be?'':'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'](_0x31cf67){const _0x372769=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x5c9104=this['_containerElement']?.['classList'];if(_0x5c9104){const _0x4e9c11=_0x5c9104[0x0]||'',_0x1da53e=_0x31cf67['querySelector']('.'+_0x4e9c11),_0x439568=_0x31cf67['querySelector'](_0x372769);return _0x1da53e||_0x439568||_0x31cf67;}return _0x31cf67['querySelector'](_0x372769)||_0x31cf67;}['_calculateContainerWidth'](){const _0x53b7e4=this['_parentView']?.['element']||this['_containerElement'];if(!_0x53b7e4)return an;const _0x5b26d3=window['getComputedStyle'](_0x53b7e4)['width'];if('auto'===_0x5b26d3||'0px'===_0x5b26d3||!_0x5b26d3){const _0x3338ba=_0x53b7e4['parentElement'];if(_0x3338ba){const _0x222e00=window['getComputedStyle'](_0x3338ba);return'auto'!==_0x222e00['width']?_0x222e00['width']:an;}return an;}return _0x5b26d3;}['_applyCalculationStyles'](_0x1d2408,_0x4af56b){this['_config']['cssClasses']['calculationContainer']&&_0x1d2408['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x1d2408['style']['width']=_0x4af56b,_0x1d2408['style']['position']='absolute',_0x1d2408['style']['top']='-9999px',_0x1d2408['style']['left']='-9999px',_0x1d2408['style']['opacity']='0',_0x1d2408['style']['pointerEvents']='none',_0x1d2408['style']['zIndex']='-1',_0x1d2408['style']['visibility']='visible\x20!important',_0x1d2408['style']['display']='block\x20!important',_0x1d2408['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x1bddcf){_0x1bddcf['forEach'](({element:_0xcfb6e2,originalDisplay:_0x21ece8,originalVisibility:_0x4f8ee7})=>{_0xcfb6e2['style']['display']=_0x21ece8,_0xcfb6e2['style']['visibility']=_0x4f8ee7;});}['_makeAncestorsVisible'](_0xaaa2c0){const _0x94fc6=[];let _0xe598d7=_0xaaa2c0;for(;_0xe598d7&&_0xe598d7!==document['body'];){const _0xc35ed4=window['getComputedStyle'](_0xe598d7);'none'!==_0xc35ed4['display']&&'hidden'!==_0xc35ed4['visibility']||(_0x94fc6['push']({'element':_0xe598d7,'originalDisplay':_0xe598d7['style']['display'],'originalVisibility':_0xe598d7['style']['visibility']}),_0xe598d7['style']['display']='block',_0xe598d7['style']['visibility']='visible'),_0xe598d7=_0xe598d7['parentElement'];}return _0x94fc6;}['_createContainerElements'](){let _0x1c9576,_0x2a6098;return this['_parentView']?.['element']?(_0x1c9576=this['_parentView']['element']['cloneNode'](!0x0),_0x2a6098=this['_findTargetContainer'](_0x1c9576)):(_0x1c9576=document['createElement']('div'),_0x2a6098=_0x1c9576),{'calculationContainer':_0x1c9576,'targetContainer':_0x2a6098};}['_createCalculationContainer'](){const {calculationContainer:_0x395ae1,targetContainer:_0x5cc557}=this['_createContainerElements'](),_0x3b9b57=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x395ae1,_0x3b9b57);const _0x3a68f1=this['_parentView']?.['element']||this['_containerElement'],_0x4a584d=_0x3a68f1?.['parentElement'];_0x4a584d?_0x4a584d['appendChild'](_0x395ae1):document['body']['appendChild'](_0x395ae1),_0x395ae1['_targetContainer']=_0x5cc557;const _0xf220c7=this['_makeAncestorsVisible'](_0x4a584d||null);return _0x395ae1['offsetWidth'],_0x395ae1['_ancestorsToRestore']=_0xf220c7,_0x395ae1;}['_calculateOverflowInContainer'](_0x4e2d36,_0xc775c4){const _0x1ee522=_0x4e2d36['_targetContainer']||_0x4e2d36,_0x3e7473=[],{rowCount:_0x301fa2}=this['_renderChipsAndCountRows'](_0x1ee522,_0xc775c4);if(_0x301fa2<=this['_config']['maxVisibleRows'])return _0x3e7473;const _0x52e2a6=_0xc775c4['slice']();for(;_0x52e2a6['length']>0x0;){if(this['_testButtonFit'](_0x4e2d36,_0x1ee522,_0x52e2a6)){const _0xbec10f=_0xc775c4['filter'](_0x5192d8=>!_0x52e2a6['includes'](_0x5192d8));_0x3e7473['push'](..._0xbec10f);break;}if(!_0x52e2a6['pop']())break;}return _0x3e7473;}['_renderChipsAndCountRows'](_0x332ee9,_0x5ce798){_0x332ee9['innerHTML']='',_0x5ce798['forEach'](_0x5d1231=>{if(_0x5d1231['element']){const _0x10d813=_0x5d1231['element']['cloneNode'](!0x0);_0x332ee9['appendChild'](_0x10d813);}}),_0x332ee9['offsetWidth'];const _0x978305=_0x332ee9['children'],_0x595ea8=[];return Array['from'](_0x978305)['forEach'](_0x3126c5=>{const _0x2215d0=_0x3126c5['getBoundingClientRect']()['top'];_0x595ea8['some'](_0x463143=>Math['abs'](_0x463143-_0x2215d0)<this['_config']['rowDetectionTolerance'])||_0x595ea8['push'](_0x2215d0);}),{'rowCount':_0x595ea8['length']};}['_createMockButton'](){const _0x1f85db=document['createElement']('button');return _0x1f85db['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x1f85db['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x1f85db['textContent']='+\x201',_0x1f85db;}['_testButtonFit'](_0x5d779c,_0x314963,_0x7a79f4){this['_renderChipsAndCountRows'](_0x314963,_0x7a79f4);const _0x704a6d=this['_createMockButton']();_0x5d779c['appendChild'](_0x704a6d),_0x5d779c['offsetWidth'];const _0x4a7fee=[..._0x314963['children'],_0x704a6d],_0x26e849=[];_0x4a7fee['forEach'](_0x4f2b42=>{const _0xe0efe7=_0x4f2b42['getBoundingClientRect']()['top'];_0x26e849['some'](_0x305141=>Math['abs'](_0x305141-_0xe0efe7)<this['_config']['rowDetectionTolerance'])||_0x26e849['push'](_0xe0efe7);});const _0x2e161f=_0x26e849['length'];return _0x704a6d['remove'](),_0x2e161f<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x461ec0,_0x1412ae){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x461ec0['forEach'](_0x2f7417=>{_0x1412ae['includes'](_0x2f7417)?this['_overflowChips']['add'](_0x2f7417):this['_visibleChips']['add'](_0x2f7417);});}['_updateOverflowUI'](_0x182f3d){if(_0x182f3d>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x182f3d>0x0&&this['_showMoreButtonView']){const _0xee9d92=''+this['_config']['showMoreLabelPrefix']+(_0x182f3d<0x63?_0x182f3d:'99');this['_showMoreButtonView']['label']=_0xee9d92;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x517cc0,_0x4ba99f){this['_distributeChips'](_0x517cc0,_0x4ba99f),this['_updateOverflowUI'](_0x4ba99f['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x27d05c=>{_0x27d05c[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 _0x2e2d12=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x2e2d12['width']||0x0===_0x2e2d12['height'])return!0x1;const _0x261040=window['innerHeight']||document['documentElement']['clientHeight'],_0x3326be=window['innerWidth']||document['documentElement']['clientWidth'],_0x5b0612=0xc8;return _0x2e2d12['bottom']>=-0xc8&&_0x2e2d12['top']<=_0x261040+_0x5b0612&&_0x2e2d12['right']>=-0xc8&&_0x2e2d12['left']<=_0x3326be+_0x5b0612;}}const Zr='ck-ai-chat__feed__context-chips',la='ck-ai-chat-context-chips-wrapper',ua='ck-ai-chat-context-chips-wrapper-balloon',da='ck-ai-chat-controls-button',_a='ck-ai-chat-controls_context_show-more-button',Aa='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0x1f054a{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x5e4412,_0x5d5d96,_0x11607a){super(_0x5e4412),this['_bodyCollection']=_0x11607a,this['_createContextChips'](_0x5d5d96);const _0x5f5578={'cssClasses':{'showMoreButton':_a,'showMoreBalloon':Aa,'overflowContainer':ua,'controlsButton':da}};this['_overflowManager']=new Ro(_0x5e4412,this['_contextChips'],_0x5f5578,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Zr,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':la},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x5691f5=this['element']['querySelector']('.'+la);_0x5691f5&&(this['_overflowManager']['setContainerElement'](_0x5691f5),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x223305){for(const _0x29ad66 of _0x223305){const _0x2dc326=new Vo(this['locale'],_0x29ad66,!0x0,!0x1);this['_contextChips']['add'](_0x2dc326);}}}class Ye extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x2a4943,_0x445616,_0xf66ca1){super(_0x445616),this['_locale']=_0x2a4943,this['_bodyCollection']=_0xf66ca1,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'](_0x5d9c3d=>!_0x5d9c3d['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x1f054a(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(_0x228470,_0x5e0e7f){super(_0x5e0e7f);const {isWebSearchEnabled:_0x5c09a8,isReasoningEnabled:_0x5bfd25}=_0x5e0e7f['capabilities'],_0x3fec2b=[];let _0x6d636d='';_0x5c09a8&&_0x5bfd25?(_0x6d636d=h(_0x228470,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x3fec2b['push'](aa(_0x26bf07)),_0x3fec2b['push'](aa(_0x782cf1))):_0x5c09a8?(_0x6d636d=h(_0x228470,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x3fec2b['push'](aa(_0x26bf07))):_0x5bfd25&&(_0x6d636d=h(_0x228470,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x3fec2b['push'](aa(_0x782cf1))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x6d636d?'':'ck-hidden']}});const _0x147724=new _0x1f054a();_0x147724['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x3fec2b,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x6d636d]}]}),this['children']['add'](_0x147724),this['capabilities']=_0x5e0e7f['capabilities'];}}function aa(_0x52d613){const _0x3d3bb0=new _0x152087();return _0x3d3bb0['content']=_0x52d613,_0x3d3bb0;}const Fs=['wheel','touchstart','pointerdown','keydown'],qs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class ai{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x4e6457){this['element']=_0x4e6457,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x51e075 of Fs){const _0x529c2a='keydown'!==_0x51e075;this['element']['addEventListener'](_0x51e075,this['_onUserEvent']['bind'](this),{'passive':_0x529c2a,'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'](_0x1e7ca7){if(this['isRunning']){if('keydown'===_0x1e7ca7['type']){const _0xb21d86=_0x1e7ca7['key'];if(!qs['includes'](_0xb21d86))return;}_0x1e7ca7 instanceof WheelEvent?_0x1e7ca7['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x292ecc,scrollHeight:_0xbaee0c,clientHeight:_0x1afecd}=this['element'];return _0xbaee0c-_0x292ecc-_0x1afecd<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class di extends _0x1f054a{constructor(_0x27d478,_0x1bba17){super(_0x27d478),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x1bba17)});}['_createSkeletonItems'](_0x16d078){const _0x2ee84f=['ck','ck-ai-skeleton__item'];return _0x16d078['map'](_0x5418e6=>{let _0x14bcdb='';switch(_0x5418e6['attributes']['align']){case'right':_0x14bcdb='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x14bcdb='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x14bcdb='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x5418e6['tag'],'attributes':{'class':[..._0x2ee84f,_0x5418e6['attributes']['class']?_0x5418e6['attributes']['class']:''],'style':'width:\x20'+_0x5418e6['attributes']['width']+';\x20height:\x20'+_0x5418e6['attributes']['height']+';'+_0x14bcdb}};});}}const li={'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(_0x15e804,_0x29b245,_0x570d55,_0x56021a){return new Array(_0x15e804)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x29b245,'height':_0x570d55,'align':_0x56021a}}));}class gi extends Fr{constructor(_0x323fec){super(_0x323fec),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 ui extends _0x1f054a{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x1e12b8,_0x34c0fa){super(_0x1e12b8),this['_bodyCollection']=_0x34c0fa,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 ai(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x1e3edd,_0x2e4fcb){let _0x1a5d88;return'ai-reply'===_0x1e3edd?_0x1a5d88=new Xe(this['locale'],_0x2e4fcb,this['_bodyCollection']):'ai-suggestion-reply'===_0x1e3edd?(_0x1a5d88=new Qe(this['locale'],_0x2e4fcb,this['_bodyCollection']),_0x1a5d88['bind']('isTrackChangesOn')['to'](this)):_0x1a5d88='user-message'===_0x1e3edd?new Ye(this['locale'],_0x2e4fcb,this['_bodyCollection']):'interaction-header'===_0x1e3edd?new Ct(this['locale'],_0x2e4fcb):'custom-element'===_0x1e3edd?new gi(_0x2e4fcb):new Ze(_0x2e4fcb),this['children']['add'](_0x1a5d88),_0x1a5d88;}async['updateReplyItem']({id:_0x50d7c7,parsedContent:_0x3fccfb,renderingStrategy:_0x4c1b48,abortSignal:_0x131c6e}){const _0x5bc6ce=this['getItemById'](_0x50d7c7);if(!(_0x5bc6ce instanceof Xe))throw new _0x25c351('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x5bc6ce,'id':_0x50d7c7,'parsedContent':_0x3fccfb});await _0x5bc6ce['updateContent']({'parsedContent':_0x3fccfb,'renderingStrategy':_0x4c1b48,'abortSignal':_0x131c6e});}async['updateWebSources'](_0x3bfe78,_0x1c597d){const _0x5d01ac=this['getItemById'](_0x3bfe78);if(_0x5d01ac instanceof Qe)_0x5d01ac['updateSources'](_0x1c597d);else{if(!(_0x5d01ac instanceof Xe))throw new _0x25c351('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x5d01ac,'id':_0x3bfe78,'sources':_0x1c597d});_0x5d01ac['updateSources'](_0x1c597d);}}async['updateSuggestionItem']({id:_0x32f62b,parts:_0x5a367c,renderingStrategy:_0x43c7a7,abortSignal:_0x540c3b}){const _0x1fd417=this['getItemById'](_0x32f62b);if(!(_0x1fd417 instanceof Qe))throw new _0x25c351('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x1fd417,'id':_0x32f62b,'parts':_0x5a367c});await _0x1fd417['updateContent']({'parts':_0x5a367c,'renderingStrategy':_0x43c7a7,'abortSignal':_0x540c3b});}['updateSuggestionPartState']({id:_0x24f3b0,index:_0x15f140,state:_0x3271ca}){const _0x5760c9=this['getItemById'](_0x24f3b0);if(!(_0x5760c9 instanceof Qe))throw new _0x25c351('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x24f3b0});_0x5760c9['updatePartState'](_0x15f140,_0x3271ca);}['setSuggestionPartActive']({id:_0x362e9f,index:_0x4d4cc6,isActive:_0x4aa0de}){const _0x494516=this['getItemById'](_0x362e9f);if(!(_0x494516 instanceof Qe))throw new _0x25c351('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x362e9f});this['children']['filter'](_0x3ae1b8=>_0x3ae1b8 instanceof Qe)['forEach'](_0x5d7dfa=>{_0x5d7dfa['setPartActive'](!0x1);}),_0x494516['setPartActive'](_0x4d4cc6,_0x4aa0de);}['markItemAsDone'](_0x46621f){this['getItemById'](_0x46621f)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x286bc1=>_0x286bc1['options']['id']);}['removeItem'](_0x47e8fa){this['children']['remove'](this['getItemById'](_0x47e8fa));}['hasItem'](_0x120ff9){return!!this['children']['find'](_0xaeaf84=>_0xaeaf84['options']['id']['includes'](_0x120ff9));}['scrollToSuggestion'](_0x426fef,_0x1543f6){const _0x4153c2=this['getItemById'](_0x426fef);if(!(_0x4153c2 instanceof Qe))return void _0x1c9a23('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x426fef,'partIndex':_0x1543f6});const _0x1f702e=_0x4153c2['getPartView'](_0x1543f6);_0x1f702e?_0x2d39e3(_0x1f702e['element'],0x14,this['element']['parentElement'],!0x0,!0x0):_0x1c9a23('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x426fef,'partIndex':_0x1543f6});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x1f5c6b=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x1f5c6b,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x339fef=new di(this['locale'],li['aiFeed']);return _0x339fef['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x1a4d8e=>!_0x1a4d8e)]}}),_0x339fef;}['_createFeedItems'](){const _0x552032=new _0x1f054a(this['locale']);return _0x552032['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x552032;}['_createFeedLoader'](){const _0x3fe236=new _0x1f054a(this['locale']);return _0x3fe236['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x5d4a68=>!_0x5d4a68)]},'children':this['_createLoaderChildren']()}),_0x3fe236;}['_createLoaderChildren'](){const _0x19d7ec=new mi();return _0x19d7ec['isVisible']=!0x0,[_0x19d7ec,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x4adfe3){const _0x1ad52f=this['children']['find'](_0x14f514=>_0x14f514['options']['id']['includes'](_0x4adfe3));if(!_0x1ad52f)throw new _0x25c351('ai-chat-feed-view-item-not-found',this,{'id':_0x4adfe3});return _0x1ad52f;}['setLoadingMessage'](_0x5a27e6){this['set']('loadingMessage',_0x5a27e6);}['toggleLoadingSkeleton'](_0x1e3abf){this['set']('isLoadingSkeletonVisible',_0x1e3abf);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class ph extends _0xc6bdf6{['filter'](){let _0x33ce36=0x0;for(const _0x2e1bb4 of this['items'])_0x33ce36+=_0x2e1bb4['items']['length'];return{'resultsCount':_0x33ce36,'totalItemsCount':_0x33ce36};}}const uh='ck-ai-chat__prompt-input_highlighted';class _s extends _0x9be194{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x27d531,_0xb20f34){super(_0x27d531,{'queryView':{'label':'','creator':_0x2dda8d,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new ph(_0x27d531),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0xb20f34,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=_s['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=_s['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x452f0e,_0x172a2d)=>!_0x452f0e&&!_0x172a2d),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x5b502c,_0x280655)=>{this['isUploadInProgress']||this['isEmpty']||_0x5b502c['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x280655());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x5a7483=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x5a7483)return this['queryView']['errorText']=h(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x374f13=_0x4ae586(_0x5a7483);this['fire']('sendUserMessage',_0x374f13),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0xb7e5a){this['queryView']['fieldView']['set']('placeholder',_0xb7e5a);}['focus'](_0x5e26c8=!0x1){super['focus'](),_0x5e26c8&&(this['element']['classList']['contains'](uh)||(this['element']['classList']['add'](uh),setTimeout(()=>{this['element']['classList']['remove'](uh);},0x320)));}['_createSubmitButton'](){const _0x1ed820=new _0x1d1b95(this['locale']);return _0x1ed820['set']({'icon':_0x4d010f,'label':h(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x1ed820['on']('execute',()=>{this['submit']();}),_0x1ed820;}['setIsUploadInProgress'](_0x2ce79b){this['isUploadInProgress']=_0x2ce79b;}['_setUpAddContextButtonPositioning'](){const _0x223e03=this['locale'],_0x50d711=()=>{_0x1385df['window']['requestAnimationFrame'](()=>{if(_0x3e9e44(this['element'])){const _0x446e40=new _0x5002e3(this['queryView']['fieldView']['element']),_0x2f6a9a=new _0x5002e3(this['_addContextButtonView']['element']),_0x45cd54=_0x446e40['width'],_0x5d5c5e='rtl'===_0x223e03['uiLanguageDirection']?'right':'left';_0x446e40['excludeScrollbarsAndBorders']();const _0x50ea1d=_0x45cd54-_0x446e40['width']+0x1;this['_addContextButtonView']['element']['style'][_0x5d5c5e]='calc('+(_0x45cd54-_0x2f6a9a['width']-_0x50ea1d)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x50d711),this['on']('render',()=>{_0x50d711(),this['_queryViewResizeObserver']=new _0x54df55(this['queryView']['fieldView']['element'],()=>{_0x50d711();});});}}const ga='ck-ai-chat__prompt-capabilities',Ia='ck-ai-chat-controls-button',Ea='ck-ai-chat-controls-button--commands',pa='ck-ai-button-tertiary',Ta='ck-ai-chat-controls__model-selection',ma='ck-ai-chat-controls__model-selection__item-name',Ca='ck-ai-chat-controls__model-selection__item-description',wa='ck-ai-chat-controls__model-selection__item-capabilities',fa='n';class vs extends _0x1f054a{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x5bb09b){super(_0x5bb09b),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',_0x4fa0ea=>'selector'===_0x4fa0ea),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0xedf1e9=>_0xedf1e9?this['_modelSelectionDropdown']['buttonView']['label']:h(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x3862dd=>_0x3862dd),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x5f2808=>_0x5f2808),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x4be189=>h(this['locale'],_0x4be189?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x18bde1=>_0x18bde1),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x164f72=>h(this['locale'],_0x164f72?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ga]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x405f09(),_0x46fef8(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0xe0c378,_0x2bfa2e){if(_0x2bfa2e)this['set']('modelDisplayMode','hidden');else{const _0x4068af=0x1===_0xe0c378['length'];this['set']('modelDisplayMode',_0x4068af?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0xe0c378?.['length'])for(const _0x2d68aa of _0xe0c378){const _0x509351=new _0x53ecce({'label':_0x2d68aa['name'],'withText':!0x0,'role':'menuitemradio','id':_0x2d68aa['id'],'model':_0x2d68aa});_0x509351['bind']('isOn')['to'](this,'activeModelId',_0x51a162=>_0x51a162===_0x2d68aa['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x509351,'labelView':new Sa(this['locale'],_0x2d68aa)});}}['setWebSearch'](_0x86887){this['set']('webSearchActive',_0x86887);}['setReasoning'](_0x3c9623){this['set']('reasoningActive',_0x3c9623);}['setModel'](_0x16f1f5){if(!_0x16f1f5)return;this['activeModelId']=_0x16f1f5['id'],this['activeModelName']=_0x16f1f5['name']||_0x16f1f5['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x16f1f5['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x16f1f5['name']);const _0x482dfb=_0x16f1f5['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x482dfb),this['_webSearchButton']['set']('isVisible',_0x482dfb);const _0x1301a4=_0x16f1f5['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x1301a4),this['_reasoningButton']['set']('isVisible',_0x1301a4);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x32bb74){this['set']('modelSelectorEnabled',!0x1),_0x32bb74&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0xdc8f7=new _0x1d1b95();return _0xdc8f7['set']({'label':h(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x26bf07,'class':Ia,'isToggleable':!0x0,'tooltipPosition':fa}),_0xdc8f7['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0xdc8f7;}['_createReasoningButton'](){const _0x188f98=new _0x1d1b95();return _0x188f98['set']({'label':h(this['locale'],'AI_CHAT_REASONING'),'icon':_0x782cf1,'class':Ia,'isToggleable':!0x0,'tooltipPosition':fa}),_0x188f98['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x188f98;}['_createCommandsButton'](){const _0x129b6b=new _0x1d1b95();return _0x129b6b['set']({'label':h(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x2e776a,'withText':!0x0,'class':Ia,'isToggleable':!0x0,'tooltip':h(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':fa}),_0x129b6b['extendTemplate']({'attributes':{'class':[Ea]}}),_0x129b6b['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x129b6b;}['_createModelSelectionDropdown'](){const _0x24ca20=_0x290605(this['locale']);return _0x24ca20['set']({'panelPosition':'ne','class':[Ta]}),_0x24ca20['buttonView']['set']({'label':h(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':fa,'class':pa}),this['listenTo'](_0x24ca20,'execute',_0x474c52=>{this['fire']('selectModel',_0x474c52['source']['model']);}),_0x24ca20;}['_createModelNameView'](){const _0x3f7a1a=new ba(this['locale']);return _0x3f7a1a['bind']('text')['to'](this,'activeModelName',_0x5b719a=>_0x5b719a??''),_0x3f7a1a['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5cad43=>'name'===_0x5cad43),_0x3f7a1a;}}let Sa=class extends _0x34171b{constructor(_0x1b4ba6,_0x333a1d){super();const _0x5c835a=this['bindTemplate'],_0x34491c=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x5c835a['to']('style'),'id':_0x5c835a['to']('id')},'children':[{'tag':'div','attributes':{'class':[ma]},'children':[{'text':_0x5c835a['to']('text')}]},{'tag':'div','attributes':{'class':[Ca]},'children':[{'tag':'span','children':[{'text':_0x333a1d['description']}]}]},{'tag':'div','attributes':{'class':[wa]},'children':_0x34491c}]}),_0x34491c['addMany'](this['_getCapabilityParts'](_0x1b4ba6,_0x26bf07,'AI_CHAT_SEARCH_WEB',_0x333a1d['capabilities']['webSearch']?.['enabled']??!0x1)),_0x34491c['addMany'](this['_getCapabilityParts'](_0x1b4ba6,_0x782cf1,'AI_CHAT_REASONING',_0x333a1d['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x126ea1,_0x289018,_0x4ff4a1,_0x4fa9d4){const _0x1d40f4=new _0x152087();_0x1d40f4['content']=_0x289018;const _0x4ab420=new _0x1f054a(_0x126ea1);_0x4ab420['setTemplate']({'tag':'span','children':[{'text':h(_0x126ea1,_0x4ff4a1)+':\x20'}]});const _0x1b37f7=new _0x1f054a(_0x126ea1);return _0x1b37f7['setTemplate']({'tag':'span','children':[{'text':h(_0x126ea1,_0x4fa9d4?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x1d40f4,_0x4ab420,_0x1b37f7];}},ba=class extends _0x1f054a{constructor(_0x4cf3c0){super(_0x4cf3c0),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x3e85fc=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x3e85fc['if']('isVisible','ck-hidden',_0x2f4d32=>!_0x2f4d32)]},'children':[{'text':_0x3e85fc['to']('text')}]});}};const Ra='ck-ai-chat-context-controls__url-form',Oa='ck-ai-chat-context-controls__url-input-section';class Po extends _0x1f054a{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x5444f4){super(_0x5444f4),this['focusTracker']=new _0x50d771(),this['keystrokes']=new _0x407d91(),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 _0x18b3f0({'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'](_0x2b47ee=>{this['focusTracker']['add'](_0x2b47ee['element']),this['keystrokes']['listenTo'](_0x2b47ee['element']);}),_0x5b1132({'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'](_0x3722d9){this['urlInputField']['errorText']=_0x3722d9,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x2ab844=new _0x1d1b95(this['locale']);return _0x2ab844['set']({'icon':_0x37ead0,'tooltip':h(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x349b12,_0x5f165c,_0x23e08c)=>{_0x2ab844['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x23e08c?'':'\x20ck-hidden')]});}),_0x2ab844;}['_createUrlInputField'](){const _0x244aba=new _0x1e4591(this['locale'],_0x4b3e4e);return _0x244aba['set']({'label':h(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x244aba['fieldView']['set']({'placeholder':h(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x244aba;}['_createConfirmButton'](){const _0x9a2c31=new _0x1d1b95(this['locale']);return _0x9a2c31['set']({'icon':_0xa99da,'tooltip':h(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x9a2c31;}['_setupTemplate'](){const _0x5028d8=new _0x337d54(this['locale'],{'label':h(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x5028d8['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Ra,'tabindex':'-1'},'children':[_0x5028d8,{'tag':'div','attributes':{'class':Oa},'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',_0xad9357=>{_0xad9357['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x48bab7,_0x4ac738)=>{this['clear'](),this['fire']('cancel'),_0x4ac738();});}['_handleSubmit'](){const _0x2ef8ac=this['getValue']()['trim']();_0x2ef8ac?this['_isValidUrl'](_0x2ef8ac)?(this['clearError'](),this['fire']('submitUrl',_0x2ef8ac)):this['setError'](h(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](h(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x5ce6af=this['getValue']()['trim'](),_0x1f9bbe=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x5ce6af['length']>0x0&&!_0x1f9bbe;}['_isValidUrl'](_0x44df3f){try{return!!new URL(_0x44df3f);}catch{return!0x1;}}}const ka='ck-ai-chat-resources__item',Na='ck-ai-chat-resources__item--in-context',ya='ck-ai-chat-resources__item-title',va='ck-ai-chat-resources__item__icon';class hc extends _0x2a0bb9{['resource'];['_titleView'];['_iconView'];constructor(_0x5bef28,_0x4ef596){super(_0x5bef28),this['resource']=_0x4ef596,this['set']('isInContext',!!_0x4ef596['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x4fe102){if(_0x4fe102['isInContext'])return _0xa99da;switch(_0x4fe102['type']){case Fe['DOCUMENT']:return _0x1ef80c;case Fe['URL']:return _0x9a2128;case Fe['FILE']:case Fe['TEXT']:return _0x107670;default:return _0x4791e0;}}['highlightText'](_0x5e80b6){if(!_0x5e80b6||''===_0x5e80b6['trim']())return void this['_titleView']['highlightText'](null);const _0xfefece=new RegExp(_0x1afc1d(_0x5e80b6),'gi');this['_titleView']['highlightText'](_0xfefece);}['updateResourceState'](_0x4ee534){this['resource']['isInContext']=_0x4ee534,this['isInContext']=_0x4ee534,this['_updateIcon']();}['_createTitleView'](){const _0x542559=new _0x5ecd8f();return _0x542559['text']=this['resource']['label'],_0x542559['extendTemplate']({'tag':'span','attributes':{'class':[ya]}}),_0x542559;}['_createIconView'](){const _0x545fad=new _0x152087();return _0x545fad['content']=this['getResourceIcon'](this['resource']),_0x545fad;}['_setupTemplate'](){const _0x2a7547=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[ka,_0x2a7547['if']('isVisible','ck-hidden',_0x4e5b0a=>!_0x4e5b0a),_0x2a7547['if']('isInContext',Na)]},'children':[{'tag':'div','attributes':{'class':[va]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x2a7547['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const xa='ck-ai-chat-resources__list';class Lr extends _0xc6bdf6{['_source'];constructor(_0x36bc95,_0x48a84f){super(_0x36bc95),this['_source']=_0x48a84f,this['extendTemplate']({'attributes':{'class':[xa]}});}['setResources'](_0x354a7a,_0x221d7d){this['items']['clear']();let _0x26b24a=_0x354a7a;if(this['_source']['useDefaultFiltering']&&_0x221d7d&&''!==_0x221d7d['trim']()){const _0x4513f7=new RegExp(_0x221d7d['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x26b24a=_0x354a7a['filter'](_0x35890a=>_0x4513f7['test'](_0x35890a['label']));}for(const _0x514229 of _0x26b24a){const _0xeed780=new hc(this['locale'],_0x514229);_0xeed780['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x514229);}),this['items']['add'](_0xeed780);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x221d7d);}['highlightText'](_0x53d22b){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x103250=>{_0x103250['highlightText'](_0x53d22b);});}['updateResourceState'](_0x11257a,_0x2e2854){for(const _0x2f240d of this['items']){const _0x182059=_0x2f240d;_0x182059['resource']['id']===_0x11257a&&_0x182059['updateResourceState'](_0x2e2854);}}['_handleResourceSelection'](_0x27d0bb,_0x293f74){this['fire']('addResourceToContext',{'source':_0x27d0bb,'resource':_0x293f74});}}class Tr extends _0x1e4591{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x138e97){const t=_0x138e97['t'],_0x365f35={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x4b3e4e,'label':h(_0x138e97,'AI_CHAT_SEARCH_RESOURCES')};super(_0x138e97,_0x365f35['creator']),this['label']=_0x365f35['label'],this['_viewConfig']=_0x365f35,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x138e97,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x25035d){this['fire']('search',_0x25035d);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x152087(),this['iconView']['content']=_0x3d0ec3,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0xe0210a,t){this['resetButtonView']=new _0x1d1b95(_0xe0210a),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x12f0df,'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',_0x1e5861=>!_0x1e5861),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 _0x1f054a{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x5debd0,_0xb92ae1){super(_0x5debd0),this['_source']=_0xb92ae1['source'],this['_searchInputVisibleFrom']=_0xb92ae1['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 _0x44a698([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 _0x4341b9=new _0x1f054a(this['locale']);return _0x4341b9['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x2b5f69,_0x3c8615)=>{this['loadResources'](_0x3c8615),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x3c8615);}),_0x4341b9;}['_createResourcesListView'](){const _0x207a3b=new Lr(this['locale'],this['_source']);return _0x207a3b['delegate']('addResourceToContext')['to'](this),_0x207a3b['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x207a3b;}['_createSkeletonView'](){const _0x4eae4a=new di(this['locale'],li['aiChatResources']);return _0x4eae4a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x3a9ada=>!_0x3a9ada)]}}),_0x4eae4a;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0xc65b9c){const _0x792e4d=_0x677d44();this['_latestLoadResourcesUid']=_0x792e4d,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0xc65b9c,'uid':_0x792e4d}),this['isLoading']=!0x0;}['setResources'](_0x5d876e,_0x39f435){if(_0x39f435&&_0x39f435!==this['_latestLoadResourcesUid'])return;const _0x521f7c=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x5d876e,_0x521f7c),_0x5d876e['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x5bfab1,_0x3d9c09){this['_resourcesListView']['updateResourceState'](_0x5bfab1,_0x3d9c09);}}const La='ck-ai-chat-context-controls__source-balloon-panel',Da='ck-button-icon\x20ck-button-back',Pa='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Oo{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x45eddc,_0x5b47fe,_0x48701a){this['_locale']=_0x45eddc,this['_bodyCollection']=_0x5b47fe,this['_config']=_0x48701a;}['showSourceResourcesBalloon']({source:_0x3bb9cf,withBackButton:_0x37b4af}){let _0x348a74=this['_sourceResourceBalloons']['get'](_0x3bb9cf['id']);_0x348a74||(_0x348a74=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x3bb9cf['id'],_0x348a74),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x348a74)),this['_addSourceResourceContent']({'balloonPanel':_0x348a74,'source':_0x3bb9cf,'withBackButton':_0x37b4af}),_0x348a74['show']();const _0x5e2f70=this['_config']['getTargetElement']();_0x5e2f70&&_0x348a74['pin']({'target':_0x5e2f70,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x4283ec,_0x436e6d,_0x1bc8a7){const _0x4d958e=this['_sourceResourceBalloons']['get'](_0x4283ec);if(!_0x4d958e)return;const _0x55d8b2=this['_getResourcesViewFromBalloon'](_0x4d958e);_0x55d8b2&&(_0x55d8b2['setResources'](_0x436e6d,_0x1bc8a7),_0x55d8b2['once']('change:isLoading',()=>{_0x4d958e['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x520772){const _0x2ba434=this['_sourceResourceBalloons']['get'](_0x520772);_0x2ba434&&requestAnimationFrame(()=>{_0x2ba434['hide'](),this['_sourceResourceBalloons']['delete'](_0x520772),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x4e32d3 of this['_sourceResourceBalloons']['values']())if(_0x4e32d3['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x6b4b2b,_0x4c9559,_0x119b51){const _0x26d2f4=this['_sourceResourceBalloons']['get'](_0x6b4b2b);if(!_0x26d2f4||!_0x26d2f4['isVisible'])return;const _0x589f13=this['_config']['getTargetElement']();if(!_0x589f13)return;_0x26d2f4['pin']({'target':_0x589f13,'limiter':this['_config']['getLimiterElement']()});const _0xd4cb73=this['_getResourcesViewFromBalloon'](_0x26d2f4);_0xd4cb73&&_0xd4cb73['updateResourceState'](_0x4c9559,_0x119b51);}['destroy'](){for(const _0x45b447 of this['_sourceResourceBalloons']['values']())_0x45b447['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x4b0d49=new _0x10e1b3(this['_locale']);return _0x4b0d49['extendTemplate']({'attributes':{'class':La}}),this['_bodyCollection']['add'](_0x4b0d49),_0x4b0d49;}['_addSourceResourceContent']({balloonPanel:_0x53cec4,source:_0x885b66,withBackButton:_0x42e05c}){_0x53cec4['content']['clear']();const _0x1e8c12=this['_createBalloonHeader']({'balloonPanel':_0x53cec4,'source':_0x885b66,'withBackButton':_0x42e05c});_0x53cec4['content']['add'](_0x1e8c12);const _0xa8c6cf=this['_createBalloonResourcesView'](_0x885b66);_0x53cec4['content']['add'](_0xa8c6cf);}['_createBalloonHeader']({balloonPanel:_0x39754f,source:_0x4b4ca5,withBackButton:_0x1c7257}){const _0x130936=new _0x337d54(this['_locale'],{'label':_0x4b4ca5['label'],'class':Pa});return _0x1c7257&&_0x130936['children']['add'](this['_createBackButton'](_0x39754f),0x0),_0x130936;}['_createBackButton'](_0x122448){const _0x34665b=new _0x1d1b95(this['_locale']);return _0x34665b['set']({'icon':_0x37ead0,'tooltip':h(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Da}),_0x34665b['on']('execute',()=>{_0x122448['hide'](),this['_config']['onBackToContext']();}),_0x34665b;}['_createBalloonResourcesView'](_0x5ed75e){const _0x21bfb6=new lc(this['_locale'],{'source':_0x5ed75e,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x21bfb6['on']('loadSourceResources',(_0x818b99,_0x45832b)=>{this['_config']['onLoadSourceResources'](_0x45832b);}),_0x21bfb6['on']('addResourceToContext',(_0x1198ce,_0x5dcf72)=>{this['_config']['onResourceSelected'](_0x5dcf72['source'],_0x5dcf72['resource']),this['closeSourceResourceBalloon'](_0x5ed75e['id']);}),_0x21bfb6;}['_getResourcesViewFromBalloon'](_0x4f9ab8){const _0x70c71e=_0x4f9ab8['content']['get'](0x1);return _0x70c71e instanceof lc?_0x70c71e:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x5f2554){_0x1d6ed3({'emitter':_0x5f2554,'contextElements':[_0x5f2554['element']],'callback':()=>{_0x5f2554['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x5f2554['isVisible']});}}const xs=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Uo='ck-ai-chat-context-controls',Lo='ck-ai-chat-context-controls__pending-contexts',No='ck-ai-chat-context-controls__add-context-balloon-panel',Mo='ck-ai-chat-context-controls__add-context-button',Ho='ck-ai-chat-context-controls__url-balloon-panel',jo='ck-ai-chat-context-controls__balloon-button',Fo='ck-ai-chat-context-controls__balloon-button-source',Xo='ck-ai-chat-controls-button',Do='ck-ai-chat-context-chips-wrapper-balloon',$o='ck-ai-chat-controls_context_show-more-button',Wo='ck-ai-chat-context-controls__show-more-balloon-panel',qo='ck-ai-chat',zo=[_0x10e1b3['defaultPositions']['northArrowSouthWest'],_0x10e1b3['defaultPositions']['northArrowSouth'],_0x10e1b3['defaultPositions']['northArrowSouthEast'],_0x10e1b3['defaultPositions']['southArrowNorthWest'],_0x10e1b3['defaultPositions']['southArrowNorth'],_0x10e1b3['defaultPositions']['southArrowNorthEast']];class Is extends _0x1f054a{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x431470,_0x58a6ee){super(_0x431470),this['bodyCollection']=_0x58a6ee['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x431470),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x431470),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x431470),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x431470,_0x58a6ee);const _0x1aa651={'cssClasses':{'showMoreButton':$o,'showMoreBalloon':Wo,'overflowContainer':Do,'controlsButton':Xo}};this['_overflowManager']=new Ro(_0x431470,this['_currentContextsChips'],_0x1aa651,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'](_0x19f696,_0xff8076){const _0x27afeb=this['_createContextButton'](_0x19f696,'current',!0x0,_0xff8076);this['_addContextToCollection'](_0x27afeb,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x18d70f){this['_removeContextFromCollection'](_0x18d70f,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x18d70f,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x2f3241,_0x12cab0){let _0xd74405=this['_currentContextsChips']['find'](_0x2495ac=>_0x2495ac['id']===_0x2f3241);_0xd74405||(_0xd74405=this['_overflowManager']['overflowChips']['find'](_0x34f252=>_0x34f252['id']===_0x2f3241)),_0xd74405&&(_0xd74405['isLoading']=_0x12cab0);}['setConversationContext'](_0x4d06aa){this['_conversationContextsChips']['clear']();for(const _0x44dcd2 of _0x4d06aa){const _0x3d3f11=this['_createContextButton'](_0x44dcd2,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x3d3f11,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0xff60fc,_0x101e6b,_0x397c24){this['_resourcesBalloonView']['updateResourceState'](_0xff60fc,_0x101e6b,_0x397c24);}['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:_0x3384ec,withBackButton:_0x442f5e}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x3384ec,'withBackButton':_0x442f5e}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x465907,_0x3d4113,_0x185be4,_0x1073c7){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x465907,_0x185be4,_0x1073c7);}['closeSourceResourceBalloon'](_0x2a5803){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x2a5803),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x5da9bf){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x5da9bf),this['_setAddContextButtonEnabled'](_0x5da9bf);}['_setAddContextButtonEnabled'](_0x1dd66c){const _0x9c0a92=!_0x1dd66c['document']['isHidden']&&_0x1dd66c['document']['enabled'],_0x534004=_0x1dd66c['urls']['enabled'],_0x252b1e=_0x1dd66c['files']['enabled'],_0x31d086=_0x1dd66c['sources']['length']>0x0,_0x41176b=_0x1dd66c['customItems']&&_0x1dd66c['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x9c0a92||_0x534004||_0x252b1e||_0x31d086||_0x41176b;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Uo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Lo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x18cd82){const _0x43cdce=new _0x1d1b95(_0x18cd82);return _0x43cdce['set']({'label':h(_0x18cd82,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Xo+'\x20'+Mo,'icon':_0x4db22d,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x43cdce;}['_createAddContextBalloonPanelView'](_0x58c713){return this['_createBaseBalloonPanel'](_0x58c713,No);}['_createUrlBalloonPanelView'](_0x806de4){const _0x16db6a=this['_createBaseBalloonPanel'](_0x806de4,Ho);return this['_addUrlContent'](_0x16db6a,_0x806de4),_0x16db6a;}['_createResourcesBalloonView'](_0x320980,_0x4250fa){const _0x66afd5={'searchInputVisibleFrom':_0x4250fa['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo});},'onResourceSelected':(_0x54dcbc,_0x2e14d3)=>{this['fire']('addResourceToContext',{'source':_0x54dcbc,'resource':_0x2e14d3});},'onLoadSourceResources':_0x1535a4=>{this['fire']('loadSourceResources',_0x1535a4);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Oo(_0x320980,_0x4250fa['bodyCollection'],_0x66afd5);}['_getLimiterElement'](){return this['element']?.['closest']('.'+qo)||document['body'];}['_createBaseBalloonPanel'](_0x424e71,_0x850625){const _0x53353b=new _0x10e1b3(_0x424e71);return _0x53353b['extendTemplate']({'attributes':{'class':_0x850625}}),this['bodyCollection']['add'](_0x53353b),_0x53353b;}['_setBalloonPanelContent'](_0x38eb91,_0xc0a5b3,_0x3d929a){if(_0x38eb91['content']['clear'](),!_0x3d929a['document']['isHidden']&&_0x3d929a['document']['enabled']){const _0x8ad515=this['_createBalloonButton'](_0xc0a5b3,{'label':h(_0xc0a5b3,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x1ef80c});_0x8ad515['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x38eb91['content']['add'](_0x8ad515);}if(_0x3d929a['urls']['enabled']){const _0x31df20=this['_createBalloonButton'](_0xc0a5b3,{'label':h(_0xc0a5b3,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x9a2128});_0x31df20['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}),this['_urlInputView']['focus']();}),_0x38eb91['content']['add'](_0x31df20);}if(_0x3d929a['files']['enabled']){const _0x51fd81=new _0x34ca85(_0xc0a5b3);_0x51fd81['set']({'label':h(_0xc0a5b3,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x1c54d4,'withText':!0x0,'tooltip':!0x0,'class':jo,'allowMultipleFiles':!0x0}),_0x51fd81['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x51fd81['on']('done',(_0x3e24ce,_0x35b6a2)=>{this['fire']('addFileToContext',_0x35b6a2);}),_0x51fd81['tooltip']=!0x0,_0x38eb91['content']['add'](_0x51fd81);}for(const _0x2274b9 of _0x3d929a['sources']){const _0x429b6e=this['_createBalloonButton'](_0xc0a5b3,{'label':_0x2274b9['label'],'icon':_0x2274b9['icon']||_0x4791e0,'type':'source'});_0x38eb91['content']['add'](_0x429b6e),_0x429b6e['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x2274b9,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x2f147b of _0x3d929a['customItems']||[]){const _0x7606e4=this['_createBalloonButton'](_0xc0a5b3,{'label':_0x2f147b['label'],'icon':_0x2f147b['icon']||_0x4791e0,'type':'customItem'});_0x38eb91['content']['add'](_0x7606e4),_0x7606e4['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x2f147b);});}this['_hasExactlyOneSource']=0x1===_0x38eb91['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x13f6fc,_0x5416a9){this['_urlInputView']=new Po(_0x5416a9),this['_urlInputView']['on']('submitUrl',(_0x58cae7,_0x5bd8ea)=>{this['_handleUrlSubmit'](_0x5bd8ea);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo});}),_0x13f6fc['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x20777a,_0x42186a){const _0x2b609f='source'===_0x42186a['type']?new Ha(_0x20777a):new _0x1d1b95(_0x20777a);return _0x2b609f['set']({'label':_0x42186a['label'],'icon':_0x42186a['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':jo}),_0x2b609f;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x1d6ed3({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x1fc49a){const _0x2b5345=this['_addContextBalloonConfig'];_0x2b5345['buttonView']['isOn']=_0x1fc49a,_0x1fc49a?_0x2b5345['balloonView']['show']():_0x2b5345['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x1a20ae,buttonView:_0x164dd3,hideMethod:_0x21afd2}=this['_addContextBalloonConfig'];_0x1d6ed3({'emitter':_0x1a20ae,'contextElements':[_0x1a20ae['element'],_0x164dd3['element']],'callback':()=>{_0x21afd2();},'activator':()=>_0x164dd3['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x4394fc,_0x3bdcbd,_0x1cd855=!0x1,_0x225fc4=!0x1){const _0x248cab='conversation'===_0x3bdcbd||!0x0===_0x4394fc['isReadOnly'],_0x3490de=new Vo(this['locale'],_0x4394fc,_0x248cab,_0x1cd855,_0x225fc4);return _0x248cab||_0x3490de['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x3490de['id']);}),_0x3490de;}['_addContextToCollection'](_0x529766,_0xd70623){_0xd70623['add'](_0x529766,0x0);}['_removeContextFromCollection'](_0x5ee98c,_0x5655f5){const _0x53c865=_0x5655f5['find'](_0x593d92=>_0x593d92['id']===_0x5ee98c);_0x53c865&&_0x5655f5['remove'](_0x53c865);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':zo}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x231ba5){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x231ba5);}}class Ha extends _0x1d1b95{['arrowView'];constructor(_0x293ed1){super(_0x293ed1),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Fo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x275982=new _0x152087();return _0x275982['content']=_0x264f12,_0x275982['extendTemplate']({'attributes':{'class':Fo+'__arrow'}}),_0x275982;}}class Cs extends _0x1f054a{['_cancelButtonView'];['_loaderView'];constructor(_0x5161df){super(_0x5161df),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 _0x552116=new _0x1d1b95(this['locale']);return _0x552116['set']({'label':h(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x45f60c}),_0x552116['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x552116;}['_createLoaderView'](){const _0x33285c=new _0x1f054a(this['locale']);return _0x33285c['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':h(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x33285c;}}class pi extends _0x1f054a{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x334a01,_0x380c13){super(_0x334a01),this['_contextPanelView']=this['_createContextPanelView'](_0x334a01,{'bodyCollection':_0x380c13['bodyCollection'],'searchInputVisibleFrom':_0x380c13['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x334a01),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x334a01),this['_loaderView']=this['_createLoaderView'](_0x334a01),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x334a01),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...xs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0xa85ec6=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0xa85ec6['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0xa85ec6['if']('isLoading','ck-hidden',_0x4e9083=>_0x4e9083||!this['isModelAvailable']),_0xa85ec6['if']('isModelAvailable','ck-hidden',_0x3c81ad=>!_0x3c81ad||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0xa85ec6['if']('isLoading','ck-hidden',_0x25f57d=>!_0x25f57d)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0xa85ec6['if']('isModelAvailable','ck-hidden',_0xebdd90=>_0xebdd90)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x1d6ed3({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x50b4df,_0x458e30){return new Is(_0x50b4df,_0x458e30);}['_createPromptInputView'](_0x4bdbff){return new _s(_0x4bdbff,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x343289){return new vs(_0x343289);}['_createLoaderView'](_0x5966c3){return new Cs(_0x5966c3);}['_createModelUnavailableMessageView'](_0x59b355){const _0x1a9195=new As(_0x59b355);return _0x1a9195['delegate']('startConversation')['to'](this),_0x1a9195;}['_handlePromptInputFocus'](_0x16a583,_0x19e778,_0x324be3){_0x324be3?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x1a74ca,_0x5b5d8d){this['_contextPanelView']['addContextItem'](_0x1a74ca,_0x5b5d8d);}['removeContextItem'](_0x39e1b5){this['_contextPanelView']['removeContextItem'](_0x39e1b5);}['setContextItemLoading'](_0x29b725,_0x2ab756){this['_contextPanelView']['setContextItemLoading'](_0x29b725,_0x2ab756);}['setIsUploadInProgress'](_0x47284){this['_promptInputView']['setIsUploadInProgress'](_0x47284);}['setConversationContext'](_0x1b9534){this['_contextPanelView']['setConversationContext'](_0x1b9534);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x11b896,_0x1fec49,_0x9ec86a){this['_contextPanelView']['updateResourceState'](_0x11b896,_0x1fec49,_0x9ec86a);}['setWebSearch'](_0x4438ef){this['_promptCapabilitiesView']['setWebSearch'](_0x4438ef);}['setReasoning'](_0x213b3a){this['_promptCapabilitiesView']['setReasoning'](_0x213b3a);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x55dc42){this['_contextPanelView']['setAddContextOptions'](_0x55dc42);}['setInputPlaceholder'](_0xb0ebe){this['_promptInputView']['setPlaceholderText'](_0xb0ebe);}['setModelList'](_0x36c3bf,_0x2c6cd){this['_promptCapabilitiesView']['setModelList'](_0x36c3bf,_0x2c6cd);}['setModel'](_0x49367d){_0x49367d?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x49367d)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x511faf){this['_promptCapabilitiesView']['disableModelSelector'](_0x511faf);}['populateSourceResourceBalloon'](_0x3722e0,_0x2996b6,_0x45eae3,_0x4f5197){this['_contextPanelView']['populateSourceResourceBalloon'](_0x3722e0,_0x2996b6,_0x45eae3,_0x4f5197);}['closeSourceResourceBalloon'](_0xdea1cb){this['_contextPanelView']['closeSourceResourceBalloon'](_0xdea1cb);}['focusPromptInput'](_0x3a8f02=!0x1){this['_promptInputView']['focus'](_0x3a8f02);}['setPromptInputValue'](_0x404ef4){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x404ef4;}}class As extends _0x1f054a{constructor(_0x22734d){super(_0x22734d);const _0x1ae3ca=new _0x1d1b95(_0x22734d);_0x1ae3ca['set']({'label':h(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x1ae3ca['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':h(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x1ae3ca]}]});}}class wi extends _0x337d54{['conversationStartButton'];['resizeButton'];constructor(_0x3945b3,_0x1dc67e){super(_0x3945b3,{'label':h(_0x3945b3,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Et}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x3945b3),this['children']['add'](this['conversationStartButton']),_0x1dc67e&&(this['resizeButton']=Hs(_0x3945b3,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x1ee981){const _0x56a5d4=new _0x1d1b95(_0x1ee981);return _0x56a5d4['set']({'label':h(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x18a571,'class':'ck-ai-chat__start-conversation'}),_0x56a5d4['on']('execute',()=>{this['fire']('startConversation');}),_0x56a5d4;}}class fi extends _0x1f054a{constructor(_0xef8686){super(_0xef8686),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':h(_0xef8686,'AI_DISCLAIMER_TEXT')}]}]});}}class At extends _0x1f054a{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x3c1986,_0x990f28){super(_0x3c1986),this['_bodyCollection']=new _0x1c4f1c(_0x3c1986),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new wi(_0x3c1986,_0x990f28['showResizeButton']),this['chatHeader']['delegate'](...Rt)['to'](this),this['chatFeed']=new ui(_0x3c1986,this['_bodyCollection']),this['chatFeed']['delegate'](...Rt)['to'](this),this['chatControls']=new pi(_0x3c1986,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x990f28['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Rt)['to'](this),this['chatDisclaimer']=new fi(_0x3c1986),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x3c1986['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x360078,_0x16a6c8,_0x41814b,_0x1cb3e4){this['chatControls']['populateSourceResourceBalloon'](_0x360078,_0x16a6c8,_0x41814b,_0x1cb3e4);}['closeSourceResourceBalloon'](_0x4a6cfd){this['chatControls']['closeSourceResourceBalloon'](_0x4a6cfd);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class F extends _0x5dcf5b{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(_0x371a68){super(_0x371a68);const _0x3a5a40=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new St(),this['_view']=new At(this['context']['locale'],{'showResizeButton':_0x3a5a40['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Rt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x478dbc,{showDiff:_0x58bf28})=>{this['showDiff']=_0x58bf28;}),_0x3a5a40['view']['addTab']({'id':'chat','buttonLabel':h(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':Et,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x72d81c=>_0x72d81c),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x24c7bb=>_0x24c7bb),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x1d6e3c){const _0x459496=this['context']['config']['get']('ai.chat.welcomeMessage')??h(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x1d6e3c['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x459496}),this['fire']('conversationCreated');}['addFeedItemStaticMessage']({id:_0x34ed54,staticMessage:_0x2aca58}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x34ed54,'initialContent':'<p>'+_0x2aca58+'</p>'});}['addFeedItemUserMessage'](_0x5621b3){const _0x368673=_0x5621b3['attributes']?.['displayedPrompt']||_0x5621b3['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x5621b3['contextItems']['values']()),'initialContent':'<p>'+_0x368673+'</p>','id':_0x5621b3['id']});}['addFeedItemError']({errorMessage:_0x3477c3,id:_0x5a61fc}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x3477c3+'</p>','id':_0x5a61fc});}['addFeedItemAIReply'](_0x544afd){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x544afd['interactionId']+':'+_0x544afd['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x5080d8){const _0x48c2e2=c(this['context']);let _0x117814=_0x48c2e2['config']['get']('ai.availableReplyActions')||[...J];if(_0x48c2e2['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x2cac6b=_0x48c2e2['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x2cac6b,'value');}}else _0x117814=_0x117814['filter'](_0x321607=>'insertSuggestion'!=_0x321607);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x5080d8['interactionId']+':'+_0x5080d8['id'],'areActionsDisabled':_0x5080d8['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x117814}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x5b2ff6,_0x2f387d){const _0x1e2603=this['_view']['chatFeed']['children']['last'];if(_0x1e2603 instanceof Ct)return this['_view']['chatFeed']['children']['remove'](_0x1e2603),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x5b2ff6['id'],'capabilities':{'isWebSearchEnabled':_0x1e2603['capabilities']['isWebSearchEnabled']||_0x2f387d['isWebSearchEnabled'],'isReasoningEnabled':_0x1e2603['capabilities']['isReasoningEnabled']||_0x2f387d['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x5b2ff6['id'],'capabilities':_0x2f387d});}async['addFeedItemCustomElement'](_0x80b842,_0x595718){let _0x3fd3a7;return await this['_promiseQueue']['enqueue'](async()=>{_0x3fd3a7=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x80b842,'id':_0x595718});}),_0x3fd3a7;}['removeFeedItem'](_0x526918){this['_view']['chatFeed']['removeItem'](_0x526918);}['hasFeedItem'](_0x28d3d2){return this['_view']['chatFeed']['hasItem'](_0x28d3d2);}['updateFeedInteractionHeader'](_0x2fd24d){const _0x8784c4=this['_view']['chatFeed']['children']['find'](_0xb8dc80=>_0xb8dc80['options']['id']==_0x2fd24d['id']&&_0xb8dc80 instanceof Ct);_0x8784c4&&_0x8784c4['set']('isVisible',_0x2fd24d['isVisible']);}async['updateFeedItemAIReplyContent'](_0x4f5396){const _0x2099ec=_0x4f5396['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x63a21e=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x4f5396,'abortSignal':_0x63a21e,'renderingStrategy':_0x2099ec}),_0x4f5396['isDone']&&this['markFeedItemAsDone'](_0x4f5396['id']);});}['updateFeedItemAIReplySources'](_0x1ff26b,_0x34dcc5){this['_view']['chatFeed']['updateWebSources'](_0x1ff26b,_0x34dcc5);}async['updateFeedItemAIReplySuggestionContent'](_0x195ed2){const _0x2bf66d=_0x195ed2['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x1e1e13=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x195ed2,'abortSignal':_0x1e1e13,'renderingStrategy':_0x2bf66d}),_0x195ed2['isDone']&&this['markFeedItemAsDone'](_0x195ed2['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x1503c4){this['_view']['chatFeed']['updateSuggestionPartState'](_0x1503c4);}['setFeedItemAIReplySuggestionPartActive'](_0x50c7b4){this['_view']['chatFeed']['setSuggestionPartActive'](_0x50c7b4);}['markFeedItemAsDone'](_0x53ea38){this['_view']['chatFeed']['markItemAsDone'](_0x53ea38);}['removeFeedInteraction'](_0x3791e4){this['_view']['chatFeed']['getItemIds']()['filter'](_0x53f23c=>_0x53f23c['startsWith'](_0x3791e4))['forEach'](_0xc77438=>this['_view']['chatFeed']['removeItem'](_0xc77438));}['startInteraction'](){const _0x16fe95=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x16fe95),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x495574){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x12dee1=>_0x12dee1['startsWith'](_0x495574['id']))['forEach'](_0x4267e5=>this['markFeedItemAsDone'](_0x4267e5)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x2b66eb,_0x30fbd2){this['_view']['chatControls']['addContextItem'](_0x2b66eb,_0x30fbd2);}['removeContextItem'](_0x28cc15){this['_view']['chatControls']['removeContextItem'](_0x28cc15);}['setContextItemLoading'](_0x229a06,_0x2dbf58){this['_view']['chatControls']['setContextItemLoading'](_0x229a06,_0x2dbf58);}['setIsUploadInProgress'](_0x1213fb){this['_view']['chatControls']['setIsUploadInProgress'](_0x1213fb);}['setConversationContext'](_0x41f5b6){this['_view']['chatControls']['setConversationContext'](_0x41f5b6);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x65c5d9,_0x37b06d,_0x13d712){this['_view']['chatControls']['updateResourceState'](_0x65c5d9,_0x37b06d,_0x13d712);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0xaaf78){this['_view']['chatControls']['setAddContextOptions'](_0xaaf78);}['updateCapabilities'](_0x35e309){this['_view']['chatControls']['setWebSearch'](_0x35e309['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x35e309['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x35e309));}['setSelectedModel'](_0x2809a3,_0x24f8c7){this['_view']['chatControls']['setModel'](_0x2809a3),_0x24f8c7&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x5195d6){this['feedItemRenderingStrategy']=_0x5195d6;}['toggleLoadingSkeleton'](_0x16ea86){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x16ea86);}['resetConversationTitle'](){this['setConversationTitle'](h(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x36265c,_0x1565a4=!0x1){if(_0x1565a4&&!mt()&&_0x36265c['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x36265c);this['_view']['chatHeader']['label']=_0x36265c;}['setLoadingMessage'](_0x1c7255){this['_view']['chatFeed']['setLoadingMessage'](_0x1c7255);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x360ff9){let _0x526a14=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x360ff9[_0x526a14],_0x526a14++,_0x526a14===_0x360ff9['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x25c3dc){this['_view']['chatHeader']['isMaximized']=_0x25c3dc;}['prepareLoadingMessage'](_0x5843cd){return _0x5843cd['isWebSearchEnabled']&&_0x5843cd['isReasoningEnabled']?h(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x5843cd['isWebSearchEnabled']?h(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x5843cd['isReasoningEnabled']?h(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):h(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x345e9f){return _0x345e9f?_0x345e9f['isWebSearchEnabled']&&_0x345e9f['isReasoningEnabled']?h(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x345e9f['isWebSearchEnabled']?h(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x345e9f['isReasoningEnabled']?h(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):h(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):h(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x8bbe41,_0x1ca392,_0x330d31,_0x4e2e14){this['_view']['populateSourceResourceBalloon'](_0x8bbe41,_0x1ca392,_0x330d31,_0x4e2e14);}['closeSourceResourceBalloon'](_0x54762f){this['_view']['closeSourceResourceBalloon'](_0x54762f);}['setPromptInputValue'](_0x2f0493){this['_view']['chatControls']['setPromptInputValue'](_0x2f0493);}['focusPromptInput'](_0x272a90=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x272a90);}['scrollFeedToSuggestion'](_0x1d2c41,_0x2566be){this['_view']['chatFeed']['scrollToSuggestion'](_0x1d2c41,_0x2566be);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class yi extends _0xc6bdf6{['sections'];constructor(_0x1cc9d9,_0xce5108){super(_0x1cc9d9),this['sections']=_0xce5108,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x1dd18d){let _0x467928=0x0,_0x365691=0x0;for(const _0x5ae5dc of this['sections']){const {resultsCount:_0x15c6e1,totalItemsCount:_0x5669a5}=_0x5ae5dc['filter'](_0x1dd18d);_0x467928+=_0x15c6e1,_0x365691+=_0x5669a5;}return{'resultsCount':_0x467928,'totalItemsCount':_0x365691};}}class Ri extends _0x2a0bb9{['title'];['itemsViews'];['_itemsListView'];constructor(_0x27ba6a,{title:_0x233ce6,items:_0x61fcef}){super(_0x27ba6a);const _0x587f69=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x233ce6,this['itemsViews']=_0x61fcef;const _0x50a16=new _0x1f054a(_0x27ba6a);_0x50a16['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0xc6bdf6(_0x27ba6a),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x587f69['if']('isVisible','ck-hidden',_0x51204d=>!_0x51204d)]},'children':[_0x50a16,this['_itemsListView']]});}['filter'](_0xb5535f){const _0x60947f=this['itemsViews']['length'];let _0x46bc03=0x0;for(const _0x549c3e of this['itemsViews']){if(_0xb5535f){const _0x398f45=_0x549c3e['isMatching'](_0xb5535f);_0x549c3e['isVisible']=!!_0x398f45,_0x549c3e['highlightText'](_0xb5535f);}else _0x549c3e['isVisible']=!0x0,_0x549c3e['highlightText'](null);_0x549c3e['isVisible']&&_0x46bc03++;}return this['isVisible']=_0x46bc03>0x0,{'resultsCount':_0x46bc03,'totalItemsCount':_0x60947f};}['getItem'](_0x11acdc){return this['itemsViews']['find'](_0x397f38=>_0x397f38['id']===_0x11acdc);}['removeItem'](_0x26b368){const _0x39ebcd=this['itemsViews']['indexOf'](_0x26b368);-0x1!==_0x39ebcd&&(this['itemsViews']['splice'](_0x39ebcd,0x1),this['_itemsListView']['items']['remove'](_0x26b368));}}class Mi extends/* #__PURE__ -- @preserve */
27
+ _0x25cea9(_0x2a0bb9){['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(_0x4ea12b,_0x3486ed){super(_0x4ea12b);const _0x2f04c9=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x3486ed['pinned']),this['set']('loadingState',null),this['id']=_0x3486ed['id'];const {title:_0xabf734,createdAt:_0x1df724,active:_0x1b59b4=!0x1}=_0x3486ed;this['_titleView']=new _0x5ecd8f(),this['_titleView']['text']=_0xabf734,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x5f472c=this['_createCheckView'](),_0x3f2709=this['_createPinButtonView'](_0x4ea12b),_0x31e86d=this['_createMenuDropdownView'](),_0x521238=this['_createEditInputView'](_0x4ea12b,_0xabf734),_0x3caa3c=this['_createAcceptEditButtonView'](_0x4ea12b,_0x521238),_0x5a7586=this['_createCancelEditButtonView'](_0x4ea12b,_0x521238);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x3f2709),this['actions']['add'](_0x31e86d),this['on']('change:isEdit',(_0x593672,_0x18cdf7,_0x3367d2)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x3367d2?(this['actions']['add'](_0x3caa3c),this['actions']['add'](_0x5a7586),this['mainContent']['add'](_0x521238),_0x521238['element']['focus']()):(this['actions']['add'](_0x3f2709),this['actions']['add'](_0x31e86d),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x1b59b4?'ck-ai-chat-history__item--active':'',_0x2f04c9['if']('isVisible','ck-hidden',_0x49208f=>!_0x49208f),_0x2f04c9['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',_0x2f04c9['if']('loadingState','ck-hidden',_0x58b1cc=>!!_0x58b1cc)]},'children':_0x1b59b4?[_0x5f472c]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x2f04c9['if']('loadingState','ck-hidden',_0x39487b=>!_0x39487b)]},'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',_0x2f04c9['if']('loadingState','ck-hidden',_0x3c9ba3=>!!_0x3c9ba3)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x2f04c9['if']('loadingState','ck-hidden',_0x140bdf=>!_0x140bdf)]},'children':[{'text':_0x2f04c9['to']('loadingState',_0x1ebdbf=>_0x1ebdbf?h(this['locale'],Mi['LOADING_LABELS'][_0x1ebdbf]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x1df724]}]},{'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'](_0x5936a0){this['_titleView']['text']=_0x4ae586(_0x5936a0);}['updateLoadingState'](_0x35eaa8,_0x1757f2){this['set']('loadingState',_0x1757f2?_0x35eaa8:null);}['_createCheckView'](){const _0xddff4e=new _0x152087();return _0xddff4e['set']({'content':_0x386c9f}),_0xddff4e;}['_createPinButtonView'](_0x42e631){const _0x5ac9b9=new _0x1d1b95(_0x42e631);return _0x5ac9b9['set']({'label':h(_0x42e631,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x1d01b4,'withText':!0x1,'tooltip':!0x0}),_0x5ac9b9['bind']('isOn')['to'](this,'pinned'),_0x5ac9b9['on']('execute',()=>{const _0x458004=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x458004});}),_0x5ac9b9;}['_createMenuDropdownView'](){const _0x26370a=_0x290605(this['locale'],_0x36a822),_0x3cf524=_0x26370a['panelView']['children'];_0x26370a['buttonView']['set']({'label':h(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x36ac21}),_0x26370a['panelPosition']='sw';const _0x20e055=new _0x1d1b95(this['locale']);_0x20e055['label']=h(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x20e055['withText']=!0x0,_0x20e055['on']('execute',()=>{this['isEdit']=!0x0;});const _0x451c38=new _0x1d1b95(this['locale']);_0x451c38['label']=h(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x451c38['withText']=!0x0,_0x451c38['on']('execute',()=>{this['showConfirm'](h(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x41023d=new _0xc6bdf6(this['locale']),_0x289cf2=new _0x2a0bb9(this['locale']);_0x289cf2['children']['add'](_0x20e055);const _0x1cefae=new _0x2a0bb9(this['locale']);return _0x1cefae['children']['add'](_0x451c38),_0x41023d['items']['addMany']([_0x289cf2,_0x1cefae]),_0x3cf524['add'](_0x41023d),_0x26370a;}['_createEditInputView'](_0x3cfc98,_0xdce3ac){const _0x4f0373=new _0x3ca17d(_0x3cfc98),_0x15c2fc=_0x4f0373['bindTemplate'];return _0x4f0373['value']=_0xdce3ac,_0x4f0373['extendTemplate']({'on':{'keydown':_0x15c2fc['to'](_0x52599b=>{'Enter'==_0x52599b['key']&&this['_commitEditInputValue'](_0x4f0373);})}}),_0x4f0373;}['_createAcceptEditButtonView'](_0x2b3e64,_0x90c78a){const _0x3705ee=new _0x1d1b95(_0x2b3e64);return _0x3705ee['set']({'icon':_0x386c9f,'withText':!0x1,'tooltip':h(_0x2b3e64,'AI_CHAT_HISTORY_ACCEPT')}),_0x3705ee['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x3705ee['on']('execute',()=>{this['_commitEditInputValue'](_0x90c78a);}),_0x3705ee;}['_commitEditInputValue'](_0x3c4465){const _0x5c6425=_0x3c4465['element']['value']||'';this['_titleView']['text']=_0x5c6425,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x5c6425});}['_createCancelEditButtonView'](_0x156a0a,_0x157849){const _0x36e954=new _0x1d1b95(_0x156a0a);return _0x36e954['set']({'icon':_0x12f0df,'withText':!0x1,'tooltip':h(_0x156a0a,'AI_CHAT_HISTORY_CANCEL')}),_0x36e954['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x36e954['on']('execute',()=>{this['isEdit']=!0x1,_0x157849['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x36e954;}['_createSpinnerView'](){const _0xc8ded1=new mi('tiny');return _0xc8ded1['isVisible']=!0x0,_0xc8ded1;}['isMatching'](_0x78c704){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x78c704)?{'title':!0x0}:null;}['highlightText'](_0x1c064b){this['_titleView']['highlightText'](_0x1c064b);}}class vt extends _0x1f054a{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x2bdd34,_0x460eea){super(_0x2bdd34),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 _0x24c297=new _0x337d54(_0x2bdd34,{'label':h(_0x2bdd34,'AI_CHAT_HISTORY_HEADING'),'icon':Ht,'class':'ck-ai-header\x20ck-ai-header_history'});_0x460eea&&(this['resizeButton']=Hs(_0x2bdd34,this),_0x24c297['children']['add'](this['resizeButton'])),this['sectionsView']=new yi(_0x2bdd34,[]),this['sectionsView']['delegate'](...ji)['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',_0x3c72a3=>!_0x3c72a3)]}}),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':[_0x24c297,{'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 _0x18794c=new _0x1877d1(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':h(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x2c2996=>h(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x2c2996),'secondary':h(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x2f2b40=this['_createErrorView']();return _0x2f2b40['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x427d2a=>!_0x427d2a)]}}),_0x18794c['on']('render',()=>{_0x18794c['children']['add'](_0x2f2b40,0x1);}),_0x18794c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x582401=>!_0x582401)]}}),_0x18794c;}['_createSkeletonView'](){const _0xd8473f=new di(this['locale'],li['aiHistory']);return _0xd8473f['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x26deb2=>!_0x26deb2)]}}),_0xd8473f;}['_createErrorView'](){const _0x3ba1fd=new _0x1f054a(this['locale']),_0x326581=new _0x1d1b95(this['locale']);_0x326581['set']({'withText':!0x1,'icon':_0x12f0df,'class':'ck-ai-notification_error__dismiss-button'}),_0x326581['bind']('isVisible')['to'](this,'hasItems',_0x3fe011=>!!_0x3fe011),_0x326581['on']('execute',()=>{this['errorMessage']='';});const _0x16e081=this['bindTemplate'];return _0x3ba1fd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x16e081['to']('errorMessage')}]},_0x326581]}),_0x3ba1fd;}['_createEmptyStateView'](){const _0x3c13fc=new _0x1d1b95(this['locale']);_0x3c13fc['set']({'label':h(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x18a571,'class':'ck-ai-chat__start-conversation'}),_0x3c13fc['on']('execute',()=>{this['fire']('openChat');});const _0x17340e=new _0x1f054a(this['locale']);return _0x17340e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x6be2db=>!_0x6be2db)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[h(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x3c13fc]}),_0x17340e;}['_createListItemViews'](_0x3fc313,_0x581d96){const _0x52ed40=[];for(const _0x568c6f of _0x3fc313){const _0x224249=new Mi(_0x581d96,_0x568c6f);_0x224249['delegate'](...ji)['to'](this),_0x52ed40['push'](_0x224249);}return _0x52ed40;}['updateHistoryItemsWithCategories'](_0x131103){const _0x244751=this['locale']||'en',_0x582165=[];for(const _0x5b5c66 of _0x131103){const _0x1a9c8b=this['_createListItemViews'](_0x5b5c66['items'],_0x244751);_0x582165['push'](new Ri(_0x244751,{'title':_0x5b5c66['title'],'items':_0x1a9c8b}));}this['sectionsView']['sections']=_0x582165,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x582165),this['hasItems']=_0x131103['some'](_0x3db5ff=>_0x3db5ff['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x2db331){for(const _0x29c62b of this['sectionsView']['sections']){const _0x540e76=_0x29c62b['getItem'](_0x2db331);if(_0x540e76){if(_0x29c62b['removeItem'](_0x540e76),0x0===_0x29c62b['itemsViews']['length']){const _0x1de9da=this['sectionsView']['sections']['indexOf'](_0x29c62b);-0x1!==_0x1de9da&&(this['sectionsView']['sections']['splice'](_0x1de9da,0x1),this['sectionsView']['items']['remove'](_0x29c62b));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x5e4c15,_0xfebf0f){for(const _0x3425d7 of this['sectionsView']['sections']){const _0x1707a7=_0x3425d7['getItem'](_0x5e4c15);if(_0x1707a7){_0x1707a7['updateTitle'](_0xfebf0f);break;}}}['updateItemLoadingState'](_0x58cb4e,_0x5625ad,_0x45c270){for(const _0x1d0ede of this['sectionsView']['sections']){const _0x1444ea=_0x1d0ede['getItem'](_0x58cb4e);if(_0x1444ea){_0x1444ea['updateLoadingState'](_0x5625ad,_0x45c270);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x15d7d4=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x15d7d4);}}}const ji=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class yt extends _0x5dcf5b{static get['requires'](){return[it];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3dcb1d){super(_0x3dcb1d);const _0x5487df=this['context']['plugins']['get']('AITabs');this['_historyView']=new vt(this['context']['locale'],_0x5487df['showResizeButton']),this['_historyView']['delegate'](...ji)['to'](this),_0x5487df['view']['addTab']({'id':'history','buttonLabel':h(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x3c4fdc){this['_historyView']['removeHistoryItem'](_0x3c4fdc);}['updateItems'](_0x40315d){this['_historyView']['updateHistoryItemsWithCategories'](_0x40315d);}['updateItemTitle'](_0x1e50c0,_0x56eae6){this['_historyView']['updateItemTitle'](_0x1e50c0,_0x56eae6);}['updateItemLoadingState'](_0x3bbcdb,_0x134091,_0x4dd262){this['_historyView']['updateItemLoadingState'](_0x3bbcdb,_0x134091,_0x4dd262);}['setLoadingSkeleton'](_0x42aeb6){this['_historyView']['isLoading']=_0x42aeb6;}['showError'](_0x3b01ea){this['_historyView']['errorMessage']=_0x3b01ea;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x1e5842){this['_historyView']['isMaximized']=_0x1e5842;}}class ir extends ts(){['id'];['createdAt'];constructor({id:_0x2f1b2e,title:_0x37af14,createdAt:_0x322624,updatedAt:_0x324d75,pinned:_0x12f9a2}){super(),this['id']=_0x2f1b2e,this['createdAt']=new Date(_0x322624),this['set']('title',_0x37af14),this['set']('updatedAt',_0x324d75?new Date(_0x324d75):null),this['set']('pinned',_0x12f9a2||!0x1);}['updateTitle'](_0x5cc891){this['set']('title',_0x4ae586(_0x5cc891)),this['updatedAt']=new Date();}['updatePinned'](_0x371522){this['set']('pinned',_0x371522),this['updatedAt']=new Date();}}class Tt extends _0xa7ecb2(){['items']=[];['connector'];['group'];constructor({connector:_0x2ec5d4,group:_0x3e654b}){super(),this['connector']=_0x2ec5d4,this['group']=_0x3e654b;}async['init'](){try{const _0x21292c=this['connector']['fetchConversations'](this['group']),_0x55267c=await _0x21292c['getConversations']();this['loadItems'](_0x55267c);}catch(_0x44a8e9){this['fire']('error',{'error':_0x44a8e9,'operation':'init'});}}['addItem'](_0x3722db){this['items']['push'](_0x3722db);}async['removeItem'](_0x4be48c){const _0x49fafa=this['items']['findIndex'](_0x3952f0=>_0x3952f0['id']===_0x4be48c);if(-0x1===_0x49fafa)return!0x1;try{return await this['connector']['deleteConversation'](_0x4be48c)['execute'](),this['items']['splice'](_0x49fafa,0x1),this['fire']('itemRemoved',{'itemId':_0x4be48c}),!0x0;}catch(_0x16b639){return this['fire']('error',{'error':_0x16b639,'operation':'removeItem','itemId':_0x4be48c}),!0x1;}}['getItem'](_0x336501){return this['items']['find'](_0x242914=>_0x242914['id']===_0x336501);}async['updateItemTitle'](_0x545fe9,_0x6209b){const _0x4c4381=this['getItem'](_0x545fe9);if(!_0x4c4381)return!0x1;try{return await this['connector']['updateConversation'](_0x545fe9,{'title':_0x6209b})['getResult'](),_0x4c4381['updateTitle'](_0x6209b),this['fire']('itemUpdated',{'itemId':_0x545fe9,'updates':{'title':_0x6209b}}),!0x0;}catch(_0x100518){return this['fire']('error',{'error':_0x100518,'operation':'updateItemTitle','itemId':_0x545fe9}),!0x1;}}async['updateItemPinned'](_0xe78bc8,_0x1d2e51){const _0x5de32d=this['getItem'](_0xe78bc8);if(!_0x5de32d)return!0x1;try{return await this['connector']['updateConversation'](_0xe78bc8,{'pinned':_0x1d2e51})['getResult'](),_0x5de32d['updatePinned'](_0x1d2e51),this['fire']('itemUpdated',{'itemId':_0xe78bc8,'updates':{'pinned':_0x1d2e51}}),!0x0;}catch(_0x37ad96){return this['fire']('error',{'error':_0x37ad96,'operation':'updateItemPinned','itemId':_0xe78bc8}),!0x1;}}['loadItems'](_0xd01ec7){try{this['items']=[],_0xd01ec7['map'](_0x13d637=>{this['addItem'](new ir(_0x13d637));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x297d32){this['fire']('error',{'error':_0x297d32,'operation':'loadItems'});}}['getItems'](_0x2ca95f={}){const _0x3a66d4=void 0x0!==_0x2ca95f['pinned']&&_0x2ca95f['pinned'],_0x10fe77=_0x2ca95f['from']?new Date(_0x2ca95f['from']['getFullYear'](),_0x2ca95f['from']['getMonth'](),_0x2ca95f['from']['getDate']()):null,_0x2b27aa=_0x2ca95f['to']?new Date(_0x2ca95f['to']['getFullYear'](),_0x2ca95f['to']['getMonth'](),_0x2ca95f['to']['getDate']()):null;return this['items']['filter'](_0xff4175=>{if(_0xff4175['pinned']!==_0x3a66d4)return!0x1;if(_0x2b27aa){const _0x415a0b=new Date(_0xff4175['createdAt']['getFullYear'](),_0xff4175['createdAt']['getMonth'](),_0xff4175['createdAt']['getDate']());return _0x10fe77?_0x10fe77['getTime']()===_0x2b27aa['getTime']()?_0x415a0b['getTime']()===_0x10fe77['getTime']():_0x415a0b<_0x2b27aa&&_0x415a0b>=_0x10fe77:_0x415a0b<_0x2b27aa;}return!0x0;});}}class ft extends _0x5dcf5b{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[tt,S,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'](S);const _0x43dd2a=this['context']['plugins']['get'](it);try{const _0x21e793=this['_aiChatController']['getGroupId']();this['history']=new Tt({'connector':this['_aiConnector'],'group':_0x21e793}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x527146,_0x9745ba)=>{this['_setItemLoading'](_0x9745ba['id'],'remove'),this['_handleRemove'](_0x9745ba['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x1c004a,_0x4c884e)=>{this['_setItemLoading'](_0x4c884e['id'],'rename'),this['_handleEditTitle'](_0x4c884e['id'],_0x4c884e['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x4beddc,_0x24aab7)=>{void 0x0!==_0x24aab7['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x24aab7['itemId'],_0x24aab7['updates']['title']),void 0x0!==_0x24aab7['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x24aab7['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x4f89ff,_0x581c6b)=>{this['_aiChatController']['handleRemovedConversation'](_0x581c6b['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x581c6b['itemId']),this['_clearItemLoading'](_0x581c6b['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0xd2fbc9,_0x53391d)=>{this['_handleHistoryErrorUI'](_0x53391d['error'],_0x53391d['operation'],_0x53391d['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x597048,_0x50aff5)=>{this['_handleSelectConversation'](_0x50aff5['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x57a9c7,_0x428e74)=>{const _0xc94f44=_0x428e74['pinned']?'pin':'unpin';this['_setItemLoading'](_0x428e74['id'],_0xc94f44),this['_handleTogglePin'](_0x428e74['id'],_0x428e74['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x43dd2a['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x43dd2a['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x43dd2a,'resizedTabs',(_0x3937be,_0x28984f)=>{this['_setIsMaximized'](_0x28984f);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x43dd2a['resize']();});}catch(_0xa8db57){this['_handleHistoryErrorUI'](_0xa8db57,'init');}}async['_handleEditTitle'](_0x3a8413,_0x3e57ff){await this['history']['updateItemTitle'](_0x3a8413,_0x3e57ff);}async['_handleTogglePin'](_0x59ef31,_0x436fa1){await this['history']['updateItemPinned'](_0x59ef31,_0x436fa1);}async['_handleRemove'](_0x73ca89){await this['history']['removeItem'](_0x73ca89);}async['_handleSelectConversation'](_0x2e5394){await this['_aiChatController']['loadConversation'](_0x2e5394);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x124973=this['_aiChatController']['activeConversation']?.['id'],_0x2fd19a=this['_getCategorizedItems']()['map'](_0x2d7e3b=>({'title':_0x2d7e3b['title'],'items':_0x2d7e3b['items']['map'](_0x57d831=>({'id':_0x57d831['id'],'title':_0x57d831['title']||h(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x57d831['createdAt'])['toLocaleDateString'](),'active':_0x57d831['id']===_0x124973,'pinned':_0x57d831['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x2fd19a);}['_setItemLoading'](_0x46c21f,_0x59a705){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x46c21f,_0x59a705,!0x0);}['_clearItemLoading'](_0x2c7255){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x2c7255,null,!0x1);}['_handleHistoryErrorUI'](_0x46202a,_0x2400bd,_0x5c356e){const _0x490e=this['_generateErrorMessage'](_0x2400bd,_0x5c356e);this['_aiChatHistoryUi']['showError'](_0x490e),_0x5c356e&&this['_clearItemLoading'](_0x5c356e),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x34b1f2,_0x38d52a){const _0x4a718b=_0x38d52a?this['history']['getItem'](_0x38d52a):null,_0x22c39d=_0x4a718b?.['title']||h(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x34b1f2){case'updateItemTitle':return h(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x22c39d);case'updateItemPinned':{const _0x4c3f38=h(this['context']['locale'],_0x4a718b?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return h(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x4c3f38,_0x22c39d]);}case'removeItem':return h(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x22c39d);case'init':case'loadItems':return h(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return h(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0xef6e96=new Date(),_0x4e4d72=new Date(_0xef6e96['getFullYear'](),_0xef6e96['getMonth'](),_0xef6e96['getDate']()),_0x4395d2=new Date(_0x4e4d72);_0x4395d2['setDate'](_0x4395d2['getDate']()-0x1);const _0x36d0c9=new Date(_0x4e4d72);_0x36d0c9['setDate'](_0x36d0c9['getDate']()-0xe);const _0x5c99b9=this['history']['getItems']({'pinned':!0x0}),_0x2af87d=this['history']['getItems']({'from':_0x4e4d72,'to':_0x4e4d72}),_0x19e45f=this['history']['getItems']({'from':_0x4395d2,'to':_0x4395d2}),_0x2e3f85=this['history']['getItems']({'from':_0x36d0c9,'to':_0x4395d2}),_0xc35140=this['history']['getItems']({'to':_0x36d0c9}),_0x439fe7=[];return _0x5c99b9['length']>0x0&&_0x439fe7['push']({'title':h(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x5c99b9}),_0x2af87d['length']>0x0&&_0x439fe7['push']({'title':h(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x2af87d}),_0x19e45f['length']>0x0&&_0x439fe7['push']({'title':h(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x19e45f}),_0x2e3f85['length']>0x0&&_0x439fe7['push']({'title':h(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x2e3f85}),_0xc35140['length']>0x0&&_0x439fe7['push']({'title':h(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0xc35140}),_0x439fe7;}['_setIsMaximized'](_0x3c914f){this['_aiChatHistoryUi']['setIsMaximized'](_0x3c914f);}}class z extends _0x5dcf5b{static get['requires'](){return[ft,yt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ma extends _0x5dcf5b{static get['requires'](){return[S,s,F,z];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x39ed0c){super(_0x39ed0c),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'](S)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](S)['startConversation']();}async['sendMessage']({message:_0x595f4a,attributes:_0x5c1c6e}){await this['context']['plugins']['get'](S)['sendMessage']({'message':_0x595f4a,'attributes':_0x5c1c6e});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](S)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](S)['focusPromptInput']();}['registerToolDataCallback'](_0x35362d){this['context']['plugins']['get'](S)['_registerToolDataCallback'](_0x35362d);}}class js extends _0x1d1b95{['id'];constructor(_0x5d90a2,_0x8e47b8){super(_0x5d90a2);const {id:_0x2a91ae,type:_0x437c41,icon:_0x361fb1}=_0x8e47b8;this['id']=_0x2a91ae,this['set']({'label':_0x8e47b8['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x8e47b8['id']}}),_0x361fb1?this['icon']=_0x361fb1:'chat'===_0x437c41?this['icon']=_0x315ea9:'review'===_0x437c41?this['icon']=_0x1a4041:'translate'===_0x437c41&&(this['icon']=Vt);}}class Mt extends _0x1f054a{['listView'];constructor(_0x4489bb,_0x4adaf0){super(_0x4489bb);const _0x20132b=_0x4adaf0['map'](_0x13542c=>{const _0x59fc8e=new _0x2a0bb9(this['locale']),_0x58de79=new js(this['locale'],_0x13542c);return _0x59fc8e['children']['add'](_0x58de79),_0x58de79['delegate']('execute')['to'](this),_0x59fc8e;});this['listView']=new _0xc6bdf6(this['locale']),this['listView']['items']['addMany'](_0x20132b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const Ut='chat-shortcuts';var Ua=function(_0xfc97ae){return _0xfc97ae['CHAT']='chat',_0xfc97ae['REVIEW']='review',_0xfc97ae['TRANSLATE']='translate',_0xfc97ae;}({});class Va extends _0x5dcf5b{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[F];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](F),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x4d7132=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x4d7132['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x4d7132,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0xa8324=Object['values'](Ua);this['_shortcuts']['forEach'](_0x441e5d=>{let _0x16ea5a=!0x0;if(_0x441e5d['id']&&_0x441e5d['label']&&_0xa8324['includes'](_0x441e5d['type'])?'chat'===_0x441e5d['type']&&(_0x16ea5a='string'==typeof _0x441e5d['prompt']):_0x16ea5a=!0x1,!_0x16ea5a)throw new _0x25c351('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x441e5d});});}['_injectShortcuts'](){const _0x1ce98a=this['context']['plugins']['get'](F);this['_shortcutsView']=new Mt(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x1ce98a['addFeedItemCustomElement'](this['_shortcutsView']['element'],Ut),this['_shortcutsView']['on']('execute',_0x569ac3=>{const _0x26bf40=_0x569ac3['source']['id'];this['_executeShortcut'](_0x26bf40);});}['_removeShortcuts'](){const _0x5c5df3=this['context']['plugins']['get'](F);_0x5c5df3['hasFeedItem'](Ut)&&_0x5c5df3['removeFeedItem'](Ut),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x2edd4b){const _0x4eb102=this['_shortcuts']['find'](_0x54252f=>_0x54252f['id']===_0x2edd4b),_0x39ad44=_0x4eb102['type'];'chat'===_0x39ad44?this['_runChatShortcut'](_0x4eb102):'review'===_0x39ad44?_0x4eb102['check']?this['_runReviewShortcut'](_0x4eb102):this['_switchTab']('reviewMode'):'translate'===_0x39ad44&&(_0x4eb102['language']?this['_runTranslateShortcut'](_0x4eb102):this['_switchTab']('translate'));}['_switchTab'](_0x57d348){if(!this['context']['plugins']['has']('AITabs'))throw new _0x25c351('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x57d348});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x57d348);}async['_runChatShortcut']({prompt:_0x373fb9,draftMode:_0x2dfc37,useWebSearch:_0x5440e1=!0x1,useReasoning:_0x36bf5b=!0x1,model:_0x53fd14}){const _0x2af908=this['context']['plugins']['get']('AIChat'),_0x1ae151=this['context']['plugins']['get']('AIChatController'),_0xea52e1=_0x1ae151['activeConversation'];let _0x188d55;_0x188d55=_0x53fd14?await _0xea52e1['chatModels']['getModel'](_0x53fd14):await _0xea52e1['chatModels']['getDefault'](),_0x188d55&&await _0xea52e1['setModel'](_0x188d55),_0xea52e1['setWebSearch'](_0x5440e1),_0xea52e1['setReasoning'](_0x36bf5b),_0x1ae151['addCurrentDocumentToChatContext'](),_0x2dfc37?(this['_aiChatUI']['setPromptInputValue'](_0x373fb9),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x2af908['sendMessage']({'message':_0x373fb9});}['_runReviewShortcut']({check:_0x320ee2,model:_0x30eec0,prompt:_0x50ef27,params:_0x1ad2fe}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new _0x25c351('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x4fd3f3={'id':_0x320ee2,'isCustom':'custom'===_0x320ee2};_0x30eec0&&_0x50ef27&&(_0x4fd3f3['args']={'model':_0x30eec0,'prompt':_0x50ef27}),_0x1ad2fe&&(_0x4fd3f3['params']=_0x1ad2fe),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x4fd3f3);}['_runTranslateShortcut']({language:_0x1f8b4a}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new _0x25c351('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x1f8b4a,'args':{'language':_0x1f8b4a}});}}class io extends Lt{constructor(_0x23a219){super(_0x23a219);const _0x3228bd=_0x23a219['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x3228bd,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x312fc9=this['editor']['plugins']['get']('AITabs')['view'];_0x312fc9['isVisible']=!_0x312fc9['isVisible'];}}class Pt extends _0x53f6d2{static get['requires'](){return[it];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1a3610=this['editor'];_0x1a3610['commands']['add']('toggleAi',new io(_0x1a3610)),_0x1a3610['ui']['componentFactory']['add']('toggleAi',()=>{const _0xa4d986=this['_createAIUIButton'](_0x1d1b95);return _0xa4d986['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0xa4d986;}),_0x1a3610['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x47f8e2=this['_createAIUIButton'](_0x229d28);return _0x47f8e2['set']({'role':'menuitemcheckbox'}),_0x47f8e2;});}['_createAIUIButton'](_0x2c19b1){const _0x734230=this['editor'],_0x281b45=_0x734230['commands']['get']('toggleAi'),_0x574cdf=new _0x2c19b1(_0x734230['locale']);return _0x574cdf['set']({'label':h(_0x734230['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x5591e5,'isToggleable':!0x0}),_0x574cdf['bind']('isEnabled')['to'](_0x281b45),_0x574cdf['bind']('isOn')['to'](_0x281b45,'value',_0x547a46=>!!_0x547a46),this['listenTo'](_0x574cdf,'execute',()=>{_0x281b45['execute']();}),_0x574cdf;}}const u=['applySuggestion','insertSuggestion','showNext','showPrevious'];class gs extends _0x1f054a{['_errorView'];constructor(_0x1453b9){super(_0x1453b9),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x3a9b0d){this['showError'](_0x3a9b0d);}['showError'](_0x354c70){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x354c70,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x5a2ece=new _0x1f054a(this['locale']),_0x13a2dd=new _0x1f054a(this['locale']);return _0x13a2dd['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x5a2ece['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x38a312=>!_0x38a312)]},'children':[_0x13a2dd]}),_0x5a2ece;}}const m=0xa;class R extends _0x5dcf5b{static get['requires'](){return[s];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x1733f0){const {id:_0x3b0217}=this['_currentConfig']??{};this['_currentConfig']=_0x1733f0;const {id:_0x43bc82}=this['_currentConfig'];this['isOpen']&&_0x3b0217===_0x43bc82?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x2c9f93=c(this['context'])['plugins']['get']('Dialog');_0x2c9f93['isOpen']&&this['_currentConfig']&&_0x2c9f93['id']===this['_currentConfig']['id']&&_0x2c9f93['hide']();}['_updateDialog'](){const _0x1b9ec7=c(this['context'])['plugins']['get']('Dialog'),{icon:_0x24c25b,title:_0x2837ca}=this['_currentConfig'];_0x1b9ec7['view']?.['headerView']&&(_0x1b9ec7['view']['headerView']['label']=_0x2837ca,_0x1b9ec7['view']['headerView']['iconView']&&_0x24c25b&&(_0x1b9ec7['view']['headerView']['iconView']['content']=_0x24c25b)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x1b9ec7['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](s)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x20bfa1){this['context']['plugins']['get'](s)['hideFakeVisualSelection']('ai-balloon-'+_0x20bfa1);}['_showDialog'](){const _0x546988=c(this['context'])['plugins']['get']('Dialog'),{id:_0xf2dbc3,title:_0x4efc0e,icon:_0x216a1f,class:_0x45126d,mainView:_0x156b48}=this['_currentConfig'];_0x156b48['delegate'](...u)['to'](this),_0x546988['show']({'title':_0x4efc0e,'icon':_0x216a1f,'hasCloseButton':!0x0,'id':_0xf2dbc3,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x45126d||''),'content':_0x156b48,'onShow':_0x28f483=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x5cfe5d=this['_getSelectionElements']();_0x5cfe5d&&_0x5cfe5d[0x0]&&_0x517478({'target':_0x5cfe5d[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x28f483['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0xf2dbc3});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0xf2dbc3}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x152181,_0x3cfc9f){if(!_0x3cfc9f)return null;const _0x550a53=this['_getSelectionElements']();if(!_0x550a53||0x0===_0x550a53['length'])return{'left':Math['round'](_0x3cfc9f['left']+_0x3cfc9f['width']/0x2-_0x152181['width']/0x2),'top':Math['round'](_0x3cfc9f['top']+_0x3cfc9f['height']/0x2-_0x152181['height']/0x2)};const _0x260a42=Math['round'](_0x3cfc9f['left']+_0x3cfc9f['width']/0x2-_0x152181['width']/0x2),_0x1d9c2f=_0x550a53['map'](_0x1cfbf6=>new _0x5002e3(_0x1cfbf6)),_0x220671=_0x152181['height'];return{'left':_0x260a42,'top':this['_calculateOptimalTopPosition'](_0x1d9c2f,_0x220671,_0x3cfc9f)};}['_calculateOptimalTopPosition'](_0x56dd0d,_0x217825,_0x2d6c7f){const _0x240d62=new _0x5002e3(_0x1385df['window']),_0x6f0947=_0x56dd0d['map'](_0x32c84f=>_0x32c84f['getVisible']())['filter'](_0x54f6b6=>_0x54f6b6),_0x210b21=_0x5002e3['getBoundingRect'](_0x6f0947);if(!_0x210b21)return Math['round'](_0x2d6c7f['top']+_0x2d6c7f['height']/0x2);const _0x3123ba=_0x240d62['getIntersection'](_0x210b21);if(!_0x3123ba)return Math['round'](_0x2d6c7f['top']+_0x2d6c7f['height']/0x2);const _0xc38260=_0x2d6c7f['getVisible'](),_0x4b8a41=_0xc38260&&_0x210b21['height']>_0xc38260['height'],_0x55fed1=_0x3123ba['top'],_0x1dee06=_0x3123ba['bottom'];if(_0x4b8a41){const _0x5893ab=(_0xc38260||_0x240d62)['height']/0x2-_0x217825/0x2,_0x5ab73d=_0x55fed1-m-_0x2d6c7f['top'],_0xd040cc=_0x2d6c7f['bottom']-_0x1dee06-m;return _0x5ab73d>=_0x217825?Math['max'](m,_0x55fed1-_0x217825-m):_0xd040cc>=_0x217825?_0x1dee06+m:Math['max'](m,_0x5893ab);}const _0x4e0f62=_0x55fed1-_0x217825,_0x33a28b=_0x2d6c7f['bottom']-_0x1dee06-m,_0xf3ef56=_0x55fed1-m-_0x2d6c7f['top'];let _0x5ba3cb;if(_0x33a28b>=_0x217825)_0x5ba3cb=_0x1dee06+m;else{if(_0xf3ef56>=_0x217825)_0x5ba3cb=_0x4e0f62-m;else _0x5ba3cb=_0x55fed1+_0x210b21['height']/0x2-_0x217825/0x2;}return _0x5ba3cb;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x2330f6=c(this['context']);this['listenTo'](_0x2330f6['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0xcf2e4,data:{newRange:_0x586b88}}of _0x2330f6['model']['document']['differ']['getChangedMarkers']())if(_0xcf2e4['startsWith'](o+':')&&(_0x586b88&&(_0x586b88['start']['isEqual'](_0x586b88['end'])||'$graveyard'==_0x586b88['root']['rootName'])||null==_0x586b88)){const _0x51f17a=h(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x51f17a),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x58b123=c(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x58b123['model']['document']);}['_getSelectionElements'](){const _0x43e3ca=c(this['context']);return _0x19636f(_0x43e3ca['editing'],[..._0x43e3ca['model']['markers']['getMarkersGroup']('ai-selection'),..._0x43e3ca['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class ls extends _0x50bbb8{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x215d4c,_0x122296={}){super(_0x215d4c),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x122296};const _0x49e8de=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x49e8de?'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'](_0x7b041b){this['showChangesButton']['isEnabled']=_0x7b041b;}['_setupRatingButtons'](){this['likeButton']=new _0x1d1b95(this['locale']),this['likeButton']['set']({'icon':_0x4d8f3a,'label':h(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x1d1b95(this['locale']),this['dislikeButton']['set']({'icon':_0x23728d,'label':h(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 _0x1d1b95(this['locale']),this['copyButton']['set']({'icon':_0x353d3e,'label':h(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x35ddbc=new _0x152087();_0x35ddbc['set']({'content':_0xa99da}),_0x35ddbc['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'](_0x35ddbc);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x1d1b95(this['locale']),this['showChangesButton']['set']({'icon':_0x44ac4f,'label':h(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',_0x68a76f=>_0x68a76f?_0x42f8e1:_0x44ac4f),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class Q extends gs{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x489f8c,_0x246075){super(_0x489f8c);const _0x447357=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _0x50d771(),this['_keystrokes']=new _0x407d91(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x18b3f0({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x246075,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new cs(_0x489f8c),this['_partToolbarView']=new us(_0x489f8c,_0x246075['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x246075),this['_stateView']=new ps(_0x489f8c),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new ls(_0x489f8c,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new fs(_0x489f8c,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0xb68871,_0x53b36d,_0x4e34ef,_0x24551f)=>{let _0x5615f5,_0x5f1b76;'pending'===_0x24551f?(_0x5615f5=this['_partToolbarView'],_0x5f1b76=this['_stateView']):(_0x5615f5=this['_stateView'],_0x5f1b76=this['_partToolbarView']),this['_stateView']['setState'](_0x4e34ef),_0x5615f5['isVisible']=!0x1,_0x5f1b76['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x447357['to']('_state',_0x5e6696=>'ck-ai-chat-balloon-main_state_'+_0x5e6696)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x246075);});}['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'](_0x637936){_0x637936?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x637936);}['setState'](_0x180d2c){this['_state']=_0x180d2c;}['showError'](_0x23d5b2){super['showError'](_0x23d5b2),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x17f86b){super['showBlockingError'](_0x17f86b),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x1d51f8){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x1d51f8;}['togglePartToolbarEnabled'](_0x2c22ab){this['_partToolbarView']['isEnabled']=_0x2c22ab;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x39bcef,showSuggestButton:_0xbbf42d}){_0x39bcef=_0x39bcef&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0xbbf42d=_0xbbf42d&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x39bcef,'showSuggestButton':_0xbbf42d});}['_createNextButtonView'](){const _0x777ae7=new _0x1d1b95(this['locale']);return _0x777ae7['set']({'icon':_0x5ef844,'label':h(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x777ae7['on']('execute',()=>{this['fire']('showNext');}),_0x777ae7;}['_createPreviousButtonView'](){const _0x5aa7bb=new _0x1d1b95(this['locale']);return _0x5aa7bb['set']({'icon':_0x57c1ba,'label':h(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x5aa7bb['on']('execute',()=>{this['fire']('showPrevious');}),_0x5aa7bb;}}class fs extends _0x1f054a{constructor(_0x219ea6,_0x1ee6e2){super(_0x219ea6),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x1ee6e2});}}class qt extends _0x53f6d2{static get['requires'](){return[_0x2dc660,R];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x4dfd55){super(_0x4dfd55),this['set']('showDiff',!0x1);}['open'](_0x5f4ed0){const _0x2ef75a=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x2ef75a['plugins']['get']('AIBalloon')['open']({..._0x5f4ed0,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x5f4ed0['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x5f4ed0['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x520f1d){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x520f1d);}['setState'](_0x49ef63){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x49ef63);}['_createChatBalloonView'](){const _0x5845f5=this['editor'],_0x2b0dc4=_0x5845f5['plugins']['get']('AIBalloon'),_0x2ab5b0=_0x5845f5['commands']['get']('trackChanges');let _0x32155b=_0x5845f5['config']['get']('ai.availableReplyActions')||[...J];_0x5845f5['plugins']['has']('TrackChanges')||(_0x32155b=_0x32155b['filter'](_0x1fac3c=>'insertSuggestion'!=_0x1fac3c));const _0x20ef26=new Q(_0x5845f5['locale'],{'availableActions':_0x32155b,'showApplyButton':!0x0,'showSuggestButton':!!_0x2ab5b0});return _0x20ef26['bind']('showDiff')['to'](this),_0x20ef26['delegate'](...W)['to'](this),_0x20ef26['delegate']('showPrevious','showNext')['to'](this),_0x2b0dc4['delegate']('dialogClosed')['to'](this),_0x20ef26['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x20ef26['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x20ef26['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x2ab5b0&&_0x20ef26['bind']('isTrackChangesOn')['to'](_0x2ab5b0,'value'),_0x20ef26['render'](),_0x20ef26;}['_toggleRotatorButtonsInDialogHeader'](_0x2bf26f){const _0x59ea6e=this['editor'],_0x30379f=_0x59ea6e['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x2bf26f),_0x30379f['has'](this['_chatBalloonView']['previousButtonView'])||(_0x30379f['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x59ea6e['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x30379f['remove'](this['_chatBalloonView']['previousButtonView']),_0x30379f['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class Ba extends _0x53f6d2{static get['requires'](){return[Pt,qt,Nt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Zt(_0x3ebe08){const {editor:_0x1258e1,action:_0xeb27d0,withText:_0x3d54e7=!0x1,withIcon:_0x4d5bfd=!0x0,isInDropdown:_0x6a4978=!0x0,shouldPreventFocus:_0x341ae6=!0x1}=_0x3ebe08;return()=>{const _0x7e3735=_0x1258e1['locale'],_0x5d09b0=new _0x1d1b95(_0x7e3735),_0x545c0e=_0x5d09b0['bindTemplate'];_0x6a4978&&_0x5d09b0['extendTemplate']({'on':{'mouseenter':_0x545c0e['to'](()=>{_0x341ae6&&_0x341ae6()||_0x5d09b0['focus']();})}});const _0x546a19=_0xeb27d0['icon']??_0xeb27d0['parent']?.['icon'];return _0x5d09b0['set']({'label':_0xeb27d0['displayedPrompt'],'withText':_0x3d54e7,'role':'menuitem','icon':_0x4d5bfd?_0x546a19??bt:void 0x0,'tooltip':!_0x3d54e7,'class':'ck-ai-quick-actions-button','isEnabled':_0xeb27d0['isEnabled']}),_0x5d09b0['on']('execute',()=>{_0x1258e1['editing']['view']['focus'](),_0x1258e1['commands']['execute']('aiQuickAction',_0xeb27d0);}),_0x5d09b0;};}class Gs extends _0x3abefb{['arrowView'];constructor(_0x24eef4,_0x2f9636){super(_0x24eef4,_0x2f9636);const _0x4355b2=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',_0x411a22=>String(_0x411a22)),'data-cke-tooltip-disabled':_0x4355b2['to']('isOn')},'on':{'mouseenter':_0x4355b2['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x3df051=new _0x152087();return _0x3df051['content']=_0x264f12,_0x3df051['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x3df051;}}class Ks extends _0xc6bdf6{['_allListItems'];['_allSearchableItems'];constructor(_0x59f89d,_0x15a2c6,_0x41887a){super(_0x59f89d),this['_allListItems']=_0x15a2c6,this['_allSearchableItems']=_0x41887a;}['filter'](_0x131306){if(!_0x131306)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x4e5580=_0x131306['source']['toLowerCase']()['trim'](),_0x5671e7=this['_allSearchableItems']['filter'](_0x3734c8=>(_0x3734c8['groupLabel']?_0x3734c8['label']+'\x20('+_0x3734c8['groupLabel']+')':_0x3734c8['label'])['toLowerCase']()['includes'](_0x4e5580));return this['items']['clear'](),this['items']['addMany'](_0x5671e7['sort']((_0x595fa5,_0x41b807)=>{const _0x58b995=_0x595fa5['groupLabel'],_0x1e88ef=_0x41b807['groupLabel'];return _0x58b995||_0x1e88ef?_0x58b995?0x1:-0x1:0x0;})['map'](_0x1eeb0a=>_0x1eeb0a['item'])),this['_highlightQuery'](_0x4e5580,_0x5671e7),{'resultsCount':_0x5671e7['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x64af76,_0x34ef2a){if(!_0x64af76)return;const _0x5b93a7=new RegExp(_0x1afc1d(_0x64af76),'gi');_0x34ef2a['forEach'](_0x16ce1b=>{_0x16ce1b['highlightViews']&&_0x16ce1b['highlightViews']['forEach'](_0x2ccaa1=>{'function'==typeof _0x2ccaa1['highlightText']&&_0x2ccaa1['highlightText'](_0x5b93a7);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x3248fd=>{_0x3248fd['highlightViews']&&_0x3248fd['highlightViews']['forEach'](_0x4d80f5=>{'function'==typeof _0x4d80f5['highlightText']&&_0x4d80f5['highlightText'](null);});});}}const Js='menu',Ws='menuitem';class co extends _0x1f054a{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x312b44,_0x1d3850,_0x2d5ce4,_0x51ffaf,_0xbed93d=!0x1){const _0x19cc79=_0x312b44['locale'];super(_0x19cc79),this['_bodyCollection']=_0x51ffaf,this['_hasSearch']=_0xbed93d;const _0x139dfc=this['_createListItems'](_0x312b44,_0x1d3850,_0x2d5ce4);this['optionsListView']=new Ks(_0x19cc79,_0x139dfc,this['_allSearchableItems']),this['optionsListView']['role']=Js,this['optionsListView']['items']['addMany'](_0x139dfc),this['focusTracker']=new _0x50d771(),this['keystrokes']=new _0x407d91(),_0xbed93d&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x139dfc,this['focusCycler']=new _0x18b3f0({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0xbed93d&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x14979d=_0xbed93d&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x44a698(_0x14979d),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x19cc79['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x1877d1(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':h(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':h(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0xa7af51=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0xa7af51);}['_createListItems'](_0x49d298,_0x5e1eed,_0x1c09e1){const _0x10d096=new _0x44a698();return _0x5e1eed['forEach'](_0x106fe5=>{if('actions'in _0x106fe5){const {listItem:_0x17cc7c}=this['_createActionGroupButton'](_0x49d298,_0x106fe5,_0x1c09e1);_0x10d096['add'](_0x17cc7c),_0x106fe5['actions']['forEach'](_0x532843=>{this['_createActionButton'](_0x49d298,_0x532843,_0x106fe5['label'],_0x106fe5['icon']);const {listItem:_0x546b2a,highlightViews:_0x4614ce}=this['_createSearchResultActionButton'](_0x49d298,_0x532843,_0x106fe5['label'],_0x106fe5['icon']);this['_allSearchableItems']['push']({'item':_0x546b2a,'label':_0x532843['displayedPrompt'],'groupLabel':_0x106fe5['label'],'highlightViews':_0x4614ce});});}else{const {listItem:_0x7b3d33}=this['_createActionButton'](_0x49d298,_0x106fe5);_0x10d096['add'](_0x7b3d33);const _0x11a74a=_0x7b3d33['children']['first'];if(_0x11a74a){const {listItem:_0x8b91cc,highlightViews:_0x4c34ee}=this['_createSearchResultActionButton'](_0x49d298,_0x106fe5);this['_allSearchableItems']['push']({'item':_0x8b91cc,'label':_0x11a74a['label']||'','highlightViews':_0x4c34ee});}}}),_0x10d096;}['_createActionButton'](_0x5c9b25,_0x538e69,_0xe01934,_0xfff2ff){const _0x2ff26a=new _0x2a0bb9(this['locale']);if(_0xe01934&&_0xfff2ff){const _0x10b254=new _0x1d1b95(this['locale']),_0x1e8d9c=_0x10b254['bindTemplate'],_0x194287=new _0x5ecd8f();_0x194287['text']=_0x538e69['displayedPrompt'];const _0x5226a1=new _0x5ecd8f();_0x5226a1['text']=_0xe01934;const _0x1de67e=new _0x152087();_0x1de67e['content']=_0xfff2ff,_0x1de67e['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x248428=new _0x1f054a(this['locale']);_0x248428['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x1fe6fb=new _0x1f054a(this['locale']);return _0x1fe6fb['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x10b254['set']({'label':_0x538e69['displayedPrompt']+'\x20('+_0xe01934+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x10b254['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':[_0x194287,_0x248428,_0x1de67e,_0x5226a1,_0x1fe6fb],'on':{'mouseenter':_0x1e8d9c['to'](()=>{this['_isSearchFocused']()||_0x10b254['focus']();}),'click':_0x1e8d9c['to'](()=>{_0x10b254['fire']('execute');})}}),_0x10b254['on']('execute',()=>{_0x5c9b25['editing']['view']['focus'](),_0x5c9b25['commands']['execute']('aiQuickAction',_0x538e69);}),_0x2ff26a['children']['add'](_0x10b254),{'listItem':_0x2ff26a,'highlightViews':[_0x194287,_0x5226a1]};}{const _0xb0fd9b=new _0x5707f9(),_0xaeab64=new _0x1d1b95(this['locale'],_0xb0fd9b),_0x41110a=_0xaeab64['bindTemplate'],_0x416adf=_0x538e69['icon']??_0x538e69['parent']?.['icon'],_0x1443da=void 0x0!==_0x538e69['icon'];return _0xaeab64['set']({'label':_0x538e69['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x1443da?_0x416adf??bt:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0xaeab64['extendTemplate']({'on':{'mouseenter':_0x41110a['to'](()=>{this['_isSearchFocused']()||_0xaeab64['focus']();})}}),_0xaeab64['on']('execute',()=>{_0x5c9b25['editing']['view']['focus'](),_0x5c9b25['commands']['execute']('aiQuickAction',_0x538e69);}),_0x2ff26a['children']['add'](_0xaeab64),{'listItem':_0x2ff26a,'highlightViews':[_0xb0fd9b]};}}['_createSearchResultActionButton'](_0x44c73f,_0x4600bd,_0x155411,_0x2f4a56){return _0x155411&&_0x2f4a56?this['_createSearchResultGroupedActionButton'](_0x44c73f,_0x4600bd,_0x155411,_0x2f4a56):this['_createSearchResultIndividualActionButton'](_0x44c73f,_0x4600bd);}['_createSearchResultGroupedActionButton'](_0x49146a,_0x229d9a,_0x4c4002,_0xff5347){const _0x5cca6a=new _0x2a0bb9(this['locale']),_0x3fc44e=new _0x1d1b95(this['locale']),_0x20e28b=_0x3fc44e['bindTemplate'],{view:_0x229b4e,highlightView:_0x46ad61}=this['_createSearchResultGroupRow'](_0x4c4002,_0xff5347),{view:_0x2995d0,highlightView:_0x529212}=this['_createSearchResultActionRow'](_0x229d9a['displayedPrompt']),_0x43f52f=this['_createSearchResultContentView'](_0x229b4e,_0x2995d0);return _0x3fc44e['set']({'label':_0x229d9a['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}),_0x3fc44e['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':[_0x43f52f],'on':{'mouseenter':_0x20e28b['to'](()=>{this['_isSearchFocused']()||_0x3fc44e['focus']();}),'click':_0x20e28b['to'](()=>{this['_handleSearchResultButtonClick'](_0x3fc44e);})}}),this['_setupActionButtonExecution'](_0x3fc44e,_0x49146a,_0x229d9a),_0x5cca6a['children']['add'](_0x3fc44e),{'listItem':_0x5cca6a,'highlightViews':[_0x46ad61,_0x529212]};}['_createSearchResultIndividualActionButton'](_0x3479ec,_0x545c98){const _0x3bf42f=new _0x2a0bb9(this['locale']),_0x2e1448=new _0x5707f9(),_0x39b339=new _0x1d1b95(this['locale'],_0x2e1448),_0x1b5c15=_0x39b339['bindTemplate'];return _0x39b339['set']({'label':_0x545c98['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x39b339['extendTemplate']({'on':{'mouseenter':_0x1b5c15['to'](()=>{this['_isSearchFocused']()||_0x39b339['focus']();})}}),this['_setupActionButtonExecution'](_0x39b339,_0x3479ec,_0x545c98),_0x3bf42f['children']['add'](_0x39b339),{'listItem':_0x3bf42f,'highlightViews':[_0x2e1448]};}['_createSearchResultGroupRow'](_0x55edc8,_0x41d601){const _0x2c2329=new _0x1f054a(this['locale']),_0xcd8d22=new _0x152087();_0xcd8d22['content']=_0x41d601,_0xcd8d22['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0xb19caf=new _0x5ecd8f();return _0xb19caf['text']=_0x55edc8,_0x2c2329['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0xcd8d22,_0xb19caf]}),{'view':_0x2c2329,'highlightView':_0xb19caf};}['_createSearchResultActionRow'](_0x42f648){const _0x151116=new _0x1f054a(this['locale']),_0xde0a51=new _0x5ecd8f();return _0xde0a51['text']=_0x42f648,_0x151116['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0xde0a51]}),{'view':_0x151116,'highlightView':_0xde0a51};}['_createSearchResultContentView'](_0x26a990,_0x416f45){const _0x453a15=new _0x1f054a(this['locale']);return _0x453a15['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x26a990,_0x416f45]}),_0x453a15;}['_setupActionButtonExecution'](_0x89e3b,_0x56590b,_0x54fe98){_0x89e3b['on']('execute',()=>{_0x56590b['editing']['view']['focus'](),_0x56590b['commands']['execute']('aiQuickAction',_0x54fe98);});}['_createActionGroupButton'](_0xc277b4,_0x408b16,_0x2dc7a8){const _0x280915=new _0x2a0bb9(this['locale']),_0x324f87=new _0x5707f9(),_0x447c5d=new Gs(this['locale'],_0x324f87),_0x5cca98=_0x447c5d['bindTemplate'],_0x2a8ee3=this['_getPanelKeystroke'](_0x2dc7a8),_0x3bcc3f=this['_createGroupActionsList'](_0xc277b4,_0x408b16['actions'],_0x2dc7a8);_0x447c5d['set']({'label':_0x408b16['label'],'withText':!0x0,'role':Ws,'icon':_0x408b16['icon']??bt,'isEnabled':_0x408b16['actions']['some'](_0x3031ba=>_0x3031ba['isEnabled'])}),_0x447c5d['extendTemplate']({'on':{'mouseenter':_0x5cca98['to'](()=>{this['_isSearchFocused']()||_0x447c5d['focus']();})}});const _0x1f6701=new _0x10e1b3(this['locale']);return _0x1f6701['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x5cca98['to'](_0x40683d=>{this['_handlePanelKeydown'](_0x40683d,_0x2a8ee3,_0x447c5d,_0x1f6701);})}}),_0x447c5d['bind']('isOn')['to'](_0x1f6701,'isVisible'),this['_bodyCollection']['add'](_0x1f6701),_0x1f6701['content']['add'](_0x3bcc3f),this['_setupGroupMenuBehavior'](_0x447c5d,_0x1f6701),_0x280915['children']['add'](_0x447c5d),{'listItem':_0x280915,'highlightView':_0x324f87};}['_createGroupActionsList'](_0x41a4d2,_0x1d1319,_0x3dd946){const _0x460001=new _0xc6bdf6(this['locale']);return _0x460001['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x1d1319['forEach'](_0x2d51f8=>{const _0x5480c7=new _0x2a0bb9(this['locale']),_0x1cd404=Zt({'editor':_0x41a4d2,'action':_0x2d51f8,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x5480c7['children']['add'](_0x1cd404),_0x3dd946['focusTracker']['add'](_0x1cd404),_0x460001['items']['add'](_0x5480c7);}),_0x460001;}['_setupGroupMenuBehavior'](_0x245113,_0x1ae2d1){const _0x4a45fe=_0x245113['bindTemplate'],_0x541e83=this['_getButtonKeystroke'](_0x245113);_0x245113['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x4a45fe['to'](()=>{this['_showNestedPanel'](_0x1ae2d1,_0x245113);}),'mouseleave':_0x4a45fe['to'](_0x7096f=>{const _0x310e4d=_0x7096f['relatedTarget'];this['_isMovingToNestedMenu'](_0x310e4d,_0x1ae2d1)||this['_hideNestedPanel'](_0x1ae2d1);}),'keydown':_0x4a45fe['to'](_0x148f2d=>{_0x148f2d['key']==_0x541e83&&(this['_showNestedPanel'](_0x1ae2d1,_0x245113),_0x1ae2d1['content']['get'](0x0)['focus']());})}}),_0x1ae2d1['on']('render',()=>{_0x1ae2d1['element']?.['addEventListener']('mouseleave',_0x3d5e94=>{const _0x4b100c=_0x3d5e94['relatedTarget'];_0x245113['element']?.['contains'](_0x4b100c)||this['_isMovingToNestedMenu'](_0x4b100c,_0x1ae2d1)||this['_hideNestedPanel'](_0x1ae2d1);});});}['_showNestedPanel'](_0x49e90e,_0x4b4981){this['_openNestedPanels']['forEach'](_0x3cfd7e=>{_0x3cfd7e!==_0x49e90e&&_0x3cfd7e['isVisible']&&_0x3cfd7e['hide']();}),_0x49e90e['show'](),_0x49e90e['pin']({'positions':[_0x7bd7ce['eastSouth']],'target':_0x4b4981['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x49e90e);}['_hideNestedPanel'](_0x4c3b2e){_0x4c3b2e['hide'](),this['_openNestedPanels']['delete'](_0x4c3b2e);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x514eac=>_0x514eac['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0xaad68d,_0x3a800f){if(!_0xaad68d)return!0x1;if(_0x3a800f['element']?.['contains'](_0xaad68d))return!0x0;const _0x8a5e5=_0xaad68d;return _0x8a5e5['closest']&&(null!==_0x8a5e5['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x8a5e5['closest']('.ck-ai-quick-actions-group-list')||null!==_0x8a5e5['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'](_0x5a3803){return'rtl'===_0x5a3803['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x454cfe){return'rtl'===_0x454cfe['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x3b527c,_0x28e17f,_0x21312c,_0x31f8d7){_0x3b527c['key']==_0x28e17f&&(_0x21312c['focus'](),this['_hideNestedPanel'](_0x31f8d7));}['_handleSearchResultButtonClick'](_0x3a2499){_0x3a2499['fire']('execute');}}function Xt(_0x585f4a){const {editor:_0x1d0419,content:_0x38ac1b,buttonDefinition:_0x1b6894,bodyCollection:_0x5e01f4,hasSearch:_0x5abf2c=!0x1}=_0x585f4a;return()=>{const _0x50ac3a=_0x1d0419['locale'],_0xcbcdc8=_0x290605(_0x50ac3a);_0xcbcdc8['buttonView']['set']({'icon':_0x1b6894['icon']??bt,'label':_0x1b6894['label'],'tooltip':!0x0}),_0xcbcdc8['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x52ef04=new co(_0x1d0419,_0x38ac1b,_0xcbcdc8,_0x5e01f4,_0x5abf2c);if(_0xcbcdc8['panelView']['children']['add'](_0x52ef04),_0x5abf2c){const _0x357722='ai-quick-actions-dropdown-selection';_0xcbcdc8['on']('change:isOpen',(_0x64407f,_0x5aa267,_0x5cc555)=>{if(_0x5cc555){if(_0x1d0419['plugins']['has']('AIEditing')){const _0x12176a=_0x1d0419['plugins']['get'](s),_0x4e08a1=_0x1d0419['model']['document']['selection'],_0x558286=Array['from'](_0x4e08a1['getRanges']());_0x558286['length']>0x0&&_0x12176a['showFakeVisualSelection'](_0x558286,_0x357722,!0x1,!0x0);}}else _0x1d0419['plugins']['has']('AIEditing')&&_0x1d0419['plugins']['get'](s)['hideFakeVisualSelection'](_0x357722),_0x52ef04['resetSearch']();});}return _0xcbcdc8;};}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(_0x45afe8){return _0x45afe8['CHAT']='CHAT',_0x45afe8['ACTION']='ACTION',_0x45afe8['REVIEW']='REVIEW',_0x45afe8;}({}),Ga=function(_0x527cf6){return _0x527cf6['CHAT']='AIChat',_0x527cf6['ACTION']='AIActions',_0x527cf6['REVIEW']='AIReviewMode',_0x527cf6;}({});class ii extends _0x53f6d2{static get['requires'](){return[te,tt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x79027b=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x79027b),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x35c904){return function(_0x278232){const _0x42d96e=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x278232['uiLanguage']),_0x4e8aab=_0x42d96e||'English',_0x4856d8=[{'id':'ask-ai','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Gt},{'id':'chat-commands','label':h(_0x278232,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Gt,'actions':[{'id':'explain','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ee['replace']('%0',_0x4e8aab),'type':'CHAT'},{'id':'summarize','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ie['replace']('%0',_0x4e8aab),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ne['replace']('%0',_0x4e8aab),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Wt},{'id':'continue','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':zt},{'id':'fix-grammar','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Ft},{'id':'adjust-length','label':h(_0x278232,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':h(_0x278232,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Yt,'actions':[{'id':'make-tone-casual','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Vt,'actions':[{'id':'translate-to-english','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':h(_0x278232,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':h(_0x278232,'AI_QUICK_ACTIONS_OTHER'),'icon':Jt,'actions':[]}];return _0x4856d8;}(_0x35c904);}async['_getDefaultAndCustomActions'](){const _0x1e2a82=ii['getDefaultQuickActions'](this['editor']['locale']),_0x482be2=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x21a7fb=[];try{_0x21a7fb=await new et({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x410ae1){const _0x3c25d9=new _0x25c351('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x410ae1});_0x2d18bd(_0x3c25d9['message']);}finally{const _0x42b4c8=_0x482be2['map'](_0xeff9cc=>({..._0xeff9cc,'icon':void 0x0}));_0x1e2a82['find'](_0x67d305=>'other'===_0x67d305['id'])['actions']['push'](..._0x42b4c8),_0x1e2a82['forEach'](_0xb14389=>{if('actions'in _0xb14389)_0xb14389['actions']['forEach'](_0x4ebeeb=>{if(_0x4ebeeb['isEnabled']=!!_0x21a7fb['find'](_0x2a86fa=>_0x2a86fa['id']===_0x4ebeeb['model'])||void 0x0===_0x4ebeeb['model'],!_0x4ebeeb['isEnabled']){const _0xdf8c46=new _0x25c351('ai-quick-actions-unavailable-model',this,{'actionId':_0x4ebeeb['id'],'modelId':_0x4ebeeb['model']});_0x2d18bd(_0xdf8c46['message']);}});else{if(_0xb14389['isEnabled']=!!_0x21a7fb['find'](_0x1a62a1=>_0x1a62a1['id']===_0xb14389['model'])||void 0x0===_0xb14389['model'],!_0xb14389['isEnabled']){const _0x2a3a6b=new _0x25c351('ai-quick-actions-unavailable-model',this,{'actionId':_0xb14389['id'],'modelId':_0xb14389['model']});_0x2d18bd(_0x2a3a6b['message']);}}});}return _0x1e2a82;}['_initializeQuickActionsComponentsAndCommands'](){const _0x4d7152=new _0x1c4f1c(this['editor']['locale']);_0x4d7152['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x4d7152),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x4d7152);}['_initializeQuickActionsDropdown'](_0x471d69){const _0x1563f2=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':h(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x471d69,'hasSearch':_0x1563f2}));}['_prepareQuickActionsDefinition'](_0x1c05c5){this['_quickActionsDefinition']=_0x1c05c5['map'](_0x3f2ae2=>{if('actions'in _0x3f2ae2){const _0x48bb3e=_0x3f2ae2;return{..._0x48bb3e,'actions':_0x48bb3e['actions']['map'](_0x230cec=>{const {actions:_0x25e268,..._0x4810c4}=_0x48bb3e;return{..._0x230cec,'parent':_0x4810c4};})['filter'](_0x166eb0=>this['_shouldIncludeAction'](_0x166eb0))};}return _0x3f2ae2;})['filter'](_0x33b5d1=>'actions'in _0x33b5d1?_0x33b5d1['actions']['length']>0x0:this['_shouldIncludeAction'](_0x33b5d1));}['_shouldIncludeAction'](_0x5e4bd5){const _0x394419=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ga[_0x5e4bd5['type']])&&!_0x394419['includes'](_0x5e4bd5['id'])&&!('CHAT'===_0x5e4bd5['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x364e7d){this['_quickActionsDefinition']['forEach'](_0x35b710=>{if('actions'in _0x35b710){const _0x59ee0f=Xt({'editor':this['editor'],'content':_0x35b710['actions'],'buttonDefinition':_0x35b710,'bodyCollection':_0x364e7d});this['editor']['ui']['componentFactory']['add'](_0x35b710['id'],_0x59ee0f),_0x35b710['actions']['forEach'](_0x281c19=>{const _0x43dbb0=Zt({'editor':this['editor'],'action':_0x281c19});this['editor']['ui']['componentFactory']['add'](_0x281c19['id'],_0x43dbb0);});}else{const _0x164002=Zt({'editor':this['editor'],'action':_0x35b710,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x35b710['id'],_0x164002);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x3dd241=>{const _0x363f25=new _0x36bad0(_0x3dd241),_0x167c28=h(_0x3dd241,'AI_QUICK_ACTIONS_HEADING');_0x363f25['buttonView']['set']({'label':_0x167c28,'icon':bt});const _0x3f2318=new _0x1388e9(_0x3dd241);_0x3f2318['set']({'ariaLabel':_0x167c28,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x5ea56d=>{if('actions'in _0x5ea56d){const _0x5ce784=_0x5ea56d,_0x11769b=new _0x134620(_0x3dd241,_0x363f25),_0x5e9f65=new _0x36bad0(_0x3dd241),_0x265aa2=new _0x1388e9(_0x3dd241);_0x5e9f65['buttonView']['set']({'label':_0x5ce784['label'],'icon':_0x5ce784['icon']}),_0x5ce784['actions']['forEach'](_0x3a299d=>{const _0x498cd8=new _0x134620(_0x3dd241,_0x5e9f65),_0x22ec4c=new _0x229d28(_0x3dd241);_0x22ec4c['set']({'label':_0x3a299d['displayedPrompt'],'icon':_0x3a299d['icon'],'role':'menuitem','isEnabled':_0x3a299d['isEnabled']}),_0x22ec4c['on']('execute',()=>{this['_executeQuickAction'](_0x3a299d);}),_0x22ec4c['delegate']('execute')['to'](_0x5e9f65),_0x498cd8['children']['add'](_0x22ec4c),_0x265aa2['items']['add'](_0x498cd8);}),_0x5e9f65['panelView']['children']['add'](_0x265aa2),_0x11769b['children']['add'](_0x5e9f65),_0x3f2318['items']['add'](_0x11769b);}else{const _0x5524cc=_0x5ea56d,_0x6ca2c6=new _0x134620(_0x3dd241,_0x363f25),_0x41542f=new _0x229d28(_0x3dd241);_0x41542f['set']({'label':_0x5524cc['displayedPrompt'],'icon':_0x5524cc['icon'],'role':'menuitem','isEnabled':_0x5524cc['isEnabled']}),_0x41542f['on']('execute',()=>{this['_executeQuickAction'](_0x5524cc);}),_0x41542f['delegate']('execute')['to'](_0x363f25),_0x6ca2c6['children']['add'](_0x41542f),_0x3f2318['items']['add'](_0x6ca2c6);}});const _0x586ba9=Object['values'](Ga)['some'](_0x52ab51=>this['editor']['plugins']['has'](_0x52ab51));return _0x363f25['set']({'isEnabled':_0x586ba9}),_0x363f25['panelView']['children']['add'](_0x3f2318),_0x363f25;});}['_executeQuickAction'](_0x195929){const _0x45c97d=this['editor'];_0x45c97d['editing']['view']['focus'](),_0x45c97d['commands']['execute']('aiQuickAction',_0x195929);const _0x386b8c=_0x45c97d['ui']['view']['menuBarView'];_0x386b8c&&_0x386b8c['close']&&_0x386b8c['close']();}}class ci extends Lt{['execute'](_0x3b680a){switch(this['_expandSelectionIfCollapsed'](),_0x3b680a['type']){case Qt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x5424e0=h(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x25c351('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5424e0});}this['_handleAIChatAction'](_0x3b680a);break;case Qt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x2f8ad4=h(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x25c351('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x2f8ad4});}this['_handleAIActionsAction'](_0x3b680a);break;case Qt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x306a44=h(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x25c351('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x306a44});}this['_handleAIReviewAction'](_0x3b680a);}}async['_handleAIChatAction'](_0x3b47a){const _0x3013d0=this['editor']['plugins']['get']('AIChat'),_0x424f65=this['editor']['plugins']['get']('AIChatController'),_0x1c1261=this['editor']['plugins']['get']('AITabs')['view'];if(_0x1c1261['isVisible']||(_0x1c1261['isVisible']=!0x0),'chat'!==_0x1c1261['activeTab']&&_0x1c1261['activateTab']('chat'),'ask-ai'===_0x3b47a['id'])_0x424f65['removeSelectionFromChatContext'](),await _0x3013d0['addSelectionToChatContext'](),_0x3013d0['focusPromptInput']();else await _0x3013d0['startConversation'](),_0x424f65['removeSelectionFromChatContext'](),await _0x3013d0['addSelectionToChatContext'](),_0x3013d0['focusPromptInput'](),await _0x3013d0['sendMessage']({'message':_0x3b47a['prompt']||_0x3b47a['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x3b47a['id']},'displayedPrompt':_0x3b47a['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x2f3301=this['editor'],_0x356d05=_0x2f3301['model']['document']['selection'];if(!_0x356d05['isCollapsed'])return;const _0x13528c=_0x22aa77(_0x356d05['getSelectedBlocks']())||_0x2f3301['model']['schema']['getLimitElement'](_0x356d05);_0x2f3301['model']['change'](_0x49498b=>{_0x49498b['setSelection'](_0x13528c,'in');});}['_handleAIActionsActionLabel'](_0x448cc1){return _0x448cc1['parent']?.['label']&&'other'!==_0x448cc1['parent']?.['id']?_0x448cc1['parent']['label']+':\x20'+_0x448cc1['displayedPrompt']:_0x448cc1['displayedPrompt'];}async['_handleAIActionsAction'](_0x25a067){const _0x5a686c=this['editor']['plugins']['get']('AIActions'),_0x2432d1=_0x25a067['prompt']?{'userMessage':_0x25a067['prompt'],'model':_0x25a067['model']}:{'actionName':_0x25a067['actionName']||_0x25a067['id'],'args':_0x25a067['args']},_0x34c788=this['_handleAIActionsActionLabel'](_0x25a067);await _0x5a686c['executeAction'](_0x2432d1,_0x34c788,_0x25a067['icon']);}async['_handleAIReviewAction'](_0x10abd4){console['log']('handleAIReviewAction',_0x10abd4);}}class ti extends _0x53f6d2{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2e1227=this['editor'],_0x50ef21=new ci(this['editor']);if(_0x2e1227['commands']['add']('aiQuickAction',_0x50ef21),_0x2e1227['plugins']['has']('AIChat')){const _0x378133=this['editor']['plugins']['get']('AIChat');_0x2e1227['model']['document']['selection']['on']('change:range',(_0x54c1ab,_0x106583)=>{_0x106583['directChange']&&_0x378133['removeSelectionFromChatContext']();});}}}class ys extends xi{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x35b202=this['documentContextContent']['children']['map'](_0x45de7d=>({'node':_0x45de7d,'id':ut(_0x45de7d,'data-id')})),_0x5ecb46=this['parsedMergedContent']['children']['map'](_0x25fc42=>({'node':_0x25fc42,'id':ut(_0x25fc42,'data-id')||_0x677d44()})),_0xd051d5=_0x36b77a(_0x35b202,_0x5ecb46,{'comparator':(_0x1b76e1,_0x33f416)=>_0x1b76e1['id']==_0x33f416['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0xd051d5['length']&&_0xd051d5[_0xd051d5['length']-0x1]['removed'];)_0xd051d5['pop']();}const _0x5099df=_0xd051d5['map'](_0xc4afdc=>{const _0x5b033f=_0xc4afdc['added']?'new':_0xc4afdc['removed']?'removed':'modified';return{'node':_0xc4afdc['value'][0x0]['node'],'type':_0x5b033f,'id':_0xc4afdc['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x5099df,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x5ca3af,_0x4583e8){return _0x4583e8;}}class wt extends os{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x54db3e){super(_0x54db3e),this['content']=_0x54db3e['content'],this['version']=_0x54db3e['version'],this['actionName']=_0x54db3e['actionName'],this['args']=_0x54db3e['args'],this['userMessage']=_0x54db3e['userMessage'],this['model']=_0x54db3e['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':Fe['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x28ceb1){const _0x2583a7=new ys({'editor':this['editor'],'documentContextContent':this['content'],..._0x28ceb1});return this['replies']['push'](_0x2583a7),_0x2583a7['delegate'](...ze)['to'](this),this['fire']('replyCreated',_0x2583a7),_0x2583a7;}}class Bn extends _0x50bbb8{constructor(_0x41f6b9,_0x10d64b=!0x0,_0x18ba4d=!0x0){super(_0x41f6b9),this['set']('isEnabled',!0x1),_0x10d64b&&(this['applyButton']=this['_createButton'](h(_0x41f6b9,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x18ba4d&&(this['suggestButton']=this['_createButton'](h(_0x41f6b9,'AI_BALLOON_SUGGEST_BUTTON'),_0x10d64b?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x10d64b,'showSuggestButton':_0x18ba4d}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x5d2aa3,showSuggestButton:_0x17d5f5}){this['applyButton']&&(this['applyButton']['isVisible']=_0x5d2aa3),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x17d5f5);}['_createButton'](_0x2ef69e,_0x3bc240){const _0x4230bd=new _0x1d1b95(this['locale']);return _0x4230bd['set']({'label':_0x2ef69e,'class':_0x3bc240,'isVisible':!0x0,'withText':!0x0}),_0x4230bd;}}class yn extends _0x1f054a{constructor(_0x379162){super(_0x379162),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':h(_0x379162,'AI_DISCLAIMER_TEXT')}]}]});}}class Nn extends _0x1f054a{constructor(_0x2946bd){super(_0x2946bd),this['set']('isVisible',!0x0);const _0xec9f06=new mi('small');_0xec9f06['isVisible']=!0x0;const _0x5c2240=new _0x1f054a(this['locale']);_0x5c2240['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[h(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x1306e5=>!_0x1306e5)]},'children':[_0xec9f06,_0x5c2240]});}}class Bt extends gs{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x24cd9c,_0x5c3a63){super(_0x24cd9c),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x5c3a63,this['_focusTracker']=new _0x50d771(),this['_keystrokes']=new _0x407d91(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x18b3f0({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x44a698(),this['_addContentWrapper'](_0x5c3a63),this['_addDisclaimerView'](),this['_addToolbar'](_0x5c3a63),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'](_0x5c3a63);});}['render'](){super['render']();for(const _0x380e08 of this['_focusables'])this['_focusTracker']['add'](_0x380e08['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x1853d2){-0x1===_0x1853d2?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x2b2479){this['_isLoading']=_0x2b2479;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0xe8c310){super['showError'](_0xe8c310),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x12ab05){super['showBlockingError'](_0x12ab05),this['setErrorState']();}['addMiniToolbarItem'](_0x12845d){this['_miniToolbarView']['items']['has'](_0x12845d)||this['_miniToolbarView']['items']['add'](_0x12845d);}['removeMiniToolbarItem'](_0x37aae4){this['_miniToolbarView']['items']['has'](_0x37aae4)&&this['_miniToolbarView']['items']['remove'](_0x37aae4);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x53218a,showSuggestButton:_0x49557a}){_0x53218a=_0x53218a&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x49557a=_0x49557a&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x53218a,'showSuggestButton':_0x49557a});}async['updateContent'](_0x2f6a09){await this['_streamableContentView']['update'](_0x2f6a09);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x29411d){this['_contentWrapper']=new _0x1f054a(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'](_0x29411d['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new yn(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x5efb89,showSuggestButton:_0x3692b0}){this['_toolbarView']=new Bn(this['locale'],_0x5efb89,_0x3692b0),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',(_0x105a20,_0x432b53,_0x1bfed6)=>!(_0x105a20||_0x432b53||_0x1bfed6)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x5efb89,'showSuggestButton':_0x3692b0}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x59bcf4){return this['_miniToolbarView']=new ls(this['locale'],_0x59bcf4),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',(_0x1cab78,_0x3610da)=>!(_0x1cab78||_0x3610da)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Nn(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new cs(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x21cb1f=new _0x1d1b95(this['locale']),_0x1f5065=new _0x1d1b95(this['locale']),_0x36293d=new Ln(this['locale']),_0x20c9b2=new _0x1d1b95(this['locale']);_0x21cb1f['set']({'icon':_0x1b9a26,'label':h(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x1f5065['set']({'icon':_0x37ead0,'tooltip':h(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x20c9b2['set']({'icon':_0xa5f5aa,'tooltip':h(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x21cb1f['bind']('isEnabled')['to'](this,'isBusy',_0x12c56d=>!_0x12c56d),_0x21cb1f['on']('execute',()=>{this['fire']('tryAgain');}),_0x1f5065['bind']('isEnabled')['to'](this,'isBusy',_0xa5b024=>!_0xa5b024),_0x1f5065['on']('execute',()=>{this['fire']('showPrevious');}),_0x20c9b2['bind']('isEnabled')['to'](this,'isBusy',_0x57ece2=>!_0x57ece2),_0x20c9b2['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x1f5065,this['_navigationCounter']=_0x36293d,this['_navigationNextButton']=_0x20c9b2,this['_navigationTryAgainButton']=_0x21cb1f;}['updateMiniToolbarButtons'](_0x4fe748,_0x108bc5){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x2c9d58=_0x4fe748>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x2c9d58){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0xe2f4a=_0x4fe748-_0x108bc5;this['_navigationCounter']['setInteractionCount'](_0xe2f4a+'/'+_0x4fe748),this['_navigationPreviousButton']['isEnabled']=_0x108bc5<_0x4fe748-0x1,this['_navigationNextButton']['isEnabled']=_0x108bc5>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'](_0x40f2b7){this['_isLoading']=_0x40f2b7;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x12c2e2=this['_getScrollableElement']();_0x12c2e2&&!this['_scrollManager']&&(this['_scrollManager']=new ai(_0x12c2e2));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Ln extends _0x1f054a{constructor(_0x4d9cc4){super(_0x4d9cc4);const _0x43b688=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x43b688['to']('interactionCount')}]});}['setInteractionCount'](_0x5c8bb0){this['set']('interactionCount',_0x5c8bb0);}}class ri extends _0x53f6d2{static get['requires'](){return[tt,_0x2dc660,s,R,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(_0x100a28){super(_0x100a28),this['_bodyCollection']=new _0x1c4f1c(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'](_0x112eae,_0x1dc561,_0x5702b2){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0xc6bbb0,anchorData:_0x3bebe7}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x112eae,_0xc6bbb0,_0x3bebe7,_0x1dc561,_0x5702b2);}}const {modelFragment:_0x4855e5,anchorData:_0x4630af}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x112eae,_0x4855e5,_0x4630af,_0x1dc561,_0x5702b2);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x107ba8=this['editor']['plugins']['has']('TrackChanges');let _0x4c2253=this['editor']['config']['get']('ai.availableReplyActions')||[...J];_0x107ba8||(_0x4c2253=_0x4c2253['filter'](_0x328eb1=>'insertSuggestion'!=_0x328eb1));const _0x39cd36=this['editor']['commands']['get']('trackChanges'),_0xdb1bf4=new Bt(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x107ba8,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x4c2253});return _0xdb1bf4['bind']('isBusy')['to'](this),_0x39cd36&&_0xdb1bf4['bind']('isTrackChangesOn')['to'](_0x39cd36,'value'),_0xdb1bf4['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0xdb1bf4['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0xdb1bf4['on']('showNext',()=>{this['_navigateToNext']();}),_0xdb1bf4;}['_getExecuteDataRegular'](){const _0x57dbfe=this['editor']['model']['document']['selection'];if(_0x57dbfe['isCollapsed']){const _0x5db566=_0x22aa77(_0x57dbfe['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x57dbfe);this['editor']['model']['change'](_0x45bff3=>{_0x45bff3['setSelection'](_0x5db566,'in');});}const _0x400b6d=_0x57dbfe['getFirstRange'](),_0xaa7363=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x57dbfe),_0x400b6d['start'],_0x400b6d['end']);this['_copyMarkersToFragment'](_0xaa7363,_0x57dbfe,{'isTableSelection':!0x1});const _0x213ca4=_0x57dbfe['getFirstRange']()['start'],_0x163d28=new Map();let _0x30d81b=_0xaa7363;for(let _0x2cd970=0x0;_0x2cd970<_0x213ca4['path']['length'];_0x2cd970++)_0x163d28['set'](_0x30d81b,_0x213ca4['path'][_0x2cd970]),_0x30d81b=_0x30d81b['getChild'](0x0);return{'modelFragment':_0xaa7363,'anchorData':_0x163d28};}['_getExecuteDataInTable'](){const _0x3a3491=this['editor']['model']['document']['selection'],_0x3d18dd=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x3ecfb8=_0x3a3491['getFirstRange']()['start']['parent']['parent'],_0x294897=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x3ecfb8),this['editor']['model']['createPositionAfter'](_0x3ecfb8)),_0x23ce40=this['_wrapWithCommonAncestors'](_0x3d18dd,_0x294897['start'],_0x294897['end']);this['_copyMarkersToFragment'](_0x23ce40,_0x3a3491,{'isTableSelection':!0x0});const _0x473d47=_0x3a3491['getFirstRange']()['start'],_0x8196f=new Map();let _0x5c6b31=_0x23ce40;for(let _0x4fe88b=0x0;_0x4fe88b<_0x473d47['path']['length'];_0x4fe88b++)if(_0x8196f['set'](_0x5c6b31,_0x473d47['path'][_0x4fe88b]),_0x4fe88b<_0x473d47['path']['length']-0x1)_0x5c6b31=_0x5c6b31['getChild'](0x0);else{let _0x2bff56=_0x5c6b31['nextSibling'];for(;_0x2bff56;)_0x8196f['set'](_0x2bff56,_0x473d47['path'][_0x4fe88b]),_0x2bff56=_0x2bff56['nextSibling'];}return{'modelFragment':_0x23ce40,'anchorData':_0x8196f};}async['_executeAction'](_0x51a82a,_0x4e1674,_0x52240b,_0x440efd,_0xc49488){const _0x203ff6=this['editor']['plugins']['get'](s),_0xfbcdbe=this['editor']['plugins']['get'](R),_0x3cb3a4=this['editor']['model']['document']['selection'],_0x5c90f8=await _0x203ff6['modelToDataWithIds'](_0x4e1674),_0x34433b=this['editor']['model']['document']['version'],_0x4d894d=[..._0x3cb3a4['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0xfbcdbe['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x440efd,'icon':_0xc49488||bt,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x4d894d,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0xfbcdbe),this['_interactionParams']={'action':_0x51a82a,'content':_0x5c90f8,'version':_0x34433b,'aiBalloon':_0xfbcdbe,'modelFragment':_0x4e1674,'anchorData':_0x52240b},this['_setupApplyListeners'](),this['listenTo'](_0xfbcdbe,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0xfbcdbe,'dialogClosed',(_0x2543dc,{id:_0x1af4e5})=>{if('aiActionsBalloon'===_0x1af4e5){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x226d3f=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x2a8c30=_0x226d3f['changeGroups'][0x0];_0x2a8c30&&'pending'===_0x2a8c30['state']&&_0x226d3f['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0xfbcdbe);}}),this['_createInteraction'](_0x5c90f8,_0x34433b,_0xfbcdbe,_0x51a82a);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x513dd7,anchorData:_0x3d458b}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x513dd7,_0x3d458b,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x513dd7,_0x3d458b,!0x0);});}['_wrapWithCommonAncestors'](_0x3686ec,_0x5bfa4a,_0x24f1cc){const _0x3bce2e=this['editor']['model']['createRange'](_0x5bfa4a,_0x24f1cc)['getCommonAncestor'](),_0x5ae1b7=_0x3bce2e['is']('documentFragment')?[]:_0x3bce2e['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x5ae1b7['length']){const _0x366ce4=_0x5ae1b7['map'](_0x36f187=>_0x36f187['_clone'](!0x1));for(let _0x1ee097=0x1;_0x1ee097<_0x366ce4['length'];_0x1ee097++)_0x366ce4[_0x1ee097-0x1]['_appendChild'](_0x366ce4[_0x1ee097]);return _0x366ce4[_0x366ce4['length']-0x1]['_appendChild'](_0x3686ec),new jt(_0x366ce4[0x0]);}return _0x3686ec;}['_copyMarkersToFragment'](_0x3e0a2e,_0x3edb95,_0x3ea966={'isTableSelection':!0x1}){const _0x533d54=this['editor']['model'],_0xdcd0cd=Array['from'](_0x3edb95['getRanges']()),_0x28406d=_0x3edb95['getFirstRange']()['start'];for(const _0x48f5ae of _0x533d54['markers']){if(_0x48f5ae['name']['startsWith'](o)||!_0x48f5ae['affectsData'])continue;const _0x335597=_0x48f5ae['getRange']();if(!_0xdcd0cd['some'](_0x57c1e9=>_0x57c1e9['containsRange'](_0x335597,!0x0)))continue;const _0x44e938=this['_regularCalculateMarkerPath'](_0x335597['start'],_0x28406d,_0x3ea966['isTableSelection']),_0x3236e3=this['_regularCalculateMarkerPath'](_0x335597['end'],_0x28406d,_0x3ea966['isTableSelection']),_0x516fc2=_0x533d54['createPositionFromPath'](_0x3e0a2e,_0x44e938),_0x5cf55a=_0x533d54['createPositionFromPath'](_0x3e0a2e,_0x3236e3);if(!_0x516fc2['isEqual'](_0x5cf55a)){const _0x1ea445=_0x533d54['createRange'](_0x516fc2,_0x5cf55a);_0x3e0a2e['markers']['set'](_0x48f5ae['name'],_0x1ea445);}}}['_regularCalculateMarkerPath'](_0x1d1e0b,_0x478ad1,_0x1c6822=!0x1){const _0x4b125b=[..._0x1d1e0b['path']['slice']()];for(let _0x4a70e6=0x0;_0x4a70e6<Math['max'](_0x478ad1['path']['length'],_0x1d1e0b['path']['length']);_0x4a70e6++){const _0x13cb44=_0x478ad1['path'][_0x4a70e6]||0x0,_0x1f5106=(_0x1d1e0b['path'][_0x4a70e6]||0x0)-_0x13cb44;if(_0x4b125b[_0x4a70e6]=_0x1f5106,0x0!==_0x1f5106&&!_0x1c6822)break;}return _0x4b125b;}async['_createInteraction'](_0x562efc,_0x3f5595,_0x33a898,_0x55bc72){const _0x510f3d=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x55bc72,'content':_0x562efc,'version':_0x3f5595,'aiBalloon':_0x33a898,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x2ace5f=new wt({'connector':this['_aiConnector'],'editor':_0x510f3d,'content':_0x562efc,'version':_0x3f5595,..._0x55bc72});this['_interactions']['push'](_0x2ace5f);const _0x4010fc=(_0x22acb7,_0x29d234=!0x1,_0x255357='streaming')=>this['_promiseQueue']['enqueue'](async _0x324092=>{try{const _0x4a7332=kt({'editor':_0x510f3d,'changeGroups':_0x22acb7['changeGroups'],'documentContextContent':_0x22acb7['documentContextContent'],'showDiff':_0x29d234,'trimUnchanged':!0x1});_0x4a7332['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x4a7332[0x0],'renderingStrategy':_0x255357,'abortSignal':_0x324092});}catch(_0x2b8ec5){if(this['_isAbortError'](_0x2b8ec5))return;throw _0x2b8ec5;}});this['_interaction']['on']('replyCreated',(_0x174f91,_0x307cec)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x4010fc(_0x307cec)['catch'](_0x219661=>{this['_isAbortError'](_0x219661)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x219661),this['_setErrorState'](_0x2ace5f));});}),this['_interaction']['on']('replyContentUpdated',(_0x3f031f,_0x456dae)=>{_0x4010fc(_0x456dae)['catch'](_0x742bdb=>{this['_isAbortError'](_0x742bdb)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x742bdb),this['_setErrorState'](_0x2ace5f));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x1ed99f){this['_isAbortError'](_0x1ed99f)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x1ed99f),this['_setErrorState'](_0x2ace5f));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x2decdb,{showDiff:_0x58e084})=>{try{this['_balloonShowDiff']=_0x58e084;const _0x7ef9a6=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x7ef9a6&&await _0x4010fc(_0x7ef9a6,_0x58e084,'static');}catch(_0x3ea0a3){this['_isAbortError'](_0x3ea0a3)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x3ea0a3),this['_setErrorState'](_0x2ace5f));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x56586b,{reply:_0x1014e4})=>{const _0x7b2d05={'positiveCount':_0x1014e4['changeGroups']['filter'](_0x2f7330=>'accepted'===_0x2f7330['state'])['length'],'totalCount':_0x1014e4['changeGroups']['length']},_0x469c8e=this['_interaction']['actionCallId'],_0x23c794=this['_interaction']['actionName'];_0x23c794?this['_aiConnector']['upsertAIActionRating'](_0x23c794,_0x469c8e,_0x7b2d05):this['_aiConnector']['upsertCustomAIActionRating'](_0x469c8e,_0x7b2d05);}),this['_setLoadingState']();try{const _0x49122e=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x49122e;}catch(_0x2b2d7d){if(this['_isAbortError'](_0x2b2d7d))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x2ace5f);}}['_applyChanges'](_0x2dd2c6,_0x9f6abc,_0x167bb3){const _0x2d0b54=this['editor'];if(_0x167bb3&&!_0x2d0b54['plugins']['has']('TrackChanges'))throw new _0x25c351('ai-no-track-changes',null);const _0x13fb04=this['editor']['plugins']['get'](ot),_0x892f76=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x892f76||!_0x892f76['replies']['length'])return;const _0x59e53d=_0x892f76['replies'][_0x892f76['replies']['length']-0x1],_0x971225=_0x59e53d['changeGroups'];_0x59e53d['setChangeGroupState'](0x0,'accepted');let _0x169677=at({'editor':_0x2d0b54,'reply':_0x59e53d,'interaction':_0x892f76,'groups':_0x971225,'transform':!0x1,'documentCompare':_0x13fb04,'documentCompareOptions':{'anchor':_0x2d0b54['model']['createPositionAt'](_0x2dd2c6,0x0),'markDeletions':_0x167bb3}});_0x169677=this['_filterOperationsOutsideRange'](_0x169677,_0x9f6abc);for(const _0x1d9867 of _0x169677)this['_anchorOperation'](_0x9f6abc,_0x1d9867,_0x2d0b54['model']['document']['getRoot']());const _0x5550bb=_0x892f76['getDocumentContext']()['version'],_0x201b25=_0x2d0b54['model']['document']['history']['getOperations'](_0x5550bb),_0x36245f={'document':_0x2d0b54['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x3d74f8=xt(_0x169677,_0x201b25,_0x36245f)['operationsA'];_0x2d0b54['model']['change'](_0x3e0426=>{if(_0x3e0426['setSelection'](_0x2d0b54['model']['document']['selection']['focus']),_0x167bb3)_0x2d0b54['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3d74f8);else{for(const _0x3efef0 of _0x3d74f8)_0x3efef0['baseVersion']=_0x2d0b54['model']['document']['version'],rt(_0x2d0b54,_0x3efef0),_0x3e0426['batch']['addOperation'](_0x3efef0),_0x2d0b54['model']['applyOperation'](_0x3efef0);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x5026bc,_0x414b04){return _0x5026bc['filter'](_0x1209aa=>{if('rename'==_0x1209aa['type']){const _0x464ca6=_0x1209aa['position']['nodeAfter'];return!_0x414b04['has'](_0x464ca6);}if(_0x1209aa['type']['indexOf']('Attribute')>-0x1){const _0x39eee5=_0x1209aa['range']['start']['nodeAfter'];return!_0x414b04['has'](_0x39eee5);}return!0x0;});}['_anchorOperation'](_0x147aa2,_0x3fb8f6,_0x356c37){const _0x186676=_0x3fb8f6['clone']();for(const _0x36daa6 in _0x3fb8f6){const _0x4df1d9=_0x3fb8f6[_0x36daa6];_0x4df1d9 instanceof dt?_0x3fb8f6[_0x36daa6]=new dt(_0x16dc9b(_0x4df1d9['start']),_0x16dc9b(_0x4df1d9['end'])):_0x4df1d9 instanceof Dt&&(_0x3fb8f6[_0x36daa6]=_0x16dc9b(_0x4df1d9));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x186676['type'])){if(_0x186676['isDocumentOperation']=!0x1,_0x186676['baseVersion']=null,'remove'==_0x186676['type']){const _0x31289b=_0x186676['sourcePosition'],_0x118d71=_0x186676['howMany'];new lt(_0x31289b,_0x118d71)['_execute']();}else _0x186676['_execute']();}function _0x16dc9b(_0x234ccd){if('$graveyard'==_0x234ccd['root']['rootName'])return _0x234ccd;const _0x836ec8=[];let _0x1228df=_0x234ccd['root'];for(let _0x12b154=0x0;_0x12b154<_0x234ccd['path']['length'];_0x12b154++){const _0x566d8e=_0x147aa2['get'](_0x1228df)||0x0;_0x836ec8[_0x12b154]=_0x234ccd['path'][_0x12b154]+_0x566d8e,_0x1228df=_0x1228df['getChildAtOffset'](_0x234ccd['path'][_0x12b154]);}return new Dt(_0x356c37,_0x836ec8,_0x234ccd['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x5a6364,content:_0x5d7fce,version:_0x2f8c0e,aiBalloon:_0x62e3a}=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'](_0x5d7fce,_0x2f8c0e,_0x62e3a,_0x5a6364)['catch'](_0x58c1fd=>{this['_isAbortError'](_0x58c1fd)||console['error']('Error\x20refreshing\x20interaction:',_0x58c1fd);});}['_isAbortError'](_0x73df73){return!!_0x73df73['message']&&_0x73df73['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 _0x1101b6=this['_interactions']['length'];this['_currentInteractionIndex']<_0x1101b6-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x4c2633){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x4c2633;const _0x2b1455=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x2b1455)return;if(_0x2b1455['hasError'])return this['_setErrorState'](_0x2b1455),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x2b1455['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x2c38c5=_0x2b1455['replies'][_0x2b1455['replies']['length']-0x1];if(_0x2c38c5){const _0x828aa2=this['editor'];try{const _0x37db48=kt({'editor':_0x828aa2,'changeGroups':_0x2c38c5['changeGroups'],'documentContextContent':_0x2c38c5['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x28ee1a=>setTimeout(_0x28ee1a,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x37db48[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x3f1011){this['_isAbortError'](_0x3f1011)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x3f1011);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x5ef813){const _0xb5d73a=h(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0xb5d73a),_0x5ef813['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 Fa extends _0x53f6d2{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x40db47){super(_0x40db47),_0x40db47['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class gr extends _0x1f054a{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x260167,_0x14732c){super(_0x260167),this['id']=_0x14732c,this['set']('status','pending'),this['set']('changeId',_0x14732c),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',(_0x236341,_0x2467c0)=>{_0x2467c0&&_0x2467c0['target']&&'A'===_0x2467c0['target']['tagName']&&_0x2467c0['preventDefault'](),this['fire']('activateChange',{'id':_0x14732c,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x14732c,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x14732c,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x4546bc=new _0x1f054a(this['locale']);return _0x4546bc['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',_0x3f1120=>!_0x3f1120)]}}),_0x4546bc;}['_createAcceptButtonView'](){const _0x2c167b=new _0x1d1b95(this['locale']);return _0x2c167b['set']({'label':h(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x2c167b['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5bc59c=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x5bc59c['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x3e2209=>'pending'!==_0x3e2209&&'accepted'!==_0x3e2209),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x4a425d=>'pending'===_0x4a425d),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x26a7da=>'accepted'===_0x26a7da)]}}),this['on']('change:status',(_0x13f7ea,_0x250a1e,_0x5ab90d)=>{_0x2c167b['isEnabled']='pending'===_0x5ab90d,'accepted'===_0x5ab90d&&(_0x2c167b['label']=h(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x2c167b['icon']=_0x386c9f);}),_0x2c167b;}['_createDismissButtonView'](){const _0x1ad06d=new _0x1d1b95(this['locale']);return _0x1ad06d['set']({'label':h(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x1ad06d['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3d9b1e=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x3d9b1e['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary',this['bindTemplate']['if']('status','ck-hidden',_0x20c1aa=>'pending'!==_0x20c1aa&&'rejected'!==_0x20c1aa),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x30aa3e=>'pending'===_0x30aa3e),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x4c4b99=>'rejected'===_0x4c4b99)]}}),this['on']('change:status',(_0x25fed2,_0x300133,_0x38a717)=>{_0x1ad06d['isEnabled']='pending'===_0x38a717,'rejected'===_0x38a717&&(_0x1ad06d['label']=h(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x1ad06d['icon']=_0x12f0df);}),_0x1ad06d;}['_createInfoButtonView'](){const _0x177b3a=new _0x1d1b95(this['locale']);return _0x177b3a['set']({'label':h(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':tc,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x177b3a['bind']('isOn')['to'](this,'isInfoToggleOn',_0x28fbb7=>_0x28fbb7),_0x177b3a['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x177b3a;}['_createOutdatedButtonView'](){const _0x4aa87d=new _0x1d1b95(this['locale']);return _0x4aa87d['set']({'label':h(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x4ea3ef,'withText':!0x0,'isEnabled':!0x1}),_0x4aa87d['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x5d7a15=>'outdated'!==_0x5d7a15)],'disabled':'disabled'}}),_0x4aa87d;}}class me extends _0x10e1b3{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x1395e1,_0x4082d2){super(_0x1395e1),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']()),_0x4082d2['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x515079){this['resultItemView']['changeId']=_0x515079['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x515079['contentDiffed'];}['showBalloon'](_0x51543e,_0x20defb,_0x5d9f02,_0x4606ac,_0x223bba,_0x41cb24){const _0x16a106=_0x20defb();if(!_0x16a106)return;this['updateContent'](_0x51543e),this['show']();const _0x5dacef=Array['from'](_0x16a106['getClientRects']())['reverse'](),_0x2d2cf3=this['_getPointedRectIndexFromEvent'](_0x5d9f02,_0x5dacef),_0x59261a=_0x5dacef[_0x2d2cf3??0x0];'click'===_0x4606ac?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x20defb(),_0x2d2cf3,_0x51543e['id'],_0x223bba,_0x41cb24)||_0x59261a})):'hover'===_0x4606ac&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x20defb(),_0x2d2cf3,_0x51543e['id'])||_0x59261a}));}['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'](){_0x1d6ed3({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x27149d=[this['element']];return this['_pinnedTargetElement']&&_0x27149d['push'](this['_pinnedTargetElement']),_0x27149d;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x1020d7=new _0x1f054a();return this['resultItemView']=new gr(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x1020d7['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']]}]}),_0x1020d7;}['_getBestRectPositionOnClick'](_0x59e0c9,_0x2e5e46,_0x9ac008,_0x5f4eb3,_0x353a04){if(!_0x59e0c9)return null;const _0xa386a1=this['position']['replace']('arrow_',''),_0x3934e0=Array['from'](_0x59e0c9['getClientRects']());let _0x58523c,_0x4407db=_0x3934e0['reverse']();return void 0x0!==_0x2e5e46&&this['_isPinnedRectVisible'](_0x4407db[_0x2e5e46],_0x5f4eb3,_0x353a04)?(_0x58523c=_0x4407db[_0x2e5e46],this['_pinnedRectIndex']=_0x2e5e46):this['_isPinnedRectVisible'](_0x4407db[0x0],_0x5f4eb3,_0x353a04)&&void 0x0===_0x2e5e46?_0x58523c=_0x4407db[0x0]:(_0x4407db='s'==_0xa386a1[0x0]?[..._0x3934e0]['reverse']():_0x3934e0,_0x4407db['forEach'](_0x42575a=>{this['_isPinnedRectVisible'](_0x42575a,_0x5f4eb3,_0x353a04)&&(_0x58523c=_0x42575a);})),this['_pinnedTargetChangeId']=_0x9ac008,this['_pinnedTargetElement']=_0x59e0c9,_0x58523c||_0x59e0c9['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x33be07,_0x1db9de,_0x1f2965){if(!_0x33be07)return null;const _0x562393=Array['from'](_0x33be07['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x1db9de&&this['_pinnedTargetChangeId']!==_0x1f2965)return this['_pinnedRectIndex']=_0x1db9de,this['_pinnedTargetElement']=_0x33be07,this['_pinnedTargetChangeId']=_0x1f2965,_0x562393[_0x1db9de];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x1f2965){if(_0x33be07!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x562393[this['_pinnedRectIndex']];}return void 0x0!==_0x1db9de&&this['_pinnedTargetChangeId']!==_0x1f2965?(this['_pinnedRectIndex']=_0x1db9de,this['_pinnedTargetElement']=_0x33be07,this['_pinnedTargetChangeId']=_0x1f2965,_0x562393[_0x1db9de]):_0x33be07['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x42f757,_0x422dcf){if(_0x42f757)for(let _0x472abf=0x0;_0x472abf<_0x422dcf['length'];_0x472abf++){const _0x2d8dd6=_0x422dcf[_0x472abf];if(_0x42f757['clientX']>=_0x2d8dd6['left']-0x3&&_0x42f757['clientX']<=_0x2d8dd6['right']+0x3&&_0x42f757['clientY']>=_0x2d8dd6['top']-0x3&&_0x42f757['clientY']<=_0x2d8dd6['bottom']+0x3)return _0x472abf;}}['_isPinnedRectVisible'](_0x340519,_0x326ab6,_0x56d137){const _0x4e28fc=new _0x5002e3(_0x340519),_0x531fcd=_0x326ab6||document['documentElement'],_0xcaedc2=_0x4e28fc['getIntersection'](_0x3e4f1d(_0x56d137)),_0x1613db=new _0x5002e3(_0x531fcd)['getIntersection'](_0x4e28fc);return!!(_0xcaedc2&&_0x1613db&&_0x4e28fc['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Me extends _0x5dcf5b{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[it];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x395706){super(_0x395706),this['_bodyCollection']=new _0x1c4f1c(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 _0x4ef064=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x4ef064);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x582491){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x4ce87a=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x582491,_0x4ce87a);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x159e58){_0x159e58&&('error-general'!==_0x159e58['status']?'error-chunk'!==_0x159e58['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x46a711){this['_mainView']['addCheckRunResult'](_0x46a711);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x38d0d5){this['_mainView']['showGeneralReviewCoreErrorView'](_0x38d0d5??h(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x15d936,_0x36b42b){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x15d936,_0x36b42b);}['setActiveStateInResults'](_0x49a779){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x488f8d=>{_0x488f8d['id']===_0x49a779&&_0x488f8d['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x405022=>_0x405022['setItemAsInactive']());}['updateChangeState'](_0x6634d7,_0x154884){'accepted'===_0x154884||'rejected'===_0x154884||'outdated'===_0x154884?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x6634d7,_0x154884):this['_mainView']['reviewCheckResultsView']['showResult'](_0x6634d7,_0x154884);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x4e584b,_0x1e00c5,_0xb045d0,_0x28acc1,_0x1126ac,_0x5384b0){this['_balloonSuggestionView']['showBalloon'](_0x4e584b,_0x1e00c5,_0xb045d0,_0x28acc1,_0x1126ac,_0x5384b0);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x11e97f){const _0x503c08=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x52b771=>_0x52b771['id']===_0x11e97f);return _0x503c08?_0x503c08['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0x1f054a{constructor(_0x3f1098){super(_0x3f1098),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x3db65b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x3db65b['if']('isVisible','ck-hidden',_0x52cc03=>!_0x52cc03)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x3db65b['to']('errorMessage')}]}]});}}class Ae extends _0x1f054a{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x110a31,_0x12b867){super(_0x110a31),this['reviewCoreHeader']=_0x12b867['header'],this['generalErrorView']=new sh(_0x110a31),this['reviewCheckListView']=_0x12b867['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0x12b867['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0x12b867['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'](_0x5904ec){this['reviewCheckResultsView']['addResult'](_0x5904ec),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'](_0x5e3416){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x5e3416;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class _r extends _0x1d1b95{constructor(_0xffc168,_0x59c832){super(_0x59c832),this['set']({'label':_0xffc168,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ve extends _0x2a0bb9{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x4f489e,_0x54f4e0){super(_0x4f489e),this['_contents']=_0x54f4e0,this['_resultViews']=new _0x44a698(),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 fi(_0x4f489e),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 _0x4fa3cd=this['_createCombinedSkeletonLoader'](),_0x18c054=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x18c054['if']('isLoading','ck-ai_review__check-run_loading',_0x53fe35=>_0x53fe35),_0x18c054['if']('isResultReady','ck-ai_review__check-run_ready',_0x52b7a7=>_0x52b7a7),_0x18c054['if']('isVisible','ck-hidden',_0x2a5828=>!_0x2a5828)]},'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',_0x2dddec=>_0x2dddec)]},'children':this['_resultViews']},_0x4fa3cd]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x29c263){const _0x5e6363=new gr(this['locale'],_0x29c263['id']);_0x5e6363['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x5e6363),_0x5e6363['resultResponseView']['element']['innerHTML']=_0x29c263['contentDiffed'];}['hideResult'](_0x4c05cd,_0x7e716a){if('pending'===_0x7e716a)return;const _0x306ee3=this['_resultViews']['find'](_0x2ac7be=>_0x2ac7be['id']===_0x4c05cd);_0x306ee3&&(_0x306ee3['status']=_0x7e716a,_0x306ee3['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x26ee3,_0x3bc920){if('pending'!==_0x3bc920)return;const _0x293fd4=this['_resultViews']['find'](_0x4f5b17=>_0x4f5b17['id']===_0x26ee3);_0x293fd4&&(_0x293fd4['status']=_0x3bc920,_0x293fd4['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x261663,_0xbbf7cb){this['headerTitle']=_0x261663,this['headerSubtitle']=_0xbbf7cb||'';}['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 di(this['locale'],li['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x54d319=new _0x1f054a(this['locale']),_0x43186b=[];for(let _0x5b91bc=0x0;_0x5b91bc<0x10;_0x5b91bc++){const _0x4a7bbd=this['_createSkeletonLoader']();_0x4a7bbd['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x43186b['push'](_0x4a7bbd);}return _0x54d319['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x207d74=>!_0x207d74)]},'children':_0x43186b}),_0x54d319;}['_createErrorView'](){const _0x14ad55=new _0x1f054a(this['locale']),_0x201171=new _0x1d1b95(this['locale']),t=this['locale']['t'];return _0x14ad55['delegate']('retryReview')['to'](this),_0x201171['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x201171['on']('execute',()=>{this['fire']('retryReview');}),_0x14ad55['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x4d9ffb=>!_0x4d9ffb),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x736c35=>'chunk'===_0x736c35)]},'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',_0x3ea730=>'chunk'===_0x3ea730)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x18403a=>'general'!==_0x18403a)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x1d06b9=>'chunk'!==_0x1d06b9)]},'children':[{'text':h(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x201171]}),_0x14ad55;}['_createCancelButtonView'](){const _0x58acb0=new _0x1d1b95(this['locale']);return _0x58acb0['set']({'label':h(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x45f60c}),_0x58acb0['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x53af2e=>_0x53af2e),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3c815a=>_0x3c815a)]}}),_0x58acb0['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x58acb0;}['_createToggleDiffButtonView'](){const _0xf1f1d3=new _0x1d1b95(this['locale']);_0xf1f1d3['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0xf1f1d3['bind']('isEnabled')['to'](this,'isError',_0x42c171=>!_0x42c171),_0xf1f1d3['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2aca63=>!_0x2aca63),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2f0559=>_0x2f0559)]}});const _0x551f6a=h(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0xa3f041=h(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0xf1f1d3['bind']('isOn')['to'](this,'isToggleDiffOn',_0x703f29=>_0x703f29),_0xf1f1d3['bind']('icon')['to'](this,'isToggleDiffOn',_0x447826=>_0x447826?_0x3f74ad:_0x442060),_0xf1f1d3['bind']('label')['to'](this,'isToggleDiffOn',_0x412a52=>_0x412a52?_0x551f6a:_0xa3f041),_0xf1f1d3['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0xf1f1d3;}['_createAcceptAllButtonView'](){const _0x36356e=new _0x1d1b95(this['locale']);return _0x36356e['set']({'label':h(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x36356e['bind']('isEnabled')['to'](this,'isError',_0x4acf90=>!_0x4acf90),_0x36356e['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x1f6623=>!_0x1f6623),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3233ab=>_0x3233ab)]}}),_0x36356e['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x36356e;}['_createExitReviewButtonView'](){const _0x30d2c7=new _0x1d1b95(this['locale']);return _0x30d2c7['set']({'label':h(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x30d2c7['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2b309f=>!_0x2b309f),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x276840=>_0x276840)]}}),_0x30d2c7['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x30d2c7;}['_createResultHeaderView'](){const _0x5be509=new _0x1f054a(this['locale']),_0x4254ab=this['_createTitleView']();return _0x5be509['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x4eee81=>_0x4eee81)]},'children':[_0x4254ab,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x5be509;}['_createTitleView'](){const _0x584ff2=new _0x1f054a(this['locale']),_0xda9c2b=new mi();return _0xda9c2b['bind']('isVisible')['to'](this,'isResultReady',_0x4feae5=>!_0x4feae5),_0x584ff2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0xda9c2b,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x580677=>_0x580677)]},'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',_0x21dc14=>!_0x21dc14)]},'children':[{'text':h(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x584ff2;}['_createFinishReviewButtonView'](){const _0x46436a=new _r(h(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x46436a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x29e5e1=>!_0x29e5e1)]}}),_0x46436a['delegate']('finishReview')['to'](this),_0x46436a;}}class be extends _0x2a0bb9{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x388305,_0x532d2d){super(_0x388305),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x532d2d['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x532d2d['headerText']);const _0x2e63e7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x2e63e7['if']('isVisible','ck-hidden',_0x4afc00=>!_0x4afc00)]},'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':_0x532d2d['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x32c816){const _0x337ef5=new _r(_0x32c816,this['locale']);return _0x337ef5['delegate']('finishReview')['to'](this),_0x337ef5;}['_createResultHeaderView'](_0x3511d4){const _0x1aabb5=new _0x1f054a(this['locale']);return _0x1aabb5['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':_0x3511d4}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x1aabb5;}}class Dr extends _0x1f054a{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x50696b,_0x513aa8){super(_0x50696b),this['_defaultValue']=_0x513aa8['default']||(_0x513aa8['data']['length']>0x0?_0x513aa8['data'][0x0]['id']:''),this['_defaultLabel']=_0x513aa8['data']['find'](_0x322901=>_0x322901['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x290605(this['locale']);const _0x2e5615=this['_prepareListOptions'](_0x513aa8['data']);_0x46fef8(this['_dropdownView'],_0x2e5615,{'role':'menu','ariaLabel':_0x513aa8['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1a301c=>{_0x1a301c['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0xe00685=>{this['formValue']=_0xe00685['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0xe00685['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'](_0x2881d9=[]){const _0x4728f4=new _0x405f09();this['resetToDefault']();for(const _0x5b7e76 of _0x2881d9){const _0x4da989=new _0x53ecce({'label':_0x5b7e76['label'],'withText':!0x0,'role':'menuitemradio','id':_0x5b7e76['id'],'model':_0x5b7e76});_0x4da989['bind']('isOn')['to'](this,'formValue',_0xa4feb7=>_0xa4feb7===_0x4da989['id']);const _0xbf0702={'type':'button','model':_0x4da989};_0x4728f4['add'](_0xbf0702);}return _0x4728f4;}}class cc extends _0x2a0bb9{['_formItem']=null;constructor(_0x231729,_0x23df3e,_0x11b4e5){super(_0x231729),this['argsKey']=_0x23df3e?.['argsKey'];if('dropdown'===_0x23df3e['formType'])this['_formItem']=new Dr(this['locale'],_0x23df3e);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x157784=new _0x57479f(this['locale'],{'children':[this['_formItem']],'class':[_0x11b4e5?'ck-form__row_with-submit':'']});_0x11b4e5&&_0x157784['children']['add'](_0x11b4e5),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x157784]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class po extends _0x380d9b{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x1dc915){super(_0x1dc915),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x407d91(),this['minRows']=po['MIN_ROWS'],this['maxRows']=po['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class rc extends _0x1f054a{['focusTracker']=new _0x50d771();['keystrokes']=new _0x407d91();['focusCycler'];['_focusables']=new _0x44a698();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x18a7f4,_0x2025f3,_0x70aa6b=!0x1){super(_0x18a7f4),this['_check']=_0x2025f3,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x2025f3['defaultModel']?_0x2025f3['defaultModel']['id']:'',this['_defaultLabel']=_0x2025f3['defaultModel']?_0x2025f3['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x1e4591(this['locale'],()=>new po(_0x18a7f4)),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 _0x405f09(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x70aa6b),_0x46fef8(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x57479f(this['locale'],{'children':[this['promptInputView']]}),new _0x57479f(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x464402,_0x5588fc)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x5588fc()):_0x5588fc();}),this['focusCycler']=new _0x18b3f0({'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'](_0xb9e4f7=>{this['_focusables']['add'](_0xb9e4f7),this['focusTracker']['add'](_0xb9e4f7['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 _0x46bcd8 of this['_getFormValidators']()){const _0x44543b=_0x46bcd8();if(_0x44543b)return this['promptInputView']['errorText']=_0x44543b,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return h(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x4dbb87=new _0x1d1b95(this['locale']),t=this['locale']['t'];return _0x4dbb87['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x4dbb87['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x4dbb87;}['_createCancelButtonView'](){const _0x5eeecf=new _0x1d1b95(this['locale']),t=this['locale']['t'];return _0x5eeecf['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary'}),_0x5eeecf['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xaa22e6=>{_0xaa22e6['stopPropagation']();})}}),_0x5eeecf['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x5eeecf;}['_setModelList'](_0x42d51e){this['_modelSelectionDropdownItems']['clear']();const _0x1025e0=this['_check']['models'];if(_0x42d51e)this['set']('modelDisplayMode','hidden');else{const _0x591c98=0x1===_0x1025e0['length'];this['set']('modelDisplayMode',_0x591c98?'name':'selector');}if(this['resetToDefault'](),_0x1025e0?.['length']){0x1===_0x1025e0['length']&&this['set']('activeModelName',_0x1025e0[0x0]['name']||_0x1025e0[0x0]['id']);for(const _0x2d51ce of _0x1025e0){const _0x33f454=new _0x53ecce({'label':_0x2d51ce['name'],'withText':!0x0,'role':'menuitemradio','id':_0x2d51ce['id'],'model':_0x2d51ce});_0x33f454['bind']('isOn')['to'](this,'modelId',_0x186cf5=>_0x186cf5===_0x2d51ce['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x33f454,'labelView':new ko(this['locale'],_0x2d51ce)});}}}['_createModelSelectionDropdown'](){const _0x41db80=_0x290605(this['locale']);return _0x41db80['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x41db80['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x41db80['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x20db49=>'selector'===_0x20db49),this['listenTo'](_0x41db80,'execute',_0xfdbb23=>{this['modelId']=_0xfdbb23['source']['model']['id'],_0x41db80['buttonView']['label']=_0xfdbb23['source']['label'];}),_0x41db80;}['_createModelNameView'](){const _0x13a22d=new _o(this['locale']);return _0x13a22d['bind']('text')['to'](this,'activeModelName',_0x4aabdd=>_0x4aabdd??''),_0x13a22d['bind']('isVisible')['to'](this,'modelDisplayMode',_0x1f7ecf=>'name'===_0x1f7ecf),_0x13a22d;}['_createActionsFooterView'](){const _0x5983b4=new _0x1f054a(this['locale']);return _0x5983b4['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']]}]}),_0x5983b4;}}class _o extends _0x1f054a{constructor(_0x62fe34){super(_0x62fe34),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x9a9b7f=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x9a9b7f['if']('isVisible','ck-hidden',_0x88c9b7=>!_0x88c9b7)]},'children':[{'text':_0x9a9b7f['to']('text')}]});}}class ko extends _0x34171b{constructor(_0x2f87b2,_0x49bd1c){super();const _0x2c17e1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x2c17e1['to']('style'),'id':_0x2c17e1['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x2c17e1['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x49bd1c['description']||'']}]}]});}}class ic extends _0x2a0bb9{['_formItemsCollection']=new _0x44a698();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0xcfc409,_0x18e7fd,_0x4269a1,_0x12c906=!0x1){super(_0xcfc409),this['_hideModels']=_0x12c906,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x18e7fd['isParameterized']);const _0x2fcc5f=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',_0x20244b=>_0x20244b),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x51c955=>_0x51c955)],'style':{'--ck-ai-review-check-list-item-index':_0x4269a1}},'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':_0x18e7fd['title']}]},_0x2fcc5f]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x18e7fd['description']?[{'text':_0x18e7fd['description']}]:[]}]}]},..._0x18e7fd['isParameterized']?[this['_createParameterizedView'](_0x18e7fd)]:[],...'custom'===_0x18e7fd['id']?[this['_createCustomView'](_0x18e7fd,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x18e7fd['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x18e7fd['id'],'args':_0x18e7fd['useArgs']?_0x18e7fd['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x1d6ed3({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x3864d3=>{_0x3864d3['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x2696c3=new _0x152087();return _0x2696c3['content']=_0x2a08e8,_0x2696c3['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x2696c3;}['_createParameterizedView'](_0x83cb93){const _0x58853f=new _0x1f054a(),_0x2396ee=this['_createFormView'](_0x83cb93);return _0x58853f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0xcdfc9f=>!_0xcdfc9f)]},'children':[_0x2396ee]}),_0x58853f;}['_createFormView'](_0x236788){const _0x13bd75=new _0x1f054a(),_0x489513=Array['isArray'](_0x236788['options'])?_0x236788['options']:[],_0x54817e=new _0x1d1b95(this['locale']),t=this['locale']['t'];_0x54817e['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x54817e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1e8e86=>{_0x1e8e86['stopPropagation']();})}}),_0x54817e['on']('execute',()=>{const _0x559d5b=[],_0x594f74={};this['_formItemsCollection']['forEach'](_0x2a3fdb=>{_0x559d5b['push'](_0x2a3fdb['value']),_0x236788['useArgs']&&_0x236788['options']&&(_0x594f74[_0x2a3fdb['argsKey']]=_0x2a3fdb['value']);}),this['fire']('runReviewCheck',{'id':_0x236788['id'],'params':_0x559d5b['length']?_0x559d5b:void 0x0,'args':Object['keys'](_0x594f74)['length']?_0x594f74:void 0x0});});const _0x51a2db=_0x489513['length'];return _0x489513['forEach']((_0x3fde6c,_0x2da00d)=>{const _0x130451=_0x2da00d===_0x51a2db-0x1;this['_formItemsCollection']['add'](new cc(this['locale'],_0x3fde6c,_0x130451?_0x54817e:null));}),_0x13bd75['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x13bd75;}['_createCustomView'](_0x5e0f45,_0x549f5a=!0x1){return this['_customCheckView']=new rc(this['locale'],_0x5e0f45,_0x549f5a),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',_0x3e0836=>!_0x3e0836)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x36dd23,_0xd24aae,_0x13df94)=>{_0x13df94||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class je extends _0x2a0bb9{['_checkViews'];constructor(_0x34b76b){super(_0x34b76b),this['_checkViews']=new _0x44a698(),this['_setupTemplate']();}['setChecks'](_0x57146d,_0x80560f=!0x1){this['_checkViews']['clear']();for(const [_0x3ba20f,_0x559e9c]of _0x57146d['entries']()){const _0x4dfbe5=new ic(this['locale'],_0x559e9c,_0x3ba20f,_0x80560f);_0x4dfbe5['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x4dfbe5);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x21673d of this['_checkViews'])_0x21673d instanceof ic&&_0x21673d['resetToDefault']();}['_setupTemplate'](){const _0x395f92=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x395f92['if']('isVisible','ck-hidden',_0x4e56f1=>!_0x4e56f1)]},'children':this['_checkViews']});}}class ge extends Me{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x2a930d=this['context']['locale'],_0x3cf04f=new _0x337d54(_0x2a930d,{'label':h(_0x2a930d,'AI_REVIEW_MODE'),'icon':_0x31c506,'class':'ck-ai-header\x20ck-ai-header_review'});return new Ae(this['context']['locale'],{'header':_0x3cf04f,'list':new je(_0x2a930d),'results':new Ve(_0x2a930d,{'generalErrorText':h(_0x2a930d,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x2a930d,{'headerText':h(_0x2a930d,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':h(_0x2a930d,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':h(_0x2a930d,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x49c26f=this['context']['plugins']['get']('AITabs');_0x49c26f['view']['on']('activateTab',(_0x435ea9,_0x45bc3f)=>{'reviewMode'===_0x45bc3f?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x49c26f['view']['addTab']({'id':'reviewMode','buttonLabel':h(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x31c506,'order':0x0,'content':this['_mainView']});}}const fe='review-';class de extends _0x5dcf5b{static get['requires'](){return[ot,s];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x25164a){super(_0x25164a),this['_domEmitter']=new(_0x30e617())(),this['_eventEmitter']=new(_0xa7ecb2())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x390669=c(this['context']);_0x390669['conversion']['for']('editingDowncast')['markerToElement']({'model':fe+'insert','view':(_0xa42dfa,{writer:_0x251ba2})=>{const _0x1d1b86=this['_markers']['get'](_0xa42dfa['markerName']),_0x32e34b={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x1d1b86?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0xa42dfa['markerName']};return _0x251ba2['createUIElement']('span',_0x32e34b,function(_0x38edf3){const _0x313153=this['toDomElement'](_0x38edf3);return _0x313153['innerHTML']=_0x1d1b86?.['content']?.['asString']||'',_0x313153;});}}),_0x390669['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-only','view':_0x1582a1=>{const _0x44e8a2=this['_markers']['get'](_0x1582a1['markerName']),_0x34bed4=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x44e8a2?.['id']||'')&&_0x34bed4['push']('ck-ai_review__change_active'),{'classes':_0x34bed4,'attributes':{'data-marker-id':_0x1582a1['markerName']}};}}),_0x390669['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-context','view':_0x5ccf3d=>{const _0x4abef7=this['_markers']['get'](_0x5ccf3d['markerName']),_0x31528a=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x4abef7?.['id']||'')&&_0x31528a['push']('ck-ai_review__change_active'),{'classes':_0x31528a,'attributes':{'data-marker-id':_0x5ccf3d['markerName']}};}}),_0x390669['conversion']['for']('editingDowncast')['markerToHighlight']({'model':fe+'remove-text','view':_0x580b37=>{const _0x3e6477=this['_markers']['get'](_0x580b37['markerName']),_0x27022c=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x3e6477?.['id']||'')&&_0x27022c['push']('ck-ai_review__change_active'),{'classes':_0x27022c,'attributes':{'data-marker-id':_0x580b37['markerName']}};}}),_0x390669['conversion']['for']('dataDowncast')['markerToElement']({'model':fe+'suggestion-context','view':(_0x55653d,{writer:_0x44a9d9})=>_0x44a9d9['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x55653d['isOpening']?'start':'end')})}),_0x390669['conversion']['for']('downcast')['attributeToAttribute']({'model':nt,'view':_0xfbb69e});const _0x95a70a=_0x390669['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x95a70a,'mouseup',(_0x2e65c9,_0x3a14e4)=>{const _0x38f3c2=_0x3a14e4['target'],_0x48505e=this['_findMarkerElement'](_0x38f3c2);if(!_0x48505e)return;const _0x5716ce=_0x48505e['getAttribute']('data-marker-id'),_0x45e122=_0x5716ce['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x5716ce,'changeId':_0x45e122,'markerElement':()=>this['_findMarkerElementById'](_0x5716ce),'domEvent':_0x3a14e4});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x95a70a,'mouseover',(_0x4baff5,_0x32890f)=>{const _0x1c8b4d=_0x32890f['target'],_0xfb7eef=_0x32890f['relatedTarget'];let _0x1435db=this['_findMarkerElement'](_0x1c8b4d);if(!_0x1435db&&_0xfb7eef&&(_0x1435db=this['_findMarkerElement'](_0xfb7eef)),!_0x1435db)return;const _0x5b17ff=_0x1435db['getAttribute']('data-marker-id'),_0x55fd00=_0x5b17ff['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x55fd00,'markerElement':()=>this['_findMarkerElementById'](_0x5b17ff),'domEvent':_0x32890f});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x21c87d((_0x5037d6,_0x3c60a5)=>{const _0x491f2c=_0x3c60a5['target'];if(this['_findMarkerElement'](_0x491f2c))return;_0x491f2c['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x390669['model']['document']['registerPostFixer'](_0x2faf64=>this['_validateMarkers'](_0x390669,_0x2faf64)),_0x390669['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x390669));}['getDocumentData'](){const _0xf88105=this['context']['plugins']['get']('AIEditing'),_0x24d1df=c(this['context']),_0x5cb57b=_0x24d1df['model'],_0x31c3aa=new jt();for(const _0x11279d of _0x5cb57b['document']['getRoot']()['getChildren']()){const _0x10c0a0=_0x11279d['_clone'](!0x0);_0x31c3aa['_appendChild'](_0x10c0a0);}for(const _0x5d77c0 of _0x5cb57b['markers'])_0x31c3aa['markers']['set'](_0x5d77c0['name'],this['_changeRangeOwnerDocument'](_0x5d77c0['getRange']()['clone'](),_0x31c3aa));const _0x16c62b=new _0x31a869({'ignoreElementEnd':!0x0,'startPosition':_0x5cb57b['createPositionAt'](_0x31c3aa,0x0)}),_0x1c3ff4=new Set(),_0x1c5674=new Map();for(const {item:_0xf98628}of _0x16c62b){if(!_0xf98628['is']('$textProxy'))continue;const _0x2dfedd=_0xf98628['parent'];if(_0x2dfedd&&_0x2dfedd['is']('element')){const _0x4f666a=this['_upsertDataId'](_0x2dfedd,()=>_0xf88105['_nextDataId'](_0x1c3ff4));_0x1c3ff4['add'](_0x4f666a);for(const _0xfd4ee1 of _0x2dfedd['getChildren']())_0xfd4ee1['is']('element')&&_0x1c3ff4['add'](this['_upsertDataId'](_0xfd4ee1,()=>_0xf88105['_nextDataId'](_0x1c3ff4)));let _0x49c68d=_0x2dfedd;for(;_0x49c68d['parent']&&!_0x49c68d['parent']['is']('documentFragment');)_0x49c68d=_0x49c68d['parent'],_0x49c68d['hasAttribute'](nt)&&_0x49c68d['_removeAttribute'](nt);_0x1c5674['set'](_0x4f666a,{'path':_0x2dfedd['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x49c68d['_clone'](!0x0),_0x4f666a,_0x24d1df['data'])}),_0x16c62b['jumpTo'](_0x5cb57b['createPositionAfter'](_0x2dfedd));}}return{'content':_0x24d1df['data']['processor']['toData'](_0x24d1df['data']['toView'](_0x31c3aa)),'version':_0x24d1df['model']['document']['version'],'elements':_0x1c5674};}['diffContent'](_0x5f0244,_0xde390f,_0xb0d895=!0x1){const _0x2f4bc0=[],_0x37bae8=c(this['context']),_0x475be5=_0x37bae8['data']['parse'](_0xde390f,'$documentFragment'),_0x26172c=_0x37bae8['data']['parse'](_0x5f0244,'$documentFragment'),_0x5a0fa0=_0x37bae8['model']['createPositionAt'](_0x26172c,0x0);if(this['_haveSingleTopLevelElement'](_0x475be5)){if(!this['_hasSameTopLevelElement'](_0x26172c,_0x475be5))return _0x2f4bc0;}else{const _0x46b973=_0x37bae8['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x26172c,_0x46b973)||!this['_haveOnlyInlineContent'](_0x475be5,_0x46b973))return _0x2f4bc0;}const _0x50dfc1=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x5f0244,_0xde390f,{'anchor':_0x5a0fa0,'markDeletions':!0x0})['getOperations']()['filter'](_0x29f181=>'insert'===_0x29f181['type']||'marker'===_0x29f181['type']&&_0x29f181['name']['startsWith']('$markedRemove')),_0x56a691=this['_groupAdjacentOperations'](_0x50dfc1),_0x4e65e6=[];if(_0xb0d895){if(_0x56a691['length']){const _0x36a6b5=_0x56a691[0x0]['operations'][0x0],_0x46728d='insert'===_0x36a6b5['type']?_0x36a6b5['position']:_0x36a6b5['newRange']['start'],_0x282ccd=this['_getPositionLimitingRange'](_0x46728d,_0x37bae8,'inside'),_0x5e907c=_0x282ccd?_0x475be5['getChild'](0x0)['getChildren']():_0x475be5['getChildren'](),_0x42cb96=_0x282ccd||_0x37bae8['model']['createRangeIn'](_0x26172c),_0xac0077=[new _0x1c5019('$markedRemove:synthetic'+_0x677d44(),null,_0x42cb96,_0x37bae8['model']['document']['model']['markers'],!0x0,_0x37bae8['model']['document']['version']+0x1),new _0x23db8e(_0x42cb96['end'],_0x5e907c,_0x37bae8['model']['document']['version']+0x2)];_0x4e65e6['push']({'operations':_0xac0077,'operationsIsolated':_0xac0077,'groupOffset':0x0});}}else _0x4e65e6['push'](..._0x56a691);let _0x2f2ece=0x0;return _0x37bae8['model']['change'](_0x3d0c6a=>{for(let _0x5cf3ac=0x0;_0x5cf3ac<_0x4e65e6['length'];_0x5cf3ac++){const _0x187164=_0x4e65e6[_0x5cf3ac],_0x528570=_0x3d0c6a['createDocumentFragment']();for(const _0x444d27 of _0x26172c['getChildren']())_0x3d0c6a['append'](_0x444d27['_clone'](!0x0),_0x528570);for(const _0x131092 of _0x187164['operationsIsolated'])if('insert'===_0x131092['type']){const _0x2acc7d=_0x131092;_0x2acc7d['baseVersion']=null,_0x2acc7d['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x2acc7d,_0x528570),_0x3d0c6a['batch']['addOperation'](_0x131092),_0x37bae8['model']['applyOperation'](_0x131092);const _0x5eb7f2='suggestion:insertion:id:authorId:'+_0x2f2ece++,_0x1ba11b=_0x37bae8['model']['createRange'](_0x2acc7d['position'],_0x2acc7d['position']['getShiftedBy'](_0x2acc7d['howMany']));_0x528570['markers']['set'](_0x5eb7f2,_0x1ba11b);}else{if('marker'===_0x131092['type']&&_0x131092['name']['startsWith']('$markedRemove')){const _0xe1af52=_0x131092,_0x5b0089='suggestion:deletion:id:authorId:'+_0x2f2ece++;this['_changeOperationOwnerDocument'](_0xe1af52,_0x528570),_0x528570['markers']['set'](_0x5b0089,_0xe1af52['newRange']);}}if(_0xb0d895)_0x2f4bc0['push']({..._0x187164,'context':this['_createGetContentFn'](_0x26172c,_0x37bae8['data']),'content':this['_createGetContentFn'](_0x26172c,_0x37bae8['data'])});else{const _0x49ec7a=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x187164['operationsIsolated'][0x0]),_0x528570),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x187164['operationsIsolated'][_0x187164['operationsIsolated']['length']-0x1]),_0x528570));_0x528570['markers']['set'](fe+'suggestion-context',new dt(_0x49ec7a['start'],_0x49ec7a['end'])),_0x2f4bc0['push']({..._0x187164,'context':this['_createGetContextFn'](_0x528570,_0x37bae8['data'],{'ellipsisBefore':_0x49ec7a['hasContentBefore'],'ellipsisAfter':_0x49ec7a['hasContentAfter']}),'content':this['_createGetContentFn'](_0x528570,_0x37bae8['data'])});}}}),_0x2f4bc0;}['markChangePositionInEditorContent'](_0x32682b,_0x21a887){if(!_0x32682b['length'])return;const _0x58d133=_0x32682b[0x0]['parent']['id'],_0x3f949b=_0x21a887['elements']['get'](_0x58d133);if(!_0x3f949b)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x58d133);const _0x4cfeb7=_0x3f949b['path'],_0x1a138f=c(this['context']),_0x3f1798=_0x1a138f['model']['document']['history']['getOperations'](_0x21a887['version']),_0x3a6f2c=[];for(const _0x237484 of _0x32682b){const _0x51b70f=_0x237484['operationsIsolated']['map'](_0x2d6912=>this['_translateOperationToEditorContent'](_0x2d6912,_0x4cfeb7,_0x1a138f['model']['document']['getRoots']()[0x0]));if(!_0x51b70f||!_0x51b70f['length'])continue;const _0x5716b9=_0x51b70f['every'](_0xc85055=>'marker'===_0xc85055['type']&&_0xc85055['name']['startsWith']('$markedRemove')),_0x3459b0={'document':_0x1a138f['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x56f78c=xt(_0x51b70f,_0x3f1798,_0x3459b0)['operationsA'];for(const _0x23ad97 of _0x56f78c)if('insert'===_0x23ad97['type']){const _0x1aef0f=_0x23ad97,_0x7c2396=_0x1aef0f['nodes'];_0x1a138f['model']['change'](_0x5dee83=>{const _0x2cbd48=_0x5dee83['createDocumentFragment']();for(const _0x48e20e of _0x7c2396)_0x5dee83['append'](_0x48e20e['_clone'](!0x0),_0x2cbd48);_0x3a6f2c['push']({'start':_0x1aef0f['position'],'end':_0x1aef0f['position'],'type':'insert','groupId':_0x237484['id'],'content':{'asString':this['_createGetContentFn'](_0x2cbd48,_0x1a138f['data'])(),'asFragment':_0x2cbd48}});});}else{if('marker'===_0x23ad97['type']&&_0x23ad97['name']['startsWith']('$markedRemove')){const _0x16d940=_0x23ad97;let _0x2a8b85='remove-text';if(_0x5716b9){const _0x551168=this['_findAdjacentContextDistance'](_0x16d940['newRange']['start'],'backward',_0x1a138f['model']['schema']),_0xb99d1d=this['_findAdjacentContextDistance'](_0x16d940['newRange']['end'],'forward',_0x1a138f['model']['schema']);if(_0x551168||_0xb99d1d){const _0x5b169d=_0x16d940['newRange']['start']['getShiftedBy'](-_0x551168),_0x393eff=_0x16d940['newRange']['end']['getShiftedBy'](_0xb99d1d);_0x3a6f2c['push']({'start':_0x5b169d,'end':_0x393eff,'groupId':_0x237484['id'],'type':'remove-context'});}else _0x2a8b85='remove-only';}_0x3a6f2c['push']({'start':_0x16d940['newRange']['start'],'end':_0x16d940['newRange']['end'],'groupId':_0x237484['id'],'type':_0x2a8b85});}}}this['_insertMarkers'](_0x3a6f2c);}['clearAllMarkers'](){const _0x274692=c(this['context']);_0x274692['model']['change'](_0x18d084=>{for(const _0x474917 of this['_markers']['keys']())_0x274692['model']['markers']['get'](_0x474917)&&_0x18d084['removeMarker'](_0x474917);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){c(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){c(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x1e7bb6){const _0x32707d=c(this['context']),_0x581f7b=_0x32707d['model'],_0x2b6def=_0x1e7bb6['map'](_0x203082=>this['_getMarkersDataForGroup'](_0x203082))['flat']();_0x581f7b['change'](_0x2b0b21=>{for(const _0x5eb20c of _0x2b6def){const _0x20f0c2=_0x32707d['model']['markers']['get'](_0x5eb20c['id']);if(_0x20f0c2){if('insert'===_0x5eb20c['type']){if(!_0x5eb20c['content'])continue;_0x581f7b['insertContent'](_0x5eb20c['content']['asFragment']||null,_0x20f0c2['getRange']()['start']);}else'remove-text'!==_0x5eb20c['type']&&'remove-only'!==_0x5eb20c['type']||_0x581f7b['deleteContent'](_0x581f7b['createSelection'](_0x20f0c2['getRange']()));_0x2b0b21['removeMarker'](_0x5eb20c['id']),this['_markers']['delete'](_0x5eb20c['id']);}}});}['rejectChange'](_0x139808){const _0x23e202=c(this['context']),_0x69c4b=this['_getMarkersDataForGroup'](_0x139808);_0x23e202['model']['change'](_0x42dd93=>{for(const _0x343b02 of _0x69c4b)_0x42dd93['removeMarker'](_0x343b02['id']),this['_markers']['delete'](_0x343b02['id']);});}['getEditor'](){return c(this['context']);}['getMarkerElementForChange'](_0x1aeda9){const _0xdbedc5=Array['from'](this['_markers']['values']())['filter'](_0x3e59a4=>_0x3e59a4['groupId']===_0x1aeda9);if(!_0xdbedc5['length'])return null;const _0x2df0ec=0x1===_0xdbedc5['length']?_0xdbedc5[0x0]:this['_sortMarkers'](_0xdbedc5)[0x0],_0x19c53f=c(this['context'])['model']['markers']['get'](_0x2df0ec['id']);if(!_0x19c53f)return null;return{'modelRange':_0x19c53f['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x2df0ec['id'])};}['getContentElementForChange'](_0x1ffb2d){const _0x316317=Array['from'](this['_markers']['values']())['filter'](_0x520696=>_0x520696['groupId']===_0x1ffb2d);if(!_0x316317['length'])return null;const _0x504f3b=0x1===_0x316317['length']?_0x316317[0x0]:this['_sortMarkers'](_0x316317)[0x0],_0x2678d8=c(this['context']),_0x2782db=_0x2678d8['model']['markers']['get'](_0x504f3b['id']);if(!_0x2782db)return null;const _0x497df0=_0x2782db['getRange'](),_0x3394e5=_0x2678d8['editing']['view']['getDomRoot']();if(!_0x3394e5||!_0x497df0)return null;let _0x1047d2=_0x497df0['start']['parent'];for(;_0x1047d2['parent']&&'$root'!==_0x1047d2['parent']['name'];)_0x1047d2=_0x1047d2['parent'];if(!_0x1047d2||!_0x1047d2['name'])return null;const _0x13a716=_0x3394e5['querySelector']('[data-marker-id=\x22'+_0x504f3b['id']+'\x22]');if(!_0x13a716)return null;let _0x384278=null;_0x2678d8['model']['change'](_0x215a73=>{_0x384278=_0x215a73['createDocumentFragment'](),_0x215a73['append'](_0x1047d2['_clone'](!0x0),_0x384278);});const _0x4f031c=_0x2678d8['data']['toView'](_0x384278)['getChild'](0x0);return _0x13a716['closest'](_0x4f031c['name']);}['reactivateMarkers'](_0x431a1d){const _0x27a58b=this['_getMarkersDataForGroup'](_0x431a1d);if(!_0x27a58b['length'])return;const _0xddf46a=Array['from'](this['_activeMarkers'])['sort'](),_0x1f74b4=Array['from'](new Set(_0x27a58b['map'](_0x2f4fe6=>_0x2f4fe6['id'])))['sort']();_0xddf46a['join']('|')!==_0x1f74b4['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x431a1d));}['setMarkersInElementAsActive'](_0xbbd307){const _0x41d1b0=this['_getMarkersDataForGroup'](_0xbbd307);if(!_0x41d1b0['length'])return;const _0xa2618e=c(this['context']),_0x10918f=new Set(_0x41d1b0['map'](_0x5be085=>_0x5be085['id'])),_0x5f4ddd=Array['from'](_0x10918f['values']())['map'](_0x2c7c7e=>_0xa2618e['model']['markers']['get'](_0x2c7c7e))['filter'](_0xdc81be=>!!_0xdc81be);_0x10918f['forEach'](_0x49c276=>{this['_activeMarkers']['add'](_0x49c276);}),_0xa2618e['model']['change'](()=>{_0x5f4ddd['forEach'](_0x6a4607=>{_0xa2618e['editing']['reconvertMarker'](_0x6a4607);});});}['setAllMarkersAsInactive'](){const _0x28d14c=Array['from'](this['_activeMarkers']);if(!_0x28d14c['length'])return;this['_activeMarkers']['clear']();const _0x83a11d=c(this['context']),_0x39202a=_0x28d14c['map'](_0x4baf8f=>_0x83a11d['model']['markers']['get'](_0x4baf8f))['filter'](_0x37696a=>!!_0x37696a);_0x83a11d['model']['change'](()=>{_0x39202a['forEach'](_0x1922cb=>{_0x83a11d['editing']['reconvertMarker'](_0x1922cb);});});}['_getPositionLimitingRange'](_0x47329a,_0x164053,_0x237b39='outside'){if(!_0x47329a)return null;let _0x3927f5=_0x47329a['parent'];for(;_0x3927f5&&_0x3927f5['parent']&&'$root'!==_0x3927f5['parent']['name']&&!_0x164053['model']['schema']['isLimit'](_0x3927f5)&&!_0x164053['model']['schema']['isBlock'](_0x3927f5);)_0x3927f5=_0x3927f5['parent'];if(!_0x3927f5||!_0x3927f5['name']||'$root'===_0x3927f5['name'])return null;let _0x33702f=null;return _0x164053['model']['change'](_0x2a9d41=>{_0x33702f='inside'===_0x237b39?_0x2a9d41['createRangeIn'](_0x3927f5):_0x2a9d41['createRangeOn'](_0x3927f5);}),_0x33702f;}['_validateMarkers'](_0x427062,_0x562bd9){const _0x5ab0b1=Array['from'](this['_markers']['keys']()),_0x5a0990=new Map();for(const _0x188adf of _0x5ab0b1){const _0x42b62a=_0x427062['model']['markers']['get'](_0x188adf);if(!_0x42b62a)continue;const _0x3e59bf=_0x42b62a['getStart']()['path'][0x0];_0x5a0990['has'](_0x3e59bf)||_0x5a0990['set'](_0x3e59bf,[]),_0x5a0990['get'](_0x3e59bf)['push'](_0x42b62a);}const _0x24a686=new Set();for(const _0x1ddd50 of _0x427062['model']['document']['differ']['getChanges']()){let _0xdbd78d=-0x1,_0x5c8005=null;if('insert'===_0x1ddd50['type'])_0x5c8005=new dt(_0x1ddd50['position'],_0x1ddd50['position']['getShiftedBy'](_0x1ddd50['length'])),_0xdbd78d=_0x1ddd50['position']['path'][0x0];else{if('remove'!==_0x1ddd50['type'])continue;_0x5c8005=new dt(_0x1ddd50['position']),_0xdbd78d=_0x1ddd50['position']['path'][0x0];}const _0x1a5041=_0x5a0990['get'](_0xdbd78d)||[];if(_0x1a5041['length']){for(const _0x332072 of _0x1a5041)if(_0x5c8005['root']['rootName']===_0x332072['getRange']()['root']['rootName']&&('insert'!==_0x1ddd50['type']||!_0x5c8005['containsRange'](_0x332072['getRange']()))&&(_0x5c8005['isIntersecting'](_0x332072['getRange']())||_0x5c8005['start']['isTouching'](_0x332072['getRange']()['end'])||_0x5c8005['end']['isTouching'](_0x332072['getRange']()['start']))){const _0x60818a=this['_parseMarkerName'](_0x332072['name']);Array['from'](this['_markers']['values']())['filter'](_0x677bde=>_0x677bde['groupId']===_0x60818a['groupId'])['forEach'](_0x4786e9=>_0x24a686['add'](_0x4786e9['id']));}}}if(_0x24a686['size']){for(const _0x686a54 of _0x24a686)_0x562bd9['removeMarker'](_0x686a54);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x189429){for(const {name:_0x1724bd,data:_0x162b6f}of _0x189429['model']['document']['differ']['getChangedMarkers']()){if(!_0x1724bd['startsWith'](fe))continue;const _0x103f54=_0x162b6f['oldRange'],_0x3cdd46=_0x162b6f['newRange'],_0x388b05=_0x103f54&&'$graveyard'===_0x103f54['root']['rootName'],_0x1e7298=_0x3cdd46&&'$graveyard'===_0x3cdd46['root']['rootName'];if(_0x388b05&&_0x1e7298)continue;const _0x3f8047=this['_parseMarkerName'](_0x1724bd);this['_markers']['get'](_0x1724bd)&&(_0x1e7298||!_0x3cdd46?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x1724bd,'changeId':_0x3f8047['groupId']}):_0x388b05&&_0x3cdd46&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x1724bd,'changeId':_0x3f8047['groupId']}));}}['_parseMarkerName'](_0x2e858e){const _0x47e7ea=_0x2e858e['split'](':'),_0x423108=(_0x47e7ea[0x1]||'')['split']('_');return{'prefix':_0x47e7ea[0x0],'groupId':_0x423108[0x0],'suffix':_0x423108[0x1]};}['_translateOperationToEditorContent'](_0x17f6bc,_0x46bfa3,_0xa8774){if('insert'===_0x17f6bc['type']){const _0xaa3c33=_0x17f6bc;return new _0x23db8e(this['_changePosition'](_0x46bfa3['concat'](_0xaa3c33['position']['offset']),_0xa8774),_0xaa3c33['nodes'],_0xaa3c33['baseVersion']);}if('marker'===_0x17f6bc['type']&&_0x17f6bc['name']['startsWith']('$markedRemove')){const _0x413c2f=_0x17f6bc;return new _0x1c5019(_0x413c2f['name'],_0x413c2f['oldRange'],this['_changeRange'](_0x413c2f['newRange'],_0x46bfa3['concat'](_0x413c2f['newRange']['start']['offset']),_0x46bfa3['concat'](_0x413c2f['newRange']['end']['offset']),_0xa8774),_0x413c2f['_markers'],_0x413c2f['affectsData'],_0x413c2f['baseVersion']);}return _0x17f6bc;}['_groupAdjacentOperations'](_0x1feda9){if(!_0x1feda9['length'])return[];const _0x45bc5d=[];let _0x46b2c9=0x0,_0x3d50dd=0x0,_0x5d0d6b=[];for(let _0x10b194=0x0;_0x10b194<=_0x1feda9['length'];_0x10b194++){const _0x385d4b=_0x1feda9[_0x10b194],_0x4d19ed=_0x1feda9[_0x10b194-0x1];!_0x385d4b||_0x4d19ed&&!this['_getOperationEnd'](_0x4d19ed)['isTouching'](this['_getOperationStart'](_0x385d4b))?(_0x45bc5d['push']({'operations':_0x5d0d6b,'operationsIsolated':_0x5d0d6b['map'](_0x312445=>this['_shiftOperation'](_0x312445['clone'](),-_0x3d50dd)),'groupOffset':_0x46b2c9}),_0x5d0d6b=_0x385d4b?[_0x385d4b]:[],_0x3d50dd+=_0x46b2c9,_0x46b2c9=0x0):_0x5d0d6b['push'](_0x385d4b),_0x385d4b&&'insert'===_0x385d4b['type']&&(_0x46b2c9+=_0x385d4b['howMany']);}return _0x45bc5d;}['_findAdjacentContextDistance'](_0x3a1655,_0x5f5648,_0x1cb66d,_0x4be503=0x1){const _0x2fda76=new _0x31a869({'startPosition':_0x3a1655,'direction':_0x5f5648});let _0x782404=0x0;for(let _0x219a93=0x0;_0x219a93<_0x4be503;_0x219a93++){let _0xbc2db0=0x0,_0x2db6fa=!0x1,_0x2f5d2a='forward'===_0x5f5648?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x264a96}of _0x2fda76)if(_0x264a96['is']('$textProxy')){const _0x24e938=_0x2f5d2a['exec'](_0x264a96['data']);if(_0x24e938&&_0x24e938['length']){if(_0xbc2db0+='forward'===_0x5f5648?_0x24e938['index']+_0x24e938[0x0]['length']:_0x264a96['data']['length']-_0x24e938['index'],_0x24e938[0x0]['length']!==_0x264a96['data']['length'])break;_0x2db6fa=!0x0,_0x2f5d2a='forward'===_0x5f5648?/^\w+/:/\w+$/;}else{if(_0x2db6fa)break;_0xbc2db0+=_0x264a96['offsetSize'];}}else{if(_0x264a96['is']('element')){_0x1cb66d['isInline'](_0x264a96)&&!_0x2db6fa&&(_0xbc2db0+=0x1);break;}}_0x782404+=_0xbc2db0,_0x2fda76['jumpTo'](_0x3a1655['getShiftedBy']('forward'===_0x5f5648?_0x782404:-_0x782404));}return _0x782404;}['_getChangeContext'](_0x241d81,_0x3e3e3f){const _0xec4257=c(this['context'])['model']['schema'],_0x54f576=this['_findAdjacentContextDistance'](_0x241d81,'backward',_0xec4257,0x6),_0x55f2e8=this['_findAdjacentContextDistance'](_0x3e3e3f,'forward',_0xec4257,0x6),_0x2e9d5c=_0x241d81['getShiftedBy'](-_0x54f576),_0x18e18c=_0x3e3e3f['getShiftedBy'](_0x55f2e8);return{'start':_0x2e9d5c,'end':_0x18e18c,'hasContentBefore':!_0x2e9d5c['isAtStart'],'hasContentAfter':!_0x18e18c['isAtEnd']};}['_insertMarkers'](_0x764525){const _0xcb089c=this['context']['plugins']['get']('AIEditing'),_0x7f42d=new Set();c(this['context'])['model']['change'](_0x38f822=>{for(const _0x4ba34e of _0x764525){const _0x1303ff=''+fe+_0x4ba34e['type']+':'+_0x4ba34e['groupId']+'_'+_0xcb089c['_nextDataId'](_0x7f42d);this['_markers']['set'](_0x1303ff,{'id':_0x1303ff,'groupId':_0x4ba34e['groupId'],'type':_0x4ba34e['type'],'content':_0x4ba34e['content']}),_0x38f822['addMarker'](_0x1303ff,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x38f822['createRange'](_0x4ba34e['start'],_0x4ba34e['end'])});}});}['_createGetContextFn'](_0x2e4f66,_0x11c292,_0x3d36ea){let _0x1508fa='';return()=>{if(!_0x1508fa){const _0x19c3a3=_0x11c292['toView'](_0x2e4f66,{'showSuggestionHighlights':!0x0});let _0x2818bc=_0x19c3a3['getChild'](0x0);if(_0x2818bc['is']('containerElement')||(_0x2818bc=_0x19c3a3),!_0x2818bc)return'';let _0x2a6e2e=!0x1;const _0x3cb538=[];for(const _0x4b9e3c of _0x2818bc['getChildren']())_0x4b9e3c['is']('element','span')&&_0x4b9e3c['hasClass']('ck-ai_review-marker_context-end')&&(_0x2a6e2e=!0x1),_0x2a6e2e&&_0x3cb538['push'](_0x4b9e3c),_0x4b9e3c['is']('element','span')&&_0x4b9e3c['hasClass']('ck-ai_review-marker_context-start')&&(_0x2a6e2e=!0x0);_0x2818bc['_removeChildren'](0x0,_0x2818bc['childCount']),_0x3d36ea?.['ellipsisBefore']&&_0x2818bc['_appendChild']('…'),_0x2818bc['_appendChild'](_0x3cb538),_0x3d36ea?.['ellipsisAfter']&&_0x2818bc['_appendChild']('…');const _0x197e1a=_0x11c292['htmlProcessor']['domConverter']['viewToDom'](_0x19c3a3),_0xa06d0d=_0x11c292['htmlProcessor']['htmlWriter']['getHtml'](_0x197e1a);_0x1508fa=_0xa06d0d;}return _0x1508fa;};}['_createGetContentFn'](_0x8a8f2d,_0x3c74f8){let _0x1e317b='';return()=>(_0x1e317b||(_0x1e317b=_0x3c74f8['stringify'](_0x8a8f2d,{'showSuggestionHighlights':!0x0})),_0x1e317b);}['_createGetContentUsingDataIdFn'](_0x24903f,_0x5d414c,_0x381fd1){let _0xde5b85='';return()=>{if(!_0xde5b85){const _0xe6ee67=_0x381fd1['toView'](new jt(_0x24903f)),_0x43e4ee=_0x381fd1['htmlProcessor']['domConverter']['viewToDom'](_0xe6ee67)['querySelector']('[data-id=\x22'+_0x5d414c+'\x22]');_0xde5b85=_0x43e4ee?.['outerHTML']||'';}return _0xde5b85;};}['_findMarkerElement'](_0x4f77c1,_0x361012=0x5){let _0x2bec87=_0x4f77c1,_0x531992=null;for(let _0x52f09b=0x0;_0x52f09b<_0x361012&&_0x2bec87;_0x52f09b++){if(!_0x2bec87['className']){_0x2bec87=_0x2bec87['parentElement'];continue;}if(!(''+_0x2bec87['className'])['includes']('ck-ai_review-marker_')){_0x2bec87=_0x2bec87['parentElement'];continue;}if(!_0x2bec87['getAttribute']('data-marker-id'))break;_0x531992=_0x2bec87;break;}return _0x531992;}['_findMarkerElementById'](_0x257581){const _0x4aa751=c(this['context']),_0x3540fb=_0x4aa751['model']['markers']['get'](_0x257581);return _0x3540fb?_0x470cd1(_0x4aa751['editing'],_0x3540fb):null;}['_getMarkersDataForGroup'](_0x52f526){return Array['from'](this['_markers']['values']())['filter'](_0x1daea6=>_0x1daea6['groupId']===_0x52f526);}['_getOperationStart'](_0x298179){return'insert'===_0x298179['type']?_0x298179['position']:_0x298179['newRange']['start'];}['_getOperationEnd'](_0x34bfe6,_0x2e4300=!0x1){return'insert'===_0x34bfe6['type']?_0x2e4300?_0x34bfe6['position']:_0x34bfe6['position']['getShiftedBy'](_0x34bfe6['howMany']):_0x34bfe6['newRange']['end'];}['_shiftOperation'](_0x43f508,_0x4f4711){return'insert'===_0x43f508['type']?_0x43f508['position']=_0x43f508['position']['getShiftedBy'](_0x4f4711):'marker'===_0x43f508['type']&&_0x43f508['newRange']&&(_0x43f508['newRange']=new dt(_0x43f508['newRange']['start']['getShiftedBy'](_0x4f4711),_0x43f508['newRange']['end']['getShiftedBy'](_0x4f4711))),_0x43f508;}['_changeOperationOwnerDocument'](_0x5f57b1,_0x33774f){'insert'===_0x5f57b1['type']?_0x5f57b1['position']=this['_changePositionOwnerDocument'](_0x5f57b1['position'],_0x33774f):'marker'===_0x5f57b1['type']&&_0x5f57b1['newRange']&&(_0x5f57b1['newRange']=this['_changeRangeOwnerDocument'](_0x5f57b1['newRange'],_0x33774f));}['_changePositionOwnerDocument'](_0x470829,_0x3008a0){return new Dt(_0x3008a0,_0x470829['path']);}['_changeRangeOwnerDocument'](_0x2f4774,_0x466d1f){return new dt(this['_changePositionOwnerDocument'](_0x2f4774['start'],_0x466d1f),this['_changePositionOwnerDocument'](_0x2f4774['end'],_0x466d1f));}['_changePosition'](_0x440785,_0x44de7b){return new Dt(_0x44de7b,[..._0x440785]);}['_changeRange'](_0x5e1835,_0x108b95,_0x810d5c,_0x2836a8){return new dt(this['_changePosition'](_0x108b95,_0x2836a8),this['_changePosition'](_0x810d5c,_0x2836a8));}['_sortMarkers'](_0x2b9450){const _0x156acd=_0x534ca3=>{switch(_0x534ca3){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x2b9450['sort']((_0x2188ba,_0x2306a0)=>_0x156acd(_0x2188ba['type'])-_0x156acd(_0x2306a0['type']));}['_hasSameTopLevelElement'](_0x3096cf,_0xd9b219){const _0x911fd7=_0x3096cf['getChild'](0x0),_0x42a125=_0xd9b219['getChild'](0x0);return!(!_0x911fd7||!_0x42a125)&&((!_0x911fd7['is']('element')||!_0x42a125['is']('element')||_0x911fd7['name']===_0x42a125['name'])&&!(_0x911fd7['is']('element')&&!_0x42a125['is']('element')||!_0x911fd7['is']('element')&&_0x42a125['is']('element')));}['_haveSingleTopLevelElement'](_0x4683d2){return 0x1===_0x4683d2['childCount'];}['_haveOnlyInlineContent'](_0x500c31,_0x22b57b){for(const _0x3d4a1b of _0x500c31['getChildren']())if(_0x3d4a1b['is']('element')&&!_0x22b57b['isInline'](_0x3d4a1b))return!0x1;return!0x0;}['_upsertDataId'](_0x4caa3e,_0x18f55c){let _0x400f98=_0x4caa3e['getAttribute'](nt);return _0x400f98||(_0x400f98=_0x18f55c(),_0x4caa3e['_setAttribute'](nt,_0x400f98)),_0x400f98;}}class Zs extends _0xa7ecb2(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x34f639,contentNew:_0x583af9,contentInitial:_0x765780,documentVersion:_0x5751a3}){super(),this['id']=_0x34f639,this['contentNew']=_0x583af9,this['contentInitial']=_0x765780,this['documentVersion']=_0x5751a3;}}class th extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x240c22,_0x40f21f,_0x46d467){super(),this['id']=_0x240c22,this['parent']=_0x46d467,this['_data']=_0x40f21f,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 eh extends ts(){['id']=_0x677d44();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x39da42,_0x334c8b,_0x4e31a8,_0x15e1a2,_0x237f5b){super(),this['_sourceCheck']=_0x334c8b,this['_documentData']=_0x39da42,this['_aiConnector']=_0x4e31a8,this['_reviewParams']=_0x15e1a2,this['_reviewArgs']=_0x237f5b,this['on']('change:status',(_0x3ef572,_0x82921e,_0x42b6ab)=>{'aborted'==_0x42b6ab&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x42b6ab,'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'](_0x524434=>'pending'===_0x524434['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x30d23b){this['_documentData']=_0x30d23b;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x3554cf=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x4a3db3 of _0x3554cf)'unmodified'!==_0x4a3db3['data']['operation']&&('error'!==_0x4a3db3['data']['operation']?'review-metadata'!==_0x4a3db3['event']?this['_addReviewCheckResult'](_0x4a3db3['data']['dataId'],_0x4a3db3['data']['textDelta']):this['callId']=_0x4a3db3['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(_0x5585b7){this['_currentError']=_0x5585b7,_0x5585b7 instanceof Error&&_0x5585b7['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'](_0x83de70,_0x4385c3){const _0x2a626a=this['_results']['get'](_0x83de70);if(!_0x2a626a)return;if(0x0===_0x4385c3['length'])return;const _0x3c73df=[];_0x4385c3['forEach']((_0x4b0515,_0x7eb897)=>{const _0x558974=new th(_0x2a626a['id']+'-'+_0x7eb897,_0x4b0515,_0x2a626a);_0x558974['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x558974,'status':_0x558974['status']});}),_0x558974['on']('change:isActivated',()=>{_0x558974['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x558974}):this['fire']('reviewCheckResultDeactivated',{'change':_0x558974});}),this['_changes']['push'](_0x558974),_0x3c73df['push'](_0x558974);}),this['fire']('reviewCheckResultReady',{'changes':_0x3c73df,'result':_0x2a626a,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x3dc984){const _0x1cdaa3=this['_changes']['find'](_0x300373=>_0x300373['id']===_0x3dc984);return!(!_0x1cdaa3||'pending'!==_0x1cdaa3['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x69f29f=>!0x0===_0x69f29f['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x4ee95f=>'pending'===_0x4ee95f['status']);}['getChangeById'](_0x133bb9){return this['_changes']['find'](_0x4790b6=>_0x4790b6['id']===_0x133bb9);}['markAllChangesAsAccepted'](){for(const _0x30576b of this['_changes'])'pending'===_0x30576b['status']&&(_0x30576b['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0xfa97ae){const _0xab2a86=this['_changes']['find'](_0x3c23ad=>_0x3c23ad['id']===_0xfa97ae);_0xab2a86&&'pending'===_0xab2a86['status']&&(_0xab2a86['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0xa4225a){const _0x2993bf=this['_changes']['find'](_0x2df6fe=>_0x2df6fe['id']===_0xa4225a);_0x2993bf&&'pending'===_0x2993bf['status']&&(_0x2993bf['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x35008c){const _0x29fd99=this['_changes']['find'](_0x1b7566=>_0x1b7566['id']===_0x35008c);_0x29fd99&&'pending'===_0x29fd99['status']&&(_0x29fd99['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x105449){const _0x853354=this['_changes']['find'](_0xc25f8a=>_0xc25f8a['id']===_0x105449);_0x853354&&'outdated'===_0x853354['status']&&(_0x853354['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x55e5ca){this['_changes']['filter'](_0x3633ba=>_0x3633ba['isActivated']&&_0x3633ba['id']!==_0x55e5ca)['forEach'](_0x26ae45=>{_0x26ae45['isActivated']=!0x1;});const _0xfa1592=this['_changes']['find'](_0x39d29b=>_0x39d29b['id']===_0x55e5ca);_0xfa1592&&'pending'===_0xfa1592['status']&&(_0xfa1592['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x38d5fd=>_0x38d5fd['isActivated'])['forEach'](_0x5d1b7a=>{_0x5d1b7a['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x1407b2){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x3b9853;if(_0x1407b2){const _0x2675d5=this['_changes']['find'](_0xba4d21=>_0xba4d21['id']===_0x1407b2);if(_0x2675d5&&_0x2675d5['isRated'])return;_0x2675d5&&(_0x3b9853=_0x2675d5['parent']['id'],_0x2675d5['isRated']=!0x0);}const _0x221dd2={'positiveCount':this['_changes']['filter'](_0x4a1a02=>'accepted'===_0x4a1a02['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x221dd2,this['callId'],_0x3b9853);}['_addReviewCheckResult'](_0x45fa3e,_0x1a0d6c){const _0x4f7480=this['_documentData']['elements']['get'](_0x45fa3e);if(!_0x4f7480)return;const _0x3b7e60=_0x4f7480['getContent']();if(_0x3b7e60===_0x1a0d6c)return;const _0x1220fb=new Zs({'id':_0x45fa3e,'contentInitial':_0x3b7e60,'contentNew':_0x1a0d6c,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x1220fb['id'],_0x1220fb),this['fire']('reviewCheckResultAdded',{'result':_0x1220fb,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x5103a1=>'pending'===_0x5103a1['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x909e63=>'pending'===_0x909e63['status'])['length']&&(this['status']='finished'));}}class si extends eh{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x26173c=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x21d964=0x0;_0x21d964<this['_reviewParams']['length'];_0x21d964++){if(!this['_reviewParams'][_0x21d964]||!this['_sourceCheck']['options'][_0x21d964])continue;const _0x4cac36=this['_sourceCheck']['options'][_0x21d964],_0x5a7c8c=_0x4cac36['data']?.['find'](_0x8a0b75=>_0x8a0b75['id']===this['_reviewParams'][_0x21d964]);_0x5a7c8c&&_0x26173c['push'](_0x5a7c8c['label']);}return _0x26173c['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x476aee,_0xf434ee,_0x4c4464){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0xf434ee,_0x476aee,_0x4c4464);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ve extends _0x5dcf5b{['_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(_0x5f055c,_0x43d9ee)=>{const _0x3f57de=this['_aiReviewCheckList']['getCheckById'](_0x43d9ee['id']);if(_0x3f57de){this['_onReviewCheckRun'](_0x43d9ee),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x43d9ee,_0x3f57de),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x313a9d,_0x105487)=>{switch(_0x105487['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x105487);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 _0x25c351('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x25c351('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'!==_0x105487['status']&&'error-chunk'!==_0x105487['status']&&'error-general'!==_0x105487['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x30d5aa,_0x4aa11b)=>{if(!this['_currentReviewCheckRun'])throw new _0x25c351('ai-review-mode-no-current-check-run',this);const _0x3d4f08=this['_diffContent'](_0x4aa11b['result']['contentInitial'],_0x4aa11b['result']['contentNew']);_0x4aa11b['source']['addResultChanges'](_0x4aa11b['result']['id'],_0x3d4f08);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0xbb4a01,_0x1b394f)=>{for(const _0x203cce of _0x1b394f['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x203cce);this['_markChangePositionInEditorContent'](_0x1b394f['changes'],_0x1b394f['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x19cbbd,_0x43d2a2)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x43d2a2['change']['id'],_0x43d2a2['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x2bcbdf,_0x4e0958)=>{this['_onReviewCheckResultActivated'](_0x4e0958);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0xa579b8){_0xa579b8 instanceof Error&&_0xa579b8['message']['includes']('ai-request-aborted')||(_0xa579b8 instanceof _0x25c351?this['_logError'](_0xa579b8):this['_logError'](new _0x25c351('ai-review-mode-check-run-failed',this,void 0x0,_0xa579b8)));}}else this['_logError'](new _0x25c351('ai-review-mode-source-check-not-found',this,{'checkId':_0x43d9ee['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 _0x2c428c=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x2c428c['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x2c428c['map'](_0x37f143=>_0x37f143['id']));const _0x5a4ea4=this['_currentReviewCheckRun'];_0x5a4ea4['markAllChangesAsAccepted'](),_0x5a4ea4['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x3fdb5e,_0x37151e)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x37151e['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x37151e['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x37151e['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x37151e['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x2fd826,_0x4dc964)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4dc964['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x4dc964['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x4dc964['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4dc964['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',(_0x33a141,_0x284846)=>{this['_onActivateChange'](_0x284846);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x4765b9,_0x1c788a)=>{this['_onDeactivateChange'](_0x1c788a);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x234bbb,_0x3c99c1)=>{this['_onChangeMarkerClicked'](_0x234bbb,_0x3c99c1);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x477499,_0x3c7373)=>{this['_onChangeMarkerHovered'](_0x477499,_0x3c7373);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x361235,_0x2db361)=>{this['_onChangeMarkerRemoved'](_0x361235,_0x2db361);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0xb97ce2,_0x2d106f)=>{this['_onChangeMarkerRestored'](_0xb97ce2,_0x2d106f);});}['_createReviewCheckRun'](_0xd68e3c,_0xbbe431){return new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0xbbe431,this['_aiConnector'],_0xd68e3c['params'],_0xd68e3c['args']);}['_onChangeMarkerRemoved'](_0x42d2c0,_0x324292){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x324292['changeId']);}['_onChangeMarkerRestored'](_0x2471db,_0x23f4f9){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x23f4f9['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x2f5cc7=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x2f5cc7&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x5030b1=this['_aiReviewCoreEditing']['getEditor']();_0x5030b1&&_0x5030b1['editing']['view']['change'](_0x1260e9=>{const _0x3844ee=_0x5030b1['editing']['view']['document']['getRoot']();_0x1260e9['removeClass']('ck-ai_review-diff',_0x3844ee),_0x1260e9['removeClass']('ck-ai_review-highlights',_0x3844ee),_0x1260e9['removeClass']('ck-ai-translate-mode-content',_0x3844ee);});}['_getTranslationWithDefault'](_0x36db25,_0x3b66ed){const _0x258c8c=h(this['context']['locale'],_0x36db25);return _0x258c8c===_0x36db25?_0x3b66ed:_0x258c8c;}['_logError'](_0x854468,_0x1b7603=!0x1){_0x2d18bd(_0x854468['message']),_0x1b7603||(_0x854468['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x12a4b9){if('content'===this['_changeActivationSource']){const _0x5e8bcb=this['_aiReviewCoreUi']['getChangeElement'](_0x12a4b9);_0x5e8bcb&&_0x2d39e3(_0x5e8bcb['closest']('.ck-ai_review__check-run-result')||_0x5e8bcb);}else{if('panel'===this['_changeActivationSource']){const _0x524756=this['_getChangeContentElement'](_0x12a4b9);if(!_0x524756)return;_0x517478({'target':_0x524756,'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 Ys{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x26a772){this['id']=_0x26a772['id'],this['commandId']=_0x26a772['commandId'],this['title']=_0x26a772['title'],this['description']=_0x26a772['description'],this['isParameterized']=_0x26a772['isParameterized'],this['useArgs']=_0x26a772['useArgs'],this['options']=_0x26a772['options'],this['args']=_0x26a772['args'];}}class vo extends ts(){['_checks']=[];['setupChecks'](_0x114956){this['_checks']=_0x114956['map'](_0x30fcc3=>new Ys(_0x30fcc3));}get['checks'](){return this['_checks'];}['getCheckById'](_0x127bf4){return this['checks']['find'](_0x56ba06=>_0x56ba06['id']===_0x127bf4);}['removeCheckById'](_0x1b1679){this['_checks']=this['_checks']['filter'](_0x33cf3a=>_0x33cf3a['id']!==_0x1b1679);}}class ke extends Ys{['_models']=[];['_defaultModel']=null;constructor(_0x4d6136,_0x5a71b3,_0x2d28ce){super(_0x4d6136),this['_models']=_0x5a71b3,this['_defaultModel']=_0x2d28ce;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Ie extends Ys{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x5b16,_0x31cff7,_0x2e707b){super(_0x5b16),this['prompt']=_0x5b16['prompt'],this['model']=_0x5b16['model'],this['model']?this['_defaultModel']=_0x31cff7['find'](_0x1318d2=>_0x1318d2['id']===this['model'])||null:this['_defaultModel']=_0x2e707b;}get['defaultModel'](){return this['_defaultModel'];}}class _e extends vo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x369ff9,_0x27568a,_0x58f43f){super(),this['_allModels']=_0x369ff9,this['_recommendedModels']=_0x27568a,this['_defaultModel']=_0x58f43f;}['setupChecks'](_0x58ddde){this['_checks']=_0x58ddde['map'](_0x1b2752=>!0x0===_0x1b2752['isExtra']?new Ie(_0x1b2752,this['_allModels'],this['_defaultModel']):'custom'===_0x1b2752['id']?new ke(_0x1b2752,this['_recommendedModels'],this['_defaultModel']):new Ys(_0x1b2752));}}class Ce extends eh{['_prompt'];['_model'];constructor(_0x2bd119,_0x59e936,_0x1cdf7c,_0x7a31f0,_0x29f9d0){super(_0x1cdf7c,_0x7a31f0,_0x29f9d0),this['_prompt']=_0x2bd119,this['_model']=_0x59e936;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x3189fb,_0x38dd83,_0x2eb9c7){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x38dd83,_0x3189fb,_0x2eb9c7);}}class Re extends Ce{get['subTitle'](){return'';}set['prompt'](_0x58ec75){this['_prompt']=_0x58ec75;}set['model'](_0x352505){this['_model']=_0x352505;}}class pe extends ve{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x110b20){super(_0x110b20),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',we['map'](_0x50bb91=>_0x50bb91['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x4184cb,_0x5e5cd9)=>{this['_isDiffOn']=_0x5e5cd9['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x49ce83,_0xa791e3){return _0x49ce83['isCustom']?new Ce(_0x49ce83['args']['prompt'],_0x49ce83['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0xa791e3,this['_aiConnector']):_0xa791e3['isExtra']?new Re(_0xa791e3['prompt'],_0xa791e3['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0xa791e3,this['_aiConnector']):new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0xa791e3,this['_aiConnector'],_0x49ce83['params'],_0x49ce83['args']);}['_onReviewCheckResultActivated'](_0x1469f9){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x1469f9['change']['id']),this['_scrollToChange'](_0x1469f9['change']['id']);const _0x2af859=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1469f9['change']['id']);if(!_0x2af859)return;const _0x1aff86=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x1469f9['change'],()=>_0x2af859['getElement'](),void 0x0,'click',_0x1aff86?.['editing']?.['view']?.['getDomRoot'](),_0x1aff86?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x1469f9['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x37cc8c){this['_currentReviewCheckRun']&&'click'===_0x37cc8c['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x37cc8c['id']));}['_onDeactivateChange'](_0xec506c){this['_currentReviewCheckRun']&&'balloon'===_0xec506c['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0xbc543f,_0x52f743){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x52f743['changeId']);const _0x188476=this['_currentReviewCheckRun']['getChangeById'](_0x52f743['changeId']);if(!_0x188476)return;const _0x5e9f5b=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x188476,_0x52f743['markerElement'],_0x52f743['domEvent'],'click',_0x5e9f5b?.['editing']?.['view']?.['getDomRoot'](),_0x5e9f5b?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x578684,_0x422166){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x3a19f2=this['_currentReviewCheckRun']['getChangeById'](_0x422166['changeId']);if(!_0x3a19f2)return;const _0x49f099=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x3a19f2,_0x422166['markerElement'],_0x422166['domEvent'],'hover',_0x49f099?.['editing']?.['view']?.['getDomRoot'](),_0x49f099?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x57f9c1){const _0x464bb8=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x57f9c1);return _0x464bb8?_0x464bb8['getElement']():null;}['_markChangePositionInEditorContent'](_0x27657c,_0x12f77a){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x27657c,_0x12f77a);}['_diffContent'](_0x382d93,_0x4b2dfe){return this['_aiReviewCoreEditing']['diffContent'](_0x382d93,_0x4b2dfe);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x3f184a){const _0x41536c=this['_aiReviewCoreEditing']['getEditor']();_0x3f184a?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x41536c&&_0x41536c['editing']['view']['change'](_0x497acc=>{const _0x4bba2f=_0x41536c['editing']['view']['document']['getRoot']();for(const _0x3542cc of _0x4bba2f['getClassNames']())_0x3542cc['startsWith']('ck-ai_review-')&&_0x497acc['removeClass'](_0x3542cc,_0x4bba2f);_0x497acc['addClass'](_0x3f184a?'ck-ai_review-diff':'ck-ai_review-highlights',_0x4bba2f);});}async['_getChecksList'](){const _0x35f7a6=[...we,...this['_getExtraChecks']()],_0x5a0da3=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x5a0da3,_0x35f7a6);let _0x85e0bd=_0x35f7a6;this['_hasDefaultAvailableCommands']||(_0x85e0bd=_0x5a0da3['map'](_0x1390f5=>_0x35f7a6['find'](_0x5bd1be=>_0x5bd1be['id']===_0x1390f5))['filter'](_0x453c78=>!!_0x453c78)),_0x85e0bd=_0x85e0bd['map'](_0x1ff485=>_0x1ff485['isExtra']?_0x1ff485:this['_translateReviewCheck'](_0x1ff485));const _0x9e0669=_0x85e0bd['some'](_0x1633ed=>_0x1633ed['isExtra']||'custom'===_0x1633ed['id']);let _0xc2ebec=[],_0x3216cd=[],_0x5ca8e3=null;if(_0x9e0669){const _0x3250a1=await this['_getModels']();_0xc2ebec=_0x3250a1['all'],_0x3216cd=_0x3250a1['recommended'],_0x5ca8e3=_0x3250a1['default'];}const _0x4d3a3a=new _e(_0xc2ebec,_0x3216cd,_0x5ca8e3);return _0x4d3a3a['setupChecks'](_0x85e0bd),_0x9e0669&&this['_filterChecksWithMissingModel'](_0x4d3a3a),_0x4d3a3a;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x178938=>({'id':_0x178938['id'],'commandId':_0x178938['id'],'title':_0x178938['label'],'description':_0x178938['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x178938['prompt'],'model':_0x178938['model']}));}['_logErrorForNonExistentChecks'](_0x18b6a4,_0x4df08c){const _0x5a7654=_0x18b6a4['filter'](_0x5f4f08=>!_0x4df08c['some'](_0x3811bf=>_0x3811bf['id']===_0x5f4f08));_0x5a7654['length']&&this['_logError'](new _0x25c351('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x5a7654['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x54816c=new et({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x54816c['getAll'](),'recommended':await _0x54816c['getAvailableModels'](),'default':await _0x54816c['getDefault']()};}catch(_0x8853e6){return this['_logError'](new _0x25c351('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x8853e6)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x262f56){const _0x2311a1='AI_REVIEW_CHECK_'+_0x262f56['id']['toUpperCase']()['replaceAll']('-','_'),_0x4e34fd={..._0x262f56,'title':this['_getTranslationWithDefault'](_0x2311a1+'_TITLE',_0x262f56['title']),'description':this['_getTranslationWithDefault'](_0x2311a1+'_DESCRIPTION',_0x262f56['description'])};return _0x262f56['options']&&(_0x4e34fd['options']=_0x262f56['options']['map'](_0x2a8b2a=>({..._0x2a8b2a,'label':this['_getTranslationWithDefault'](_0x2311a1+'_OPTIONS_LABEL',_0x2a8b2a['label']||''),'data':_0x2a8b2a['data']?_0x2a8b2a['data']['map'](_0x489026=>({..._0x489026,'label':this['_getTranslationWithDefault'](_0x2311a1+'_OPTIONS_DATA_'+_0x489026['id']['toUpperCase'](),_0x489026['label'])})):void 0x0}))),_0x4e34fd;}['_filterChecksWithMissingModel'](_0x488a3b){const _0x5d75eb=[];_0x488a3b['checks']['forEach'](_0x641c5b=>{(_0x641c5b instanceof Ie&&!_0x641c5b['defaultModel']||_0x641c5b instanceof ke&&!_0x641c5b['models']['length'])&&_0x5d75eb['push'](_0x641c5b['id']);}),_0x5d75eb['length']&&_0x5d75eb['forEach'](_0x202f5b=>{_0x488a3b['removeCheckById'](_0x202f5b),this['_logError'](new _0x25c351('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x202f5b}),!0x0);});}}class Ka extends _0x5dcf5b{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 Ys{get['apiId'](){return'translate';}}class Pe extends vo{['setupChecks'](_0x3bf9c5){this['_checks']=_0x3bf9c5['map'](_0x1bdc76=>new jr(_0x1bdc76));}}class Se extends si{['_title'];constructor(_0x1f1c2c,_0x2f1a78,_0x3ca925,_0x59e8d3,_0x105e4c,_0xfd4741){super(_0x1f1c2c,_0x2f1a78,_0x3ca925,_0x105e4c,_0xfd4741),this['_title']=_0x59e8d3;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ve{static get['pluginName'](){return'AITranslateController';}constructor(_0x55ff5f){super(_0x55ff5f),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'](_0x482473,_0x3775f6){return new Se(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3775f6,this['_aiConnector'],h(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x482473['params'],_0x482473['args']);}['_onReviewCheckResultActivated'](_0x5897eb){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x5897eb['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x5897eb['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x8d4f70){this['_currentReviewCheckRun']&&('hover'===_0x8d4f70['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x8d4f70['id'])),'click'===_0x8d4f70['uiInteraction']&&this['_scrollToChange'](_0x8d4f70['id']));}['_onDeactivateChange'](_0x4d1e9e){this['_currentReviewCheckRun']&&'panel'===_0x4d1e9e['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x3b4b55,_0x4929c4){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x4929c4['changeId']),this['_scrollToChange'](_0x4929c4['changeId']));}['_onChangeMarkerHovered'](_0x916d,_0x58af42){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x58af42['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x58af42['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x5d22be){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x5d22be);}['_markChangePositionInEditorContent'](_0x2a69b7,_0x3cd908){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x2a69b7,_0x3cd908);}['_diffContent'](_0x3d6a7b,_0x1619d5){return this['_aiReviewCoreEditing']['diffContent'](_0x3d6a7b,_0x1619d5,!0x0);}['_onReviewCheckRun'](){const _0x587e55=this['_aiReviewCoreEditing']['getEditor']();_0x587e55&&_0x587e55['editing']['view']['change'](_0x8a539f=>{const _0x3dbfa4=_0x587e55['editing']['view']['document']['getRoot']();for(const _0x26a1da of _0x3dbfa4['getClassNames']())(_0x26a1da['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x26a1da)&&_0x8a539f['removeClass'](_0x26a1da,_0x3dbfa4);_0x8a539f['addClass']('ck-ai-translate-mode-content',_0x3dbfa4);});}async['_getChecksList'](){const _0x21cd9e=[],_0x3f3b53=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x29afa1 of _0x3f3b53)_0x21cd9e['push']({'title':_0x29afa1['label'],'id':_0x29afa1['id'],'commandId':_0x29afa1['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x29afa1['id']}});const _0x2ba717=new Pe();return _0x2ba717['setupChecks'](this['_translateChecks'](_0x21cd9e)),_0x2ba717;}['_translateChecks'](_0x267ba4){return _0x267ba4['map'](_0x4d2d15=>{const _0x1f5c53='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x4d2d15['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x4d2d15,'title':this['_getTranslationWithDefault'](_0x1f5c53,_0x4d2d15['title'])};});}}class Le extends Ve{constructor(_0x5e4fc2,_0x44af0b){super(_0x5e4fc2,_0x44af0b),this['on']('set:isLoading',(_0x5743c8,_0x12dad3,_0x551398)=>{_0x551398&&(this['headerTitle']=h(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x5b57b5,_0xe178f5,_0x4ed8bb)=>{_0x4ed8bb&&(this['headerTitle']=h(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x4f1e77=super['_createAcceptAllButtonView']();return _0x4f1e77['set']('label',h(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x4f1e77;}['_createExitReviewButtonView'](){const _0x41da7a=super['_createExitReviewButtonView']();return _0x41da7a['set']('label',h(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x41da7a;}}class Ne extends je{['_setupTemplate'](){const _0x2f379a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x2f379a['if']('isVisible','ck-hidden',_0x2cd368=>!_0x2cd368)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':h(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':h(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x2f379a['if']('isVisible','ck-hidden',_0x5c5eaf=>!_0x5c5eaf)]},'children':this['_checkViews']}]});}}class tr extends Me{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x28b135=this['context']['locale'],_0x342cc8=new _0x337d54(_0x28b135,{'label':h(_0x28b135,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x4cfcba,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x8f257e=new Ae(_0x28b135,{'header':_0x342cc8,'list':new Ne(_0x28b135),'results':new Le(_0x28b135,{'generalErrorText':h(_0x28b135,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new be(_0x28b135,{'headerText':h(_0x28b135,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':h(_0x28b135,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':h(_0x28b135,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x8f257e['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x8f257e;}['registerTab'](){const _0x141ef6=this['context']['plugins']['get']('AITabs');_0x141ef6['view']['on']('activateTab',(_0x1bcaf5,_0x4b4722)=>{'translate'===_0x4b4722?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x141ef6['view']['addTab']({'id':'translate','buttonLabel':h(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x4cfcba,'order':0x0,'content':this['_mainView']});}}class Wa extends _0x5dcf5b{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,$ as AIAdapter,$n as AIAssistant,g as AIAssistantUI,R as AIBalloon,Ma as AIChat,S as AIChatController,z as AIChatHistory,ft as AIChatHistoryController,yt as AIChatHistoryUI,Va as AIChatShortcuts,F as AIChatUI,tt as AIConnector,s as AIEditing,Ba as AIEditorIntegration,Qt as AIQuickActionType,Fa as AIQuickActions,ii as AIQuickActionsUI,er as AIRequestError,Ys as AIReviewCheck,Zs as AIReviewCheckResult,eh as AIReviewCheckRun,Ka as AIReviewMode,ve as AIReviewModeController,de as AIReviewModeEditing,ge as AIReviewModeUI,it as AITabs,ye as AITextAdapter,Pt as AIToggleButtonUI,Wa as AITranslate,rr as AITranslateController,tr as AITranslateUI,Xn as AWSTextAdapter,Qn as OpenAITextAdapter,D as ShowAIAssistantCommand,io as ToggleAICommand,Hs as createResizeButton,qn as getDefaultAICommands};