@ckeditor/ckeditor5-ai 47.3.0-alpha.2 → 47.3.0-alpha.4

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 (298) hide show
  1. package/build/ai.js +1 -1
  2. package/dist/index-editor.css +18 -11
  3. package/dist/index.css +19 -11
  4. package/dist/index.js +5 -5
  5. package/dist/translations/af.js +1 -1
  6. package/dist/translations/af.umd.js +1 -1
  7. package/dist/translations/ar.js +1 -1
  8. package/dist/translations/ar.umd.js +1 -1
  9. package/dist/translations/ast.js +1 -1
  10. package/dist/translations/ast.umd.js +1 -1
  11. package/dist/translations/az.js +1 -1
  12. package/dist/translations/az.umd.js +1 -1
  13. package/dist/translations/be.js +1 -1
  14. package/dist/translations/be.umd.js +1 -1
  15. package/dist/translations/bg.js +1 -1
  16. package/dist/translations/bg.umd.js +1 -1
  17. package/dist/translations/bn.js +1 -1
  18. package/dist/translations/bn.umd.js +1 -1
  19. package/dist/translations/bs.js +1 -1
  20. package/dist/translations/bs.umd.js +1 -1
  21. package/dist/translations/ca.js +1 -1
  22. package/dist/translations/ca.umd.js +1 -1
  23. package/dist/translations/cs.js +1 -1
  24. package/dist/translations/cs.umd.js +1 -1
  25. package/dist/translations/da.js +1 -1
  26. package/dist/translations/da.umd.js +1 -1
  27. package/dist/translations/de-ch.js +1 -1
  28. package/dist/translations/de-ch.umd.js +1 -1
  29. package/dist/translations/de.js +1 -1
  30. package/dist/translations/de.umd.js +1 -1
  31. package/dist/translations/el.js +1 -1
  32. package/dist/translations/el.umd.js +1 -1
  33. package/dist/translations/en-au.js +1 -1
  34. package/dist/translations/en-au.umd.js +1 -1
  35. package/dist/translations/en-gb.js +1 -1
  36. package/dist/translations/en-gb.umd.js +1 -1
  37. package/dist/translations/en.js +1 -1
  38. package/dist/translations/en.umd.js +1 -1
  39. package/dist/translations/eo.js +1 -1
  40. package/dist/translations/eo.umd.js +1 -1
  41. package/dist/translations/es-co.js +1 -1
  42. package/dist/translations/es-co.umd.js +1 -1
  43. package/dist/translations/es.js +1 -1
  44. package/dist/translations/es.umd.js +1 -1
  45. package/dist/translations/et.js +1 -1
  46. package/dist/translations/et.umd.js +1 -1
  47. package/dist/translations/eu.js +1 -1
  48. package/dist/translations/eu.umd.js +1 -1
  49. package/dist/translations/fa.js +1 -1
  50. package/dist/translations/fa.umd.js +1 -1
  51. package/dist/translations/fi.js +1 -1
  52. package/dist/translations/fi.umd.js +1 -1
  53. package/dist/translations/fr.js +1 -1
  54. package/dist/translations/fr.umd.js +1 -1
  55. package/dist/translations/gl.js +1 -1
  56. package/dist/translations/gl.umd.js +1 -1
  57. package/dist/translations/gu.js +1 -1
  58. package/dist/translations/gu.umd.js +1 -1
  59. package/dist/translations/he.js +1 -1
  60. package/dist/translations/he.umd.js +1 -1
  61. package/dist/translations/hi.js +1 -1
  62. package/dist/translations/hi.umd.js +1 -1
  63. package/dist/translations/hr.js +1 -1
  64. package/dist/translations/hr.umd.js +1 -1
  65. package/dist/translations/hu.js +1 -1
  66. package/dist/translations/hu.umd.js +1 -1
  67. package/dist/translations/hy.js +1 -1
  68. package/dist/translations/hy.umd.js +1 -1
  69. package/dist/translations/id.js +1 -1
  70. package/dist/translations/id.umd.js +1 -1
  71. package/dist/translations/it.js +1 -1
  72. package/dist/translations/it.umd.js +1 -1
  73. package/dist/translations/ja.js +1 -1
  74. package/dist/translations/ja.umd.js +1 -1
  75. package/dist/translations/jv.js +1 -1
  76. package/dist/translations/jv.umd.js +1 -1
  77. package/dist/translations/kk.js +1 -1
  78. package/dist/translations/kk.umd.js +1 -1
  79. package/dist/translations/km.js +1 -1
  80. package/dist/translations/km.umd.js +1 -1
  81. package/dist/translations/kn.js +1 -1
  82. package/dist/translations/kn.umd.js +1 -1
  83. package/dist/translations/ko.js +1 -1
  84. package/dist/translations/ko.umd.js +1 -1
  85. package/dist/translations/ku.js +1 -1
  86. package/dist/translations/ku.umd.js +1 -1
  87. package/dist/translations/lt.js +1 -1
  88. package/dist/translations/lt.umd.js +1 -1
  89. package/dist/translations/lv.js +1 -1
  90. package/dist/translations/lv.umd.js +1 -1
  91. package/dist/translations/ms.js +1 -1
  92. package/dist/translations/ms.umd.js +1 -1
  93. package/dist/translations/nb.js +1 -1
  94. package/dist/translations/nb.umd.js +1 -1
  95. package/dist/translations/ne.js +1 -1
  96. package/dist/translations/ne.umd.js +1 -1
  97. package/dist/translations/nl.js +1 -1
  98. package/dist/translations/nl.umd.js +1 -1
  99. package/dist/translations/no.js +1 -1
  100. package/dist/translations/no.umd.js +1 -1
  101. package/dist/translations/oc.js +1 -1
  102. package/dist/translations/oc.umd.js +1 -1
  103. package/dist/translations/pl.js +1 -1
  104. package/dist/translations/pl.umd.js +1 -1
  105. package/dist/translations/pt-br.js +1 -1
  106. package/dist/translations/pt-br.umd.js +1 -1
  107. package/dist/translations/pt.js +1 -1
  108. package/dist/translations/pt.umd.js +1 -1
  109. package/dist/translations/ro.js +1 -1
  110. package/dist/translations/ro.umd.js +1 -1
  111. package/dist/translations/ru.js +1 -1
  112. package/dist/translations/ru.umd.js +1 -1
  113. package/dist/translations/si.js +1 -1
  114. package/dist/translations/si.umd.js +1 -1
  115. package/dist/translations/sk.js +1 -1
  116. package/dist/translations/sk.umd.js +1 -1
  117. package/dist/translations/sl.js +1 -1
  118. package/dist/translations/sl.umd.js +1 -1
  119. package/dist/translations/sq.js +1 -1
  120. package/dist/translations/sq.umd.js +1 -1
  121. package/dist/translations/sr-latn.js +1 -1
  122. package/dist/translations/sr-latn.umd.js +1 -1
  123. package/dist/translations/sr.js +1 -1
  124. package/dist/translations/sr.umd.js +1 -1
  125. package/dist/translations/sv.js +1 -1
  126. package/dist/translations/sv.umd.js +1 -1
  127. package/dist/translations/th.js +1 -1
  128. package/dist/translations/th.umd.js +1 -1
  129. package/dist/translations/ti.js +1 -1
  130. package/dist/translations/ti.umd.js +1 -1
  131. package/dist/translations/tk.js +1 -1
  132. package/dist/translations/tk.umd.js +1 -1
  133. package/dist/translations/tr.js +1 -1
  134. package/dist/translations/tr.umd.js +1 -1
  135. package/dist/translations/tt.js +1 -1
  136. package/dist/translations/tt.umd.js +1 -1
  137. package/dist/translations/ug.js +1 -1
  138. package/dist/translations/ug.umd.js +1 -1
  139. package/dist/translations/uk.js +1 -1
  140. package/dist/translations/uk.umd.js +1 -1
  141. package/dist/translations/ur.js +1 -1
  142. package/dist/translations/ur.umd.js +1 -1
  143. package/dist/translations/uz.js +1 -1
  144. package/dist/translations/uz.umd.js +1 -1
  145. package/dist/translations/vi.js +1 -1
  146. package/dist/translations/vi.umd.js +1 -1
  147. package/dist/translations/zh-cn.js +1 -1
  148. package/dist/translations/zh-cn.umd.js +1 -1
  149. package/dist/translations/zh.js +1 -1
  150. package/dist/translations/zh.umd.js +1 -1
  151. package/package.json +15 -15
  152. package/src/aiactions/aiactions.js +1 -1
  153. package/src/aiactions/model/aiactionsinteraction.js +1 -1
  154. package/src/aiactions/model/aiactionsreply.js +1 -1
  155. package/src/aiassistant/adapters/aiadapter.js +1 -1
  156. package/src/aiassistant/adapters/aitextadapter.js +1 -1
  157. package/src/aiassistant/adapters/awstextadapter.js +1 -1
  158. package/src/aiassistant/adapters/openaitextadapter.js +1 -1
  159. package/src/aiassistant/aiassistant.js +1 -1
  160. package/src/aiassistant/aiassistantediting.js +1 -1
  161. package/src/aiassistant/aiassistantui.js +1 -1
  162. package/src/aiassistant/legacyerrors.js +1 -1
  163. package/src/aiassistant/ui/aiassistantcontroller.js +2 -2
  164. package/src/aiassistant/ui/form/aiformcontentarea.js +1 -1
  165. package/src/aiassistant/ui/form/aiformerrorview.js +1 -1
  166. package/src/aiassistant/ui/form/aiformpromptview.js +1 -1
  167. package/src/aiassistant/ui/form/aiformtoolbarview.js +1 -1
  168. package/src/aiassistant/ui/form/aiformview.js +1 -1
  169. package/src/aiassistant/ui/form/aihistorylistitemview.js +1 -1
  170. package/src/aiassistant/ui/form/aihistorylistview.js +1 -1
  171. package/src/aiassistant/ui/form/prompthistory.js +1 -1
  172. package/src/aiassistant/ui/showaiassistantcommand.js +1 -1
  173. package/src/aiassistant/utils/common-translations.js +1 -1
  174. package/src/aiassistant/utils/normalizecommandsconfig.js +1 -1
  175. package/src/aiballoon/aiballoon.js +1 -1
  176. package/src/aiballoon/ui/aiballoondisclaimerview.js +1 -1
  177. package/src/aiballoon/ui/aiballoontoolbarview.js +1 -1
  178. package/src/aiballoon/ui/aiballoonview.js +1 -1
  179. package/src/aichat/aichat.js +1 -1
  180. package/src/aichat/aichatcontroller.js +1 -1
  181. package/src/aichat/aichatui.js +1 -1
  182. package/src/aichat/model/aichatcontext.js +1 -1
  183. package/src/aichat/model/aichatconversation.js +1 -1
  184. package/src/aichat/model/aichatinteraction.js +1 -1
  185. package/src/aichat/model/aichatmodels.js +1 -1
  186. package/src/aichat/ui/aichatcontrolsview.js +1 -1
  187. package/src/aichat/ui/aichatfeedview.js +1 -1
  188. package/src/aichat/ui/aichatheaderview.js +1 -1
  189. package/src/aichat/ui/aichatview.js +1 -1
  190. package/src/aichat/ui/controls/aichatchipsoverflowmanager.js +1 -1
  191. package/src/aichat/ui/controls/aichatcontextitembuttonview.js +1 -1
  192. package/src/aichat/ui/controls/aichatcontextpanelurlinputview.js +1 -1
  193. package/src/aichat/ui/controls/aichatcontextpanelview.js +1 -1
  194. package/src/aichat/ui/controls/aichatcontrolsloaderview.js +1 -1
  195. package/src/aichat/ui/controls/aichatpromptcapabilitiesview.js +1 -1
  196. package/src/aichat/ui/controls/aichatpromptinputview.js +1 -1
  197. package/src/aichat/ui/controls/aichatpromptsuggestionslistview.js +1 -1
  198. package/src/aichat/ui/controls/resources/aichatcontextresourceslistview.js +1 -1
  199. package/src/aichat/ui/controls/resources/aichatcontextresourcesview.js +1 -1
  200. package/src/aichat/ui/controls/resources/aichatresourcelistitemview.js +1 -1
  201. package/src/aichat/ui/controls/resources/aichatresourcesballoonview.js +1 -1
  202. package/src/aichat/ui/controls/resources/aichatresourcessearchinputview.js +1 -1
  203. package/src/aichat/ui/feed/aichatfeedcontextchipsview.js +1 -1
  204. package/src/aichat/ui/feed/aichatfeederroritemview.js +1 -1
  205. package/src/aichat/ui/feed/aichatfeedinteractionheaderview.js +1 -1
  206. package/src/aichat/ui/feed/aichatfeeditemview.js +1 -1
  207. package/src/aichat/ui/feed/aichatfeedreplyitemview.js +1 -1
  208. package/src/aichat/ui/feed/aichatfeedsuggestionitemactionsview.js +1 -1
  209. package/src/aichat/ui/feed/aichatfeedsuggestionitemview.js +1 -1
  210. package/src/aichat/ui/feed/aichatfeedusermessageitem.js +1 -1
  211. package/src/aichat/utils/eventnames.js +1 -1
  212. package/src/aichat/utils/promisequeue.js +1 -1
  213. package/src/aichathistory/aichathistory.js +1 -1
  214. package/src/aichathistory/aichathistorycontroller.js +1 -1
  215. package/src/aichathistory/aichathistoryui.js +1 -1
  216. package/src/aichathistory/model/aichathistoryconversations.js +1 -1
  217. package/src/aichathistory/model/aichathistoryitem.js +1 -1
  218. package/src/aichathistory/ui/aichathistorylistitemview.js +2 -2
  219. package/src/aichathistory/ui/aichathistorylistview.js +1 -1
  220. package/src/aichathistory/ui/aichathistorysectionlistview.js +1 -1
  221. package/src/aichathistory/ui/aichathistoryview.d.ts +1 -0
  222. package/src/aichathistory/ui/aichathistoryview.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/aisuggestioncontentpartview.js +1 -1
  239. package/src/aicore/ui/suggestioncontainer/aisuggestionheaderview.js +1 -1
  240. package/src/aicore/utils/common-translations.js +1 -1
  241. package/src/aicore/utils/createresizebutton.js +1 -1
  242. package/src/aicore/utils/documentposition.js +1 -1
  243. package/src/aicore/utils/documentrange.js +1 -1
  244. package/src/aicore/utils/eventnames.js +1 -1
  245. package/src/aicore/utils/geteditorfromcontext.js +1 -1
  246. package/src/aicore/utils/getoperationsfromreply.js +1 -1
  247. package/src/aicore/utils/getsuggestionpartsfromreply.js +1 -1
  248. package/src/aicore/utils/htmlparser.js +1 -1
  249. package/src/aicore/utils/htmlstreamer.js +1 -1
  250. package/src/aicore/utils/scrollmanager.js +1 -1
  251. package/src/aieditorintegration/aieditorintegration.js +1 -1
  252. package/src/aieditorintegration/aitogglebutton/aitogglebuttonui.js +1 -1
  253. package/src/aieditorintegration/aitogglebutton/toggleaicommand.js +1 -1
  254. package/src/aiquickactions/aiquickactions.js +1 -1
  255. package/src/aiquickactions/aiquickactionscommand.js +1 -1
  256. package/src/aiquickactions/aiquickactionsediting.js +1 -1
  257. package/src/aiquickactions/aiquickactionsui.js +1 -1
  258. package/src/aiquickactions/ui/aiquickactionsbuttoncreator.js +1 -1
  259. package/src/aiquickactions/ui/aiquickactionsdropdowncontentview.js +1 -1
  260. package/src/aiquickactions/ui/aiquickactionsdropdowncreator.js +1 -1
  261. package/src/aiquickactions/ui/aiquickactionsfilteredlistview.js +1 -1
  262. package/src/aiquickactions/ui/dropdownmenubuttonwithhighlightview.js +1 -1
  263. package/src/aireviewmode/aireviewcheckdefinitions.js +1 -1
  264. package/src/aireviewmode/aireviewmode.js +1 -1
  265. package/src/aireviewmode/aireviewmodecontroller.js +1 -1
  266. package/src/aireviewmode/aireviewmodeediting.js +1 -1
  267. package/src/aireviewmode/aireviewmodeui.js +1 -1
  268. package/src/aireviewmode/model/aireviewcheck.js +1 -1
  269. package/src/aireviewmode/model/aireviewcheckcustom.js +1 -1
  270. package/src/aireviewmode/model/aireviewchecklist.js +1 -1
  271. package/src/aireviewmode/model/aireviewcheckresult.js +1 -1
  272. package/src/aireviewmode/model/aireviewcheckresultchange.js +1 -1
  273. package/src/aireviewmode/model/aireviewcheckrun.js +1 -1
  274. package/src/aireviewmode/model/aireviewcustomcheckrun.js +1 -1
  275. package/src/aireviewmode/model/aireviewsystemcheckrun.js +1 -1
  276. package/src/aireviewmode/ui/aireviemodepromptinputview.js +1 -1
  277. package/src/aireviewmode/ui/aireviewmodeballoonsuggestionview.js +1 -1
  278. package/src/aireviewmode/ui/aireviewmodechecklistitemresultview.js +1 -1
  279. package/src/aireviewmode/ui/aireviewmodecustomcheckview.js +1 -1
  280. package/src/aireviewmode/ui/aireviewmodefinishreviewbuttonview.js +1 -1
  281. package/src/aireviewmode/ui/aireviewmodegeneralerrorview.js +1 -1
  282. package/src/aireviewmode/ui/aireviewmodereviewchecklistview.js +1 -1
  283. package/src/aireviewmode/ui/aireviewmodereviewcheckresultsview.js +1 -1
  284. package/src/aireviewmode/ui/aireviewmodereviewcommandlistitemview.js +1 -1
  285. package/src/aireviewmode/ui/aireviewmodereviewcompletedview.js +1 -1
  286. package/src/aireviewmode/ui/aireviewmodeview.js +1 -1
  287. package/src/aireviewmode/ui/form/aireviewmodeformdropdown.js +1 -1
  288. package/src/aireviewmode/ui/form/aireviewmodeformmanager.js +1 -1
  289. package/src/aitabs/aitabs.js +1 -1
  290. package/src/aitabs/aitabsmainview.js +1 -1
  291. package/src/aitabs/tabs/aitabsview.js +1 -1
  292. package/src/aitabs/tabs/tabbuttonview.js +1 -1
  293. package/src/aitabs/tabs/tabpanelview.js +1 -1
  294. package/src/errors.js +1 -1
  295. package/src/errorsmap.js +1 -1
  296. package/src/index.js +1 -1
  297. package/theme/aiballoon/aiballoon.css +2 -1
  298. package/theme/aiquickactions/aiquickactions.css +17 -10
package/dist/index.js CHANGED
@@ -20,8 +20,8 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x2a4cc7,Command as At,ContextPlugin as _0x4404b9,Editor as _0x1e9e1e}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x4559bc,IconCheck as _0x2a5a64,IconError as _0x1b5390,IconSubmit as _0x47a449,IconAIHistory as It,IconMagicWand as _0x5253a5,IconRobotPencil as ti,IconMaximize as _0x1d3e4d,IconMinimize as to,IconDocumentWithLoupe as _0x4c9c07,IconAddComment as _0x36635b,IconShowChangesOn as _0x7a6747,IconShowChangesOff as _0x5cd197,IconDocument as _0x7efb12,IconThreeStars as _0x4e7318,IconRemove as _0x55fa0e,IconDocumentWithCheckmark as _0x1fca69,IconDocumentWithCross as _0x37a396,IconLoupe as _0x23aea4,IconCancel as _0x2c2a0c,IconStop as _0x16a978,IconAIChat as ot,IconPlus as _0x22fde5,IconPin as _0x1dd126,IconThreeHorizontalDots as _0x40bfd1,IconChevronRight as _0x341b4d,IconInfo as _0x1e356f,IconOutdated as _0x596197,IconEye as _0x3868ae,IconEyeCrossedOut as _0x4a4f33,IconAIReview as _0x48c39b}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x3bb1ce,CKEditorError as _0x19ee7d,ObservableMixin as $t,global as _0x384749,isVisible as _0x1ec9b5,Rect as _0x1ba12e,Collection as _0x1c36f7,FocusTracker as Bt,KeystrokeHandler as Wt,first as _0x4e3c0f,toArray as _0x719a8,EmitterMixin as _0x3dcb71,logWarning as _0xe189d1,logError as _0x543541,scrollViewportToShowTarget as _0x414134,ResizeObserver as _0x488e19,_isMotionReduced as at,scrollAncestorsToShowTarget as _0x4446ba,getConstrainedViewportRect as _0x4fae9d,DomEmitterMixin as _0x22fceb}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x39a08b,ButtonView as _0x21bd9e,View as _0x492b6b,SpinnerView as _0x1e37e5,IconView as _0x25e498,AutocompleteView as _0x143cba,ListView as _0x24784f,ListItemGroupView as _0x23de91,ListItemView as _0x8a8c30,ButtonLabelView as _0xb0531d,FocusCycler as Vt,createLabeledTextarea as _0x1eaf41,Dialog as _0x43b27c,createDropdown as _0x35c3bd,addMenuToDropdown as _0x571ded,MenuBarMenuView as _0xc03205,MenuBarMenuListItemButtonView as _0x4f4ee6,DialogViewPosition as _0x6f5cfb,MenuBarMenuListView as _0x1c5a64,MenuBarMenuListItemView as _0x4b1a57,UIModel as _0x1bf3fd,SplitButtonView as _0x18c56d,BalloonPanelView as _0x257cec,BodyCollection as Kt,clickOutsideHandler as ts,ListItemButtonView as _0x1bb418,ViewCollection as _0x2b3021,addListToDropdown as _0x1cd684,submitHandler as _0x7b6908,LabeledFieldView as _0x94787a,createLabeledInputText as _0x52c7a3,FormHeaderView as _0x5e5898,HighlightedTextView as _0x1f83e8,FileDialogButtonView as _0x45b20c,InputTextView as _0x257805,SearchTextView as _0xc3c8d,ButtonLabelWithHighlightView as _0x1c8ce8,DropdownMenuPanelPositioningFunctions as _0x3f95b9,BalloonToolbar as Rt,FormRowView as _0x523985,TextareaView as _0x225711}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as lt,ClipboardMarkersUtils as _0x2c5fc2}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as wt,ViewDataTransfer as ft,ViewUpcastWriter as _0x176332,Matcher as _0x9dd39e,_DetachOperation as _0x253f92,_insertIntoModelNodeList as _0xbc492c,_removeFromModelNodeList as _0x5f0c2d,ModelRange as _0x184fda,ViewDowncastWriter as gt,transformOperationSets as _0x39cd19,ModelDocumentFragment as _0x246996,ModelPosition as _0x5a23f1,ModelTreeWalker as _0x31667d,InsertOperation as _0x207529,MarkerOperation as _0xd05c7f}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x2e79bc,escape as Zt,escapeRegExp as _0xfb43f9,debounce as _0xa4b43}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x21bcef,InvokeModelWithResponseStreamCommand as _0x35b305,InvokeModelCommand as _0x8386c5}from'@aws-sdk/client-bedrock-runtime';import{createParser as Ct}from'eventsource-parser';import{parseDocument as _0x8953d3}from'htmlparser2';import{isTag as _0x1a9650,findOne as _0x3019e1,getParent as _0x2ea8c9,findAll as _0x37808d,removeElement as _0x19c981,replaceElement as _0x20fcd7,prepend as _0x4e9405,prependChild as _0x5578be,appendChild as _0x4fe58e,append as _0x41021b,find as _0x4b09e5,isComment as _0x336631,getChildren as _0x51e789,textContent as _0x4b97d9}from'domutils';import _0x20dcd7 from'dom-serializer';import{Document as it,Element as _0x1781b0,Text as _0xe506f9,cloneNode as _0x2ef420,isDocument as _0xa44e7b,isText as _0xb35865,NodeWithChildren as _0x19bfe3}from'domhandler';import{MarkdownGfmMdToHtml as _0x5a2309}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x2fc611,getAllMarkersDomElementsSorted as _0x489432,DocumentCompare as _0x1f61c4,DATA_ID_MODEL_ATTRIBUTE as _0x359efb,ConfirmMixin as _0x4bf1f4,LateFocusDropdownButtonView as _0x5a11e2,DATA_ID_VIEW_ATTRIBUTE as _0x5438d9}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x4b1575}from'es-toolkit';import{IconThumbUp as _0x1e0de2,IconThumbDown as _0x1b416f,IconCopy as _0x385135,IconCheck as _0x347166,IconShowChangesOff as _0x376600,IconShowChangesOn as _0x2eeddb,IconWeb as _0x4f04ad,IconNextArrow as _0x395cb2,IconPreviousArrow as _0x48be9f,IconAI as et,IconClose as _0x3a2bed,IconSelection as _0x25d747,IconFileUpload as _0x241668,IconLink as _0x3fc296,IconDocument as _0x3fd5d1,IconBulb as _0x4bb0b4,IconDocumentOutline as _0x169e77,IconPaperClip as _0x4d54fb,IconBrowseFiles as _0x257af9,IconDropdownArrow as _0x39e693,IconAIAskAI as _0x5bf2c9,IconAIQuickActions as _0x2e8536,IconAIChatCommands as Qt,IconAIImproveWriting as Ot,IconAIContinueWriting as St,IconAIGrammarCheck as xt,IconAIAdjustLength as yt,IconAIChangeTone as Tt,IconAITranslate as vt,IconAIOther as Et,IconRefresh as _0x4e53d3}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x1e000f from'morphdom';import{SuggestionsConversion as kt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{diffArrays as _0x26ee2a}from'diff';const mi='_ungrouppedCommands';function ne(_0x4d5dc8,_0xf68838){const _0x15a23a=(0x0,_0xf68838['t'])('Other');return _0x4d5dc8['length']?'groupId'in _0x4d5dc8[0x0]?_0x4d5dc8:[{'groupId':mi,'groupLabel':_0x15a23a,'order':0x1/0x0,'commands':_0x4d5dc8}]:[{'groupId':mi,'groupLabel':_0x15a23a,'order':0x1/0x0,'commands':[]}];}const Wn=globalThis['DataTransfer'],pt='ai-ui';class te extends _0x2a4cc7{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2ed69f}=this,_0x237dd3=['ck-fake-ai-selection'];_0x2ed69f['config']['get']('ai.assistant.useTheme')&&_0x237dd3['push']('ck-ai-assistant-ui_theme'),_0x2ed69f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':pt,'view':{'classes':_0x237dd3,'priority':0xc}}),_0x2ed69f['conversion']['for']('editingDowncast')['markerToElement']({'model':pt,'view':(_0x3ea913,{writer:_0x451e53})=>{if(!_0x3ea913['markerRange']['isCollapsed'])return null;const _0x4b8878=_0x451e53['createUIElement']('span');return _0x451e53['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x4b8878),_0x4b8878;}});}['afterInit'](){!async function(_0x127ca7){const _0x15f781=_0x8d381([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]),_0x2e25a2=0x3dffc4e1,_0x58d725=0x3df8be81^_0x2e25a2,_0x3ecc28=window[_0x8d381([0x44,0x61,0x74,0x65])][_0x8d381([0x6e,0x6f,0x77])](),_0x1235bd=_0x127ca7[_0x8d381([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x136d29=new window[(_0x8d381([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1d060b=>{_0x1235bd[_0x8d381([0x6f,0x6e,0x63,0x65])](_0x8d381([0x72,0x65,0x61,0x64,0x79]),_0x1d060b);}),_0x53326c={[_0x8d381([0x6b,0x74,0x79])]:_0x8d381([0x45,0x43]),[_0x8d381([0x75,0x73,0x65])]:_0x8d381([0x73,0x69,0x67]),[_0x8d381([0x63,0x72,0x76])]:_0x8d381([0x50,0x2d,0x32,0x35,0x36]),[_0x8d381([0x78])]:_0x8d381([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]),[_0x8d381([0x79])]:_0x8d381([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]),[_0x8d381([0x61,0x6c,0x67])]:_0x8d381([0x45,0x53,0x32,0x35,0x36])},_0x5766d7=_0x1235bd[_0x8d381([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x8d381([0x67,0x65,0x74])](_0x8d381([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x10d351(){let _0x593770,_0x1025e9=null,_0x171fd8=null;try{if(_0x5766d7==_0x8d381([0x47,0x50,0x4c]))return _0x8d381([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x593770=_0x1e5606(),!_0x593770)return _0x8d381([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x593770[_0x8d381([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x171fd8=_0x43a8bb(_0x593770[_0x8d381([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x593770[_0x8d381([0x6a,0x74,0x69])])),await _0x4b5606()?_0x3d6fa3()?_0x1b7fac()?_0x8d381([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x4b9fdd()?(_0x593770[_0x8d381([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x8d381([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x1025e9=_0xa1d269(_0x8d381([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x593770[_0x8d381([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x8d381([0x74,0x72,0x69,0x61,0x6c])&&(_0x1025e9=_0xa1d269(_0x8d381([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0xf992d3()):_0x8d381([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x8d381([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x8d381([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x8d381([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x1b7fac(){const _0xb61096=[_0x8d381([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x8d381([0x74,0x72,0x69,0x61,0x6c])][_0x8d381([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x593770[_0x8d381([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x3ecc28/0x3e8:0xe10*_0x58d725;return _0x593770[_0x8d381([0x65,0x78,0x70])]<_0xb61096;}function _0x3d6fa3(){const _0x25c894=_0x593770[_0x8d381([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x25c894&&(!!_0x25c894[_0x8d381([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x8d381([0x2a]))||!!_0x25c894[_0x8d381([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x8d381([0x41,0x49])));}function _0x4b9fdd(){const _0x387e64=_0x593770[_0x8d381([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x387e64||0x0==_0x387e64[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x490ad1}=new URL(window[_0x8d381([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x387e64[_0x8d381([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x490ad1))return!0x0;const _0x4d3d2c=_0x490ad1[_0x8d381([0x73,0x70,0x6c,0x69,0x74])](_0x8d381([0x2e]));return _0x387e64[_0x8d381([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3684ee=>_0x3684ee[_0x8d381([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x8d381([0x2a])))[_0x8d381([0x6d,0x61,0x70])](_0x36c96e=>_0x36c96e[_0x8d381([0x73,0x70,0x6c,0x69,0x74])](_0x8d381([0x2e])))[_0x8d381([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x22a71d=>_0x22a71d[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x4d3d2c[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x8d381([0x6d,0x61,0x70])](_0x185f87=>Array(_0x4d3d2c[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x185f87[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x8d381([0x66,0x69,0x6c,0x6c])](_0x185f87[0x0]===_0x8d381([0x2a])?_0x8d381([0x2a]):'')[_0x8d381([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x185f87))[_0x8d381([0x73,0x6f,0x6d,0x65])](_0x5bf1bf=>_0x4d3d2c[_0x8d381([0x65,0x76,0x65,0x72,0x79])]((_0xe8d24,_0x5ef96d)=>_0x5bf1bf[_0x5ef96d]===_0xe8d24||_0x5bf1bf[_0x5ef96d]===_0x8d381([0x2a])));}function _0xf992d3(){return _0x1025e9&&_0x171fd8?new window[(_0x8d381([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3a6cd0,_0x555160)=>{_0x1025e9[_0x8d381([0x74,0x68,0x65,0x6e])](_0x3a6cd0,_0x555160),_0x171fd8[_0x8d381([0x74,0x68,0x65,0x6e])](_0x11da56=>{_0x11da56!=_0x8d381([0x56,0x61,0x6c,0x69,0x64])&&_0x3a6cd0(_0x11da56);},_0x555160);}):_0x1025e9||_0x171fd8||_0x8d381([0x56,0x61,0x6c,0x69,0x64]);}}function _0x43a8bb(_0x3e6374,_0x2e6c1a){return new window[(_0x8d381([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x326e90=>{if(_0x25b947())return _0x326e90(_0x8d381([0x56,0x61,0x6c,0x69,0x64]));_0x17ba1d(),_0x1235bd[_0x8d381([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x8d381([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x1c270c=!0x1;const _0x5a4a20=_0x3bb1ce();function _0x48797d(_0x22d164){return!!_0x22d164&&(typeof _0x22d164===_0x8d381([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x22d164===_0x8d381([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x22d164[_0x8d381([0x74,0x68,0x65,0x6e])]===_0x8d381([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x22d164[_0x8d381([0x63,0x61,0x74,0x63,0x68])]===_0x8d381([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x30087b(_0x4191e7){_0x1417fb(_0x4191e7)[_0x8d381([0x74,0x68,0x65,0x6e])](_0xa84739=>{if(!_0xa84739||_0xa84739[_0x8d381([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x8d381([0x6f,0x6b]))return _0x8d381([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x3d930a(_0x362e33(_0x5a4a20+_0x2e6c1a))!=_0xa84739[_0x8d381([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x8d381([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x8d381([0x56,0x61,0x6c,0x69,0x64]);})[_0x8d381([0x74,0x68,0x65,0x6e])](_0x116341=>(_0x998b1c(),_0x116341),()=>{const _0x4fc159=_0x2d1c45();return null==_0x4fc159?(_0x998b1c(),_0x8d381([0x56,0x61,0x6c,0x69,0x64])):_0x8d381(_0x3ecc28-_0x4fc159>(0x19f340e1^_0x2e25a2)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x8d381([0x74,0x68,0x65,0x6e])](_0x326e90)[_0x8d381([0x63,0x61,0x74,0x63,0x68])](()=>{_0x326e90(_0x8d381([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x12c607=0x3dc92a61^_0x2e25a2;function _0x998b1c(){const _0x61a1cf=_0x8d381([0x6c,0x6c,0x63,0x74,0x2d])+_0x3d930a(_0x362e33(_0x3e6374)),_0x537e30=_0x1fec3d(_0x3d930a(window[_0x8d381([0x4d,0x61,0x74,0x68])][_0x8d381([0x63,0x65,0x69,0x6c])](_0x3ecc28/_0x12c607)));window[_0x8d381([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x8d381([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x61a1cf,_0x537e30);}function _0x2d1c45(){const _0x5dedce=_0x8d381([0x6c,0x6c,0x63,0x74,0x2d])+_0x3d930a(_0x362e33(_0x3e6374)),_0x4e0f12=window[_0x8d381([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x8d381([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5dedce);return _0x4e0f12?window[_0x8d381([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1fec3d(_0x4e0f12),0x10)*_0x12c607:null;}function _0x1417fb(_0x27694e){return new window[(_0x8d381([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3d6e50,_0x41241e)=>{_0x27694e[_0x8d381([0x74,0x68,0x65,0x6e])](_0x3d6e50,_0x41241e),window[_0x8d381([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x41241e,0x3dfe1021^_0x2e25a2);});}}_0x1235bd[_0x8d381([0x6f,0x6e])](_0x8d381([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x49d9ad,_0x2a67a8)=>{if(_0x2a67a8[0x0]!=_0x3e6374)return _0x326e90(_0x8d381([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x2a67a8[0x1]={..._0x2a67a8[0x1],[_0x8d381([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x5a4a20};},{[_0x8d381([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x8d381([0x68,0x69,0x67,0x68])}),_0x1235bd[_0x8d381([0x6f,0x6e])](_0x8d381([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x581924=>{_0x48797d(_0x581924[_0x8d381([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x1c270c=!0x0,_0x30087b(_0x581924[_0x8d381([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x8d381([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x8d381([0x6c,0x6f,0x77])}),_0x136d29[_0x8d381([0x74,0x68,0x65,0x6e])](()=>{_0x1c270c||_0x326e90(_0x8d381([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x25b947(){return _0x1235bd[_0x8d381([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x8d381([0x76,0x69,0x65,0x77])][_0x8d381([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x8d381([0x61,0x75,0x74,0x6f]);}function _0x17ba1d(){_0x1235bd[_0x8d381([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x8d381([0x76,0x69,0x65,0x77])][_0x8d381([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x8d381([0x61,0x75,0x74,0x6f]);}}function _0xa1d269(_0x40f985){const _0x30a095=[new window[(_0x8d381([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x15f8fe=>setTimeout(_0x15f8fe,0x3df6fa2d^_0x2e25a2)),_0x136d29[_0x8d381([0x74,0x68,0x65,0x6e])](()=>new window[(_0x8d381([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x544dc8=>{let _0x568c2d=0x0;_0x1235bd[_0x8d381([0x6d,0x6f,0x64,0x65,0x6c])][_0x8d381([0x6f,0x6e])](_0x8d381([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x407800,_0x48561c)=>{_0x48561c[0x0][_0x8d381([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x568c2d++,_0x568c2d==(0x3dffc519^_0x2e25a2)&&(_0x544dc8(),_0x407800[_0x8d381([0x6f,0x66,0x66])]());});}))];return window[_0x8d381([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x8d381([0x72,0x61,0x63,0x65])](_0x30a095)[_0x8d381([0x74,0x68,0x65,0x6e])](()=>_0x40f985);}async function _0x3d38cd(){await _0x136d29,_0x1235bd[_0x8d381([0x6d,0x6f,0x64,0x65,0x6c])][_0x8d381([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x308fe5,_0x1235bd[_0x8d381([0x6d,0x6f,0x64,0x65,0x6c])][_0x8d381([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x308fe5,_0x1235bd[_0x8d381([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x8d381([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x33dc92(_0xa70a41){const _0x12f91b=_0x41aa92();_0x1235bd[_0x12f91b]=_0x8d381([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0xa70a41,_0xa70a41!=_0x8d381([0x56,0x61,0x6c,0x69,0x64])&&_0x3d38cd();}function _0x41aa92(){const _0x4bcc49=window[_0x8d381([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x8d381([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x8d381([0x6e,0x6f,0x77])]())[_0x8d381([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x8d381([0x2e]),'');let _0xc22ab6=_0x8d381([0x6e]);for(let _0x9a38f1=0x0;_0x9a38f1<_0x4bcc49[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x9a38f1+=0x2){let _0x4e100e=window[_0x8d381([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4bcc49[_0x8d381([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x9a38f1,_0x9a38f1+0x2));_0x4e100e>=_0x15f781[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x4e100e-=_0x15f781[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0xc22ab6+=_0x15f781[_0x4e100e];}return _0xc22ab6;}function _0x1e5606(){const _0xaddc76=_0x5766d7[_0x8d381([0x73,0x70,0x6c,0x69,0x74])](_0x8d381([0x2e]));if(0x3!=_0xaddc76[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x5c66b3(_0xaddc76[0x1]);function _0x5c66b3(_0x88829b){const _0x3895bc=_0x1739af(_0x88829b);return _0x3895bc&&_0x503c53()?_0x3895bc:null;function _0x503c53(){const _0x506de7=_0x3895bc[_0x8d381([0x6a,0x74,0x69])],_0x5f5bd8=window[_0x8d381([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x506de7[_0x8d381([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x506de7[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x16d9d1={..._0x3895bc,[_0x8d381([0x6a,0x74,0x69])]:_0x506de7[_0x8d381([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x506de7[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x16d9d1[_0x8d381([0x76,0x63])],_0x362e33(_0x16d9d1)==_0x5f5bd8;}}}async function _0x4b5606(){let _0x6bafb7=!0x0;try{const _0x322b89=_0x5766d7[_0x8d381([0x73,0x70,0x6c,0x69,0x74])](_0x8d381([0x2e])),[_0x72b7ba,_0x5efa3d,_0x493547]=_0x322b89;return _0xa661a9(_0x72b7ba),await _0x14add3(_0x72b7ba,_0x5efa3d,_0x493547),_0x6bafb7;}catch{return!0x1;}function _0xa661a9(_0x756974){const _0x14f22d=_0x1739af(_0x756974);_0x14f22d&&_0x14f22d[_0x8d381([0x61,0x6c,0x67])]==_0x8d381([0x45,0x53,0x32,0x35,0x36])||(_0x6bafb7=!0x1);}async function _0x14add3(_0x63ebb8,_0x24f53f,_0x23d3f5){const _0x19c2ba=window[_0x8d381([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x8d381([0x66,0x72,0x6f,0x6d])](_0x5bc924(_0x23d3f5),_0x54c235=>_0x54c235[_0x8d381([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x307205=new window[(_0x8d381([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x8d381([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x63ebb8+_0x8d381([0x2e])+_0x24f53f),_0x550884=window[_0x8d381([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x8d381([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x550884)return;const _0x43852d=await _0x550884[_0x8d381([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x8d381([0x6a,0x77,0x6b]),_0x53326c,{[_0x8d381([0x6e,0x61,0x6d,0x65])]:_0x8d381([0x45,0x43,0x44,0x53,0x41]),[_0x8d381([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x8d381([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x8d381([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x550884[_0x8d381([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x8d381([0x6e,0x61,0x6d,0x65])]:_0x8d381([0x45,0x43,0x44,0x53,0x41]),[_0x8d381([0x68,0x61,0x73,0x68])]:{[_0x8d381([0x6e,0x61,0x6d,0x65])]:_0x8d381([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x43852d,_0x19c2ba,_0x307205)||(_0x6bafb7=!0x1);}}function _0x1739af(_0x3347fa){return _0x3347fa[_0x8d381([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x8d381([0x65,0x79]))?JSON[_0x8d381([0x70,0x61,0x72,0x73,0x65])](_0x5bc924(_0x3347fa)):null;}function _0x5bc924(_0x899fc6){return window[_0x8d381([0x61,0x74,0x6f,0x62])](_0x899fc6[_0x8d381([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x8d381([0x2b]))[_0x8d381([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x8d381([0x2f])));}function _0x362e33(_0x256918){let _0xde6ac9=0x1505;function _0x26dbf1(_0x5c74b0){for(let _0x106be6=0x0;_0x106be6<_0x5c74b0[_0x8d381([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x106be6++){const _0x49bf11=_0x5c74b0[_0x8d381([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x106be6);_0xde6ac9=(_0xde6ac9<<0x5)+_0xde6ac9+_0x49bf11,_0xde6ac9&=_0xde6ac9;}}function _0x350ce1(_0x5f0caa){Array[_0x8d381([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x5f0caa)?_0x5f0caa[_0x8d381([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x350ce1):_0x5f0caa&&typeof _0x5f0caa==_0x8d381([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x8d381([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x5f0caa)[_0x8d381([0x73,0x6f,0x72,0x74])]()[_0x8d381([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x11e236,_0x4bd6c9])=>{_0x26dbf1(_0x11e236),_0x350ce1(_0x4bd6c9);}):_0x26dbf1(window[_0x8d381([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x5f0caa));}return _0x350ce1(_0x256918),_0xde6ac9>>>0x0;}function _0x3d930a(_0x3c538f){return _0x3c538f[_0x8d381([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x8d381([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x8d381([0x30]));}function _0x1fec3d(_0x1a1b39){return _0x1a1b39[_0x8d381([0x73,0x70,0x6c,0x69,0x74])]('')[_0x8d381([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x8d381([0x6a,0x6f,0x69,0x6e])]('');}function _0x308fe5(){}function _0x8d381(_0xce10d){return _0xce10d['map'](_0x4bbabf=>String['fromCharCode'](_0x4bbabf))['join']('');}_0x33dc92(await _0x10d351());}(this);}['showFakeVisualSelection'](){const _0x1f2b9d=this['editor']['model'];_0x1f2b9d['change'](_0xcb056f=>{const _0x196806=_0x1f2b9d['document']['selection']['getRanges']();let _0x44aafc=0x0;for(const _0x240957 of _0x196806){const _0x1de637=pt+':'+_0x44aafc;if(_0x1f2b9d['markers']['has'](_0x1de637))_0xcb056f['updateMarker'](_0x1de637,{'range':_0x240957});else{if(_0x240957['start']['isAtEnd']){const _0xb6600=_0x240957['start']['getLastMatchingPosition'](({item:_0x15897b})=>!_0x1f2b9d['schema']['isContent'](_0x15897b),{'boundaries':_0x240957});_0xcb056f['addMarker'](_0x1de637,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xcb056f['createRange'](_0xb6600,_0x240957['end'])});}else _0xcb056f['addMarker'](_0x1de637,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x240957});}_0x44aafc++;}});}['hideFakeVisualSelection'](){const _0x53d73c=this['editor']['model'],_0xdcf3e7=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](pt));_0xdcf3e7['length']&&_0x53d73c['change'](_0x23dfd8=>{_0xdcf3e7['forEach'](_0xb9672f=>{_0x23dfd8['removeMarker'](_0xb9672f);});});}['insertContent'](_0x33981b,_0x885f78){const _0x1ff200=this['_getAISelection'](),_0x3f8d5d=_0x885f78||_0x1ff200['getFirstRange']();this['editor']['model']['canEditAt'](_0x3f8d5d)&&this['editor']['model']['change'](_0x10fb0e=>{this['hideFakeVisualSelection'](),_0x885f78||this['_resetContentOfSelectedTableCells'](_0x10fb0e,_0x1ff200),this['_pasteHTMLUsingClipboard']({'insertAt':_0x3f8d5d,'writer':_0x10fb0e,'html':_0x33981b});});}['insertContentBelow'](_0x360df1){const {model:_0x1a49d1}=this['editor'],_0x286e30=this['_getAISelection']();_0x1a49d1['change'](()=>{const _0x125f4a=this['_prepareTableInsertBelowPosition'](_0x360df1,_0x286e30)||this['_getDefaultInsertBelowPosition'](_0x286e30);this['insertContent'](_0x360df1,_0x125f4a);});}['_getAISelection'](){const _0x492d45=this['editor']['model'],_0x37e2a2=Array['from'](_0x492d45['markers']['getMarkersGroup'](pt))['map'](_0x2d24da=>_0x2d24da['getRange']());return _0x492d45['createSelection'](_0x37e2a2);}['_pasteHTMLUsingClipboard']({writer:_0x146a03,html:_0x8885bc,insertAt:_0x3ce8aa}){const {view:_0x163869}=this['editor']['editing'],_0x357e72=this['editor']['plugins']['get'](lt),_0xbcb82b=new Wn();_0xbcb82b['setData']('text/html',_0x8885bc);const _0x3e265b=new ClipboardEvent('paste',{'clipboardData':_0xbcb82b}),_0x503052=new wt(_0x163869,_0x3e265b,{'dataTransfer':new ft(_0xbcb82b)});_0x146a03['setSelection'](_0x3ce8aa);const _0x32381c=(_0x46e845,_0x5475f6)=>{_0x5475f6['resultRange']&&_0x146a03['setSelection'](_0x5475f6['resultRange']);};_0x357e72['once']('contentInsertion',_0x32381c,{'priority':'lowest'}),_0x163869['document']['fire']('paste',_0x503052),_0x357e72['off']('contentInsertion',_0x32381c);}['_getDefaultInsertBelowPosition'](_0x397460){const {model:_0x2b56f1}=this['editor'],_0x30d527=Array['from'](_0x397460['getSelectedBlocks']());return _0x30d527['length']?_0x2b56f1['createPositionAfter'](_0x30d527['pop']()):_0x397460['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x1984c4,_0x2dc5fb){const {model:_0x36fd9b,plugins:_0x4279b0}=this['editor'];if(_0x4279b0['has']('TableUtils')){const _0x3d5fb2=_0x4279b0['get']('TableUtils')['getSelectedTableCells'](_0x2dc5fb);if(_0x3d5fb2['length']){const _0xe27fee=this['_getTableRowCountFromContent'](_0x1984c4),_0x53fa45=this['_createEmptyTableRows'](_0x3d5fb2,_0xe27fee);return _0x36fd9b['createPositionAt'](_0x53fa45,0x0);}}return null;}['_getTableRowCountFromContent'](_0x3dbffd){const _0x1cd4f9=this['editor']['plugins']['get']('TableUtils'),_0x58aa91=this['editor']['data']['parse'](_0x3dbffd),_0x455be7=Array['from'](_0x58aa91['getChildren']())['filter'](_0x58cc6a=>_0x58cc6a['is']('element','table'));let _0x37a084=0x0;return _0x455be7['forEach'](_0x21e593=>{_0x37a084+=_0x1cd4f9['getRows'](_0x21e593);}),_0x37a084;}['_createEmptyTableRows'](_0x423291,_0x1510ba){const _0x6ba4d5=this['editor']['plugins']['get']('TableUtils'),_0x1f4ec8=_0x6ba4d5['getRowIndexes'](_0x423291),_0x405a4b=_0x6ba4d5['getColumnIndexes'](_0x423291),_0x54a672=_0x1f4ec8['last']+0x1,_0x4c9d46=_0x405a4b['first'],_0x3ae6d9=_0x423291[0x0]['findAncestor']('table');for(let _0x2dbd60=0x0;_0x2dbd60<_0x1510ba;_0x2dbd60++)_0x6ba4d5['insertRows'](_0x3ae6d9,{'at':_0x54a672});return _0x3ae6d9['getChild'](_0x54a672)['getChild'](_0x4c9d46);}['_resetContentOfSelectedTableCells'](_0x2af38f,_0x354e34){const {plugins:_0x8c62b4}=this['editor'],{model:_0xb38537}=_0x2af38f;if(!_0x8c62b4['has']('TableUtils'))return;_0x8c62b4['get']('TableUtils')['getSelectedTableCells'](_0x354e34)['length']&&_0xb38537['deleteContent'](_0x354e34);}}class li extends _0x2a4cc7{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x19ee7d('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x1e8dfb){super(_0x1e8dfb),this['name']='AIRequestError';}}function Fn(_0x165a43,_0x3b862d,_0x44d685){const t=_0x165a43['t'];switch(_0x3b862d){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',_0x44d685);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x44d685);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'},_0x44d685);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 _0x3b862d;}}class hi extends At{['_commandDefinitions'];constructor(_0x30e8e2,_0x3b9701){super(_0x30e8e2),this['_commandDefinitions']=_0x3b9701,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x5f1609,_0x117213,_0x54e978)=>{this['isEnabled']&&(this['enabledCommandsIds']=xs(this['_commandDefinitions'],_0x54e978));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x24a890,_0x4e3fa3,_0x51e398)=>{this['enabledCommandsIds']=_0x51e398?xs(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x40bbd5=this['editor']['model'];this['_hasContext']=function(_0x13a353){const _0x55f8c4=_0x13a353['document']['selection'];return _0x55f8c4['isCollapsed']?0x0!==[..._0x55f8c4['getSelectedBlocks']()]['length']&&![..._0x55f8c4['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x13a353['hasContent'](_0x55f8c4['getFirstRange']());}(_0x40bbd5);const _0x381253=_0x40bbd5['document']['selection'],_0x5c7601=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x494640 of _0x381253['getRanges']())for(const _0xd19bdd of _0x494640['getItems']())if(_0xd19bdd['is']('element')&&_0x5c7601['includes'](_0xd19bdd['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x504e26='',_0x1b804c='',_0x271ab2='custom'){this['editor']['plugins']['get'](ee)['showUI'](_0x504e26,_0x1b804c,_0x271ab2);}}function xs(_0x59ea56,_0x36658d){const _0x4d043d=new Set();for(const _0x1e4b3b of _0x59ea56['values']())(_0x36658d||!0x1===_0x1e4b3b['requiresContent'])&&_0x4d043d['add'](_0x1e4b3b['id']);return Array['from'](_0x4d043d);}const fs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class di extends/* #__PURE__ -- @preserve */
24
- $t(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x6c8339,_0x282ab6,_0x47c9a5){super(),this['editor']=_0x6c8339,this['textAdapter']=_0x282ab6,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x47c9a5,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x38dc79,_0x3f24cc,_0x5751ca)=>{this['view']['value']=this['_sanitizeHTML'](_0x5751ca);}),this['listenTo'](this['view'],'submitPrompt',(_0x5e3e2c,_0x4b3fca)=>{const _0x148ce8=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x4b3fca,_0x148ce8,'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:_0xd9b8f8,query:_0x3c73fe,htmlContent:_0x2c1917,label:_0x5344cd,mainActionLabel:_0x21513a}){this['view']['prompt']=_0x5344cd,this['view']['mainAction']=_0x21513a,this['initialContext']=_0x2c1917,_0x3c73fe&&(this['view']['isRendered']?this['_handleQuery'](_0x3c73fe,_0x2c1917,_0xd9b8f8,_0x5344cd):this['view']['once']('render',()=>{this['_handleQuery'](_0x3c73fe,_0x2c1917,_0xd9b8f8,_0x5344cd);}));}['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'](_0x10738c,_0x2f887e,_0x33a87d,_0x1608a1){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x2f887e,this['previousQuery']=_0x10738c,this['previousLabel']=_0x1608a1||_0x10738c,this['previousActionId']=_0x33a87d,new Promise(_0x58a948=>{this['textAdapter']['makeRequest']({'query':_0x10738c,'context':_0x2f887e,'onData':_0x43347d=>{this['currentResponse']=_0x43347d,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x33a87d})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x34ec20=>{_0x34ec20 instanceof tr?this['view']['handleError'](_0x34ec20['message']):this['view']['handleError'](),_0x58a948();})['finally'](()=>{this['stopProcessing'](),_0x58a948();});});}['_parseAndNormalizeContent'](_0x412d9f,_0xcd5992=!0x1){const _0x474bfa=fs['exec'](_0x412d9f);_0x412d9f=_0x474bfa?_0x412d9f['substring'](_0x474bfa[0x1]['length']):_0x412d9f['length']<0x64&&!_0xcd5992?'':this['_stripMarkdownSyntax'](_0x412d9f);const _0x24ab12=this['_domParser']['parseFromString'](_0x412d9f,'text/html');if(_0x474bfa){const _0x59242a=Array['from'](_0x24ab12['body']['childNodes']);_0x59242a['reverse']();for(const _0x2a4f5e of _0x59242a){if(_0x2a4f5e['nodeType']==Node['ELEMENT_NODE'])break;_0x2a4f5e['remove']();}}const _0x1db382=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x24ab12['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x1db382);const _0x8c6ce4=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x30539a=this['editor']['data']['toModel'](_0x1db382);return _0x8c6ce4||_0x30539a['markers']['clear'](),this['editor']['data']['stringify'](_0x30539a);}['_normalizeResponseHeadings'](_0x2b64c9){const _0x1a7034=new _0x176332(this['editor']['editing']['view']['document']),_0x33d2e4=new _0x9dd39e({'name':/^h[1-5]$/}),_0x12bb16=[];let _0x379f51=!0x1;for(const _0x48178f of _0x2b64c9)_0x48178f['is']('element')&&_0x33d2e4['match'](_0x48178f)&&(_0x12bb16['push'](_0x48178f),'h1'==_0x48178f['name']&&(_0x379f51=!0x0));if(_0x379f51){for(const _0x5bf0aa of _0x12bb16)_0x1a7034['rename']('h'+(parseInt(_0x5bf0aa['name'][0x1])+0x1),_0x5bf0aa);}}['_isH1TagSupportEnabled'](){const {data:_0x396dfb,editing:_0x9d23c0}=this['editor'],_0x3b6614=_0x396dfb['htmlProcessor']['toView']('<h1></h1>'),_0x191584=_0x396dfb['toView'](_0x396dfb['toModel'](_0x3b6614));return!!_0x9d23c0['view']['domConverter']['viewToDom'](_0x191584)['querySelector']('h1');}['_sanitizeHTML'](_0x4c15ee){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x4c15ee),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x574475){const _0x21a97b=_0x574475['trim']();return _0x21a97b['startsWith']('```html')?_0x21a97b['endsWith']('```')?_0x21a97b['substring'](0x7,_0x21a97b['length']-0x3):_0x21a97b['substring'](0x7):_0x574475;}}const pi={'REPLACE':'replace','INSERT':'insert'};class Er extends _0x39a08b{constructor(_0x54a9dd){super(_0x54a9dd),this['set']('isVisible',!0x1),this['set']('mainAction',pi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xfb808e=>Fn(_0x54a9dd,'AI_'+_0xfb808e['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Fn(_0x54a9dd,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Fn(_0x54a9dd,'Try\x20again')),this['stopButton']=this['_createButton'](Fn(_0x54a9dd,'Stop'));const _0x389665=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x389665['if']('isVisible','ck-hidden',_0x147445=>!_0x147445)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x371030,_0x588f1b){const _0x5533ef=new _0x21bd9e(this['locale']);return _0x5533ef['set']({'label':_0x371030,'class':_0x588f1b||'','isVisible':!0x0,'withText':!0x0}),_0x5533ef;}}class Hr extends _0x492b6b{['contentFieldView'];['copyButtonView'];constructor(_0x302bbd,_0x4aa561=''){super(_0x302bbd),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x3a543c=this['bindTemplate'];this['contentFieldView']=new Yn(_0x302bbd,_0x4aa561),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x3a543c['if']('isVisible','ck-hidden',_0x3df118=>!_0x3df118)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x3a543c['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 _0x10ede8=!0x1;this['on']('change:value',(_0x2f229b,_0xd05960,_0x555c66)=>{const _0x14c86d=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x555c66),this['isProcessing']&&_0x14c86d&&!_0x10ede8&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x4e2814,_0x443a9f,_0x32f404)=>{_0x10ede8=!0x1,_0x32f404?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x10ede8=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x10ede8=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x13b91d=this['locale'],_0x9c73f4=new _0x21bd9e(this['locale']),_0x47e5f6='ck-ai-form__copy-button';return _0x9c73f4['set']({'label':Fn(_0x13b91d,'Copy'),'icon':_0x4559bc,'class':_0x47e5f6,'tooltip':!0x0}),_0x9c73f4['bind']('isVisible')['to'](this,'value',_0x507a76=>!!_0x507a76),_0x9c73f4['bind']('isEnabled')['to'](this,'isProcessing',_0x2b0fa1=>!_0x2b0fa1),_0x9c73f4['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x9c73f4['icon']=_0x2a5a64,_0x9c73f4['class']=_0x47e5f6+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x9c73f4['icon']=_0x4559bc,_0x9c73f4['class']=_0x47e5f6;},0x3e8);}),_0x9c73f4;}['_copyHTMLToClipboard'](_0x12c16a){const {window:_0x495eeb,document:_0x40f798}=_0x384749;if(_0x495eeb['ClipboardItem']){const {Blob:_0x3ad645,ClipboardItem:_0x30db6c}=_0x495eeb,_0x2d03dd=[new _0x30db6c({'text/html':new _0x3ad645([_0x12c16a['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3ad645([_0x12c16a['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x2d03dd);}else{const _0x318da9=_0x40f798['createElement']('div');_0x318da9['style']['position']='absolute',_0x318da9['style']['left']='-9999px',_0x318da9['innerHTML']='<span>[</span>'+_0x12c16a['innerHTML']+'<span>]</span>',_0x40f798['body']['appendChild'](_0x318da9);const _0xd81bcd=_0x40f798['createRange']();_0xd81bcd['setStartAfter'](_0x318da9['firstElementChild']),_0xd81bcd['setEndBefore'](_0x318da9['lastElementChild']);const _0x4f08c4=_0x495eeb['getSelection']();_0x4f08c4['removeAllRanges'](),_0x4f08c4['addRange'](_0xd81bcd),_0x40f798['execCommand']('copy'),_0x318da9['remove']();}}}class Yn extends _0x492b6b{constructor(_0x472202,_0x1221f1=''){super(_0x472202),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x1221f1,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x2da93a){this['element']['innerHTML']=_0x2da93a;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x5adfd0=new _0x492b6b(),_0x405f5d=this['locale'],_0xada4c7=new _0x1e37e5();return _0xada4c7['isVisible']=!0x0,_0x5adfd0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0xada4c7,{'text':Fn(_0x405f5d,'AI\x20is\x20writing...')}]}),_0x5adfd0['render'](),_0x5adfd0;}}class Rr extends _0x492b6b{constructor(_0x1e92b2,_0x168129=''){super(_0x1e92b2);const _0x4900f4=new _0x25e498(),_0x5571b0=this['bindTemplate'];this['set']('text',_0x168129),_0x4900f4['content']=_0x1b5390,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x4900f4,{'text':_0x5571b0['to']('text')}]});}}class Tr extends _0x143cba{['submitButtonView'];['showHistoryButtonView'];constructor(_0xe51dfc,_0x1e7d54){super(_0xe51dfc,_0x1e7d54),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',(_0x3c7d47,_0x354d6c)=>{_0x3c7d47['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x354d6c());});}['_createSubmitButton'](){const _0x1a2894=new _0x21bd9e(this['locale']),_0x5bb6a4=this['locale'];return _0x1a2894['set']({'icon':_0x47a449,'label':Fn(_0x5bb6a4,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1a2894['on']('execute',()=>{this['submit']();}),_0x1a2894['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x19c125,_0x46ef87)=>!_0x19c125&&_0x46ef87),_0x1a2894;}['_createShowHistoryButton'](){const _0x4c8862=new _0x21bd9e(this['locale']),_0x42ccee=this['resultsView'],_0x184d51=this['locale'];_0x4c8862['set']({'label':Fn(_0x184d51,'History'),'withText':!0x1,'icon':It,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4c8862['bind']('isOn')['to'](_0x42ccee,'isVisible'),_0x4c8862['bind']('isEnabled')['to'](this,'isEnabled'),_0x4c8862['on']('execute',()=>{_0x42ccee['isVisible']=!_0x42ccee['isVisible'],_0x42ccee['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x1b729f=()=>{_0x384749['window']['requestAnimationFrame'](()=>{if(_0x1ec9b5(this['element'])){const _0x435c5f=new _0x1ba12e(this['queryView']['fieldView']['element']),_0xc23493=_0x435c5f['width'],_0x457732='rtl'===_0x184d51['uiLanguageDirection']?'left':'right';_0x435c5f['excludeScrollbarsAndBorders'](),_0x4c8862['element']['style'][_0x457732]=_0xc23493-_0x435c5f['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x1b729f),this['on']('render',_0x1b729f),_0x4c8862;}['submit'](){const _0x5c52ee=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x5c52ee);}['focus'](_0x429e71){-0x1===_0x429e71?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class qr extends _0x24784f{['historyGroupView'];['clearHistoryButton'];constructor(_0x5a3ddb){super(_0x5a3ddb),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x23de91(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Fn(_0x5a3ddb,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x27d7c5=0x0;for(const _0x137611 of this['items'])_0x27d7c5+=_0x137611['items']['length'];return{'resultsCount':_0x27d7c5,'totalItemsCount':_0x27d7c5};}['_createClearHistoryButton'](){const _0x1e77b8=this['locale'],_0x3356f9=new _0x21bd9e(this['locale']);return _0x3356f9['set']({'label':'('+Fn(_0x1e77b8,'Clear')+')','withText':!0x0}),_0x3356f9['on']('execute',()=>this['fire']('clearHistory')),_0x3356f9;}}class Fr extends _0x8a8c30{constructor(_0x16f48f){super();const _0x42670f=new _0xb0531d(),_0x2e56b6=new _0x21bd9e(this['locale'],_0x42670f);this['children']['add'](_0x2e56b6),_0x2e56b6['set']({'label':_0x16f48f['prompt'],'withText':!0x0}),_0x2e56b6['on']('execute',()=>{this['fire']('execute',{'value':_0x2e79bc(_0x16f48f['prompt'])});});}}const Jo='CKEditor/AIFormView/PromptHistory';class Or extends _0x1c36f7{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x26dc57,_0x3a2ff4)=>{const _0xa230f2=Ko(_0x3a2ff4['prompt']);for(const _0x434b0d of this)if(_0x434b0d!=_0x3a2ff4&&Ko(_0x434b0d['prompt'])===_0xa230f2){this['remove'](_0x434b0d);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x14b81a=sessionStorage['getItem'](Jo)||'[]';this['addMany'](JSON['parse'](_0x14b81a));}['_saveToSessionStorage'](){sessionStorage['setItem'](Jo,JSON['stringify'](this['map'](_0x4dce61=>_0x4dce61)));}}function Ko(_0xe118ac){return _0xe118ac['toLowerCase']()['trim']();}class ui extends _0x492b6b{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x27cc81,_0x22316d,_0x4edde7=''){super(_0x27cc81),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',pi['REPLACE']),this['_promptHistory']=new Or(),this['errorView']=new Rr(_0x27cc81),this['contentArea']=new Hr(_0x27cc81,_0x4edde7),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 Bt(),this['keystrokes']=new Wt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Vt({'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 _0x25c940=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x22316d],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x25c940['if']('isError','ck-hidden',_0x5c014b=>!_0x5c014b)]},'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'](_0x3b4404=0x1){-0x1===_0x3b4404?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 _0x3aa2d1=this['locale'],_0xf85906=new Tr(_0x3aa2d1,{'queryView':{'label':Fn(_0x3aa2d1,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x1eaf41,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Fn(_0x3aa2d1,'Empty\x20history'),'secondary':Fn(_0x3aa2d1,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0xf85906['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2c03ff,_0x9b135a)=>_0x2c03ff&&!_0x9b135a),this['listenTo'](_0xf85906,'submit',(_0x16e2c4,_0x192c3c)=>{this['prompt']=_0x192c3c;const _0x2b7450=Zt(_0x192c3c);this['fire']('submitPrompt',_0x2b7450),_0x192c3c['trim']()&&this['_promptHistory']['add']({'prompt':_0x2b7450},0x0);},{'priority':'high'}),_0xf85906;}['_createHistoryView'](){const _0x2b5593=new qr(this['locale']);return _0x2b5593['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Fr),_0x2b5593['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2b5593;}['_createToolbar'](){const _0x59901d=new Er(this['locale']);return _0x59901d['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x68e2da,_0x125f74,_0x3b90e2)=>_0x68e2da&&!_0x125f74&&!!_0x3b90e2),_0x59901d['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x59901d['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3b0c21,_0x37c22,_0x1f3cc2)=>_0x3b0c21&&!_0x37c22&&!!_0x1f3cc2),_0x59901d['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x59901d['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4e0be8,_0x49e2df)=>_0x4e0be8&&!_0x49e2df),_0x59901d['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x59901d['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x59901d['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x59901d;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0xb9e842=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Fn(_0xb9e842,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x80ed9b){const _0x2d1532=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x80ed9b||Fn(_0x2d1532,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const dt=globalThis['DataTransfer'];class ee extends _0x2a4cc7{['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[_0x2c5fc2,te,li,_0x43b27c];}constructor(_0xec4f73){super(_0xec4f73),_0xec4f73['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0xec4f73['config']['define']('ai.assistant.contentAreaCssClass',''),_0xec4f73['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0xec4f73['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x36ea1e}=this;this['_aiAdapter']=_0x36ea1e['plugins']['get'](li),this['_dialog']=_0x36ea1e['plugins']['get'](_0x43b27c),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x436460=new hi(_0x36ea1e,Array['from'](this['_commandDefinitions']['values']()));_0x36ea1e['commands']['add']('showAIAssistant',_0x436460),_0x36ea1e['ui']['componentFactory']['add']('aiCommands',_0x281a5d=>{const _0x202434=_0x35c3bd(_0x281a5d);return _0x202434['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x202434['buttonView']['set']({'label':Fn(_0x281a5d,'AI\x20Commands'),'icon':_0x5253a5,'tooltip':!0x0}),_0x202434['on']('execute',_0x45d99c=>this['_onExecute'](_0x45d99c['source']['id'])),_0x571ded(_0x202434,_0x36ea1e['ui']['view']['body'],function(_0x8b2cb2){const _0x30200c=ne(_0x8b2cb2['config']['get']('ai.assistant.commands'),_0x8b2cb2['locale']),_0x1e0bb7=wi(_0x8b2cb2,_0x30200c)['filter'](_0x4e115e=>_0x4e115e['commands']['length']);if(0x1===_0x1e0bb7['length'])return wi(_0x8b2cb2,_0x1e0bb7[0x0]['commands'])['map'](_0x459ad2=>({'id':_0x459ad2['id'],'label':_0x459ad2['label']}));return _0x1e0bb7['map'](_0x50a0fa=>{const {groupId:_0x498f87,groupLabel:_0xaf8e74,commands:_0x4b3c8f}=_0x50a0fa,_0x4247cd=wi(_0x8b2cb2,_0x4b3c8f)['map'](_0x4ea18f=>({'id':_0x4ea18f['id'],'label':_0x4ea18f['label']}));return{'id':_0x498f87,'menu':_0xaf8e74||_0x498f87,'children':_0x4247cd};});}(_0x36ea1e),{'ariaLabel':Fn(_0x281a5d,'AI\x20Commands')}),_0x202434['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x436460['on']('change:enabledCommandsIds',_0x15e762),_0x202434['menuView']['once']('render',_0x15e762),_0x202434;function _0x15e762(){_0x202434['isEnabled']=_0x436460['enabledCommandsIds']['length']>0x0;for(const _0x2827ea of _0x202434['menuView']['buttons'])_0x2827ea['isEnabled']=_0x436460['enabledCommandsIds']['includes'](_0x2827ea['id']);}}),_0x36ea1e['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3e108f=>{const _0x50caee=new _0xc03205(_0x3e108f);_0x50caee['buttonView']['set']({'label':Fn(_0x3e108f,'AI\x20Commands'),'icon':_0x5253a5}),_0x50caee['bind']('isEnabled')['to'](_0x436460,'enabledCommandsIds',_0x3c5783=>_0x3c5783['length']>0x0);const _0x4ec567=ne(_0x36ea1e['config']['get']('ai.assistant.commands'),_0x3e108f);return this['_populateMenuBarMenu'](_0x436460,_0x50caee,_0x4ec567,_0x3802e7=>this['_onExecute'](_0x3802e7)),_0x50caee;}),_0x36ea1e['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x4b1db8=this['_createAIAssistantUIButton'](_0x21bd9e);return _0x4b1db8['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x4b1db8;}),_0x36ea1e['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x454fd6=this['_createAIAssistantUIButton'](_0x4f4ee6);return _0x454fd6['set']({'role':'menuitemcheckbox'}),_0x454fd6;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0xf56b4f=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x6a3d6;for(const _0x3c15fc in _0xf56b4f){const _0x8e5292=_0x3c15fc,_0x1f18e2=_0xf56b4f[_0x8e5292];if('aiLicenseKeyValid'==_0x1f18e2||'aiLicenseKeyInvalid'==_0x1f18e2||'aiLicenseKeyExpired'==_0x1f18e2||'aiLicenseKeyDomainLimit'==_0x1f18e2||'aiLicenseKeyNotAllowed'==_0x1f18e2||'aiLicenseKeyEvaluationLimit'==_0x1f18e2||'aiLicenseKeyTrialLimit'==_0x1f18e2||'aiLicenseKeyUsageLimit'==_0x1f18e2){delete _0xf56b4f[_0x8e5292],_0x6a3d6=_0x1f18e2,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x6a3d6&&_0xf56b4f['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x6a3d6&&_0xf56b4f['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x6a3d6&&_0xf56b4f['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x6a3d6&&_0xf56b4f['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x6a3d6&&_0xf56b4f['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x6a3d6&&_0xf56b4f['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x6a3d6&&_0xf56b4f['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x15db7f='',_0x3120fa='',_0x7579d9='custom'){const _0x979794=this['editor'],_0x8269d1=_0x979794['editing']['view'],_0xd1dd5a=_0x979794['plugins']['get'](te),_0xf883b9=_0x979794['plugins']['get'](_0x2c5fc2);_0xd1dd5a['showFakeVisualSelection']();const _0x4d9d9c=new dt(),_0x133b26=new ClipboardEvent('copy',{'clipboardData':_0x4d9d9c}),_0x3b5441=new ft(_0x4d9d9c),_0x48d6ff=new wt(_0x8269d1,_0x133b26,{'dataTransfer':_0x3b5441});_0xf883b9['_forceMarkersCopy']('comment',()=>{_0x8269d1['document']['fire']('copy',_0x48d6ff);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new di(_0x979794,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x573c9a=_0x3b5441['getData']('text/html');const _0x329c24=_0x979794['model']['document']['selection'],_0x5cfe1c=Array['from'](_0x329c24['getRanges']());0x1===_0x5cfe1c['length']&&_0x5cfe1c[0x0]['isFlat']&&!_0x329c24['getSelectedElement']()&&''!==_0x573c9a['replace'](/&nbsp;/g,'')['trim']()&&(_0x573c9a='<p>'+_0x573c9a+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x7579d9,'query':_0x15db7f,'htmlContent':_0x573c9a,'label':_0x3120fa,'mainActionLabel':pi[_0x979794['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ti,'title':Fn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x6f5cfb['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0xd1dd5a['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x15e564=new Map(),_0x43d98e=ne(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x5c05ec of _0x43d98e)for(const _0x1c8c0f of _0x5c05ec['commands'])_0x15e564['set'](_0x1c8c0f['id'],{..._0x1c8c0f,'groupId':_0x5c05ec['groupId'],'groupLabel':_0x5c05ec['groupLabel']||_0x5c05ec['groupId']});return _0x15e564;}['_createAIAssistantUIButton'](_0x24fdac){const _0x174368=this['editor'],_0x444972=_0x174368['commands']['get']('showAIAssistant'),_0x1ea61e=new _0x24fdac(_0x174368['locale']);return _0x1ea61e['set']({'label':Fn(_0x174368['locale'],'AI\x20Assistant'),'icon':ti,'isToggleable':!0x0}),_0x1ea61e['bind']('isEnabled')['to'](_0x444972),_0x1ea61e['bind']('isOn')['to'](this['_dialog'],'id',_0x298657=>'aiAssistant'===_0x298657),this['listenTo'](_0x1ea61e,'execute',()=>{_0x1ea61e['isOn']?this['hideUI']():_0x444972['execute']();}),_0x1ea61e;}['_initView'](){const _0x1d3e5c=this['editor']['plugins']['get'](te);this['_formView']=new ui(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',()=>{_0x1d3e5c['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x1d3e5c['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x5c5770,ui:{ariaLiveAnnouncer:_0x4d196c}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x4216f5,_0x1ff88d,_0x101ef3)=>{const _0x19aa17=this['_aiAssistantController']['currentContext'];_0x101ef3?_0x4d196c['announce'](Fn(_0x5c5770,'AI\x20is\x20writing')):_0x19aa17&&_0x4d196c['announce'](Fn(_0x5c5770,'Generated\x20content:\x20%0',_0x19aa17),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x362306,_0xb2c2f1,_0x1e7d76)=>{if(_0x1e7d76){const _0x3b85da=this['_formView']['errorView']['text'];_0x4d196c['announce'](Fn(_0x5c5770,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3b85da));}});}['_onExecute'](_0x40d4b2){const _0xe4e6a9=this['_commandDefinitions']['get'](_0x40d4b2),_0x12c68e=this['editor'],_0x341cd3=_0x12c68e['model']['document']['selection'],_0x26fa2e=_0x12c68e['commands']['get']('showAIAssistant'),_0x4aeedb=_0x12c68e['plugins']['get'](te),_0x4cc19d=''+(_0xe4e6a9['groupId']!==mi?_0xe4e6a9['groupLabel']+':\x20':'')+_0xe4e6a9['label'];if(!0x1!==_0xe4e6a9['requiresContent']&&_0x341cd3['isCollapsed']){const _0x282272=_0x4e3c0f(_0x341cd3['getSelectedBlocks']())||_0x12c68e['model']['schema']['getLimitElement'](_0x341cd3);_0x12c68e['model']['change'](_0x2b6722=>{_0x2b6722['setSelection'](_0x282272,'in');});}_0x4aeedb['showFakeVisualSelection'](),_0x26fa2e['execute'](_0xe4e6a9['prompt'],_0x4cc19d,'command:'+_0x40d4b2);}['_populateMenuBarMenu'](_0x7a5325,_0x1915a9,_0x1844ba,_0x30af4a){const _0x271d7a=this['editor'],_0x528ce6=_0x271d7a['locale'],_0x7a1bff=new _0x1c5a64(_0x528ce6),_0x106ba4=wi(_0x271d7a,_0x1844ba)['filter'](_0x1dbb92=>_0x1dbb92['commands']['length']);0x1===_0x106ba4['length']?this['_getMenuBarGroupButtons']({'command':_0x7a5325,'commands':_0x106ba4[0x0]['commands'],'parentMenuView':_0x1915a9,'onExecute':_0x30af4a})['forEach'](_0x49e078=>_0x7a1bff['items']['add'](_0x49e078)):_0x106ba4['forEach'](({groupId:_0xaa73a9,groupLabel:_0x3638c8,commands:_0xb25dce})=>{const _0x4660a3=new _0x4b1a57(_0x528ce6,_0x1915a9),_0x3f85ae=new _0xc03205(_0x528ce6),_0x4f2d06=new _0x1c5a64(_0x528ce6),_0x132d9a=this['_getMenuBarGroupButtons']({'command':_0x7a5325,'commands':_0xb25dce,'parentMenuView':_0x3f85ae,'onExecute':_0x30af4a});_0x3f85ae['buttonView']['set']({'label':_0x3638c8||_0xaa73a9}),_0x3f85ae['delegate']('execute')['to'](_0x1915a9),_0x4f2d06['items']['addMany'](_0x132d9a),_0x3f85ae['panelView']['children']['add'](_0x4f2d06),_0x4660a3['children']['add'](_0x3f85ae),_0x7a1bff['items']['add'](_0x4660a3);}),_0x1915a9['panelView']['children']['add'](_0x7a1bff);}['_getMenuBarGroupButtons']({command:_0x243b41,commands:_0x36a829,parentMenuView:_0x799f9d,onExecute:_0x382798}){const _0x2e4dcb=this['editor'],_0x3f5766=_0x2e4dcb['locale'];return wi(_0x2e4dcb,_0x36a829)['map'](_0x57f065=>{const _0xfb5ee7=new _0x4b1a57(_0x3f5766,_0x799f9d),_0x4a16b6=new _0x4f4ee6(_0x3f5766);return _0x4a16b6['set']({'label':_0x57f065['label']}),_0x4a16b6['delegate']('execute')['to'](_0x799f9d),_0x4a16b6['on']('execute',()=>_0x382798(_0x57f065['id'])),_0x4a16b6['bind']('isEnabled')['to'](_0x243b41,'enabledCommandsIds',_0x3784c5=>_0x3784c5['includes'](_0x57f065['id'])),_0xfb5ee7['children']['add'](_0x4a16b6),_0xfb5ee7;});}}function Ai(_0x2ac6a7,_0x51024b){return void 0x0!==_0x2ac6a7['order']&&void 0x0===_0x51024b['order']?0x1:void 0x0===_0x2ac6a7['order']&&void 0x0!==_0x51024b['order']?-0x1:void 0x0!==_0x2ac6a7['order']&&void 0x0!==_0x51024b['order']?_0x2ac6a7['order']-_0x51024b['order']:0x0;}function wi(_0x10e4dd,_0x569093){_0x569093['sort'](Ai);const _0x52127b={},_0x154128=[];for(const _0x5e3082 of _0x569093)if(void 0x0!==_0x5e3082['order']){if(_0x5e3082['order']in _0x52127b)throw new _0x19ee7d('ai-commands-config-order-collision',_0x10e4dd,{'conflictingDefinitions':[_0x5e3082,_0x52127b[_0x5e3082['order']]]});_0x52127b[_0x5e3082['order']]=_0x5e3082,_0x154128['splice'](_0x5e3082['order'],0x0,_0x5e3082);}else _0x154128['push'](_0x5e3082);return _0x154128;}class $n extends _0x2a4cc7{static get['requires'](){return[ee,te];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2019c6){super(_0x2019c6);const _0x353c26=_0x2019c6['config'],_0x249178=_0x2019c6['locale'];_0x353c26['define']('ai.assistant.preserveComments',!0x0),_0x353c26['define']('ai.assistant.commands',qn(_0x249178)),_0x353c26['define']('ai.assistant.extraCommandGroups',[]),_0x353c26['define']('ai.assistant.removeCommands',[]);let _0x5a9d53=ne(_0x353c26['get']('ai.assistant.commands'),_0x249178);const _0x2b4294=_0x353c26['get']('ai.assistant.extraCommandGroups'),_0x4ef4a1=_0x353c26['get']('ai.assistant.removeCommands');_0x2b4294['forEach'](_0x380fb8=>{const _0x219947=_0x5a9d53['find'](_0x17cf67=>_0x17cf67['groupId']===_0x380fb8['groupId']);_0x219947?_0x219947['commands']=_0x219947['commands']['concat'](_0x380fb8['commands']):_0x5a9d53['push'](_0x380fb8);}),_0x5a9d53=_0x5a9d53['filter'](_0xed238a=>!_0x4ef4a1['includes'](_0xed238a['groupId'])),_0x5a9d53['forEach'](_0x53eb63=>{_0x53eb63['commands']=_0x53eb63['commands']['filter'](_0x30c7a1=>!_0x4ef4a1['includes'](_0x30c7a1['id']));}),_0x353c26['set']('ai.assistant.commands',_0x5a9d53);}}function qn(_0x19947a){return[{'groupId':'editOrReview','groupLabel':Fn(_0x19947a,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Fn(_0x19947a,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Fn(_0x19947a,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':Fn(_0x19947a,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Fn(_0x19947a,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':Fn(_0x19947a,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Fn(_0x19947a,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':Fn(_0x19947a,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':Fn(_0x19947a,'Change\x20tone'),'commands':[{'id':'professional','label':Fn(_0x19947a,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Fn(_0x19947a,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Fn(_0x19947a,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Fn(_0x19947a,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Fn(_0x19947a,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Fn(_0x19947a,'Change\x20style'),'commands':[{'id':'business','label':Fn(_0x19947a,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Fn(_0x19947a,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Fn(_0x19947a,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Fn(_0x19947a,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Fn(_0x19947a,'Translate'),'commands':[{'id':'translateEnglish','label':Fn(_0x19947a,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Fn(_0x19947a,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Fn(_0x19947a,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Fn(_0x19947a,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Fn(_0x19947a,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Fn(_0x19947a,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Fn(_0x19947a,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Fn(_0x19947a,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class Te extends _0x2a4cc7{['abortController'];static get['requires'](){return[li];}constructor(_0x404b9b){super(_0x404b9b),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](li)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x5bb988){return this['sendRequest'](_0x5bb988)['catch'](_0x979397=>{if(_0x979397 instanceof tr)return Promise['reject'](_0x979397);if('AbortError'==_0x979397['name'])return Promise['resolve']();throw console['error'](_0x979397),new _0x19ee7d('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x214157,_0x2705b8){const _0x56cc2b=this['editor']['locale'],_0x18231c={'Content-Type':'application/json'};if('object'==typeof _0x214157)Object['assign'](_0x18231c,_0x214157);else{if(_0x214157)try{const _0x2bb1aa=await _0x214157(_0x2705b8);Object['assign'](_0x18231c,_0x2bb1aa);}catch{return Promise['reject'](new tr(Fn(_0x56cc2b,'AI_ERROR_GET_HEADERS')));}}return _0x18231c;}async['_prepareRequestParameters'](_0x491794,_0x8ed49){const _0x41b897=this['editor']['locale'];if('object'==typeof _0x491794)return _0x491794;try{return await _0x491794(_0x8ed49);}catch{return Promise['reject'](new tr(Fn(_0x41b897,'AI_ERROR_GET_PARAMETERS')));}}}class Qn extends Te{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x28975c){super(_0x28975c),_0x28975c['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x28975c['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x28975c['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x28975c['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x28975c['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x28975c['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x2b3b12,context:_0xe03a14,onData:_0x4d7aa7,actionId:_0x3b5224}){const _0x3e3fa0=this['editor']['locale'],_0x593eb6=await this['prepareMessages'](_0x2b3b12,_0xe03a14,_0x3b5224),_0xae0dba=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3b5224),_0x293af6=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3b5224),_0x43a657={'messages':_0x593eb6,..._0x293af6},_0x42bcf3={'method':'POST','headers':_0xae0dba,'body':JSON['stringify'](_0x43a657),'signal':this['abortController']['signal']},_0x519326=await fetch(this['_apiUrl'],_0x42bcf3);if(_0x519326['ok'])return _0x293af6['stream']?await this['_readStreamableResponse'](_0x519326,_0x4d7aa7):await this['_readStaticResponse'](_0x519326,_0x4d7aa7),Promise['resolve']();{const _0x2c3ba6=await _0x519326['text']();return _0x2c3ba6['includes']('context_length_exceeded')?Promise['reject'](new tr(Fn(_0x3e3fa0,'AI_ERROR_CONTEXT_LENGTH'))):_0x2c3ba6['includes']('Moderation')?Promise['reject'](new tr(Fn(_0x3e3fa0,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x2c3ba6));}}async['prepareMessages'](_0x464f8d,_0x114971,_0x5f3576){let _0x747ea2,_0x3eb253;return _0x114971?(_0x747ea2='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.',_0x3eb253='Instruction:\x0a'+_0x464f8d+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x114971):(_0x747ea2='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.',_0x3eb253=_0x464f8d),[{'role':'system','content':_0x747ea2},{'role':'user','content':_0x3eb253}];}async['_readStreamableResponse'](_0x466d19,_0xefe150){const _0x1cb23c=_0x466d19['body']['getReader'](),_0x4c3f43=new TextDecoder();let _0x151220='',_0x2e2e63='',_0xa217ce='',_0x2cf0ae=!0x1;for(;!_0x2cf0ae;){const {done:_0x570a21,value:_0x665a85}=await _0x1cb23c['read'](),_0x391e11=_0x151220+_0x4c3f43['decode'](_0x665a85);let _0x4cfa3a='';_0x2cf0ae=_0x570a21;try{_0x4cfa3a=this['_cleanUpData'](_0x391e11),_0x151220='';}catch{_0x151220=_0x391e11;continue;}_0x2e2e63+=_0x4cfa3a,!_0x2cf0ae&&this['_isBufferIncomplete'](_0x2e2e63)||_0x2e2e63&&(_0xa217ce+=_0x2e2e63,_0x2e2e63='',_0xefe150(_0xa217ce));}return Promise['resolve']();}async['_readStaticResponse'](_0x5923ac,_0x4551d6){return _0x4551d6((await _0x5923ac['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x1dd068){const _0x302c93=_0x1dd068['split']('<')['length']!==_0x1dd068['split']('>')['length'],_0x300c3d=_0x1dd068['length']<0x1e;return _0x302c93&&_0x300c3d;}['_cleanUpData'](_0x5d0365){return _0x5d0365['split'](/\n(?![^{]*\})/g)['map'](_0x486ccc=>_0x486ccc['replace']('data:\x20',''))['filter'](_0x284138=>_0x284138&&_0x284138['length']>0x0&&'[DONE]'!==_0x284138)['map'](_0x5bd9b0=>{const {choices:_0x327ef6}=JSON['parse'](_0x5bd9b0);if(_0x327ef6[0x0]?.['delta']?.['content'])return _0x327ef6[0x0]['delta']['content'];})['filter'](_0x525611=>_0x525611)['join']('');}}class Xn extends Te{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x3195da){super(_0x3195da),_0x3195da['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x3195da['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']=_0x3195da['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x3195da['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x3195da['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x3195da['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x6a0f68,context:_0x4c258a,onData:_0xebe5fa,actionId:_0x29361c}){const {model:_0x366695,stream:_0x350cd3,..._0x17e76d}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x29361c),_0x12eefe={'prompt':await this['preparePrompt'](_0x6a0f68,_0x4c258a,_0x366695,_0x29361c),..._0x17e76d};this['_apiUrl']?await this['_processProxyRequest'](_0x12eefe,_0x366695,_0x350cd3,_0xebe5fa,_0x29361c):await this['_processAWSRequest'](_0x12eefe,_0x366695,_0x350cd3,_0xebe5fa);}async['preparePrompt'](_0x48bb81,_0x6daeef,_0xf9c5fd,_0x226d24){let _0x236b67,_0x4511df;return _0x6daeef?(_0x236b67='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.',_0x4511df='Instruction:\x0a'+_0x48bb81+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x6daeef):(_0x236b67='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.',_0x4511df=_0x48bb81),'meta.llama'==this['getModelFamily'](_0xf9c5fd)?'<<SYS>>\x0a'+_0x236b67+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x4511df+'\x0a[/INST]':'Human:\x0a'+_0x236b67+'\x0a'+_0x4511df+'\x0a\x0aAssistant:';}['getModelFamily'](_0x5ee31b){if(/^anthropic\.claude/['test'](_0x5ee31b))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x5ee31b))return'ai21.j2';if(/^cohere\.command/['test'](_0x5ee31b))return'cohere.command';if(/^meta\.llama/['test'](_0x5ee31b))return'meta.llama';throw new tr(Fn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x5ee31b));}async['_processProxyRequest'](_0x261381,_0x390e16,_0x274bf3,_0x16c371,_0x40ff2c){const _0x197eda={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x40ff2c),'body':JSON['stringify']({..._0x261381,'model':_0x390e16,'stream':_0x274bf3}),'signal':this['abortController']['signal']},_0x410274=await fetch(this['_apiUrl'],_0x197eda);_0x274bf3?await this['_readStreamableResponse'](_0x410274,_0x390e16,_0x16c371):await this['_readStaticResponse'](_0x410274,_0x390e16,_0x16c371);}async['_processAWSRequest'](_0x3f20f0,_0x2e4447,_0x192fbd,_0x1a0360){const _0x32f10e=new _0x21bcef(this['_bedrockClientConfig']),_0x25bdfb={'body':JSON['stringify'](_0x3f20f0),'contentType':'application/json','accept':'application/json','modelId':_0x2e4447};let _0x39c681;if(_0x192fbd){const _0x4c5f92=new _0x35b305(_0x25bdfb);_0x39c681=await _0x32f10e['send'](_0x4c5f92,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x39c681,_0x2e4447,_0x1a0360);}else{const _0x310bdc=new _0x8386c5(_0x25bdfb);_0x39c681=await _0x32f10e['send'](_0x310bdc,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x39c681,_0x2e4447,_0x1a0360);}}async['_readAsyncIterableResponse'](_0x5aa526,_0x4d8339,_0x21b6cf){const _0x563636=_0x5aa526['body'],_0xf4095b=new TextDecoder('utf-8');let _0x4f8459='';for await(const _0x28cf37 of _0x563636)if(_0x28cf37['chunk']){const _0xf7ebf4=_0xf4095b['decode'](_0x28cf37['chunk']['bytes']),_0x54fe49=JSON['parse'](_0xf7ebf4);_0x4f8459+=this['_getGeneratedText'](_0x54fe49,_0x4d8339),_0x21b6cf(_0x4f8459);}return Promise['resolve']();}async['_readStreamableResponse'](_0x596aa5,_0x1790d4,_0x1e769b){const _0x4b053c=_0x596aa5['body'],_0x1031fd=new TextDecoder('utf-8'),_0x36b339=_0x4b053c['getReader']();let _0x5aa8bd='',_0x95c794='',_0xbd052=!0x1;for(;!_0xbd052;){const {done:_0x25edc8,value:_0x4c732f}=await _0x36b339['read']();if(_0xbd052=_0x25edc8,_0xbd052)break;const _0x57ef64=(_0x5aa8bd+_0x1031fd['decode'](_0x4c732f))['split']('\x0a')['map'](_0x4e50f3=>{try{return _0x5aa8bd='',JSON['parse'](_0x4e50f3);}catch{return _0x5aa8bd=_0x4e50f3,null;}})['filter'](_0x5b11cb=>null!==_0x5b11cb);_0x57ef64['length']&&(_0x95c794+=_0x57ef64['map'](_0x249c68=>this['_getGeneratedText'](_0x249c68,_0x1790d4))['join'](''),_0x1e769b(_0x95c794));}return Promise['resolve']();}async['_readStaticResponse'](_0x6625a0,_0x332580,_0x385cb8){let _0x5d8ee3;return _0x5d8ee3=_0x6625a0 instanceof Response?await _0x6625a0['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x6625a0['body'])),(_0x385cb8(this['_getGeneratedText'](_0x5d8ee3,_0x332580)),Promise['resolve']());}['_getGeneratedText'](_0x299e6b,_0x34033c){switch(this['getModelFamily'](_0x34033c)){case'anthropic.claude':return _0x299e6b['completion'];case'ai21.j2':return _0x299e6b['completions'][0x0]['data']['text'];case'cohere.command':return _0x299e6b['generations'][0x0]['text'];case'meta.llama':return _0x299e6b['generation'];}}}class ia extends _0x21bd9e{constructor(_0x2e0459,_0x2f71de={}){super(_0x2e0459),this['isToggleable']=!0x0,this['set']('side',_0x2f71de['side']||'top');const _0x523338=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x719a8(_0x2f71de['class']||[]),_0x523338['to']('side',_0x4af477=>'ck-tab-button_'+_0x4af477),_0x523338['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x492b6b{['children'];constructor(_0x477807,_0x30130b={}){super(_0x477807);const _0x185378=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x719a8(_0x30130b['class']||[]),_0x185378['to']('class'),_0x185378['if']('isVisible','ck-hidden',_0x5779b4=>!_0x5779b4)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x492b6b{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0xf8dc24,_0x326888={}){super(_0xf8dc24),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x326888['side']||'top'),this['set']('isMaximized',!0x1);const _0x24b563=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x719a8(_0x326888['class']||[]),_0x24b563['to']('side',_0x1f1f4b=>'ck-tabs_'+_0x1f1f4b),_0x24b563['to']('class'),_0x24b563['to']('isMaximized',_0x3f77a7=>_0x3f77a7?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x24b563['to']('side',_0x137865=>'ck-tabs__buttons-container_'+_0x137865)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x24b563['to']('side',_0x946a5f=>'ck-tabs__panels-container_'+_0x946a5f)]},'children':this['panelViews']},..._0x719a8(_0x326888['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x4969b0){const _0x33d43c=this['_tabs']['get'](_0x4969b0);return _0x33d43c||null;}['addTab'](_0x3059d8){const _0x77cf8=this['_setupButton']({'id':_0x3059d8['id'],'label':_0x3059d8['buttonLabel'],'icon':_0x3059d8['buttonIcon'],'order':_0x3059d8['order']}),_0x53ee18=new ea(this['locale']);return _0x53ee18['render'](),_0x3059d8['content']&&_0x53ee18['children']['add'](_0x3059d8['content']),this['panelViews']['add'](_0x53ee18),this['_tabs']['set'](_0x3059d8['id'],{'button':_0x77cf8,'panel':_0x53ee18,'order':void 0x0!==_0x3059d8['order']?_0x3059d8['order']:null}),this['fire']('addTab:'+_0x3059d8['id'],{'id':_0x3059d8['id'],'button':_0x77cf8,'panel':_0x53ee18}),null===this['activeTab']?this['activateTab'](_0x3059d8['id']):this['_hidePanel'](_0x3059d8['id']),{'button':_0x77cf8,'panel':_0x53ee18};}['activateTab'](_0xba05bb){if(null!==_0xba05bb&&!this['getTab'](_0xba05bb))throw new _0x19ee7d('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xba05bb});this['activeTab']!==_0xba05bb&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0xba05bb,_0xba05bb&&this['_showPanel'](_0xba05bb),this['fire']('activateTab:'+_0xba05bb,_0xba05bb));}['showTab'](_0xd8ef0a){if(!this['getTab'](_0xd8ef0a))throw new _0x19ee7d('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xd8ef0a});this['_showPanel'](_0xd8ef0a),this['_showButton'](_0xd8ef0a),this['fire']('show:'+_0xd8ef0a,_0xd8ef0a);}['hideTab'](_0x1c3fc2){if(!this['getTab'](_0x1c3fc2))throw new _0x19ee7d('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x1c3fc2});const _0x4e6975=this['activeTab'];this['_hidePanel'](_0x1c3fc2),this['_hideButton'](_0x1c3fc2);const _0x207f07=this['getTabIds']();_0x4e6975===_0x1c3fc2&&_0x207f07['length']>0x1&&this['activateTab'](_0x207f07['find'](_0xccf9e0=>_0xccf9e0!==_0x1c3fc2)),this['fire']('hide:'+_0x1c3fc2,_0x1c3fc2);}['_getPanel'](_0x414c40){const _0xe2d3ce=this['_tabs']['get'](_0x414c40);return _0xe2d3ce?_0xe2d3ce['panel']:null;}['_showPanel'](_0x4e9508){null!==this['activeTab']&&this['activeTab']!==_0x4e9508||this['_getPanel'](_0x4e9508)['show']();}['_hidePanel'](_0x4e101b){const _0x20db32=this['_getPanel'](_0x4e101b);_0x20db32['isVisible']&&(this['activeTab']===_0x4e101b&&(this['activeTab']=null),_0x20db32['hide']());}['_getButton'](_0x262055){const _0x378796=this['_tabs']['get'](_0x262055);return _0x378796?_0x378796['button']:null;}['_showButton'](_0x2d3723){this['_getButton'](_0x2d3723)['show']();}['_hideButton'](_0x32b879){this['_getButton'](_0x32b879)['hide']();}['_setupButton'](_0x578598){const _0x167b31=new ia(this['locale'],{'side':this['side']}),_0x11cebf=this['buttonViews'];if(_0x167b31['set']({'label':_0x578598['label'],'icon':_0x578598['icon'],'tooltip':!0x0,'withText':!0x0}),_0x167b31['bind']('isOn')['to'](this,'activeTab',_0x415a06=>_0x415a06===_0x578598['id']),_0x167b31['bind']('side')['to'](this,'side'),_0x578598['order']){const _0x5a2efd=[...this['_tabs']]['reduce']((_0x34c012,_0x4c1a65)=>{const _0x4fb481=_0x4c1a65[0x0],{order:_0x122c58}=_0x4c1a65[0x1];return!_0x122c58||_0x122c58>_0x578598['order']?_0x34c012:_0x122c58>=_0x34c012['order']?{'id':_0x4fb481,'order':_0x122c58}:_0x34c012;},{'id':'','order':0x0}),_0x1f3676=_0x11cebf['getIndex'](this['_getButton'](_0x5a2efd['id']));_0x11cebf['add'](_0x167b31,_0x1f3676+0x1);}else _0x11cebf['add'](_0x167b31);return _0x167b31['on']('execute',()=>{this['activateTab'](_0x578598['id']);}),_0x167b31;}}const Ti=['overlay','sidebar','custom'],yi=['left','right'];class bi extends ss{constructor(_0x13eb97,_0x4b18ca={}){super(_0x13eb97,_0x4b18ca),this['set']('type',_0x4b18ca['type']||'sidebar'),this['set']('side',_0x4b18ca['side']||'right'),this['set']('isVisible',_0x4b18ca['visibleByDefault']??!0x0);const _0xaca920=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0xaca920['if']('type','ck-ai-tabs__overlay',_0x169e02=>'overlay'===_0x169e02),_0xaca920['if']('type','ck-ai-tabs__sidebar',_0x34cc22=>'sidebar'===_0x34cc22),_0xaca920['if']('isVisible','ck-hidden',_0x4da9f0=>!_0x4da9f0)]}}),this['buttonViews']['on']('add',(_0x5f245f,_0x12b7bf)=>{_0x12b7bf['set']('withText',!0x1);});}}class $ extends _0x4404b9{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1b30fb){super(_0x1b30fb);const _0x2e6454=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x2e6454)throw new _0x19ee7d('ai-tabs-configuration-not-found');if(void 0x0!==_0x2e6454['showResizeButton']&&(this['showResizeButton']=_0x2e6454['showResizeButton']),'sidebar'!==_0x2e6454['type']&&'overlay'!==_0x2e6454['type']||_0x2e6454['side']&&(this['side']=_0x2e6454['side']),'sidebar'===_0x2e6454['type']){if(this['container']=_0x2e6454['element'],this['set']('type','sidebar'),!this['container'])throw new _0x19ee7d('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x2e6454['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new bi(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x2e6454['visibleByDefault']||_0x2e6454['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 _0x1e9e1e&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x1db16e){if(_0x1db16e&&this['type']!==_0x1db16e){if(!Ti['includes'](_0x1db16e))throw new _0x19ee7d('ai-tabs-unsupported-ui-type');this['type']=_0x1db16e;}}['switchSide'](_0x37e246){if(_0x37e246&&this['side']!==_0x37e246){if(!yi['includes'](_0x37e246))throw new _0x19ee7d('ai-tabs-unsupported-ui-side');this['side']=_0x37e246;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class s extends _0x4404b9{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3c6703){super(_0x3c6703),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 _0x427c56=this['context']['plugins']['get']('CloudServices');if(!_0x427c56['token'])throw new _0x19ee7d('ai-missing-token',this);this['_token']=_0x427c56['token'];}['startConversation'](_0x107725,_0x255ab4){const _0x4e495f=this['_sendApiRequest']('/conversations','POST',{'id':_0x107725,'group':_0x255ab4});return{'getConversation':async()=>(await _0x4e495f['request'])['json'](),'abortController':_0x4e495f['abortController']};}['queryAssistant']({message:_0x10aa9a,conversationId:_0x10785f,parts:_0x13bc12,capabilities:_0xc58df3,model:_0x548323,quickActionData:_0x5e450c}){const _0x1977f3={..._0x5e450c&&{'quickActionData':_0x5e450c}},_0x5643ed={'prompt':_0x10aa9a,'content':_0x13bc12,'model':_0x548323,..._0xc58df3&&{'capabilities':_0xc58df3},...Object['keys'](_0x1977f3)['length']>0x0&&{'attributes':_0x1977f3}},_0x1db9de=this['_sendApiRequest']('/conversations/'+_0x10785f+'/messages','POST',_0x5643ed);return{'getStream':async()=>{const _0x25155b=(await _0x1db9de['request'])['body'];return this['_getStreamReader'](_0x25155b);},'abortController':_0x1db9de['abortController']};}['executeCustomAction']({content:_0x53d284,message:_0x13ccc2,model:_0x932921,outputFormat:_0xae0db1}){const _0x3a6865={'content':[{'type':'text','content':_0x53d284}],'prompt':_0x13ccc2,'model':_0x932921,'outputFormat':_0xae0db1},_0x13873a=this['_sendApiRequest']('/actions/custom/calls','POST',_0x3a6865);return{'getStream':async()=>{const _0x2f0b66=(await _0x13873a['request'])['body'];return this['_getStreamReader'](_0x2f0b66);},'abortController':_0x13873a['abortController']};}['executeAction']({actionName:_0x299e04,content:_0x56358b,args:_0x6a9342}){const _0x11227d={'content':[{'type':'text','content':_0x56358b}],'args':_0x6a9342},_0x5cb2c6=this['_sendApiRequest']('/actions/system/'+_0x299e04+'/calls','POST',_0x11227d);return{'getStream':async()=>{const _0x500b30=(await _0x5cb2c6['request'])['body'];return this['_getStreamReader'](_0x500b30);},'abortController':_0x5cb2c6['abortController']};}['uploadFile'](_0x350e87,_0x242324,_0x50742e){const _0x5681d3=new FormData();_0x5681d3['append']('file',_0x242324,_0x242324['name']),_0x50742e&&_0x5681d3['append']('attributes',JSON['stringify'](_0x50742e));const _0x4f9072=this['_sendApiRequest']('/conversations/'+_0x350e87+'/files','POST',_0x5681d3);return{'getId':async()=>(await _0x4f9072['request'])['json'](),'abortController':_0x4f9072['abortController']};}['fetchDocument'](_0x24083a,_0x28ac6c){const _0x115521=this['_sendApiRequest']('/conversations/'+_0x24083a+'/documents/'+_0x28ac6c,'GET');return{'getDocument':async()=>(await _0x115521['request'])['json'](),'abortController':_0x115521['abortController']};}['uploadDocument'](_0x219a40,_0x47f579,_0x22331d){const _0x44b1a3={'content':_0x47f579};_0x22331d&&(_0x44b1a3['attributes']=_0x22331d);const _0x1a970d=this['_sendApiRequest']('/conversations/'+_0x219a40+'/documents','POST',_0x44b1a3);return{'getId':async()=>(await _0x1a970d['request'])['json'](),'abortController':_0x1a970d['abortController']};}['fetchConversations'](_0x37b692,_0xcb6764){const _0x180d2d=new URLSearchParams();_0x180d2d['append']('excludeEmpty','true'),_0x180d2d['append']('limit','100'),_0x180d2d['append']('group',_0x37b692),_0xcb6764&&_0x180d2d['append']('search',_0xcb6764);const _0x2ceda2=this['_sendApiRequest']('/conversations?'+_0x180d2d['toString'](),'GET');return{'getConversations':async()=>{const _0x3b6f81=await _0x2ceda2['request'];return(await _0x3b6f81['json']())['items'];},'abortController':_0x2ceda2['abortController']};}['deleteConversation'](_0x2a34c5){const _0x7f7ebc=this['_sendApiRequest']('/conversations/'+_0x2a34c5,'DELETE');return{'execute':async()=>{await _0x7f7ebc['request'];},'abortController':_0x7f7ebc['abortController']};}['updateConversation'](_0x29f42c,_0x349e43){const _0x30de37=this['_sendApiRequest']('/conversations/'+_0x29f42c,'PATCH',_0x349e43);return{'getResult':async()=>(await _0x30de37['request'],_0x349e43),'abortController':_0x30de37['abortController']};}['fetchConversation'](_0x13ebfe){const _0x453a46=this['_sendApiRequest']('/conversations/'+_0x13ebfe,'GET');return{'getConversation':async()=>(await _0x453a46['request'])['json'](),'abortController':_0x453a46['abortController']};}['fetchConversationMessages'](_0x4add5b){const _0x56c76a=this['_sendApiRequest']('/conversations/'+_0x4add5b+'/messages','GET');return{'getMessages':async()=>{const _0x540e58=await _0x56c76a['request'];return(await _0x540e58['json']())['items'];},'abortController':_0x56c76a['abortController']};}['uploadUrl'](_0x4245a4,_0x5a5ba5,_0x2da7aa){const _0x432712=this['_sendApiRequest']('/conversations/'+_0x4245a4+'/web-resources','POST',{'url':_0x5a5ba5,'attributes':_0x2da7aa});return{'getId':async()=>(await _0x432712['request'])['json'](),'abortController':_0x432712['abortController']};}['getModels'](){const _0x210ee7=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>await(await _0x210ee7['request'])['json'](),'abortController':_0x210ee7['abortController']};}['deleteFile'](_0x2b560d,_0x1a17f3){const _0x54f2a9=this['_sendApiRequest']('/conversations/'+_0x2b560d+'/files/'+_0x1a17f3,'DELETE');return{'execute':async()=>{await _0x54f2a9['request'];},'abortController':_0x54f2a9['abortController']};}['deleteDocument'](_0x12f3fc,_0x5945aa){const _0x59709a=this['_sendApiRequest']('/conversations/'+_0x12f3fc+'/documents/'+_0x5945aa,'DELETE');return{'execute':async()=>{await _0x59709a['request'];},'abortController':_0x59709a['abortController']};}['deleteWebResource'](_0x6cf114,_0x1ec9cb){const _0x471948=this['_sendApiRequest']('/conversations/'+_0x6cf114+'/web-resources/'+_0x1ec9cb,'DELETE');return{'execute':async()=>{await _0x471948['request'];},'abortController':_0x471948['abortController']};}['callSystemReview']({reviewName:_0x181318,content:_0x236b68,args:_0x48ce73}){const _0x1dda25=this['_sendApiRequest']('/reviews/system/'+_0x181318+'/calls','POST',{'content':[{'type':'text','content':_0x236b68}],'args':_0x48ce73});return{'getStream':async()=>{const _0x2c193f=(await _0x1dda25['request'])['body'];return this['_getStreamReader'](_0x2c193f);},'abortController':_0x1dda25['abortController']};}['callCustomReview']({content:_0x457cd1,prompt:_0x53cdf1,model:_0x518c02}){const _0x1ee866=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x457cd1}],'prompt':_0x53cdf1,'model':_0x518c02});return{'getStream':async()=>{const _0x42dcd8=(await _0x1ee866['request'])['body'];return this['_getStreamReader'](_0x42dcd8);},'abortController':_0x1ee866['abortController']};}['upsertAIChatRating'](_0x17f68f,_0xf79386,_0x2d6ec1){const _0x52db5c=this['_sendApiRequest']('/conversations/'+_0x17f68f+'/messages/'+_0xf79386+'/ratings','PUT',{'positiveCount':_0x2d6ec1['positiveCount'],'totalCount':_0x2d6ec1['totalCount'],'modificationId':_0x2d6ec1['modificationId']});return{'execute':async()=>{await _0x52db5c['request'];},'abortController':_0x52db5c['abortController']};}['upsertAIActionRating'](_0x52fced,_0x263aaa,_0x5e5308){const _0x540d92=this['_sendApiRequest']('/actions/system/'+_0x52fced+'/calls/'+_0x263aaa+'/ratings','PUT',{'positiveCount':_0x5e5308['positiveCount'],'totalCount':_0x5e5308['totalCount']});return{'execute':async()=>{await _0x540d92['request'];},'abortController':_0x540d92['abortController']};}['upsertCustomAIActionRating'](_0x4d99d2,_0x3ab2a2){const _0x53145e=this['_sendApiRequest']('/actions/custom/calls/'+_0x4d99d2+'/ratings','PUT',{'positiveCount':_0x3ab2a2['positiveCount'],'totalCount':_0x3ab2a2['totalCount']});return{'execute':async()=>{await _0x53145e['request'];},'abortController':_0x53145e['abortController']};}['upsertAIReviewRating'](_0x305e37,_0xeca5ef,_0x48c4b4,_0x2b795a){const _0x4b3534=this['_sendApiRequest']('/reviews/system/'+_0x305e37+'/calls/'+_0xeca5ef+'/ratings','PUT',{'positiveCount':_0x48c4b4['positiveCount'],'totalCount':_0x48c4b4['totalCount'],'dataId':_0x2b795a});return{'execute':async()=>{await _0x4b3534['request'];},'abortController':_0x4b3534['abortController']};}['upsertCustomAIReviewRating'](_0x39f944,_0x591380,_0x1eb465){const _0x2cff85=this['_sendApiRequest']('/reviews/custom/calls/'+_0x39f944+'/ratings','PUT',{'positiveCount':_0x591380['positiveCount'],'totalCount':_0x591380['totalCount'],'dataId':_0x1eb465});return{'execute':async()=>{await _0x2cff85['request'];},'abortController':_0x2cff85['abortController']};}['_sendApiRequest'](_0x1bb5bb,_0x39cdbd,_0x21390a){const _0x105234=new AbortController(),_0x2960a8=_0x21390a instanceof FormData,_0x473ccb={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x21390a&&!_0x2960a8&&(_0x473ccb['Content-Type']='application/json');const _0x5c15f0={'method':_0x39cdbd,'headers':_0x473ccb,'signal':_0x105234['signal']};return _0x21390a&&(_0x5c15f0['body']=_0x2960a8?_0x21390a:JSON['stringify'](_0x21390a)),{'request':fetch(''+this['_apiUrl']+_0x1bb5bb,_0x5c15f0)['catch'](_0x4b9235=>{this['_handleError'](_0x4b9235);})['then'](_0x1e49d3=>_0x1e49d3['ok']?_0x1e49d3:_0x1e49d3['json']()['then'](_0x3e59e3=>{throw{'url':this['_apiUrl'],'path':_0x1bb5bb,'method':_0x39cdbd,'body':_0x21390a,'status':(_0x1e49d3||{})['status'],'statusText':(_0x1e49d3||{})['statusText'],'code':_0x3e59e3['code'],'message':_0x3e59e3['message'],'traceId':_0x3e59e3['traceId']};})),'abortController':_0x105234};}async*['_getStreamReader'](_0x2fc916){const _0x2657a8=[],_0x24cf8e=_0x2fc916['getReader'](),_0x63ee4e=Ct({'onError':_0x40273a=>{this['_handleError'](_0x40273a);},'onEvent':_0x5adef6=>{_0x5adef6['data']=JSON['parse'](_0x5adef6['data']),_0x2657a8['push'](_0x5adef6);}});try{let _0x2f00a3=!0x1;for(;!_0x2f00a3;){const {done:_0xfebdbd,value:_0x419ae9}=await _0x24cf8e['read']();_0xfebdbd&&(_0x2f00a3=!0x0),_0x63ee4e['feed'](this['_decoder']['decode'](_0x419ae9,{'stream':!0x0})),yield*_0x2657a8,_0x2657a8['length']=0x0;}}catch(_0x4028ba){this['_handleError'](_0x4028ba);}finally{_0x24cf8e['releaseLock'](),_0x63ee4e['reset']();}}['_handleError'](_0xac009){if(_0xac009 instanceof _0x19ee7d)throw _0xac009;if(_0xac009 instanceof Error&&'AbortError'===_0xac009['name'])throw new _0x19ee7d('ai-request-aborted',this,{'originalError':_0xac009});throw new _0x19ee7d('ai-request-failed',this,{'originalError':_0xac009});}}function y(_0x43c77e,_0x513353,_0x34fff6){const t=_0x43c77e['t'];switch(_0x513353){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'},_0x34fff6);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_SHOW_IN_THE_TEXT':return t({'id':'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT','string':'Preview'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Insert\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Reject'});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_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\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});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.'},_0x34fff6);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.'},_0x34fff6);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_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.'},_0x34fff6);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_SHOW_CHANGE_IN_TEXT':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','string':'Preview','plural':'Preview'},_0x34fff6);case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP','string':'Show\x20change\x20in\x20the\x20document','plural':'Show\x20changes\x20in\x20the\x20document'},_0x34fff6);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x34fff6);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP','string':'Insert\x20change\x20as\x20suggestion','plural':'Insert\x20changes\x20as\x20suggestions'},_0x34fff6);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x34fff6);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20changes\x20immediately','plural':'Apply\x20all\x20changes\x20immediately'},_0x34fff6);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x34fff6);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.'},_0x34fff6);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.'},_0x34fff6);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.'},_0x34fff6);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.'},_0x34fff6);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'},_0x34fff6);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_TOOLTIP':return t({'id':'AI_BALLOON_NEXT_TOOLTIP','string':'Next'});case'AI_BALLOON_PREVIOUS_TOOLTIP':return t({'id':'AI_BALLOON_PREVIOUS_TOOLTIP','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_MODEL_DESCRIPTION_AUTO':return t({'id':'AI_MODEL_DESCRIPTION_AUTO','string':'Automatically\x20selects\x20best\x20model\x20for\x20speed,\x20quality,\x20and\x20cost.'});case'AI_MODEL_DESCRIPTION_GPT-5':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5','string':'OpenAI\x27s\x20flagship\x20model\x20for\x20advanced\x20reasoning,\x20creativity,\x20and\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GPT-5-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5-MINI','string':'A\x20lightweight\x20version\x20of\x20GPT-5\x20-\x20faster,\x20more\x20cost-efficient'});case'AI_MODEL_DESCRIPTION_GPT-4.1':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1','string':'OpenAI\x27s\x20model\x20for\x20reliable\x20reasoning,\x20speed,\x20and\x20versatility'});case'AI_MODEL_DESCRIPTION_GPT-4.1-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1-MINI','string':'A\x20lighter\x20variant\x20of\x20GPT-4.1\x20that\x20balances\x20speed\x20and\x20cost\x20while\x20maintaining\x20solid\x20accuracy'});case'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU','string':'Anthropic\x27s\x20fast,\x20cost-efficient\x20model\x20for\x20simpler\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-5-HAIKU','string':'Cost-efficient\x20model\x20for\x20quick\x20interactions\x20with\x20improved\x20reasoning'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET','string':'Advanced\x20model\x20with\x20strong\x20reasoning\x20and\x20reliability\x20for\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-5-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-5-SONNET','string':'Advanced\x20model\x20with\x20improved\x20creativity,\x20reliability,\x20and\x20reasoning'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO','string':'Google\x27s\x20advanced\x20model\x20for\x20versatile\x20problem-solving\x20and\x20research'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH','string':'Lightweight\x20Gemini\x20model\x20for\x20fast,\x20cost-efficient\x20interactions'});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.'},_0x34fff6);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_ACTIONS_SELECTION_REMOVED_ERROR':return t({'id':'AI_ACTIONS_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'});default:return _0x513353;}}function ms(_0x5b5298,_0x2c2298){const _0x51e5c8=new _0x21bd9e(_0x5b5298),_0x34d8bd=y(_0x5b5298,'AI_TABS_LABEL_MINIMIZE'),_0x313a9e=y(_0x5b5298,'AI_TABS_LABEL_MAXIMIZE');return _0x51e5c8['set']({'withText':!0x1,'icon':_0x1d3e4d,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x51e5c8['bind']('label')['to'](_0x2c2298,'isMaximized',_0x31064b=>_0x31064b?_0x34d8bd:_0x313a9e),_0x51e5c8['bind']('icon')['to'](_0x2c2298,'isMaximized',_0x57843f=>_0x57843f?to:_0x1d3e4d),_0x51e5c8['bind']('isOn')['to'](_0x2c2298,'isMaximized'),_0x51e5c8['on']('execute',()=>{_0x2c2298['fire']('resizeTabs');}),_0x51e5c8;}function Ne(_0x2a7db7){return _0x8953d3(_0x2a7db7);}function tt(_0x5886f1){return _0x20dcd7(_0x5886f1);}function st(_0xc99426,_0x4ef6bc,_0x290e28){const _0x5c58be=null!==_0x4ef6bc?_0x2cf9fe=>_0x2cf9fe['attribs'][_0xc99426]===_0x4ef6bc:_0x2118d2=>Boolean(_0x2118d2['attribs'][_0xc99426]);return _0x3019e1(_0x59a0c6=>_0x1a9650(_0x59a0c6)&&_0x5c58be(_0x59a0c6),_0x290e28);}function Be(_0x3e3816,_0x3fa466,_0x4d865f){const _0x1c9a30=null!==_0x3fa466?_0x52eeda=>_0x52eeda['attribs'][_0x3e3816]===_0x3fa466:_0x4b4729=>Boolean(_0x4b4729['attribs'][_0x3e3816]);return _0x37808d(_0x27262f=>_0x1a9650(_0x27262f)&&_0x1c9a30(_0x27262f),_0x4d865f);}function K(_0x1cb727,_0x4c23d0){return _0x1cb727&&_0x1a9650(_0x1cb727)?_0x1cb727['attribs'][_0x4c23d0]:null;}function $e(_0x36e587,_0x480b5a,_0x1121d9){_0x1a9650(_0x36e587)&&(null===_0x1121d9?delete _0x36e587['attribs'][_0x480b5a]:_0x36e587['attribs'][_0x480b5a]=_0x1121d9);}function Ke(_0x470698,_0x17c2f9,_0x3da8fd){const _0x48356c=_0x17c2f9['cloneNode'](!0x0);'beforebegin'===_0x3da8fd?_0x4e9405(_0x470698,_0x48356c):'afterbegin'===_0x3da8fd?_0x5578be(_0x470698,_0x48356c):'beforeend'===_0x3da8fd?_0x4fe58e(_0x470698,_0x48356c):'afterend'===_0x3da8fd&&_0x41021b(_0x470698,_0x48356c);}function Le(_0x7e3cf1){const _0x297934=[];let _0x205500=_0x7e3cf1;for(;_0x205500;)_0x205500=_0x2ea8c9(_0x205500),_0x205500&&_0x297934['push'](_0x205500);return _0x297934;}function zn(_0x35db67){return _0x35db67['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Ns(_0x2381ed){let _0xb3d965=0x0;for(;_0x2381ed['parentNode'];)_0x2381ed=_0x2381ed['parentNode'],_0xb3d965++;return _0xb3d965;}function gs(_0x238c5a){const _0x163ab8=[];let _0x3205f3=_0x238c5a['nextSibling'];for(;_0x3205f3;)_0x163ab8['push'](_0x3205f3),_0x3205f3=_0x3205f3['nextSibling'];_0x163ab8['forEach'](_0xfd4b39=>{_0x19c981(_0xfd4b39);});}class Ve extends/* #__PURE__ -- @preserve */
25
- $t(){['_m2html'];constructor(){super(),this['_m2html']=new _0x5a2309();}['convertMarkdownToHTML'](_0x5b9d00){const _0x1491a1=this['_m2html']['parse'](_0x5b9d00);return this['parseAndNormalizeHTML'](_0x1491a1);}['parseAndNormalizeHTML'](_0x1dfa6a){return this['_parseHTML'](_0x1dfa6a);}['_parseHTML'](_0x57d000){const _0x4d6ea5=Ne('<dummy>'+_0x57d000['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x4d6ea5['children']=_0x4d6ea5['children'][0x0]['children'],_0x4d6ea5;}}class We extends/* #__PURE__ -- @preserve */
26
- $t(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x3f4daa){super(),this['_generateUid']=_0x3f4daa||_0x3bb1ce;}['merge'](_0x9c5b09,_0x368ddc,_0x141b7f){const _0x463c57=_0x9c5b09['cloneNode'](!0x0);if(0x0===_0x368ddc['childNodes']['length']){const _0x7a9aeb=[];return Be('data-id','new-element',_0x463c57)['forEach'](_0x575a16=>{const _0x4a8be3=this['_generateUid']();$e(_0x575a16,'data-id',_0x4a8be3),_0x7a9aeb['push'](_0x4a8be3);}),this['_removeSpecialComments'](_0x463c57),{'parsedContent':_0x463c57,'newNodeIds':_0x7a9aeb,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x141b7f&&_0x141b7f['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x463c57),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Be('data-id',null,_0x368ddc)['map'](_0x16c0d7=>K(_0x16c0d7,'data-id'))['filter'](_0x35d764=>!!_0x35d764));let _0x1fcc64=-0x1,_0x4ec8fb=!0x1;const _0x1d6b05=_0x463c57['childNodes'],_0x225c1e=Array['from'](_0x1d6b05)['filter'](_0x1b890e=>!(0x3===_0x1b890e['nodeType']&&''===tt(_0x1b890e)['trim']())),_0x5570b1=_0x225c1e['length'];for(let _0x5b2a65=0x0;_0x5b2a65<_0x5570b1;_0x5b2a65++){const _0x282979=_0x225c1e[_0x5b2a65],_0x3c73fb=_0x225c1e[_0x5b2a65+0x1];if(this['_isNewNode'](_0x282979)){if(-0x1===_0x1fcc64&&(_0x1fcc64=_0x5b2a65),this['_markWrappedElements'](_0x282979),!this['_isNewNode'](_0x3c73fb)){const [_0x3e787e,_0x2fe96c]=this['_findReferenceNode'](_0x282979,_0x4ec8fb,_0x368ddc);if(_0x3e787e){const _0xce4c8a=Array['from'](_0x225c1e)['slice'](_0x1fcc64,_0x5b2a65+0x1);this['_insertNodes'](_0x3e787e,_0xce4c8a,_0x2fe96c),_0x1fcc64=-0x1;}}}else{if(this['_isExistingContentComment'](_0x282979))_0x4ec8fb=!0x0;else{if(this['_isExistingNode'](_0x282979)){const _0x1ebfb0=K(_0x282979,'data-id');if(_0x1ebfb0&&this['_existingDataIds']['has'](_0x1ebfb0)){const _0x3540ec=st('data-id',_0x1ebfb0,_0x368ddc);this['_replaceNode'](_0x3540ec,_0x282979);}if(this['_touchedNodesState']['removedIds']['includes'](_0x1ebfb0)){const _0x13f12e=this['_touchedNodesState']['removedIds']['indexOf'](_0x1ebfb0);this['_touchedNodesState']['removedIds']['splice'](_0x13f12e,0x1);}}else{if(this['_isDelNode'](_0x282979)){const _0x1ec5ff=K(_0x282979,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x1ec5ff)||this['_storeDeletedElementIds'](_0x282979);}}}}}for(const _0x4c5ca4 of this['_touchedNodesState']['removedIds']){const _0x33d505=st('data-id',_0x4c5ca4,_0x368ddc);if(_0x33d505){if(_0x141b7f&&_0x141b7f['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x4c5ca4;const _0x3bf1f9=_0x141b7f['replaceRemovedWith']['cloneNode'](!0x0);$e(_0x3bf1f9,'data-id',_0x4c5ca4),$e(_0x3bf1f9,'data-removed','true'),_0x20fcd7(_0x33d505,_0x3bf1f9);}else _0x19c981(_0x33d505);}}if(Be('data-wrapped-id',null,_0x368ddc)['forEach'](_0x322bf3=>{const _0x22af74=st('data-id',K(_0x322bf3,'data-wrapped-id'),_0x368ddc);var _0x5021b2,_0x1a7ec2;_0x22af74&&(_0x1a7ec2=_0x322bf3,_0x19c981(_0x5021b2=_0x22af74),_0x20fcd7(_0x1a7ec2,_0x5021b2));}),Be('data-id','new-element',_0x368ddc)['forEach'](_0xb7ebd2=>{const _0x27a5e6=this['_getUid'](_0xb7ebd2);$e(_0xb7ebd2,'data-id',_0x27a5e6),this['_touchedNodesState']['newIds']['push'](_0x27a5e6);}),this['_removeSpecialComments'](_0x368ddc),_0x141b7f&&_0x141b7f['markUnstableElements']&&this['_markUnstableElements'](_0x368ddc,_0x141b7f['markUnstableElementsDepth']||0x0),_0x141b7f&&_0x141b7f['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x5ba567=st('data-id',this['_touchedNodesState']['lastTouchedId'],_0x368ddc);for(;_0x5ba567;)gs(_0x5ba567),_0x5ba567=_0x5ba567['parentNode'];}return{'parsedContent':_0x368ddc,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x51ca34,_0x5c8091,_0x364244){for(const _0x23f4cf of _0x5c8091){const _0x54b29e=this['_getUid'](_0x23f4cf);$e(_0x23f4cf,'data-id',_0x54b29e),this['_touchedNodesState']['newIds']['push'](_0x54b29e),this['_touchedNodesState']['lastTouchedId']=_0x54b29e;}const _0x1b542d='afterbegin'===_0x364244||'afterend'===_0x364244?_0x5c8091['reverse']():_0x5c8091;for(const _0x4a1f95 of _0x1b542d)Ke(_0x51ca34,_0x4a1f95,_0x364244);}['_replaceNode'](_0x1caa39,_0x41b919){if(!_0x1caa39)return;if(_0x4f9fb0=_0x41b919,zn(tt(_0x1caa39))===zn(tt(_0x4f9fb0)))return;var _0x4f9fb0;const _0x58c00c=this['_getUid'](_0x1caa39);$e(_0x41b919,'data-id',_0x58c00c),this['_touchedNodesState']['modifiedIds']['push'](_0x58c00c),this['_touchedNodesState']['lastTouchedId']=_0x58c00c,_0x20fcd7(_0x1caa39,_0x41b919['cloneNode'](!0x0));}['_findReferenceNode'](_0x41e5cc,_0x337744,_0x2542b3){const _0x77f97c=this['_findPrevElementWithDataId'](_0x41e5cc,!0x1);if(_0x77f97c){const _0x1c4e9c=this['_getNodeDataId'](_0x77f97c),_0x2c53c5=st('data-id',_0x1c4e9c,_0x2542b3);if(_0x2c53c5)return[_0x2c53c5,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x1c4e9c);}const _0x7c582b=this['_findNextElementWithDataId'](_0x41e5cc,!0x1);if(_0x7c582b){const _0x38f6ab=this['_getNodeDataId'](_0x7c582b),_0x387856=st('data-id',_0x38f6ab,_0x2542b3);if(_0x387856)return[_0x387856,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x38f6ab);}return _0x337744?_0x41e5cc['nextSibling']?this['_findFallbackReferenceNode'](_0x41e5cc,_0x2542b3):[_0x2542b3['childNodes'][_0x2542b3['childNodes']['length']-0x1],'afterend']:[_0x2542b3['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x344354,_0x571f85){const _0x499d63=[],_0x4ff314=this['_findPrevElementWithDataId'](_0x344354,!0x0);if(_0x4ff314){const _0x15d2b4=st('data-id',this['_getNodeDataId'](_0x4ff314),_0x571f85);_0x15d2b4&&_0x499d63['push']([_0x15d2b4,'afterend']);}const _0x461d9c=this['_findNextElementWithDataId'](_0x344354,!0x0);if(_0x461d9c){const _0x399b80=st('data-id',this['_getNodeDataId'](_0x461d9c),_0x571f85);_0x399b80&&_0x499d63['push']([_0x399b80,'beforebegin']);}if(_0x499d63['length']>0x1)return Ns(_0x499d63[0x0][0x0])<=Ns(_0x499d63[0x1][0x0])?_0x499d63[0x0]:_0x499d63[0x1];return 0x1===_0x499d63['length']?_0x499d63[0x0]:[_0x571f85['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x2b3733,_0x582983){let _0x4bf80a=_0x2b3733['nextSibling'],_0x550f7a=null,_0xac637=!0x1;for(;_0x4bf80a;){if(_0x336631(_0x4bf80a)){if(this['_isDelNode'](_0x4bf80a)&&(_0x550f7a=_0x4bf80a),this['_isExistingContentComment'](_0x4bf80a)&&_0x582983&&!_0xac637){_0xac637=!0x0,_0x4bf80a=_0x4bf80a['nextSibling'];continue;}break;}const _0x56a56f=K(_0x4bf80a,'data-id');if(_0x56a56f&&'new-element'!==_0x56a56f&&this['_existingDataIds']['has'](_0x56a56f)){_0x550f7a=_0x4bf80a;break;}_0x4bf80a=_0x4bf80a['nextSibling'];}return _0x550f7a;}['_findPrevElementWithDataId'](_0x41b0f2,_0x2647c7){let _0x1a81f0=_0x41b0f2['previousSibling'],_0x5c3ed1=null,_0x306abb=!0x1;for(;_0x1a81f0;){if(_0x336631(_0x1a81f0)){if(this['_isDelNode'](_0x1a81f0)&&(_0x5c3ed1=_0x1a81f0),this['_isExistingContentComment'](_0x1a81f0)&&_0x2647c7&&!_0x306abb){_0x306abb=!0x0,_0x1a81f0=_0x1a81f0['previousSibling'];continue;}break;}const _0x1250cc=K(_0x1a81f0,'data-id');if(_0x1250cc&&'new-element'!==_0x1250cc&&this['_existingDataIds']['has'](_0x1250cc)){_0x5c3ed1=_0x1a81f0;break;}_0x1a81f0=_0x1a81f0['previousSibling'];}return _0x5c3ed1;}['_markWrappedElements'](_0xc1cacf){_0x1a9650(_0xc1cacf)&&Be('data-id',null,_0xc1cacf)['forEach'](_0x2df70e=>{this['_isExistingNode'](_0x2df70e)&&!this['_hasWrappedParent'](_0x2df70e)&&($e(_0x2df70e,'data-wrapped-id',K(_0x2df70e,'data-id')),$e(_0x2df70e,'data-id',null));});}['_getNodeDataId'](_0x119b70){if(!_0x119b70)return null;if(_0x1a9650(_0x119b70))return K(_0x119b70,'data-id');if(_0x336631(_0x119b70)){const _0x517fdb=tt(_0x119b70)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x517fdb&&_0x517fdb[0x1])return _0x517fdb[0x1];}return null;}['_storeDeletedElementIds'](_0x2488bd){if(_0x336631(_0x2488bd)){const _0x15f07e=tt(_0x2488bd)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x15f07e&&_0x15f07e[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x15f07e[0x1]);}}['_getUid'](_0x48a21a){return this['_isExistingNode'](_0x48a21a)?K(_0x48a21a,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x39ffeb){(function(_0x2125c2){return _0x4b09e5(_0x49f66e=>_0x336631(_0x49f66e),_0x2125c2,!0x0,0x1/0x0);}(_0x39ffeb)['filter'](_0x2b44e7=>this['_isDelNode'](_0x2b44e7)||this['_isExistingContentComment'](_0x2b44e7))['forEach'](_0x584c16=>{_0x19c981(_0x584c16);}));}['_markLastTagElementUnstable'](_0x538661){const _0x407a96=_0x538661['childNodes'],_0x1a7aaf=_0x407a96[_0x407a96['length']-0x1];_0x1a7aaf&&_0x1a9650(_0x1a7aaf)&&$e(_0x1a7aaf,'data-unstable','true');}['_markUnstableElements'](_0x2a4574,_0x5496bf){const _0x474646=st('data-unstable','true',_0x2a4574);if(!_0x474646)return;const _0x219fcf=Le(_0x474646)['slice'](0x0,-0x1),_0x208662=_0x219fcf['length'];let _0x5f2a8a=_0x474646;if(_0x208662>_0x5496bf){let _0x4efd56=_0x208662,_0x28956d=null;for(;_0x4efd56>_0x5496bf&&_0x4efd56>=0x0;)_0x4efd56--,_0x28956d=_0x219fcf[_0x4efd56];_0x28956d&&(_0x5f2a8a=_0x28956d,$e(_0x474646,'data-unstable',null),$e(_0x28956d,'data-unstable','true'));}else{if(_0x208662<_0x5496bf){let _0x32c10b=_0x208662,_0x1e3bf0=_0x474646;for(;_0x32c10b<_0x5496bf;){const _0x57cee2=_0x1e3bf0['childNodes']['filter'](_0x1e97a9=>_0x1a9650(_0x1e97a9));if(0x0===_0x57cee2['length'])break;_0x32c10b++,_0x1e3bf0=_0x57cee2[_0x57cee2['length']-0x1];}_0x1e3bf0&&(_0x5f2a8a=_0x1e3bf0,$e(_0x474646,'data-unstable',null),$e(_0x1e3bf0,'data-unstable','true'));}}let _0x31b50a=_0x5f2a8a;for(;_0x31b50a;){for(;_0x31b50a['nextSibling'];)_0x31b50a=_0x31b50a['nextSibling'],_0x1a9650(_0x31b50a)&&$e(_0x31b50a,'data-unstable','true');_0x31b50a=_0x31b50a['parentNode'];}}['_isNewNode'](_0x11d43e){return Boolean('new-element'===K(_0x11d43e,'data-id'));}['_isExistingNode'](_0x2aa334){return Boolean((K(_0x2aa334,'data-id')||'')['length']>0x0&&'new-element'!==K(_0x2aa334,'data-id'));}['_isDelNode'](_0x236a70){return!!_0x236a70&&Boolean(_0x336631(_0x236a70)&&tt(_0x236a70)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x15874f){let _0x3cf1cb=_0x15874f['parentNode'];for(;_0x3cf1cb;){if(K(_0x3cf1cb,'data-wrapped-id'))return!0x0;_0x3cf1cb=_0x3cf1cb['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x42fa01){return Boolean(_0x336631(_0x42fa01)&&tt(_0x42fa01)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function C({editor:_0x5b41cc,changeGroups:_0x3d492f,documentContextContent:_0x57184a,showDiff:_0x41dbff,trimUnchanged:_0x1c588b=!0x0}){return _0x3d492f['map'](_0x5f571f=>{const _0x31ef39=new it([]),_0x26c19d=new it([]);for(const _0x22ec07 of _0x5f571f['changes'])if(_0x41dbff&&'removed'==_0x22ec07['type']||_0x26c19d['children']['push'](_0x22ec07['node']['cloneNode'](!0x0)),'new'!=_0x22ec07['type']&&(_0x41dbff||'removed'!=_0x22ec07['type'])){const _0x370cdf=_0x3019e1(_0x4f2aed=>K(_0x4f2aed,'data-id')==_0x22ec07['id'],_0x57184a,!0x0);_0x370cdf&&_0x31ef39['children']['push'](_0x370cdf['cloneNode'](!0x0));}const {content:_0x544ac0,hasChanges:_0x14c871}=function(_0x2dacc1,_0x12e1b5,_0x3e0644,_0x3196bf,_0x3900e1=!0x0){const _0x129183=_0x2dacc1['plugins']['get']('DocumentCompare'),_0x214a54=tt(_0x12e1b5),_0x2dbdd9=tt(_0x3e0644),_0x2f5aa7=_0x2dacc1['data']['parse'](_0x214a54,'$root'),_0x2fbb49=_0x2dacc1['model']['createPositionAt'](_0x2f5aa7,0x0),_0x360633=_0x129183['getDiff'](_0x214a54,_0x2dbdd9,{'anchor':_0x2fbb49,'markDeletions':_0x3196bf}),_0x176928=_0x360633['getOperations']();if(0x0==_0x176928['length'])return{'content':_0x12e1b5['cloneNode'](!0x0),'hasChanges':!0x1};_0x3196bf?function(_0x3c3431,_0x4eb388,_0x3c02ef){if(0x0==_0x3c3431['length'])return;const _0x50e9f2=_0x3c02ef['plugins']['get']('DocumentCompare'),_0x18b06a=_0x3c02ef['plugins']['get']('SuggestionsConversion');_0x3c02ef['model']['change'](_0x12b6d3=>{const _0x3f9cdf=new Set();for(let _0x346479=0x0;_0x346479<_0x3c3431['length'];_0x346479++){const _0x293670=_0x3c3431[_0x346479];if(_0x293670['baseVersion']=null,_0x293670['isDocumentOperation']=!0x1,_0x50e9f2['isMarkedRemoveOperation'](_0x293670)){const _0x5ab318=_0x2fc611(_0x293670['newRange'],_0x3c02ef['model']),_0x384762='suggestion:deletion:'+_0x3bb1ce()+':$aiSuggestion';_0x4eb388['markers']['set'](_0x384762,_0x5ab318);}else switch(_0x293670['type']){case'rename':{if(_0x293670['oldName']==_0x293670['newName'])break;_0x12b6d3['batch']['addOperation'](_0x293670),_0x3c02ef['model']['applyOperation'](_0x293670);const _0x2089f4='$elementName',_0x60f876=_0x293670['position'],_0x46db28=_0x3c02ef['model']['createRange'](_0x60f876,_0x3c02ef['model']['createPositionAt'](_0x60f876['nodeAfter'],'end')),_0x1f0a82='suggestion:attribute:'+_0x2089f4+':'+_0x3bb1ce()+':$aiSuggestion';_0x4eb388['markers']['set'](_0x1f0a82,_0x46db28);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x293670['oldValue']==_0x293670['newValue'])break;_0x12b6d3['batch']['addOperation'](_0x293670),_0x3c02ef['model']['applyOperation'](_0x293670);const _0x5a15f0=_0x293670['key'];if(!_0x18b06a['isRegisteredAttribute'](_0x5a15f0))break;const _0x1f036b=_0x2fc611(_0x293670['range'],_0x3c02ef['model']),_0x55a57b='suggestion:attribute:'+_0x5a15f0+':'+_0x3bb1ce()+':$aiSuggestion';_0x4eb388['markers']['set'](_0x55a57b,_0x1f036b);break;}case'insert':{_0x12b6d3['batch']['addOperation'](_0x293670),_0x3c02ef['model']['applyOperation'](_0x293670);if(_0x3c3431[_0x346479+0x1]&&'move'==_0x3c3431[_0x346479+0x1]['type']){ro(_0x4eb388,_0x293670);break;}const _0x905ec=_0x293670['position'],_0x316b89=_0x293670['howMany'],_0x19d532=_0x2fc611(_0x3c02ef['model']['createRange'](_0x905ec,_0x905ec['getShiftedBy'](_0x316b89)),_0x3c02ef['model']),_0x229ab4='suggestion:insertion:'+_0x3bb1ce()+':$aiSuggestion';_0x4eb388['markers']['set'](_0x229ab4,_0x19d532);break;}case'split':{_0x12b6d3['batch']['addOperation'](_0x293670),_0x3c02ef['model']['applyOperation'](_0x293670);const _0x47da9f=_0x293670['splitPosition'],_0x519927=_0x293670['moveTargetPosition'],_0x48fa20=_0x3c02ef['model']['createRange'](_0x47da9f,_0x519927),_0x517a7c='suggestion:insertion:'+_0x3bb1ce()+':$aiSuggestion';_0x4eb388['markers']['set'](_0x517a7c,_0x48fa20);break;}case'move':{_0x12b6d3['batch']['addOperation'](_0x293670),_0x3c02ef['model']['applyOperation'](_0x293670),_0x3c3431[_0x346479-0x1]&&'insert'==_0x3c3431[_0x346479-0x1]['type']&&ro(_0x4eb388,_0x293670);const _0x1a38e7=_0x293670['getMovedRangeStart'](),_0x58033d=_0x293670['howMany'];for(let _0x283e33=0x0;_0x283e33<_0x58033d;_0x283e33++){const _0x5f2a29=_0x1a38e7['getShiftedBy'](_0x283e33)['nodeAfter'];_0x3f9cdf['add'](_0x5f2a29);}break;}case'remove':{const _0x3470b6=_0x293670['sourcePosition'],_0x84a809=_0x293670['howMany'],_0xc12670=new _0x253f92(_0x3470b6,_0x84a809);_0x12b6d3['batch']['addOperation'](_0xc12670),_0x3c02ef['model']['applyOperation'](_0xc12670);break;}}}for(const _0x1817d2 of _0x3f9cdf){const _0x27c395=_0x3c02ef['model']['createRangeOn'](_0x1817d2),_0x1f711b='suggestion:formatBlock:$fakeWrap:'+_0x3bb1ce()+':$aiSuggestion';_0x4eb388['markers']['set'](_0x1f711b,_0x2fc611(_0x27c395,_0x3c02ef['model']));}});}(_0x176928,_0x2f5aa7,_0x2dacc1):_0x2dacc1['model']['change'](_0x5e722a=>{for(const _0x32f942 of _0x176928)if('remove'==_0x32f942['type']){const _0x143262=_0x32f942['sourcePosition'],_0x4ec6b0=_0x32f942['howMany'],_0x7eb487=new _0x253f92(_0x143262,_0x4ec6b0);_0x5e722a['batch']['addOperation'](_0x7eb487),_0x2dacc1['model']['applyOperation'](_0x7eb487);}else{if('marker'==_0x32f942['type']){const _0x310ba2=_0x32f942['name'],_0x4392d7=_0x32f942['newRange'];_0x2f5aa7['markers']['set'](_0x310ba2,_0x4392d7);}else _0x32f942['baseVersion']=null,_0x32f942['isDocumentOperation']=!0x1,_0x5e722a['batch']['addOperation'](_0x32f942),_0x2dacc1['model']['applyOperation'](_0x32f942);}});if(_0x3900e1){const _0x4814d0=Z(_0x2dacc1,_0x176928,_0x2f5aa7);Q(_0x2dacc1['model'],_0x4814d0),function(_0x9b31fd,_0xc236c1){const _0x23926e=_0xc236c1['getFirstRange']()['start'];let _0x3dabd3=_0xc236c1['getFirstRange']()['end'];const _0x3ec9f0=_0x23926e['root'];(_0x3dabd3['textNode']||_0x3dabd3['nodeAfter']&&_0x3dabd3['nodeAfter']['is']('$text'))&&(_0xbc492c(_0x3dabd3,'...'),_0x3dabd3=_0x3dabd3['getShiftedBy'](0x3)),(_0x23926e['textNode']||_0x23926e['nodeBefore']&&_0x23926e['nodeBefore']['is']('$text'))&&(_0xbc492c(_0x23926e,'...'),function(_0x7084d2,_0x4ee732,_0x50f1c7){for(let [_0x51d8ea,_0x151e1a]of _0x7084d2['markers']){const _0x23ae0d=_0x151e1a['_getTransformedByInsertion'](_0x4ee732,_0x50f1c7,!0x1);_0x151e1a=_0x23ae0d[0x0],_0x7084d2['markers']['set'](_0x51d8ea,_0x151e1a);}}(_0x3ec9f0,_0x23926e,0x3),_0x23926e['parent']==_0x3dabd3['parent']&&(_0x3dabd3=_0x3dabd3['getShiftedBy'](0x3)));const _0x32cb24=_0x9b31fd['createRange'](_0x9b31fd['createPositionAt'](_0x3ec9f0,0x0),_0x23926e),_0x3a7f65=_0x9b31fd['createRange'](_0x3dabd3,_0x9b31fd['createPositionAt'](_0x3ec9f0,'end')),_0x43eb37=[..._0x32cb24['getMinimalFlatRanges'](),..._0x3a7f65['getMinimalFlatRanges']()];_0x43eb37['reverse']();for(const _0x46ecb7 of _0x43eb37)_0x5f0c2d(_0x46ecb7),Jn(_0x3ec9f0,_0x46ecb7);}(_0x2dacc1['model'],_0x4814d0);}const _0x373b6d=_0x2dacc1['data']['stringify'](_0x2f5aa7,{'showSuggestionHighlights':!0x0});return{'content':Ne(_0x373b6d),'hasChanges':!0x0};}(_0x5b41cc,_0x31ef39,_0x26c19d,_0x41dbff,_0x1c588b);return{'type':_0x5f571f['changes'][0x0]['type'],'index':_0x5f571f['index'],'content':_0x544ac0,'hasChanges':_0x14c871};});}function ro(_0x23dbda,_0x19d151){for(const [_0x57040c,_0x2e7a47]of _0x23dbda['markers']){const _0x3cb2ea=_0x184fda['_createFromRanges'](_0x2e7a47['getTransformedByOperation'](_0x19d151));_0x23dbda['markers']['set'](_0x57040c,_0x3cb2ea);}}function Z(_0x54cec3,_0x30b9c7,_0x45f403){const _0x1f4de7=_0x54cec3['plugins']['get']('DocumentCompare');let _0x318c2d=_0x54cec3['model']['createPositionAt'](_0x45f403,Number['POSITIVE_INFINITY']),_0x36ad31=_0x54cec3['model']['createPositionAt'](_0x45f403,0x0);for(const _0x139b16 of _0x30b9c7){let _0x508751,_0x390157;if(_0x1f4de7['isMarkedRemoveOperation'](_0x139b16))_0x508751=_0x139b16['newRange']['start'],_0x390157=_0x139b16['newRange']['end'];else switch(_0x318c2d=_0x318c2d['getTransformedByOperation'](_0x139b16),_0x36ad31=_0x36ad31['getTransformedByOperation'](_0x139b16),_0x139b16['type']){case'rename':_0x508751=_0x139b16['position'],_0x390157=_0x508751['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x508751=_0x139b16['range']['start'],_0x390157=_0x139b16['range']['end'];break;case'insert':_0x508751=_0x139b16['position'],_0x390157=_0x508751['getShiftedBy'](_0x139b16['howMany']);break;case'split':_0x508751=_0x139b16['splitPosition'],_0x390157=_0x139b16['moveTargetPosition'];break;case'merge':{const _0x2cbf39=_0x139b16['targetPosition']['path']['slice'](0x0,-0x1);_0x508751=_0x54cec3['model']['createPositionFromPath'](_0x45f403,_0x2cbf39),_0x390157=_0x508751['getShiftedBy'](0x1);break;}case'remove':{const _0x4b3187=_0x139b16['howMany'],_0x5acfa7=_0x139b16['sourcePosition']['_getTransformedByInsertion'](_0x139b16['targetPosition'],_0x4b3187),_0x16ebd8=_0x139b16['getMovedRangeStart']();'remove'==_0x139b16['type']?(_0x508751=_0x5acfa7,_0x390157=_0x5acfa7):(_0x508751=_0x16ebd8,_0x390157=_0x16ebd8['getShiftedBy'](_0x4b3187));break;}}_0x508751&&_0x508751['isBefore'](_0x318c2d)&&(_0x318c2d=_0x508751['clone'](),_0x318c2d['stickiness']='toNone'),_0x390157&&_0x390157['isAfter'](_0x36ad31)&&(_0x36ad31=_0x390157['clone'](),_0x36ad31['stickiness']='toNone');}return _0x54cec3['model']['createSelection'](_0x54cec3['model']['createRange'](_0x318c2d,_0x36ad31));}function Q(_0x58db15,_0x17744e){so(_0x58db15,_0x17744e,'forward');const _0x110322=_0x17744e['getFirstRange']();_0x17744e['setTo']([]),_0x17744e['setTo'](_0x110322,{'backward':!0x0}),so(_0x58db15,_0x17744e,'backward');}function so(_0x15a75d,_0x1f6470,_0x1b115b){let _0x2df029=0x14;for(;_0x2df029;){_0x15a75d['modifySelection'](_0x1f6470,{'unit':'word','direction':_0x1b115b}),_0x2df029--;const _0x34c162=_0x1f6470['focus']['forward'==_0x1b115b?'nodeBefore':'nodeAfter'];if(_0x34c162&&_0x34c162['is']('element')&&_0x15a75d['schema']['isBlock'](_0x34c162)&&_0x15a75d['schema']['isObject'](_0x34c162))break;}}function Jn(_0x269deb,_0x1bc2f6){for(const [_0x52f778,_0x3e0fa8]of _0x269deb['markers']){const _0x203edd=_0x3e0fa8['_getTransformedByDeletion'](_0x1bc2f6['start'],_0x1bc2f6['end']['offset']-_0x1bc2f6['start']['offset']);null!=_0x203edd?_0x269deb['markers']['set'](_0x52f778,_0x203edd):_0x269deb['markers']['delete'](_0x52f778);}}const Zn=['modification-delta','text-delta','web-search','reasoning'],$r=['conversation-title'];class pe extends $t(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new it([]);['parsedMergedContent']=new it([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x5f36a5,content:_0x41568e='',isDone:_0x4b6644=!0x1,interactionId:_0x547611,areActionsDisabled:_0x4acf1a,documentContextContent:_0x5cfc0f,editor:_0x21fd3e,id:_0x2aa337}){super(),this['id']=_0x2aa337||_0x3bb1ce(),this['interactionId']=_0x547611,this['type']=_0x5f36a5,this['areActionsDisabled']=!!_0x4acf1a,this['editor']=_0x21fd3e,this['aiResponseParser']=new Ve(),this['aiResponseApplier']=new We(),this['documentContextContent']=Ne(_0x5cfc0f||''),this['set']('isDone',_0x4b6644),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x41568e);}['appendContent'](_0x3a16aa){this['set']('content',this['content']+_0x3a16aa);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x519907,_0x4ef2a2){this['changeGroups'][_0x519907]['state']=_0x4ef2a2,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x519907,'state':_0x4ef2a2});}['getContentParts']({showDiff:_0x114406,groupIndex:_0x5dd745}){if(!this['editor'])throw new _0x19ee7d('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x335789=this['_getCachedContentParts'](_0x114406,_0x5dd745);if(_0x335789)return _0x335789;let _0x296e72=[];if(void 0x0===_0x5dd745)_0x296e72=this['changeGroups'];else{const _0x148556=this['changeGroups']['find'](({index:_0x281860})=>_0x281860===_0x5dd745);if(!_0x148556)throw new _0x19ee7d('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x5dd745});_0x296e72=[_0x148556];}const _0x20cadb=C({'editor':this['editor'],'showDiff':_0x114406,'changeGroups':_0x296e72,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x114406,_0x20cadb),_0x20cadb;}['_getCachedContentParts'](_0x143f26,_0x55a5f1){const _0x43a86a=_0x143f26?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x43a86a]['length'])return null;const _0x377d13=this['cachedSuggestionContentParts'][_0x43a86a];if(void 0x0===_0x55a5f1)return _0x4b1575(_0x377d13);{const _0x8fd990=_0x377d13['find'](({index:_0x555186})=>_0x555186===_0x55a5f1);if(_0x8fd990)return[_0x4b1575(_0x8fd990)];}return null;}['_setCachedContentParts'](_0x54a96c,_0x2dc762){const _0x4cca95=_0x54a96c?'withDiff':'withoutDiff';_0x2dc762['forEach'](_0x1bceaf=>{const _0x4cce50=this['cachedSuggestionContentParts'][_0x4cca95],_0x4bc3b2=_0x4cce50['find'](({index:_0x53ca16})=>_0x53ca16===_0x1bceaf['index']);if(_0x4bc3b2){const _0x446121=_0x4cce50['indexOf'](_0x4bc3b2);_0x4cce50['splice'](_0x446121,0x1,_0x1bceaf);}else _0x4cce50['push'](_0x1bceaf);});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x51c0fd=this['changeGroups'];this['updateChangeGroups']();const _0x55d83b=this['_getDifferentChangeGroups'](_0x51c0fd,this['changeGroups']);(_0x55d83b['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x55d83b),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x54da90,_0x1c8d77){const _0x2d0fc6=[];for(const _0x1c8bd2 of _0x1c8d77){const _0x3f939c=_0x54da90[_0x1c8bd2['index']];_0x3f939c?_0x3f939c['changes']['length']!==_0x1c8bd2['changes']['length']?_0x2d0fc6['push'](_0x1c8bd2):_0x3f939c['changes']['forEach']((_0xe578ee,_0x2b396c)=>{const _0x5df646=_0x1c8bd2['changes'][_0x2b396c];_0xe578ee['id']!==_0x5df646['id']&&_0x2d0fc6['push'](_0x1c8bd2);}):_0x2d0fc6['push'](_0x1c8bd2);}return _0x2d0fc6;}['updateChangeGroups'](){const _0x39d129=new _0x1781b0('p',{},[new _0x1781b0('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0xe506f9(y(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x311ae7=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x39d129,'cutAfterLastChange':!this['isDone']});if(!_0x311ae7['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x311ae7['parsedContent'];let _0x4ca87d=[];if(_0x37808d(_0x45ac72=>{const _0x52539c=K(_0x45ac72,'data-id');if(!_0x52539c||!_0x3ea603(_0x52539c))return!0x1;const _0xef1792=[_0x45ac72,...Le(_0x45ac72)]['at'](-0x2);if(_0x45ac72!=_0xef1792){const _0x9980e7=K(_0xef1792,'data-id');_0x3ea603(_0x9980e7)||(_0x4ca87d['push']({'node':_0xef1792,'id':_0x9980e7,'type':'modified'}),_0x311ae7['modifiedNodeIds']['push'](_0x9980e7));}else _0x311ae7['modifiedNodeIds']['includes'](_0x52539c)?_0x4ca87d['push']({'node':_0x45ac72,'type':'modified','id':_0x52539c}):_0x311ae7['newNodeIds']['includes'](_0x52539c)?_0x4ca87d['push']({'node':_0x45ac72,'type':'new','id':_0x52539c,'anchorId':K(_0x45ac72['previousSibling'],'data-id')}):_0x4ca87d['push']({'node':_0x45ac72,'type':'removed','id':_0x52539c});return!0x0;},this['parsedMergedContent']),_0x4ca87d=_0x4ca87d['filter'](({node:_0x122572})=>[...Le(_0x122572),_0x122572]['every'](_0x2cff84=>!K(_0x2cff84,'data-unstable'))),0x0==_0x4ca87d['length'])return;const _0x140a59=[[_0x4ca87d[0x0]]];for(let _0x1dd8b9=0x1;_0x1dd8b9<_0x4ca87d['length'];_0x1dd8b9++){const _0x353fec=_0x140a59[_0x140a59['length']-0x1],_0x5a4845=_0x353fec[_0x353fec['length']-0x1];_0x4ca87d[_0x1dd8b9]['node']['previousSibling']==_0x5a4845['node']&&'modified'!=_0x4ca87d[_0x1dd8b9]['type']&&'modified'!=_0x5a4845['type']?_0x353fec['push'](_0x4ca87d[_0x1dd8b9]):_0x140a59['push']([_0x4ca87d[_0x1dd8b9]]);}for(const _0x9e103f of _0x140a59){const _0x2ce5b7=_0x9e103f[0x0],_0x8327e8=_0x9e103f[_0x9e103f['length']-0x1],_0x1954ba=_0x90afb4(_0x2ce5b7['node']['previousSibling']);_0x1954ba&&_0x9e103f['unshift'](_0x1954ba);const _0x3fbb57=_0x90afb4(_0x8327e8['node']['nextSibling']);_0x3fbb57&&_0x9e103f['push'](_0x3fbb57);}function _0x3ea603(_0x36ddbb){return _0x311ae7['modifiedNodeIds']['includes'](_0x36ddbb)||_0x311ae7['newNodeIds']['includes'](_0x36ddbb)||_0x311ae7['removedNodeIds']['includes'](_0x36ddbb);}function _0x90afb4(_0xa3d999){if(_0xa3d999&&K(_0xa3d999,'data-id')&&!K(_0xa3d999,'data-unstable')){const _0x1c5d1f=K(_0xa3d999,'data-id');if(!_0x3ea603(_0x1c5d1f))return{'node':_0xa3d999,'type':'context','id':_0x1c5d1f};}return null;}this['changeGroups']=_0x140a59['map']((_0x4c3dce,_0x128c94)=>({'changes':_0x4c3dce,'state':'pending','index':_0x128c94}));}}function Fe(_0x5ba5a8){return Object['values'](Zn)['includes'](_0x5ba5a8);}function Ee(_0x12eca7){return $r['includes'](_0x12eca7);}function Ae(_0x30de7b){return'conversation-title'===_0x30de7b;}function Me(_0xee36de){return'source'===_0xee36de;}const qt=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','error'];class jt extends _0x3dcb71(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x1f96ac,editor:_0x40f314}){super(),this['id']=_0x3bb1ce(),this['connector']=_0x1f96ac,this['isStopped']=!0x0,this['editor']=_0x40f314;}async['start'](){let _0x20182e;const _0x348686=[];this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x283440=await this['currentRequest']['getStream']();for await(const _0x469aee of _0x283440){if(this['isStopped'])return;if('error'===_0x469aee['event'])return void this['fire']('error',{'error':new _0x19ee7d('ai-chat-interaction-error',this)});if('message-metadata'!==_0x469aee['event']){if('action-metadata'!==_0x469aee['event']){if(Ae(_0x469aee['event'])&&this['setConversationTitle'](_0x469aee['data']['conversationTitle'],!0x0),Me(_0x469aee['event']))_0x348686['push'](_0x469aee['data']['source']);else{if(Fe(_0x469aee['event'])){if(_0x469aee['event']!==_0x20182e){if(_0x20182e=_0x469aee['event'],'web-search'===_0x469aee['event']){this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));continue;}if('reasoning'===_0x469aee['event']){this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));continue;}this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this)),this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this)),this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x469aee['event'],'interactionId':this['id'],'id':_0x469aee['data']?.['id']}),_0x348686['length']>0x0&&'modification-delta'===_0x469aee['event']&&(this['currentReply']['sources']=_0x348686['splice'](0x0));}_0x469aee['data']['textDelta']&&this['currentReply']['appendContent'](_0x469aee['data']['textDelta']);}else Ee(_0x469aee['event']);}}else this['actionCallId']=_0x469aee['data']['callId'];}else this['messageId']=_0x469aee['data']['messageId'];}}finally{this['isStopped']||(_0x348686['length']>0x0&&(this['currentReply']['sources']=_0x348686['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x153345){return this['replies']['find'](_0x57fb31=>_0x57fb31['id']===_0x153345);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x429c4d=>_0x429c4d['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x493f23){const _0x6a5ba=new pe({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x493f23});return this['replies']['push'](_0x6a5ba),_0x6a5ba['delegate'](...qt)['to'](this),this['fire']('replyCreated',_0x6a5ba),_0x6a5ba;}['setConversationTitle'](_0x946e8c,_0x594b46=!0x1){this['fire']('setConversationTitle',_0x946e8c,_0x594b46);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Ft=function(_0x5d6d9b){return _0x5d6d9b['FILE']='file',_0x5d6d9b['DOCUMENT']='document',_0x5d6d9b['URL']='web-resource',_0x5d6d9b['TEXT']='text',_0x5d6d9b['SELECTION']='selection',_0x5d6d9b;}({}),Yt=function(_0x4479e4){return _0x4479e4['TEXT']='text',_0x4479e4['MARKDOWN']='markdown',_0x4479e4['HTML']='html',_0x4479e4;}({});const Ie=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']]),Si=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Di extends $t(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x252982,config:_0x4af77a,ownerId:_0x453a53}){super(),this['_connector']=_0x252982,this['_config']=_0x4af77a,this['_ownerId']=_0x453a53;}['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'](_0x3c52c6){const _0xd8d0c8=await this['_createContextItemFromContent'](_0x3c52c6);return this['_addToConversationContextItem'](_0xd8d0c8),'current-document'===_0xd8d0c8['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0xd8d0c8;}async['_createContextItemFromContent'](_0x164fa1){if(_0x164fa1['type']===Ft['DOCUMENT']){const _0x43e018=await this['_connector']['fetchDocument'](this['_ownerId'],_0x164fa1['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x164fa1['type'],'content':_0x43e018['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x43e018['attributes']?.['version'],'sessionId':_0x43e018['attributes']?.['sessionId']};}return{'id':_0x164fa1['id'],'uiId':_0x164fa1['id'],'label':_0x164fa1['attributes']?.['label']||_0x164fa1['name']||_0x164fa1['url']||_0x164fa1['id'],'type':_0x164fa1['type'],..._0x164fa1?.['attributes']?.['resourceId']?{'resourceId':_0x164fa1['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x1cdc08){const _0x6241dd=this['_pendingContextItems']['get'](_0x1cdc08);_0x6241dd?.['isReadOnly']||this['_removeContextItem'](_0x1cdc08);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x452892 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x452892['uiId']);const _0x360143=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x360143&&this['_addContextItem']({..._0x360143,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x47ddf1){for(const _0x166da9 of _0x47ddf1['values']())this['_addToConversationContextItem'](_0x166da9);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'](_0x2b8d98){return Array['from'](_0x2b8d98['values']())['map'](_0x210884=>this['_mapContextItemToRequestData'](_0x210884))['filter'](_0x5548a3=>null!==_0x5548a3);}async['addFilesToContext'](_0x2d3016,_0x2b1e7c,_0x450776=Ft['FILE']){const _0x47696a='files-'+_0x3bb1ce();this['_startUploadOperation'](_0x47696a);try{await Promise['all'](_0x2d3016['map'](async _0x475ae2=>{const _0x4b3e87='file-'+_0x3bb1ce(),_0x4e210b=Zt(_0x475ae2['name']);try{this['_addContextItem']({'type':_0x450776,'label':_0x2b1e7c?.['label']||_0x4e210b,'uiId':_0x4b3e87,'resourceId':_0x2b1e7c?.['resourceId']},!0x0);const _0x3b11f2=this['_connector']['uploadFile'](this['_ownerId'],_0x475ae2,_0x2b1e7c);this['_ongoingUploads']['set'](_0x4b3e87,_0x3b11f2['abortController']);const {id:_0x467ece}=await _0x3b11f2['getId']();this['_ongoingUploads']['delete'](_0x4b3e87),this['_finishContextItemLoading']({'type':_0x450776,'id':_0x467ece,'label':_0x2b1e7c?.['label']||_0x4e210b,'uiId':_0x4b3e87,'resourceId':_0x2b1e7c?.['resourceId']},!0x1);}catch(_0x16317a){this['_ongoingUploads']['delete'](_0x4b3e87);if(!(_0x16317a instanceof _0x19ee7d&&_0x16317a['message']['startsWith']('ai-request-aborted'))){const _0x4ee190=Ie['get'](_0x16317a['code'])||'ai-chat-file-upload-failed',_0x3ee922=new _0x19ee7d(_0x4ee190,null,{'fileName':_0x4e210b,..._0x16317a});_0x3ee922['stack']=_0x16317a['stack'],this['fire']('error',{'error':_0x3ee922});}this['_removeContextItem'](_0x4b3e87);}}));}finally{this['_finishUploadOperation'](_0x47696a);}}['addCurrentDocumentToContext'](_0x3a4666){if(this['isCurrentDocumentInContext']())return;const _0xdb9db={'type':Ft['DOCUMENT'],'uiId':'current-document','label':_0x3a4666,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0xdb9db);}async['updateCurrentDocument'](_0x1be0d5,_0x2f29ba,_0x5b9a9f,_0x59356e){const _0x38fdde=this['_pendingContextItems']['get']('current-document');if(_0x38fdde&&_0x1be0d5){_0x38fdde['selection']=_0x59356e?_0x59356e['map'](_0x332e05=>({'start':_0x332e05['start'],'end':_0x332e05['end']})):[];try{if(_0x38fdde['version']===_0x2f29ba)return;const {id:_0x591702}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x1be0d5,{'version':_0x2f29ba,'sessionId':_0x5b9a9f})['getId']();_0x38fdde['id']=_0x591702,_0x38fdde['content']=_0x1be0d5,_0x38fdde['version']=_0x2f29ba,_0x38fdde['sessionId']=_0x5b9a9f;}catch(_0x76e8b1){const _0x6b0dc1=new _0x19ee7d('ai-chat-document-upload-failed',null);_0x6b0dc1['stack']=_0x76e8b1['stack'],this['fire']('error',{'error':_0x6b0dc1});}}}['addSelectionToContext'](_0x294721){this['_addContextItem']({'type':Ft['SELECTION'],'label':_0x294721,'uiId':'selection','content':_0x294721});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x52ca02,_0x19cf3d){const _0x421abf='url-'+_0x3bb1ce();this['_startUploadOperation'](_0x421abf);const _0x32cdd8='url-'+_0x3bb1ce();try{this['_addContextItem']({'type':Ft['URL'],'label':_0x19cf3d?.['label']||_0x52ca02,'uiId':_0x32cdd8,'resourceId':_0x19cf3d?.['resourceId']},!0x0);const _0x2f9f97=this['_connector']['uploadUrl'](this['_ownerId'],_0x52ca02,_0x19cf3d);this['_ongoingUploads']['set'](_0x32cdd8,_0x2f9f97['abortController']);const {id:_0x5afbb7}=await _0x2f9f97['getId']();this['_ongoingUploads']['delete'](_0x32cdd8),this['_finishContextItemLoading']({'type':Ft['URL'],'id':_0x5afbb7,'label':_0x19cf3d?.['label']||_0x52ca02,'uiId':_0x32cdd8,'resourceId':_0x19cf3d?.['resourceId']},!0x1);}catch(_0xed750){this['_ongoingUploads']['delete'](_0x32cdd8),(_0xed750['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x19ee7d('ai-chat-url-upload-failed',this,{'url':_0x52ca02,'originalError':_0xed750}),'url':_0x52ca02}),this['_removeContextItem'](_0x32cdd8));}finally{this['_finishUploadOperation'](_0x421abf);}}async['loadSourceResources'](_0x4138c7,_0x266927,_0x128991){const _0x5be863=this['_addContextOptionsState']['sources']['find'](_0x6c1ba6=>_0x6c1ba6['id']===_0x4138c7);if(!_0x5be863)return this['fire']('error',{'error':new _0x19ee7d('ai-chat-source-not-found',this,{'sourceId':_0x4138c7}),'sourceId':_0x4138c7}),[];try{const _0x713457=(await _0x5be863['getResources'](_0x266927))['map'](_0x1793c7=>{const _0x1a7e11=this['_isResourceInContext'](_0x1793c7['id']);return{..._0x1793c7,'isInContext':_0x1a7e11};});return _0x5be863['resources']=_0x713457,this['fire']('sourceResourcesLoaded',{'sourceId':_0x4138c7,'source':_0x5be863,'resources':_0x713457,'uid':_0x128991}),_0x713457;}catch(_0x4ae194){return this['fire']('error',{'error':new _0x19ee7d('ai-chat-source-resources-load-failed',this,{'sourceId':_0x4138c7,'originalError':_0x4ae194}),'sourceId':_0x4138c7,'sourceLabel':_0x5be863['label']}),[];}}async['addResourceToContext'](_0x35ec4f,_0x3083eb){if(this['_isResourceInContext'](_0x3083eb['id']))return;let _0x5c9b61=_0x3083eb['data'];if(!_0x5c9b61&&_0x35ec4f['getData'])try{_0x5c9b61=await _0x35ec4f['getData'](_0x3083eb['id']);}catch(_0x92a2cc){return void this['fire']('error',{'error':new _0x19ee7d('ai-chat-resource-load-failed',this,{'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id'],'originalError':_0x92a2cc}),'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id']});}if(_0x5c9b61)switch(_0x3083eb['type']){case Ft['URL']:if('string'!=typeof _0x5c9b61)return void this['fire']('error',{'error':new _0x19ee7d('ai-chat-context-invalid-data',this,{'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id'],'expectedType':'string','actualType':typeof _0x5c9b61}),'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id']});await this['addUrlToContext'](_0x5c9b61,{'label':_0x3083eb['label'],'resourceId':_0x3083eb['id']});break;case Ft['FILE']:if(!(_0x5c9b61 instanceof File))return void this['fire']('error',{'error':new _0x19ee7d('ai-chat-context-invalid-data',this,{'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id'],'expectedType':'File','actualType':typeof _0x5c9b61}),'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id']});await this['addFilesToContext']([_0x5c9b61],{'label':_0x3083eb['label'],'resourceId':_0x3083eb['id']});break;case Ft['TEXT']:if('object'!=typeof _0x5c9b61||!('content'in _0x5c9b61)||!('type'in _0x5c9b61))return void this['fire']('error',{'error':new _0x19ee7d('ai-chat-context-invalid-data',this,{'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x5c9b61}),'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id']});_0x5c9b61=Di['_convertTextResourceToFile'](_0x5c9b61,_0x3083eb['label']),await this['addFilesToContext']([_0x5c9b61],{'label':_0x3083eb['label'],'resourceId':_0x3083eb['id']},Ft['TEXT']);break;default:this['fire']('error',{'error':new _0x19ee7d('ai-chat-context-unsupported-type',this,{'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id'],'resourceType':_0x3083eb['type']}),'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id']});}else this['fire']('error',{'error':new _0x19ee7d('ai-chat-resource-no-data',this,{'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id']}),'resourceId':_0x3083eb['id'],'sourceId':_0x35ec4f['id']});}static['_convertTextResourceToFile'](_0x2752ab,_0x1fc4af){switch(_0x2752ab['type']){case Yt['MARKDOWN']:return new File([_0x2752ab['content']],_0x1fc4af,{'type':'text/markdown'});case Yt['HTML']:return new File([_0x2752ab['content']],_0x1fc4af,{'type':'text/html'});default:return new File([_0x2752ab['content']],_0x1fc4af,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x5c44b0){switch(_0x5c44b0['type']){case Ft['FILE']:return{'type':Ft['FILE'],'id':_0x5c44b0['id']};case Ft['URL']:return{'type':Ft['URL'],'id':_0x5c44b0['id']};case Ft['DOCUMENT']:return{'type':Ft['DOCUMENT'],'id':_0x5c44b0['id'],..._0x5c44b0['selection']?.['length']&&{'selection':_0x5c44b0['selection']}};case Ft['TEXT']:return{'type':Ft['FILE'],'id':_0x5c44b0['id']};default:return null;}}['_addContextItem'](_0x3172dd,_0x48f0b0=!0x1){if(this['_pendingContextItems']['set'](_0x3172dd['uiId'],_0x3172dd),_0x3172dd['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x3172dd,'isLoading':_0x48f0b0}),'current-document'===_0x3172dd['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x3172dd['resourceId']){const _0x2df7dc=this['_findSourceIdsByResourceId'](_0x3172dd['resourceId']);_0x2df7dc&&_0x2df7dc['forEach'](_0x2554cf=>{this['_updateResourceInContextState'](_0x2554cf,_0x3172dd['resourceId'],!0x0);});}}['_removeContextItem'](_0x5c671b){const _0x3d4c86=this['_pendingContextItems']['get'](_0x5c671b),_0x2caaa5=this['_ongoingUploads']['get'](_0x5c671b);if(_0x2caaa5&&(_0x2caaa5['abort'](),this['_ongoingUploads']['delete'](_0x5c671b)),_0x3d4c86?.['resourceId']){const _0xe0765e=this['_findSourceIdsByResourceId'](_0x3d4c86['resourceId']);_0xe0765e&&_0xe0765e['forEach'](_0x223b87=>{this['_updateResourceInContextState'](_0x223b87,_0x3d4c86['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x5c671b),this['fire']('contextItemRemoved',{'uiId':_0x5c671b,'type':_0x3d4c86?.['type']}),'current-document'===_0x5c671b&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0xcf6882,_0x3f755e){if(this['_pendingContextItems']['has'](_0xcf6882['uiId'])&&(this['_pendingContextItems']['set'](_0xcf6882['uiId'],_0xcf6882),this['fire']('contextItemLoadingEnded',{'contextItem':_0xcf6882,'isLoading':_0x3f755e}),_0xcf6882['resourceId'])){const _0x570beb=this['_findSourceIdsByResourceId'](_0xcf6882['resourceId']);_0x570beb&&_0x570beb['forEach'](_0xf7a319=>{this['_updateResourceInContextState'](_0xf7a319,_0xcf6882['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x2f51e1){this['_conversationContextItems']['set'](_0x2f51e1['uiId'],_0x2f51e1);}['_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']()},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x13578b=>({..._0x13578b,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x3add10=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x3add10,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x3e9e65){for(const _0xdef1be of this['_pendingContextItems']['values']())if(_0xdef1be['resourceId']===_0x3e9e65)return!0x0;for(const _0x49e217 of this['_conversationContextItems']['values']())if(_0x49e217['resourceId']===_0x3e9e65)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x448413){const _0x5ddb32=[];for(const _0xd3170c of this['_addContextOptionsState']['sources']){_0xd3170c['resources']['find'](_0x24ccbe=>_0x24ccbe['id']===_0x448413)&&_0x5ddb32['push'](_0xd3170c['id']);}return 0x0===_0x5ddb32['length']?null:_0x5ddb32;}['_updateResourceInContextState'](_0x543cb8,_0x3f730e,_0x3cee5b){const _0x5ba68a=this['_addContextOptionsState']['sources']['find'](_0x28aa50=>_0x28aa50['id']===_0x543cb8);if(!_0x5ba68a)return;const _0x42beff=_0x5ba68a['resources']['find'](_0x2b93d8=>_0x2b93d8['id']===_0x3f730e);_0x42beff&&(_0x42beff['isInContext']=_0x3cee5b,this['fire']('resourceStateChanged',{'sourceId':_0x543cb8,'resourceId':_0x3f730e,'isInContext':_0x3cee5b}));}['_startUploadOperation'](_0x25a3ec){this['_ongoingUploadOperations']['set'](_0x25a3ec,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x3d81aa){this['_ongoingUploadOperations']['delete'](_0x3d81aa),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Fi=['capabilitiesUpdated'];class qi extends _0x3dcb71(){['_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'](_0x49c4ff){const _0x515517={};return _0x49c4ff&&_0x49c4ff['isWebSearchEnabled']&&(_0x515517['webSearch']={}),_0x49c4ff&&_0x49c4ff['isReasoningEnabled']&&(_0x515517['reasoning']={}),_0x515517;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x5e1ed4){_0x5e1ed4!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x5e1ed4,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x455a09){_0x455a09!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x455a09,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class zi extends jt{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x47de19){super(_0x47de19),this['conversationId']=_0x47de19['conversationId'],this['contextItems']=_0x47de19['contextItems'],this['capabilities']=_0x47de19['capabilities'],this['userMessage']=_0x47de19['userMessage'],this['model']=_0x47de19['model'],this['quickActionData']=_0x47de19['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Di['mapContextItemsToRequestData'](this['contextItems']),'capabilities':qi['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class G extends _0x3dcb71(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x4d1319){super(),this['options']=_0x4d1319,this['connector']=_0x4d1319['connector'],this['chatModels']=_0x4d1319['chatModels'],this['id']=_0x4d1319['conversationId'];}async['init'](_0x19fa88){try{this['chatContext']=new Di({'connector':this['connector'],'config':_0x19fa88,'ownerId':this['id']}),this['chatContext']['delegate'](...Si)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new qi(),this['chatCapabilities']['delegate'](...Fi)['to'](this),this['chatCapabilities']['init']();const _0x4c2b86=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x4c2b86});const _0x58f02f=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x58f02f&&await this['setModel'](_0x58f02f);}catch(_0x30d555){const _0x43bec1=new _0x19ee7d('ai-chat-conversation-init-failed',null,{'message':_0x30d555['message']||_0x30d555});_0x43bec1['stack']=_0x30d555['stack'],this['fire']('error',{'error':_0x43bec1});}}async['start'](){if(this['isStarted'])throw new _0x19ee7d('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x19ee7d('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0xa66aa6}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0xa66aa6,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x4d7c6c){const _0xb01af2=new _0x19ee7d('ai-chat-conversation-start-failed',null,{'message':_0x4d7c6c['message'],'conversationId':this['id']});throw _0xb01af2['stack']=_0x4d7c6c['stack'],this['fire']('error',{'error':_0xb01af2}),_0xb01af2;}}async['load'](_0xa2ed06,_0xedb787){try{const _0x469744=await this['connector']['fetchConversation'](_0xa2ed06)['getConversation'](),_0x3d07bb=await this['connector']['fetchConversationMessages'](_0xa2ed06)['getMessages'](),_0x22837f=_0x3d07bb[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x469744['id'],'title'in _0x469744?this['fire']('setConversationTitle',_0x469744['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x51ca5d=(await this['chatModels']['getAll']())['find'](_0x398ad3=>_0x398ad3['id']['toLowerCase']()===_0x22837f['toLowerCase']());return this['selectedModel']=_0x51ca5d,this['fire']('modelSelected',{'selectedModel':_0x51ca5d,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x3d07bb,_0xedb787,_0x22837f),this['currentInteraction']=void 0x0,this;}catch(_0x16a7a8){const _0x2557cc=new _0x19ee7d('ai-chat-conversation-init-from-id-failed',null,{'message':_0x16a7a8['message'],'conversationId':_0xa2ed06});throw _0x2557cc['stack']=_0x16a7a8['stack'],this['fire']('error',{'error':_0x2557cc}),_0x2557cc;}}async['_processMessagesToInteractions'](_0x4d8e1f,_0x26b2aa,_0x40af88){let _0x59c108;for(const _0x23ddca of _0x4d8e1f)if('user'===_0x23ddca['role']){const _0x1ee5ca=await this['_extractContextItems'](_0x23ddca),_0x510e42={'isReasoningEnabled':Object['hasOwn'](_0x23ddca['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x23ddca['capabilities'],'webSearch')};_0x59c108=this['createInteraction']({'userMessage':_0x23ddca['prompt'],'contextItems':_0x1ee5ca,'capabilities':_0x510e42,'modelId':_0x40af88,'quickActionData':_0x23ddca['attributes']?.['quickActionData']}),this['currentInteraction']=_0x59c108,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x23ddca['role']&&_0x59c108)for(const _0x507e5f of _0x23ddca['content']){const _0x3be6f1='text'===_0x507e5f['type']?'text-delta':'modification-delta',_0x53edab=_0x59c108['getDocumentContext']()?.['sessionId']!==_0x26b2aa;_0x59c108['currentReply']=_0x59c108['createReply']({'type':_0x3be6f1,'isDone':!0x0,'interactionId':_0x59c108['id'],'areActionsDisabled':_0x53edab}),_0x59c108['currentReply']['appendContent'](_0x507e5f['content']);}}}async['_extractContextItems'](_0x28ece3){const _0x6fe7d4=new Map();if(!_0x28ece3['content'])return _0x6fe7d4;for(const _0x220996 of _0x28ece3['content']){const _0x24f19f=await this['chatContext']['populateFromMessage'](_0x220996);_0x24f19f&&_0x6fe7d4['set'](_0x24f19f['id'],_0x24f19f);}return _0x6fe7d4;}async['handleUserInteraction']({userMessage:_0x157eb2,quickActionData:_0x4e484d}){if(!this['isStarted'])throw new _0x19ee7d('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x19ee7d('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x5e2329=this['chatContext']['getPendingContextItems'](),_0x4e1ef1=this['chatCapabilities']['getCapabilitiesConfig'](),_0x4f2c01=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x157eb2,'contextItems':_0x5e2329,'capabilities':_0x4e1ef1,'modelId':_0x4f2c01,'quickActionData':_0x4e484d}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x56a875){if(_0x56a875 instanceof _0x19ee7d)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x56a875});else{const _0x16a914=Ie['get'](_0x56a875['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x19ee7d(_0x16a914,null,{'error':_0x56a875})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x3cc811,contextItems:_0x4dc3ed,capabilities:_0x4a7faf,modelId:_0x11c783,quickActionData:_0x2369ef}){const _0xac22da=new zi({'userMessage':_0x3cc811,'contextItems':_0x4dc3ed,'capabilities':_0x4a7faf,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x11c783,'quickActionData':_0x2369ef});return _0xac22da['delegate'](...qt)['to'](this),this['interactions']['push'](_0xac22da),this['fire']('interactionCreated',_0xac22da),_0xac22da;}['getInteraction'](_0x533429){return this['interactions']['find'](_0x5c7e43=>_0x5c7e43['id']===_0x533429);}['removeInteraction'](_0x38be12){const _0x42e3bc=this['getInteraction'](_0x38be12);_0x42e3bc&&(_0x42e3bc['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x42e3bc),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x432462){this['chatContext']['addCurrentDocumentToContext'](_0x432462);}async['updateCurrentDocumentInContext']({content:_0x226b58,version:_0x4d04b6,sessionId:_0x3d9d55,selections:_0x348158}){await this['chatContext']['updateCurrentDocument'](_0x226b58,_0x4d04b6,_0x3d9d55,_0x348158);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x504c13){this['chatContext']['addSelectionToContext'](_0x504c13);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x5de5f3){this['chatContext']['addFilesToContext'](_0x5de5f3);}['addUrlToContext'](_0xf2b58d){this['chatContext']['addUrlToContext'](_0xf2b58d);}['addResourceToContext'](_0x5acc1e,_0x3aa104){this['chatContext']['addResourceToContext'](_0x5acc1e,_0x3aa104);}['loadSourceResources'](_0x26980f,_0x414582,_0x5a7f30){return this['chatContext']['loadSourceResources'](_0x26980f,_0x414582,_0x5a7f30);}['removeFromContext'](_0x24d91e){this['chatContext']['removeFromContext'](_0x24d91e);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x217fc7){_0x217fc7?!0x1===await this['chatModels']['isAvailable'](_0x217fc7)&&(_0xe189d1('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x217fc7}),_0x217fc7=(await this['chatModels']['getAvailableModels']())[0x0]):(_0xe189d1('ai-chat-conversation-set-model-null',{'conversation':this}),_0x217fc7=(await this['chatModels']['getAvailableModels']())[0x0]),_0x217fc7['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x217fc7,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x217fc7}));}}function P(_0x288087){if(_0x288087 instanceof _0x1e9e1e)return _0x288087;if(_0x288087?.['editors']&&_0x288087['editors']['get'](0x0))return _0x288087['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.'),_0x288087['editors']['get'](0x0);throw new _0x19ee7d('ai-get-editor-from-context-no-editor');}const W='ai-selection';class c extends _0x4404b9{['_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 _0x11ade9=P(this['context']),_0x48767e=_0x11ade9['plugins']['has']('RealTimeCollaborationClient')&&_0x11ade9['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x48767e||_0x3bb1ce();}return this['_sessionId'];}['getDocumentData'](){const _0x39c1cf=P(this['context']),_0x3e0a8d=_0x39c1cf['model'],_0x5b8ee4=_0x39c1cf['data']['toView'](_0x3e0a8d['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0xdaf026=new gt(_0x39c1cf['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x5b8ee4,_0xdaf026);let _0x25660b=_0x39c1cf['data']['processor']['toData'](_0x5b8ee4);const _0x3119e3=this['_getMarkersInDocumentOrder'](),_0x39274f=[];for(const _0x261a1d of _0x3119e3){const _0x5b5c92='<'+_0x261a1d['name']+':start></'+_0x261a1d['name']+':start>',_0xc54a78=_0x25660b['indexOf'](_0x5b5c92);_0x25660b=_0x25660b['substring'](0x0,_0xc54a78)+_0x25660b['substring'](_0xc54a78+_0x5b5c92['length']);const _0x2d7238='<'+_0x261a1d['name']+':end></'+_0x261a1d['name']+':end>',_0x1a7235=_0x25660b['indexOf'](_0x2d7238);_0x25660b=_0x25660b['substring'](0x0,_0x1a7235)+_0x25660b['substring'](_0x1a7235+_0x2d7238['length']),_0x39274f['push']({'markerName':_0x261a1d['name'],'start':_0xc54a78,'end':_0x1a7235,'htmlFragment':_0x25660b['substring'](_0xc54a78,_0x1a7235)});}return{'content':_0x25660b,'version':_0x39c1cf['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x39274f};}async['afterInit'](){this['context']instanceof _0x1e9e1e?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x3dfa1d,_0x5b4be9)=>{_0x5b4be9['on']('ready',()=>{this['_integrateEditor'](_0x5b4be9);});});}['_integrateEditor'](_0x20e58e){_0x20e58e['conversion']['for']('editingDowncast')['markerToHighlight']({'model':W,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x20e58e['conversion']['for']('dataDowncast')['markerToElement']({'model':W,'view':(_0x3cfec0,{writer:_0x51a0b7,options:_0x43f458})=>_0x43f458['convertAiChatSelectionMarker']?_0x51a0b7['createUIElement'](_0x3cfec0['markerName']+':'+(_0x3cfec0['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x4a96df,_0x3d12f4,_0x54bebe=!0x1,_0x36b734=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x36b734)return!0x1;const _0x1244e2=P(this['context'])['model'];return _0x1244e2['change'](_0x291813=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x3d12f4,this['_displayedFakeSelectionLocked']=_0x54bebe;let _0x738a0b=0x0;for(let _0x5307ba of _0x4a96df){const _0x388fcd=W+':'+_0x738a0b;if(_0x5307ba['start']['isAtEnd']){const _0x379c30=_0x5307ba['start']['getLastMatchingPosition'](({item:_0x28c708})=>!_0x1244e2['schema']['isContent'](_0x28c708),{'boundaries':_0x5307ba});_0x5307ba=_0x291813['createRange'](_0x379c30,_0x5307ba['end']);}_0x291813['addMarker'](_0x388fcd,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5307ba}),_0x738a0b++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x4252fb){if(this['_displayedFakeSelectionId']!=_0x4252fb)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x578c41=P(this['context']),_0x5dc081=_0x578c41['model']['markers']['getMarkersGroup'](W);return _0x578c41['model']['change'](_0x415f81=>{for(const _0x217c78 of _0x5dc081)_0x415f81['removeMarker'](_0x217c78);}),!0x0;}['modelToViewWithIds'](_0x27065e){const _0x5daf48=P(this['context']),_0x22b08b=_0x5daf48['data']['toView'](_0x27065e),_0x28241f=new gt(_0x5daf48['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x22b08b,_0x28241f),_0x22b08b;}['_setDataIdsOnChildren'](_0x346c21,_0x237df4){let _0x1dfd86=!0x1;const _0x46e956=new Set();for(const _0x1e4389 of _0x346c21['getChildren']()){const _0x5e0d34=_0x1e4389['is']('emptyElement')||_0x1e4389['is']('containerElement');if(!_0x1e4389['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x1e4389,_0x237df4)||_0x5e0d34)&&(_0x237df4['setAttribute']('data-id',this['_nextDataId'](_0x46e956),_0x1e4389),_0x1dfd86=!0x0);}return _0x1dfd86;}['_nextDataId'](_0x292db8){let _0x467b51;do{_0x467b51='';for(let _0x15bd30=0x0;_0x15bd30<0x4;_0x15bd30++)_0x467b51+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x292db8['has'](_0x467b51));return _0x292db8['add'](_0x467b51),_0x467b51;}['getSelectionText'](){const {model:_0x20c626}=P(this['context']),_0x169c65=_0x20c626['document']['selection'],_0x42de86=_0x20c626['getSelectedContent'](_0x169c65),_0x4428db=[],_0x150a4e=_0x20c626['createRangeIn'](_0x42de86)['getWalker']();for(const {item:_0x2bb9f0}of _0x150a4e)_0x2bb9f0['is']('$textProxy')?_0x4428db['push'](_0x2bb9f0['data']):_0x2bb9f0['is']('element')&&_0x4428db['length']>0x0&&'\x20'!==_0x4428db[_0x4428db['length']-0x1]&&_0x4428db['push']('\x20');return'\x22'+_0x4428db['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x3ce231=P(this['context'])['model'];return Array['from'](_0x3ce231['markers']['getMarkersGroup'](W))['sort']((_0x44e0bb,_0x42ac24)=>_0x44e0bb['getStart']()['isBefore'](_0x42ac24['getStart']())?-0x1:_0x44e0bb['getStart']()['isAfter'](_0x42ac24['getStart']())?0x1:0x0);}}const k=['applySuggestion','insertSuggestion','showChangeInText'];class ah extends _0x492b6b{['actionsButton'];['children'];['applySuggestionModel'];['showChangeInTextModel'];['insertSuggestionModel'];['_partsCount']=0x1;['_dropdownOriginalConfig'];['_dropdownCurrentConfig'];['_firstRender']=!0x0;constructor(_0xdacfc7,_0x30c451){super(_0xdacfc7),this['_dropdownOriginalConfig']=_0x30c451||[...k],this['_dropdownCurrentConfig']=[...this['_dropdownOriginalConfig']];const _0x68b46=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['applySuggestionModel']=new _0x1bf3fd({'label':Pn('applySuggestion',_0xdacfc7,this['_partsCount']),'icon':_0x2a5a64,'withText':!0x0,'type':'button','actionName':'applySuggestion'}),this['showChangeInTextModel']=new _0x1bf3fd({'label':Pn('showChangeInText',_0xdacfc7,this['_partsCount']),'icon':_0x4c9c07,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x1bf3fd({'label':Pn('insertSuggestion',_0xdacfc7,this['_partsCount']),'icon':_0x36635b,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsButton']=this['_createActionsDropdownOrButton'](_0xdacfc7),this['children']=this['createCollection'](),this['actionsButton']&&this['children']['add'](this['actionsButton']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x68b46['if']('isVisible','ck-hidden',_0x433eac=>!_0x433eac)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_dropdownCurrentConfig']=this['isTrackChangesOn']?this['_dropdownOriginalConfig']['filter'](_0xcc1cc8=>'applySuggestion'!==_0xcc1cc8):[...this['_dropdownOriginalConfig']],this['_updateDropdownActions'](_0xdacfc7);});}['_updateDropdownActions'](_0x4671ee){this['actionsButton']&&this['children']['has'](this['actionsButton'])&&(this['children']['remove'](this['actionsButton']),this['actionsButton']['destroy']()),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x4671ee),this['actionsButton']&&this['children']['add'](this['actionsButton']);}['_createActionsDropdownOrButton'](_0x57dee0){if(0x0==this['_dropdownCurrentConfig']['length'])return null;const _0x3ce2aa=0x1===this['_dropdownCurrentConfig']['length']?this['_createActionsButton'](_0x57dee0):this['_createActionsDropdown'](_0x57dee0),_0x1cb0ca=this['_firstRender']?'':'ck-ai-chat__feed__ai-suggestion__actions--no-animation';_0x3ce2aa['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x57dee0,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x57dee0,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions\x20'+_0x1cb0ca});for(const _0x3502d0 of this['_dropdownCurrentConfig'])_0x3ce2aa['on'](_0x3502d0,()=>{this['fire'](_0x3502d0);});return this['_firstRender']=!0x1,_0x3ce2aa;}['_createActionsButton'](_0x1f019b){const _0x22e28a=new _0x21bd9e(_0x1f019b);return _0x22e28a['set']({'class':'ck-ai-button-primary','withText':!0x0}),_0x22e28a['on']('execute',()=>{_0x22e28a['fire'](this['_dropdownCurrentConfig'][0x0]);}),_0x22e28a;}['_createActionsDropdown'](_0x301bde){const _0x35d930=new Nn(_0x301bde,{'listItemModels':this['_dropdownCurrentConfig']['map'](_0x466ae1=>{switch(_0x466ae1){case'applySuggestion':return this['applySuggestionModel'];case'showChangeInText':return this['showChangeInTextModel'];case'insertSuggestion':return this['insertSuggestionModel'];}})});return _0x35d930['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x301bde,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x301bde,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),_0x35d930['bind']('isEnabled')['to'](this),_0x35d930;}['updateLabels'](_0x3784e1){const _0x5166aa=this['locale'];this['_partsCount']=_0x3784e1||this['_partsCount'],this['actionsButton']['set']({'label':Pn(this['_dropdownCurrentConfig'][0x0],_0x5166aa,this['_partsCount']),'tooltip':Hn(this['_dropdownCurrentConfig'][0x0],_0x5166aa,this['_partsCount'])}),this['applySuggestionModel']['label']=Pn('applySuggestion',_0x5166aa,this['_partsCount']),this['showChangeInTextModel']['label']=Pn('showChangeInText',_0x5166aa,this['_partsCount']),this['insertSuggestionModel']['label']=Pn('insertSuggestion',_0x5166aa,this['_partsCount']);}}class Nn extends _0x18c56d{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x3f6498,_0x4660b3){super(_0x3f6498),this['balloonPanelView']=new _0x257cec(this['locale']),this['bodyCollection']=new Kt(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x4660b3['listItemModels']['slice'](0x1)),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',y(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{const _0x4ac530=_0x4660b3['listItemModels'][0x0]['actionName'];this['fire'](_0x4ac530),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),this['on']('open',()=>{this['balloonPanelView']['isVisible']?(this['balloonPanelView']['hide'](),this['arrowView']['focus']()):(this['balloonPanelView']['pin']({'target':this['element'],'positions':['ltr'===this['locale']['uiLanguageDirection']?Gn:yn]}),this['listView']['focus']());}),ts({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x4382b8){const _0x1b805b=this['locale'],_0x13c27e=new _0x24784f(_0x1b805b);for(const _0x254036 of _0x4382b8){const _0x29848f=new _0x8a8c30(_0x1b805b),_0x1c1e63=new _0x1bb418(_0x1b805b);_0x1c1e63['bind'](...Object['keys'](_0x254036))['to'](_0x254036),_0x1c1e63['delegate']('execute')['to'](_0x13c27e),_0x29848f['children']['add'](_0x1c1e63),_0x13c27e['items']['add'](_0x29848f);}return _0x13c27e['items']['delegate']('execute')['to'](this),_0x13c27e['on']('execute',_0x3000ec=>{const _0x18945c=_0x3000ec['source'];this['fire'](_0x18945c['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x13c27e;}['_setUpKeystrokes'](){this['keystrokeHandler']=new Wt(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x4dab11,_0x3d0c88)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x3d0c88();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function Gn(_0x463797){return{'top':_0x463797['bottom'],'left':_0x463797['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function yn(_0x2d79a7,_0x83afc4){return{'top':_0x2d79a7['bottom'],'left':_0x2d79a7['left']-(_0x83afc4['width']-_0x2d79a7['width']),'name':'arrowless','config':{'withArrow':!0x1}};}function Pn(_0x57b4b0,_0x282bf7,_0x3a286c){switch(_0x57b4b0){case'applySuggestion':return y(_0x282bf7,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x3a286c);case'showChangeInText':return y(_0x282bf7,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x3a286c);case'insertSuggestion':return y(_0x282bf7,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x3a286c);}}function Hn(_0x2f65bb,_0x23ccab,_0x2cd7b6){switch(_0x2f65bb){case'applySuggestion':return y(_0x23ccab,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x2cd7b6);case'showChangeInText':return y(_0x23ccab,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP',_0x2cd7b6);case'insertSuggestion':return y(_0x23ccab,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP',_0x2cd7b6);}}class Mt extends _0x3dcb71(){['_connector'];['_availableModels'];['_defaultModelId'];['_modelList']=[];constructor({connector:_0x2c6ba0,availableModels:_0x474496,defaultModelId:_0x3d2597}){super(),this['_connector']=_0x2c6ba0,this['_availableModels']=_0x474496,this['_defaultModelId']=_0x3d2597;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x58e1f9=this['_connector']['getModels'](),_0x43843f=await _0x58e1f9['list']();this['_modelList']=_0x43843f['items'];}catch(_0xc00964){throw _0x543541('ai-models-unable-to-retrieve',{'error':_0xc00964}),_0xc00964;}return[...this['_modelList']];}async['getAvailableModels'](){const _0x19567=await this['getAll']();return this['_filterModels'](_0x19567,this['_availableModels']);}async['getModel'](_0x164d02){const _0x49b036=await this['getAll']();if(!_0x49b036['length'])return null;if(_0x164d02){const _0x38cde5=this['_getModelById'](_0x49b036,_0x164d02);if(_0x38cde5)return _0x38cde5;_0xe189d1('ai-chat-model-id-unrecognized',{'modelId':_0x164d02,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x366a31=await this['getAvailableModels']();if(!_0x366a31['length'])return null;if(this['_defaultModelId']){const _0x1c1d77=this['_getModelById'](_0x366a31,this['_defaultModelId']);if(_0x1c1d77)return _0x1c1d77;_0xe189d1('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x366a31[0x0]['id']});}return _0x366a31[0x0];}async['isAvailable'](_0x5e0a32){return(await this['getAvailableModels']())['some'](_0xf0fb6a=>_0xf0fb6a['name']===_0x5e0a32['name']&&_0xf0fb6a['provider']===_0x5e0a32['provider']);}['_filterModels'](_0x2a1d36,_0x32e989){let _0x6c3465;if(_0x32e989){_0x6c3465=[];const _0x55ab85='string'==typeof _0x32e989?[_0x32e989['toLocaleLowerCase']()]:_0x32e989['map'](_0x39aeda=>_0x39aeda['toLocaleLowerCase']());for(const _0x3b605c of _0x55ab85)for(const _0xf0bb7d of _0x2a1d36)(_0xf0bb7d['id']['toLocaleLowerCase']()===_0x3b605c||_0xf0bb7d['name']['toLocaleLowerCase']()===_0x3b605c||Oe(_0xf0bb7d)&&'auto'===_0x3b605c||_0xf0bb7d['provider']['toLocaleLowerCase']()===_0x3b605c||_0xf0bb7d['id']['toLocaleLowerCase']()['startsWith'](_0x3b605c))&&_0x6c3465['push'](_0xf0bb7d);}else _0x6c3465=_0x2a1d36;return _0x6c3465;}['_getModelById'](_0x3ab46d,_0x4e2fcb){return _0x3ab46d['find'](_0x2c6dc2=>Oe(_0x2c6dc2)&&'auto'===_0x4e2fcb?_0x2c6dc2:_0x2c6dc2['id']===_0x4e2fcb)||null;}static['getLocalized'](_0x117003,_0x57efb6){return _0x57efb6['map'](_0x474442=>{if(Oe(_0x474442))_0x474442['name']=y(_0x117003,'AI_MODEL_NAME_AUTO'),_0x474442['description']=y(_0x117003,'AI_MODEL_DESCRIPTION_AUTO');else y(_0x117003,'AI_MODEL_DESCRIPTION_'+_0x474442['id']['toUpperCase']())['startsWith']('AI_MODEL_DESCRIPTION_')||(_0x474442['description']=y(_0x117003,'AI_MODEL_DESCRIPTION_'+_0x474442['id']['toUpperCase']()));return _0x474442;});}}function Oe(_0x278692){return _0x278692['id']['startsWith']('agent');}class z extends Mt{async['getAll'](){return(await super['getAll']())['sort']((_0x1a9acd,_0x5d7cb9)=>{const _0x598bd5=Object['values'](_0x1a9acd['capabilities'])['filter'](_0xfc607=>_0xfc607['enabled'])['length'];return Object['values'](_0x5d7cb9['capabilities'])['filter'](_0x53921f=>_0x53921f['enabled'])['length']-_0x598bd5;});}}function v({editor:_0x45f00b,interaction:_0x4879f0,reply:_0x2a0bcf,groups:_0xadf888,transform:_0xba3871,documentCompare:_0x5d6520,documentCompareOptions:_0x74cf45}){const _0x2d6bcd=_0x4879f0['getDocumentContext']();if(!_0x2d6bcd)return[];const _0x524f8b=_0x2d6bcd['content'],_0x4579d9=_0x2d6bcd['version'],_0x32fffa=_0x2a0bcf['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x327fb2}of _0xadf888){const _0x31efd3=_0x327fb2['filter'](_0x308059=>'new'!=_0x308059['type'])['map'](_0x5d28cc=>st('data-id',_0x5d28cc['id'],_0x32fffa)),_0x477187=_0x327fb2['filter'](_0x3f1012=>'removed'!=_0x3f1012['type'])['map'](_0x5df1e6=>_0x5df1e6['node']['cloneNode'](!0x0));let _0x2522f3=null;if(_0x31efd3['length']){_0x2522f3=_0x31efd3[0x0]['previousSibling'];for(let _0x4b4c47=0x0;_0x4b4c47<_0x31efd3['length'];_0x4b4c47++)_0x19c981(_0x31efd3[_0x4b4c47]);}if(_0x477187['length']){_0x2522f3||(_0x327fb2[0x0]['anchorId']?_0x2522f3=st('data-id',_0x327fb2[0x0]['anchorId'],_0x32fffa):(_0x2522f3=_0x477187['shift'](),_0x5578be(_0x32fffa,_0x2522f3)));for(let _0x3215c4=0x0;_0x3215c4<_0x477187['length'];_0x3215c4++)_0x41021b(_0x2522f3,_0x477187[_0x3215c4]),_0x2522f3=_0x477187[_0x3215c4];}}const _0x23768e=tt(_0x32fffa),_0x36dadd=_0x5d6520['getDiff'](_0x524f8b,_0x23768e,_0x74cf45)['getOperations']();if(_0xba3871){const _0x59b9d4=_0x45f00b['model']['document']['history']['getOperations'](_0x4579d9),_0x1ce265={'document':_0x45f00b['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x39cd19(_0x36dadd,_0x59b9d4,_0x1ce265)['operationsA'];}return _0x36dadd;}function b(_0x514df2,_0x1037bd){if('marker'!=_0x1037bd['type'])return;const _0x3923e7=_0x514df2['model']['markers']['get'](_0x1037bd['name']);_0x3923e7&&(_0x1037bd['oldRange']=_0x3923e7['getRange']());}class Sr extends _0x39a08b{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x42af5a,_0x2c132b={},_0xd09d3){super(_0x42af5a),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x2c132b};const _0x2071de=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x2071de?'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'](_0xd09d3),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']);}['_setupRatingButtons'](){this['likeButton']=new _0x21bd9e(this['locale']),this['likeButton']['set']({'icon':_0x1e0de2,'label':y(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x3c16f8=>!_0x3c16f8),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x21bd9e(this['locale']),this['dislikeButton']['set']({'icon':_0x1b416f,'label':y(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x48b140=>!_0x48b140),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x21bd9e(this['locale']),this['copyButton']['set']({'icon':_0x385135,'label':y(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x246617=>!_0x246617);const _0xc13d51=new _0x25e498();_0xc13d51['set']({'content':_0x347166}),_0xc13d51['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'](_0xc13d51);}['_setupShowChangesButton'](_0xeeb738){this['showChangesButton']=new _0x21bd9e(this['locale']),this['showChangesButton']['set']({'icon':_0x376600,'label':y(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'isOn':_0xeeb738}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x577e08=>!_0x577e08),this['showChangesButton']['on']('execute',()=>{const _0x48d00f=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x48d00f,'icon':_0x48d00f?_0x2eeddb:_0x376600}),this['fire']('toggleShowChanges',_0x48d00f);});}}class Lr extends _0x492b6b{['showChangesToggleView'];constructor(_0x39ac0f,_0x12472b){super(_0x39ac0f),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new ra(_0x39ac0f),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':y(_0x39ac0f,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x12472b['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x3754d0=>_0x3754d0?_0x7a6747:_0x5cd197),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x5a3531=new _0x25e498();_0x5a3531['content']=_0x7efb12,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x12472b['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x5a3531,{'tag':'span','children':[y(_0x39ac0f,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class ra extends _0x21bd9e{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x2eab31){this['options']={'delay':_0x2eab31['delay']??0x14,'textNodeStyle':_0x2eab31['textNodeStyle'],'onStreamUpdate':_0x2eab31['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x2c9710,targetElement:_0x55c931,abortSignal:_0x291466}){this['isStreaming']&&this['stop'](),_0x291466?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x2ef420(_0x2c9710,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0xe189d1('ai-html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x5b3f13=0x0;_0x5b3f13<this['currentIndex'];_0x5b3f13++)this['nodesList'][_0x5b3f13]['shouldBeStreamed']=!0x0;let _0x479ae4=0x0;for(let _0x41a34c=this['currentIndex'];_0x41a34c<this['nodesList']['length'];_0x41a34c++){const _0x9d2bea=Date['now'](),_0x33f7c7=this['nodesList'][_0x41a34c],_0x291271=_0x9d2bea-_0x479ae4;_0x33f7c7['shouldBeStreamed']=!0x0;let _0x2e8654=_0x33f7c7['parent'];for(;_0x2e8654;)_0x2e8654['shouldBeStreamed']=!0x0,_0x2e8654=_0x2e8654['parent'];if(_0x291271<this['options']['delay'])try{const {promise:_0x3ef0ba,abortController:_0x1c12be}=pr(this['options']['delay']-_0x291271);this['timeoutAbortController']=_0x1c12be,await _0x3ef0ba;}catch(_0x141c0a){return;}_0x1e000f(_0x55c931,'<'+_0x55c931['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x55c931['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x41a34c,_0x479ae4=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x2763ef}){Array['from'](_0x2763ef['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x5ced4c=>{_0x5ced4c['replaceWith'](_0x5ced4c['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x203557){let _0x4f7282='';if(function(_0x2475ae){return _0xa44e7b(_0x2475ae);}(_0x203557)){for(const _0x4de38e of _0x203557['children'])_0x4f7282+=this['renderNode'](_0x4de38e);}else{if(dr(_0x203557)){if(!_0x203557['shouldBeStreamed'])return'';const _0x314aed=_0x203557,_0x1d8fe1=Object['entries'](_0x314aed['attribs'])['map'](([_0x5ec988,_0x5a2489])=>_0x5ec988+'=\x22'+_0x5a2489+'\x22')['join']('\x20');_0x4f7282+='<'+_0x314aed['tagName']+(_0x1d8fe1?'\x20'+_0x1d8fe1:'')+'>';for(const _0x260330 of _0x51e789(_0x314aed))_0x4f7282+=this['renderNode'](_0x260330);_0x4f7282+='</'+_0x314aed['tagName']+'>';}else{if(!ar(_0x203557))return'';if(!_0x203557['shouldBeStreamed'])return'';!function(_0x551f44){if(!_0x551f44['parent']||!dr(_0x551f44['parent']))return!0x1;if(!cr['includes'](_0x551f44['parent']['tagName']))return!0x1;return!_0x4b97d9(_0x551f44)['match'](/^\s*[<>]\s*$/);}(_0x203557)?_0x4f7282+=_0x20dcd7(_0x203557):_0x4f7282+=_0x20dcd7(new _0x1781b0('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x203557]));}}return _0x4f7282;}['getParsedDocumentNodeList'](){const _0xc84505=[];return function(_0x16dc15,_0x3d6882){const _0x142c62=_0x13a18b=>{if(_0x3d6882(_0x13a18b),_0x13a18b instanceof _0x19bfe3)for(let _0x5c3797=0x0;_0x5c3797<_0x13a18b['children']['length'];_0x5c3797++){const _0x44cbd8=_0x13a18b['children'][_0x5c3797];_0x142c62(_0x44cbd8);}};for(let _0x6cfc1e=0x0;_0x6cfc1e<_0x16dc15['children']['length'];_0x6cfc1e++)_0x142c62(_0x16dc15['children'][_0x6cfc1e]);}(this['document'],_0x5c1689=>{if(ar(_0x5c1689)){const _0x95dc=this['splitTextNodeIntoWordNodes'](_0x5c1689);_0x95dc['length']&&_0xc84505['push'](..._0x95dc);}_0x5c1689['isWordSplitSource']||_0x5c1689['isWordSplitResult']||_0xc84505['push'](_0x5c1689);}),_0xc84505;}['splitTextNodeIntoWordNodes'](_0x35e8de){if(_0x35e8de['isWordSplitSource']||_0x35e8de['isWordSplitResult'])return[];const _0x273898=_0x4b97d9(_0x35e8de)['match'](/(?:\s*\S+\s*)/g),_0x286c98=[];if(_0x273898&&_0x273898['length']>0x1){for(const _0x34b3f9 of _0x273898){const _0x7bd8f3=new _0xe506f9(_0x34b3f9);_0x7bd8f3['isWordSplitResult']=!0x0,_0x4e9405(_0x35e8de,_0x7bd8f3),_0x286c98['push'](_0x7bd8f3);}_0x35e8de['isWordSplitSource']=!0x0,_0x19c981(_0x35e8de);}return _0x286c98;}}const cr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function ar(_0xf5ab5c){return _0xb35865(_0xf5ab5c);}function dr(_0x10dd7b){return _0x1a9650(_0x10dd7b);}function pr(_0x6ba939){const _0x190d54=new AbortController();return{'promise':new Promise((_0x387511,_0x165733)=>{const _0x5dd721=setTimeout(_0x387511,_0x6ba939);_0x190d54['signal']['addEventListener']('abort',()=>{clearTimeout(_0x5dd721),_0x165733();});}),'abortController':_0x190d54};}const Ce=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class na extends _0x492b6b{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x1303fc,{part:_0x47ad07,uiIndex:_0x3a295f,areActionsDisabled:_0x481f09,availableActions:_0x5e45aa}){super(_0x1303fc),this['set']('partDefinition',_0x47ad07),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x28fa68=>'pending'==_0x28fa68&&!_0x481f09),this['children']=this['createCollection'](),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Un(_0x1303fc,{'part':_0x47ad07,'uiIndex':_0x3a295f,'availableActions':_0x5e45aa}),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Ce)['to'](this);const _0x13e92c=this['bindTemplate'];this['contentView']=new _0x492b6b(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__content']}}),this['children']['addMany']([this['contentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x13e92c['to']('state',_0x46c4ae=>'ck-ai-suggestion__body__content-part_'+_0x46c4ae),_0x13e92c['to']('isEnabled',_0x3b16d1=>_0x3b16d1?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x13e92c['if']('isVisible','ck-hidden',_0xe5bd0f=>!_0xe5bd0f)]},'children':this['children'],'on':{'mouseenter':_0x13e92c['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x47ad07['index']});}),'mouseleave':_0x13e92c['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x47ad07['index']});})}});}async['updateContent']({part:_0x2b1fac,renderingStrategy:_0x5d8ffe,showUnchangedParts:_0x5ba6f7=!0x1,abortSignal:_0x50265d}){this['partDefinition']=_0x2b1fac,this['isVisible']=this['partDefinition']['hasChanges']||_0x5ba6f7,this['isVisible']&&('streaming'===_0x5d8ffe?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x50265d}):this['contentView']['element']['innerHTML']=tt(this['partDefinition']['content']));}['toggleHeader'](_0x4b48d3){_0x4b48d3?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Un extends _0x492b6b{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];['_iconStateOutdated'];constructor(_0x5e83a8,{part:_0x12f5c6,uiIndex:_0x13e265,availableActions:_0xbfe4ac}){super(_0x5e83a8),this['set']('partDefinition',_0x12f5c6),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x3db1f6=new _0x25e498();_0x3db1f6['content']=_0x4e7318,_0x3db1f6['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x2cacf1=[];if(_0xbfe4ac['includes']('showChangeInText')){const _0xe668d3=new _0x21bd9e(_0x5e83a8);_0xe668d3['set']({'label':y(_0x5e83a8,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x4c9c07}),_0xe668d3['bind']('isEnabled')['to'](this),_0xe668d3['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x12f5c6['index']});}),_0x2cacf1['push'](_0xe668d3);}if(_0xbfe4ac['includes']('insertSuggestion')){const _0x54e686=new _0x21bd9e(_0x5e83a8);_0x54e686['set']({'label':y(_0x5e83a8,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x36635b}),_0x54e686['bind']('isEnabled')['to'](this),_0x54e686['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x12f5c6['index']});}),_0x2cacf1['push'](_0x54e686);}const _0x5844e5=new _0x21bd9e(_0x5e83a8);_0x5844e5['set']({'label':y(_0x5e83a8,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x55fa0e}),_0x5844e5['bind']('isEnabled')['to'](this),_0x5844e5['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x12f5c6['index']});}),_0x2cacf1['push'](_0x5844e5),this['_toolbarView']=new _0x39a08b(_0x5e83a8),this['_toolbarView']['items']['addMany'](_0x2cacf1),this['_iconStateAccepted']=new _0x25e498(),this['_iconStateAccepted']['content']=_0x1fca69,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':y(_0x5e83a8,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x25e498(),this['_iconStateRejected']['content']=_0x37a396,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':y(_0x5e83a8,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}}),this['_iconStateOutdated']=new _0x25e498(),this['_iconStateOutdated']['content']=_0x37a396,this['_iconStateOutdated']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-outdated'],'data-cke-tooltip-text':y(_0x5e83a8,'AI_SUGGESTION_CONTENT_PART_OUTDATED'),'data-cke-tooltip-position':'n'}});const _0x84ba98=new _0x492b6b(_0x5e83a8);_0x84ba98['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[y(_0x5e83a8,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x13e265['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x3db1f6,_0x84ba98,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',(_0x2498a9,_0x505ea1,_0x3834a3,_0x2cbe65)=>{switch(_0x2cbe65){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);break;case'outdated':this['children']['remove'](this['_iconStateOutdated']);}switch(_0x3834a3){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);break;case'outdated':this['children']['add'](this['_iconStateOutdated']);}});}}class _ extends _0x3dcb71(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x58073b){const _0x29fa6f=this['createTask'](_0x58073b);return this['queue']['push'](_0x29fa6f),this['_processQueue'](),_0x29fa6f['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(_0x4e7750=>{this['once']('_queueEmpty',()=>{_0x4e7750();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x12f841=this['queue']['shift']();try{await _0x12f841['callback'](this['_abortController']['signal']),_0x12f841['resolve']();}catch(_0x756bc7){_0x12f841['reject'](_0x756bc7);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x3d5d33){let _0x398ae1,_0x5c9328;const _0x4de103=new Promise((_0x4a11f4,_0x2124df)=>{_0x398ae1=_0x4a11f4,_0x5c9328=_0x2124df;});return{'callback':_0x3d5d33,'resolve':_0x398ae1,'reject':_0x5c9328,'completePromise':_0x4de103};}}class xr extends _0x492b6b{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x2b5c53){super();const _0x585509=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']=_0x2b5c53,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x585509['if']('isDone','ck-ai-chat__feed__item_done'),_0x585509['if']('isVisible','ck-hidden',_0x33bb90=>!_0x33bb90),'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'](_0x38c59b=>{_0x38c59b['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x2d2fdd,_0x12a037,_0x11b848){await this['htmlStreamer']['stream']({'document':_0x2d2fdd,'targetElement':_0x12a037,'abortSignal':_0x11b848});}}class ye extends xr{constructor(_0x552054){super(_0x552054),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x552054['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x4875a7){this['element']['innerHTML']=_0x4875a7;}}class Dr extends _0x492b6b{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x2302c6,_0x1acec6){super(_0x2302c6);const {areActionsDisabled:_0x58e234,showUnchangedParts:_0x22964b,availableActions:_0x26172b}=_0x1acec6;this['_areActionsDisabled']=_0x58e234,this['_showUnchangedParts']=_0x22964b,this['_availableActions']=_0x26172b,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new _(),this['_emptyPartsWarningView']=new ye({'id':'empty-parts-warning','initialContent':y(_0x2302c6,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,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']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x4d4a45,renderingStrategy:_0x5e2eef,abortSignal:_0x5a529b}){this['_children']['length']?_0x4d4a45['forEach'](_0x2af574=>{const _0x595dfc=this['_cachedContentParts']['findIndex'](_0x306705=>_0x306705['index']==_0x2af574['index']);-0x1===_0x595dfc?this['_cachedContentParts']['push'](_0x2af574):this['_cachedContentParts'][_0x595dfc]=_0x2af574;}):this['_cachedContentParts']=_0x4d4a45;for(const _0x123029 of _0x4d4a45['filter'](_0x43db3a=>_0x43db3a['hasChanges']))this['_updateContentPartsPromiseQueue']['enqueue'](async _0x4f6d2e=>{let _0x3fe627=this['getPartView'](_0x123029['index']);_0x3fe627||(_0x3fe627=new na(this['locale'],{'part':_0x123029,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x3fe627['delegate'](...Ce)['to'](this),this['_children']['add'](_0x3fe627),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x3fe627['toggleHeader'](this['_children']['length']>0x1),await _0x3fe627['updateContent']({'part':_0x123029,'renderingStrategy':_0x5e2eef,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x4f6d2e});});return _0x5a529b?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x307c39,_0x13b68c){const _0x50687f=this['getPartView'](_0x307c39);_0x50687f&&(_0x50687f['state']=_0x13b68c),this['hasPendingParts']='pending'==_0x13b68c||Array['from'](this['_children'])['some'](_0x163b26=>'pending'==_0x163b26['state']);}['getPartView'](_0x167ce8){return this['_children']['find'](_0x511832=>_0x511832['partDefinition']['index']==_0x167ce8)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x2a2f54=!this['_cachedContentParts']['find'](({hasChanges:_0x34cdf6})=>_0x34cdf6),_0x4ad2ca=!!this['_cachedContentParts']['find'](({hasChanges:_0x9dfff5})=>!_0x9dfff5);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x4ad2ca,_0x2a2f54?this['_emptyPartsWarningView']['setContent'](y(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](y(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0xe5e71d=>_0xe5e71d['partDefinition']['hasChanges']);}}class je extends _0x1e37e5{constructor(_0x40df22=void 0x0){super();const _0x246c9a=_0x40df22?'ck-ai-spinner_'+_0x40df22:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x246c9a]}});}}class e extends _0x492b6b{['bodyView'];['miniToolbarView'];['children'];['headerView'];['loaderView'];['errorView'];['sourcesView'];constructor(_0x5a0151,_0x4f4ab1){super(_0x5a0151);const {showDiff:_0x3e378a,areActionsDisabled:_0x286f96,miniToolbarConfig:_0x37585e,hideHeader:_0x5cc2c9,showLoader:_0x35a010,showUnchangedParts:_0x3e6d3c,availableActions:_0x4ff7de}=_0x4f4ab1;this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x35a010),this['set']('isErrorVisible',!0x1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x5cc2c9||(this['headerView']=new Lr(_0x5a0151,{'showDiff':_0x3e378a}),this['headerView']['on']('toggleShowChanges',(_0x4ed73b,_0x5c6beb)=>{this['areChangesVisible']=_0x5c6beb['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x5c6beb['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new Dr(_0x5a0151,{'areActionsDisabled':_0x286f96,'showUnchangedParts':!!_0x3e6d3c,'availableActions':_0x4ff7de}),this['bodyView']['delegate'](...Ce)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden'),this['bindTemplate']['if']('isErrorVisible','ck-hidden')]}}),this['miniToolbarView']=new Sr(_0x5a0151,_0x37585e,_0x3e378a),this['miniToolbarView']['delegate'](...Ce)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x32f9bd,_0x5dfa86)=>{this['areChangesVisible']=_0x5dfa86,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x5dfa86});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new yr(this['locale']),this['children']['add'](this['sourcesView']),_0x35a010&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['errorView']=this['_createErrorView'](),this['children']['add'](this['errorView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x4190fa){await this['bodyView']['updateContentParts'](_0x4190fa);}['updateSources'](_0x1225c3){this['sourcesView']['children']['addMany'](_0x1225c3['map'](_0x238c73=>new Cr(this['locale'],_0x238c73))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['showError'](_0x4fe51){if(this['errorView']){const _0x1de110=this['errorView']['element']?.['querySelector']('.ck-ai-suggestion__error-text');_0x1de110&&(_0x1de110['textContent']=_0x4fe51),this['isErrorVisible']=!0x0;}}['hideError'](){this['errorView']&&(this['isErrorVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x0),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x1);}['clearErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x1),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x0);}['addNavigationItem'](_0x560ea8){this['miniToolbarView']['items']['add'](_0x560ea8);}['removeNavigationItem'](_0x1bc639){this['miniToolbarView']['items']['remove'](_0x1bc639);}['_createLoaderView'](){const _0x5e631a=new _0x492b6b(this['locale']),_0x9d67df=new je('small');_0x9d67df['isVisible']=!0x0;const _0x562ab7=new _0x492b6b(this['locale']);return _0x562ab7['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[y(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x5e631a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0xc8a688=>!_0xc8a688)]},'children':[_0x9d67df,_0x562ab7]}),_0x5e631a;}['_createErrorView'](){const _0x248679=new _0x492b6b(this['locale']),_0xd43959=new _0x492b6b(this['locale']);return _0xd43959['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[y(this['locale'],'AI_CHAT_GENERIC_ERROR')]}),_0x248679['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x2b2ab3=>!_0x2b2ab3)]},'children':[_0xd43959]}),_0x248679;}}class yr extends _0x492b6b{['children'];constructor(_0x471d6e){super(_0x471d6e),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',_0x3d50a9=>!_0x3d50a9)]},'children':this['children']});const _0xf8fd76=new _0x492b6b(this['locale']),_0x348dda=new _0x25e498();_0x348dda['content']=_0x4f04ad,_0xf8fd76['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x348dda,{'tag':'span','children':[{'text':y(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0xf8fd76);}}class Cr extends _0x21bd9e{constructor(_0x16065e,_0x15cfa2){super(_0x16065e),this['set']({'label':_0x15cfa2['title'],'tooltip':_0x15cfa2['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x28a00c=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x28a00c['to'](()=>{window['open'](_0x15cfa2['url'],'_blank');})}}),_0x15cfa2['favicon']){const _0x4b7bc3=new _0x492b6b(_0x16065e);_0x4b7bc3['setTemplate']({'tag':'img','attributes':{'src':_0x15cfa2['favicon']||_0x4f04ad,'alt':_0x15cfa2['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x4b7bc3);}else this['set']('icon',_0x4f04ad);}}class Xt extends _0x39a08b{constructor(_0x1f5849,_0x4dfa0a=!0x0,_0x222da8=!0x0){super(_0x1f5849),this['set']('isLoading',!0x1),_0x4dfa0a&&(this['applyButton']=this['_createButton'](y(_0x1f5849,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0xdfd8ad=>!_0xdfd8ad),this['items']['add'](this['applyButton'])),_0x222da8&&(this['suggestButton']=this['_createButton'](y(_0x1f5849,'AI_BALLOON_SUGGEST_BUTTON'),_0x4dfa0a?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x365433=>!_0x365433),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x5a2038,_0x578c15){const _0x100ca9=new _0x21bd9e(this['locale']);return _0x100ca9['set']({'label':_0x5a2038,'class':_0x578c15||'','isVisible':!0x0,'withText':!0x0}),_0x100ca9;}}class Gt extends _0x492b6b{constructor(_0x3f18a4){super(_0x3f18a4),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':y(_0x3f18a4,'AI_DISCLAIMER_TEXT')}]}]});}}const As=['wheel','touchstart','pointerdown','keydown'],Fs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Jt{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x1c785d){this['element']=_0x1c785d,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0xee23d4 of As){const _0x576efb='keydown'!==_0xee23d4;this['element']['addEventListener'](_0xee23d4,this['_onUserEvent']['bind'](this),{'passive':_0x576efb,'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'](_0x3ef65f){if(this['isRunning']){if('keydown'===_0x3ef65f['type']){const _0x5b40a=_0x3ef65f['key'];if(!Fs['includes'](_0x5b40a))return;}_0x3ef65f instanceof WheelEvent?_0x3ef65f['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x35f01c,scrollHeight:_0x243f28,clientHeight:_0x3b2d1d}=this['element'];return _0x243f28-_0x35f01c-_0x3b2d1d<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}const O=['applySuggestion','insertSuggestion','showNext','showPrevious'];class R extends _0x492b6b{['focusTracker'];['keystrokes'];['focusCycler'];['_availableActions'];['_focusables'];['_errorView'];['scrollManager'];constructor(_0x51acdb,_0x58abd6,_0x436761,_0x1bc5a9){super(_0x51acdb),this['_availableActions']=_0x436761,this['set']('isLoading',!0x1),this['set']('isTrackChangesOn',_0x1bc5a9),this['set']('isErrorVisible',!0x1),this['set']('errorMessage',''),this['focusTracker']=new Bt(),this['keystrokes']=new Wt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Vt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x2b3021(),this['_addContentView'](_0x58abd6['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x58abd6['showApplyButton'],_0x58abd6['showSuggestButton']),this['toolbar']['bind']('isLoading')['to'](this),this['_focusables']['clear'](),this['_focusables']['addMany']([this['toolbar']]),this['setTemplate']({'tag':'div','attributes':{'class':'ai-balloon-content'},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_dialogContent']['remove'](this['toolbar']),this['_addToolbar'](_0x58abd6['showApplyButton'],_0x58abd6['showSuggestButton']);});}['render'](){super['render']();for(const _0x10fd2f of this['_focusables'])this['focusTracker']['add'](_0x10fd2f['element']);this['keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['scrollManager']&&this['scrollManager']['destroy']();}['focus'](_0x2ba98c){-0x1===_0x2ba98c?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['showError'](_0x392a55){this['_errorView']||(this['_errorView']=this['_createErrorView'](),this['_dialogContent']['addMany']([this['_errorView']],0x0)),this['errorMessage']=_0x392a55,this['isErrorVisible']=!0x0;}['hideError'](){this['isErrorVisible']=!0x1;}['showRecoverableError'](_0x423ee0){this['showError'](_0x423ee0);}['showBlockingError'](_0x16d6e1){this['showError'](_0x16d6e1),this['toolbar']&&(this['toolbar']['applyButton']&&(this['toolbar']['applyButton']['isEnabled']=!0x1),this['toolbar']['suggestButton']&&(this['toolbar']['suggestButton']['isEnabled']=!0x1));}['setupRotator'](_0x4eb6d8){const _0x6c4085=this['_createNextButtonView'](),_0x1ae7ac=this['_createPreviousButtonView']();_0x4eb6d8['view']['headerView']['children']['add'](_0x6c4085,0x2),_0x4eb6d8['view']['headerView']['children']['add'](_0x1ae7ac,0x0),this['_focusables']['addMany']([_0x6c4085,_0x1ae7ac]),this['focusTracker']['add'](_0x6c4085['element']),this['focusTracker']['add'](_0x1ae7ac['element']);}['_addContentView'](_0x168361){this['_mainView']=_0x168361,this['_dialogContent']['add'](this['_mainView']);}['updateContent'](_0x184af7){const _0x282f4d=this['_dialogContent']['getIndex'](this['_mainView']);this['_dialogContent']['remove'](this['_mainView']),this['_mainView']=_0x184af7,this['_dialogContent']['add'](this['_mainView'],_0x282f4d),this['hideError'](),this['scrollManager']&&this['scrollManager']['destroy'](),this['_initializeScrollManager']();}['_addDisclaimerView'](){this['disclaimerView']=new Gt(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x5d26ce=!0x0,_0x6c2bb3=!0x0){_0x5d26ce=_0x5d26ce&&!this['isTrackChangesOn']&&this['_availableActions']['includes']('applySuggestion'),_0x6c2bb3=_0x6c2bb3&&this['_availableActions']['includes']('insertSuggestion'),this['toolbar']=new Xt(this['locale'],_0x5d26ce,_0x6c2bb3),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x10b229=new _0x21bd9e(this['locale']);return _0x10b229['set']({'icon':_0x395cb2,'tooltip':y(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x10b229['on']('execute',()=>{this['fire']('showNext');}),_0x10b229;}['_createPreviousButtonView'](){const _0x51a98a=new _0x21bd9e(this['locale']);return _0x51a98a['set']({'icon':_0x48be9f,'tooltip':y(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x51a98a['on']('execute',()=>{this['fire']('showPrevious');}),_0x51a98a;}['_createErrorView'](){const _0xeba3ef=new _0x492b6b(this['locale']),_0x2ec342=new _0x492b6b(this['locale']);return _0x2ec342['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('errorMessage')}]}),_0xeba3ef['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ai-balloon-error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x259927=>!_0x259927)]},'children':[_0x2ec342]}),_0xeba3ef;}['startAutoScroll'](){this['_initializeScrollManager'](),this['scrollManager']&&this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']&&this['scrollManager']['stop']();}['_initializeScrollManager'](){const _0x25fd56=this['_getScrollableElement']();_0x25fd56&&!this['scrollManager']&&(this['scrollManager']=new Jt(_0x25fd56));}['_getScrollableElement'](){return this['_mainView']instanceof e&&this['_mainView']['bodyView']['element']?this['_mainView']['bodyView']['element']:null;}}const x=0xa;class w extends _0x4404b9{static get['requires'](){return[s,c];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['_isUpdatingMarkers']=!0x1;['_pendingRenderCallback']=null;['open'](_0x46f1b6){const _0x65daf3=P(this['context']);if(this['_config']=_0x46f1b6,this['isOpen'])return void this['_updateBalloon'](_0x46f1b6);const _0x5cc852=this['context']['config']['get']('ai.availableReplyActions')||[...k],_0x44866b=_0x65daf3?.['commands']['get']('trackChanges'),_0x3cb3ae=_0x44866b?.['value'];this['balloonView']=new R(_0x65daf3['locale'],_0x46f1b6,_0x5cc852,!!_0x3cb3ae),this['balloonView']['delegate'](...O)['to'](this),_0x44866b&&this['balloonView']['bind']('isTrackChangesOn')['to'](_0x44866b,'value'),this['_showDialog'](_0x46f1b6);}['close'](){P(this['context'])['plugins']['get']('Dialog')['hide']();}['startAutoScroll'](){this['balloonView']&&this['balloonView']['startAutoScroll']();}['stopAutoScroll'](){this['balloonView']&&this['balloonView']['stopAutoScroll']();}['_updateBalloon'](_0x426cbd){const _0x450e68=P(this['context']),_0x13bcb4=_0x450e68['plugins']['get']('Dialog');this['_pendingRenderCallback']&&(_0x450e68['editing']['view']['off']('render',this['_pendingRenderCallback']),this['_pendingRenderCallback']=null),this['_isUpdatingMarkers']=!0x0,_0x13bcb4['view']?.['headerView']&&(_0x13bcb4['view']['headerView']['label']=_0x426cbd['title'],_0x13bcb4['view']['headerView']['iconView']&&_0x426cbd['icon']&&(_0x13bcb4['view']['headerView']['iconView']['content']=_0x426cbd['icon'])),this['balloonView']['updateContent'](_0x426cbd['mainView']),this['_setupVisualSelection'](_0x426cbd['ranges'],_0x426cbd['index']),this['_pendingRenderCallback']=()=>{this['_isUpdatingMarkers']=!0x1,this['_pendingRenderCallback']=null,_0x13bcb4['view']&&_0x13bcb4['view']['updatePosition']();},_0x450e68['editing']['view']['once']('render',this['_pendingRenderCallback']);}['_setupVisualSelection'](_0xfba3f,_0x24cb0e){this['context']['plugins']['get'](c)['showFakeVisualSelection'](_0xfba3f,'ai-balloon-'+_0x24cb0e,!0x0,!0x0);}['_showDialog'](_0x13eca0){const _0x4e8405=P(this['context']);this['_setupVisualSelection'](_0x13eca0['ranges'],_0x13eca0['index']);const _0x30a830=this['_getSelectionElements']();_0x30a830&&_0x30a830[0x0]&&_0x414134({'target':_0x30a830[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),_0x4e8405['plugins']['get']('Dialog')['show']({'title':_0x13eca0['title'],'icon':_0x13eca0['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x13eca0['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x13d4ee=>{_0x13eca0['showRotator']&&this['balloonView']['setupRotator'](_0x13d4ee),this['_setupMarkerRemovalListener'](),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+this['_config']['index']),this['_cleanupMarkerRemovalListener'](),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x5d229f,_0x13ff8b){if(!_0x13ff8b)return null;const _0x3deab6=this['_getSelectionElements']();if(!_0x3deab6||0x0===_0x3deab6['length'])return{'left':Math['round'](_0x13ff8b['left']+_0x13ff8b['width']/0x2-_0x5d229f['width']/0x2),'top':Math['round'](_0x13ff8b['top']+_0x13ff8b['height']/0x2-_0x5d229f['height']/0x2)};const _0x1e121c=Math['round'](_0x13ff8b['left']+_0x13ff8b['width']/0x2-_0x5d229f['width']/0x2),_0x304e22=new _0x1ba12e(_0x3deab6[0x0]),_0x43a6e1=new _0x1ba12e(_0x3deab6[_0x3deab6['length']-0x1]),_0x21e9b2=_0x5d229f['height'],_0x45867e=this['_config']['showRotator']?0x8:0x0;return{'left':_0x1e121c,'top':this['_calculateOptimalTopPosition'](_0x304e22,_0x43a6e1,_0x21e9b2,_0x45867e,_0x13ff8b)};}['_calculateOptimalTopPosition'](_0x4eac16,_0x553d,_0xc31ae,_0x18e3a0=0x0,_0x30c200){const _0x3f8d1c=_0xc31ae+_0x18e3a0,_0x42c439=new _0x1ba12e(_0x384749['window']),_0x4095c1=[_0x4eac16['getVisible'](),_0x553d['getVisible']()]['filter'](_0x529166=>_0x529166),_0x29ed91=_0x1ba12e['getBoundingRect'](_0x4095c1);if(!_0x29ed91)return Math['round'](_0x30c200['top']+_0x30c200['height']/0x2);const _0x29a530=_0x42c439['getIntersection'](_0x29ed91);if(!_0x29a530)return Math['round'](_0x30c200['top']+_0x30c200['height']/0x2);const _0x2ea8fd=_0x30c200['getVisible'](),_0x49a786=_0x2ea8fd&&_0x29ed91['height']>_0x2ea8fd['height'],_0x4850e9=_0x29a530['top'],_0xe7fe55=_0x29a530['bottom'];if(_0x49a786){const _0x157cc0=(_0x2ea8fd||_0x42c439)['height']/0x2-_0x3f8d1c/0x2,_0x37482c=_0x4850e9-x-_0x30c200['top'],_0x5a402d=_0x30c200['bottom']-_0xe7fe55-x;return _0x37482c>=_0x3f8d1c?Math['max'](x,_0x4850e9-_0x3f8d1c-x):_0x5a402d>=_0x3f8d1c?_0xe7fe55+x:Math['max'](x,_0x157cc0);}const _0x61b799=_0x4850e9-_0x3f8d1c,_0x1ff9ae=_0x30c200['bottom']-_0xe7fe55-x,_0x57857a=_0x4850e9-x-_0x30c200['top'];let _0x295593;if(_0x1ff9ae>=_0x3f8d1c)_0x295593=_0xe7fe55+x;else{if(_0x57857a>=_0x3f8d1c)_0x295593=_0x61b799-x;else _0x295593=_0x4850e9+_0x29ed91['height']/0x2-_0x3f8d1c/0x2;}return _0x295593;}['_setupMarkerRemovalListener'](){const _0x2ecf0e=P(this['context']);this['listenTo'](_0x2ecf0e['model']['document'],'change',()=>{if(this['_isUpdatingMarkers'])return;for(const {name:_0x1e50ec,data:{newRange:_0x416ef6}}of _0x2ecf0e['model']['document']['differ']['getChangedMarkers']())if(_0x1e50ec['startsWith']('ai-selection:')&&(_0x416ef6&&(_0x416ef6['start']['isEqual'](_0x416ef6['end'])||'$graveyard'==_0x416ef6['root']['rootName'])||null==_0x416ef6)){const _0x355aa9=y(this['context']['locale'],'AI_ACTIONS_SELECTION_REMOVED_ERROR');this['balloonView']['showBlockingError'](_0x355aa9),this['fire']('selectionRemoved');}});}['_cleanupMarkerRemovalListener'](){const _0x4957d6=P(this['context']);this['stopListening'](_0x4957d6['model']['document']);}['_getSelectionElements'](){const _0x33f539=P(this['context']);return _0x489432(_0x33f539['editing'],[..._0x33f539['model']['markers']['getMarkersGroup']('ai-selection'),..._0x33f539['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class q extends _0x4404b9{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[s,w,_0x1f61c4];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new z({'connector':this['_aiConnector'],'availableModels':this['context']['config']['get']('ai.chat.models.displayedModels'),'defaultModelId':this['context']['config']['get']('ai.chat.models.defaultModelId')});const _0x507414=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x491e50,_0x302bbf)=>{this['_handleUIUserMessage']({'userMessage':_0x302bbf});}),this['listenTo'](_0x507414,'resizedTabs',(_0x4cd5d7,_0x478dd9)=>{this['_setIsMaximized'](_0x478dd9);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x507414['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](y(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x5c5033,_0x533601)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x533601));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x323738,_0x580e35)=>{this['activeConversation']?.['addUrlToContext'](_0x580e35);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x1f813f,_0x830a31)=>{this['activeConversation']?.['addResourceToContext'](_0x830a31['source'],_0x830a31['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0xec9165,_0x3da937)=>{this['_removeFromContext'](_0x3da937);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x1d6919,_0x1eb230)=>{this['activeConversation']?.['loadSourceResources'](_0x1eb230['sourceId'],_0x1eb230['query'],_0x1eb230['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x5d4781,_0x26e767)=>{this['activeConversation']?.['setModel'](_0x26e767);}),this['listenTo'](this['_aiChatUi'],'like',(_0x583698,{replyId:_0x232f80})=>{console['log']('Liked\x20response',_0x232f80);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x1e72e5,{replyId:_0x5b9139})=>{console['log']('Disliked\x20response',_0x5b9139);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x4444ea,_0xc627c8)=>{this['context']['plugins']['get'](w)['close'](),this['_insertSuggestion'](_0xc627c8);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0xe29d05,{replyId:_0x2fcd10,partIndex:_0x2643fc})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x2fcd10,_0x2643fc);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0xa96c6b,{replyId:_0x1eb414,partIndex:_0x3af83f})=>{const _0x59383a=this['_getDocumentRangeForReplyChanges'](_0x1eb414,_0x3af83f);_0x59383a&&'$graveyard'!=_0x59383a['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x59383a['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x22d7d2,_0x3790b3)=>{this['context']['plugins']['get'](w)['close'](),this['_applySuggestion'](_0x3790b3);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x3335af,{replyId:_0x5341cb,showDiff:_0x442814})=>{const {reply:_0x2447b0}=this['getInteractionAndReplyById'](_0x5341cb),_0xf78853=_0x2447b0['getContentParts']({'showDiff':_0x442814});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x2447b0['id'],'parts':_0xf78853,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x36f93c,{replyId:_0x3c58eb,partIndex:_0x2bec7b})=>{this['_previewedChangeGroup']?.['replyId']==_0x3c58eb&&this['_previewedChangeGroup']?.['partIndex']==_0x2bec7b&&this['context']['plugins']['get'](w)['close']();const {reply:_0xc5a9fb}=this['getInteractionAndReplyById'](_0x3c58eb);_0xc5a9fb['setChangeGroupState'](_0x2bec7b,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof _0x1e9e1e?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2176e2,_0x370144)=>{_0x370144['on']('ready',()=>{this['_integrateEditor'](_0x370144);});}),await this['_startConversationSafely']();}['_insertSuggestion'](_0x381eec){const _0x1a4003=P(this['context']);if(!_0x1a4003['plugins']['has']('TrackChanges'))throw new _0x19ee7d('ai-no-track-changes',null);const _0x15679a=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x3a9298,interaction:_0x280937}=this['getInteractionAndReplyById'](_0x381eec['replyId']),_0xcfacc9=this['_getDocumentRangeForReplyChanges'](_0x381eec['replyId'],_0x381eec['partIndex']),_0x511280=void 0x0!==_0x381eec['partIndex']?[_0x3a9298['changeGroups'][_0x381eec['partIndex']]]:_0x3a9298['changeGroups']['filter'](_0x44496d=>'pending'==_0x44496d['state']),_0x5c157d=_0x511280['map'](_0x297bce=>_0x3a9298['changeGroups']['indexOf'](_0x297bce));if(!_0xcfacc9||'$graveyard'==_0xcfacc9['range']['root']['rootName'])return void _0x5c157d['forEach'](_0x34c1f9=>_0x3a9298['setChangeGroupState'](_0x34c1f9,'outdated'));_0x5c157d['forEach'](_0x283523=>_0x3a9298['setChangeGroupState'](_0x283523,'accepted'));const _0xfad151=v({'editor':_0x1a4003,'reply':_0x3a9298,'interaction':_0x280937,'groups':_0x511280,'transform':!0x0,'documentCompare':_0x15679a,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x549342;_0xcfacc9&&this['_scrollToSuggestionRange'](_0xcfacc9['range']),_0x1a4003['model']['change'](_0x13df39=>{_0x549342=_0x13df39['batch'],_0x1a4003['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0xfad151),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x549342,{'interactionId':_0x280937['id'],'replyId':_0x3a9298['id'],'indexes':_0x5c157d['slice']()}),this['_updateRatings'](_0x3a9298);}['_applySuggestion'](_0x62ed23){const _0x2e58de=P(this['context']),_0xd3318f=this['context']['plugins']['get'](_0x1f61c4),{reply:_0x4b4138,interaction:_0x3350f0}=this['getInteractionAndReplyById'](_0x62ed23['replyId']),_0x16b389=this['_getDocumentRangeForReplyChanges'](_0x62ed23['replyId'],_0x62ed23['partIndex']),_0x26600d=void 0x0!==_0x62ed23['partIndex']?[_0x4b4138['changeGroups'][_0x62ed23['partIndex']]]:_0x4b4138['changeGroups']['filter'](_0x34a21a=>'pending'==_0x34a21a['state']),_0xda5c96=_0x26600d['map'](_0x3572d5=>_0x4b4138['changeGroups']['indexOf'](_0x3572d5));if(!_0x16b389||'$graveyard'==_0x16b389['range']['root']['rootName'])return void _0xda5c96['forEach'](_0x1bc388=>_0x4b4138['setChangeGroupState'](_0x1bc388,'outdated'));_0xda5c96['forEach'](_0x36e531=>_0x4b4138['setChangeGroupState'](_0x36e531,'accepted'));const _0xe7ef2d=v({'editor':_0x2e58de,'reply':_0x4b4138,'interaction':_0x3350f0,'groups':_0x26600d,'transform':!0x0,'documentCompare':_0xd3318f,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x1854cc;_0x16b389&&this['_scrollToSuggestionRange'](_0x16b389['range']),_0x2e58de['model']['change'](_0x4ca462=>{_0x1854cc=_0x4ca462['batch'];for(const _0x455126 of _0xe7ef2d)_0x455126['baseVersion']=_0x2e58de['model']['document']['version'],b(_0x2e58de,_0x455126),_0x4ca462['batch']['addOperation'](_0x455126),_0x2e58de['model']['applyOperation'](_0x455126);}),this['_batchToChanges']['set'](_0x1854cc,{'interactionId':_0x3350f0['id'],'replyId':_0x4b4138['id'],'indexes':_0xda5c96['slice']()}),this['_updateRatings'](_0x4b4138);}['_openBalloonFor'](_0x5d65ec,_0x49a476){const _0x2d3136=P(this['context']),_0x361d63=this['_getDocumentRangeForReplyChanges'](_0x5d65ec,_0x49a476),_0x1ac598=this['context']['plugins']['get'](w);if(!_0x361d63)return void _0x1ac598['close']();const {range:_0x21ed95,currentIndex:_0xabea26}=_0x361d63;if('$graveyard'==_0x21ed95['root']['rootName']){const {reply:_0xb713ee}=this['getInteractionAndReplyById'](_0x5d65ec);return _0xb713ee['setChangeGroupState'](_0xabea26,'outdated'),void _0x1ac598['close']();}if(this['_previewedChangeGroup']?.['replyId']==_0x5d65ec&&this['_previewedChangeGroup']?.['partIndex']==_0xabea26)return;this['stopListening'](_0x1ac598),this['_previewedChangeGroup']={'replyId':_0x5d65ec,'partIndex':_0xabea26};let _0x394685=_0x2d3136['config']['get']('ai.availableReplyActions')||[...k];_0x2d3136['plugins']['has']('TrackChanges')||(_0x394685=_0x394685['filter'](_0x43fb3a=>'insertSuggestion'!=_0x43fb3a));const _0x35cff9=new e(_0x2d3136['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0,'availableActions':_0x394685});this['stopListening'](_0x35cff9);const {reply:_0x382cde}=this['getInteractionAndReplyById'](_0x5d65ec),_0x12e29e=_0x382cde['getContentParts']({'showDiff':this['_balloonShowDiff']})['filter'](_0x728117=>_0x728117['hasChanges']),_0x3d4905=_0x12e29e['findIndex'](_0x4c3a48=>_0x4c3a48['index']==_0xabea26);if(-0x1==_0x3d4905)return;const _0x4c0a5f=_0x12e29e[_0x3d4905],_0x1a943e=_0x12e29e['at']((_0x3d4905-0x1)%_0x12e29e['length'])?.['index'],_0x2c3a08=_0x12e29e['at']((_0x3d4905+0x1)%_0x12e29e['length'])?.['index'];_0x35cff9['updateContent']({'parts':[_0x4c0a5f],'renderingStrategy':'static'});const _0x5d4570=_0xabea26!==_0x1a943e;this['_scrollToSuggestionRange'](_0x21ed95,!0x0),_0x1ac598['open']({'index':_0xabea26,'title':y(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x3d4905+0x1)['toString']()),'icon':et,'mainView':_0x35cff9,'showRotator':_0x5d4570,'showApplyButton':!0x0,'showSuggestButton':_0x2d3136['plugins']['has']('TrackChanges'),'ranges':[_0x21ed95]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x5d65ec,_0xabea26),this['listenTo'](_0x35cff9,'toggleSuggestionDisplayMode',(_0x12a378,{showDiff:_0x49e5f1})=>{this['_balloonShowDiff']=_0x49e5f1;const {reply:_0x152ab3}=this['getInteractionAndReplyById'](_0x5d65ec),_0x2eb7e4=_0x152ab3['getContentParts']({'showDiff':_0x49e5f1,'groupIndex':_0xabea26});_0x35cff9['updateContent']({'parts':_0x2eb7e4,'renderingStrategy':'static'});}),this['listenTo'](_0x1ac598,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x5d65ec,'partIndex':_0xabea26}),_0x5d4570?this['_openBalloonFor'](_0x5d65ec,_0x2c3a08):_0x1ac598['close']();}),this['listenTo'](_0x1ac598,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x5d65ec,'partIndex':_0xabea26}),_0x5d4570?this['_openBalloonFor'](_0x5d65ec,_0x2c3a08):_0x1ac598['close']();}),_0x5d4570&&(this['listenTo'](_0x1ac598,'showNext',()=>{this['_openBalloonFor'](_0x5d65ec,_0x2c3a08);}),this['listenTo'](_0x1ac598,'showPrevious',()=>{this['_openBalloonFor'](_0x5d65ec,_0x1a943e);})),this['listenTo'](_0x1ac598,'dialogClosed',()=>{this['stopListening'](_0x1ac598),this['stopListening'](_0x35cff9),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x5d681b,_0x5280fa){const _0x55f157=P(this['context']),{reply:_0x3df2c8,interaction:_0x166058}=this['getInteractionAndReplyById'](_0x5d681b),_0x34f3d2=_0x3df2c8['changeGroups']['filter'](_0x889748=>'pending'==_0x889748['state']),_0x4d6aa1=_0x34f3d2['map'](_0x1b0c09=>_0x3df2c8['changeGroups']['indexOf'](_0x1b0c09));void 0x0===_0x5280fa&&(_0x5280fa=_0x4d6aa1[0x0]);const _0x2913be=_0x4d6aa1['indexOf'](_0x5280fa);if(-0x1==_0x2913be)return null;const _0x425630=_0x34f3d2[_0x2913be],_0x4bfd36=new it([]),_0xf1fa4=new it([]);for(const _0x433261 of _0x425630['changes'])if('removed'!=_0x433261['type']&&_0xf1fa4['children']['push'](_0x433261['node']['cloneNode'](!0x0)),'new'!=_0x433261['type']){const _0x2e4d5a=_0x3019e1(_0x433592=>K(_0x433592,'data-id')==_0x433261['id'],_0x3df2c8['documentContextContent'],!0x0);_0x4bfd36['children']['push'](_0x2e4d5a['cloneNode'](!0x0));}if(0x0==_0x4bfd36['children']['length']){if(_0x425630['changes'][0x0]['anchorId']){const _0x332d46=st('data-id',_0x425630['changes'][0x0]['anchorId'],_0x3df2c8['documentContextContent']);_0x4bfd36['children']['unshift'](_0x332d46['cloneNode'](!0x0)),_0xf1fa4['children']['unshift'](_0x332d46['cloneNode'](!0x0)),_0x332d46['nextSibling']&&(_0x4bfd36['children']['push'](_0x332d46['nextSibling']['cloneNode'](!0x0)),_0xf1fa4['children']['push'](_0x332d46['nextSibling']['cloneNode'](!0x0)));}else{const _0x3274e6=_0x3df2c8['documentContextContent']['children'][0x0];if(!_0x3274e6)return null;_0x4bfd36['children']['push'](_0x3274e6['cloneNode'](!0x0)),_0xf1fa4['children']['push'](_0x3274e6['cloneNode'](!0x0));}}const _0x4c6800=_0x166058['getDocumentContext'](),_0x331a27=_0x55f157['data']['parse'](_0x4c6800['content']),_0x310989=tt(_0x4bfd36),_0x955634=_0x55f157['data']['parse'](_0x310989),_0x2068c5=_0x55f157['data']['parse'](_0x310989),_0xbbb5e8=_0x55f157['model']['createPositionAt'](_0x955634,0x0),_0x40d4f8=tt(_0xf1fa4),_0x131ea7={'anchor':_0xbbb5e8,'markDeletions':!0x1},_0x47e735=_0x55f157['plugins']['get'](_0x1f61c4)['getDiff'](_0x310989,_0x40d4f8,_0x131ea7)['getOperations']();if(!_0x47e735['length'])return null;_0x55f157['model']['change'](_0x234708=>{for(const _0x9bcec0 of _0x47e735)if('remove'==_0x9bcec0['type']){const _0xdd78f7=_0x9bcec0['sourcePosition'],_0x4a43f0=_0x9bcec0['howMany'],_0x4ed9df=new _0x253f92(_0xdd78f7,_0x4a43f0);_0x234708['batch']['addOperation'](_0x4ed9df),_0x55f157['model']['applyOperation'](_0x4ed9df);}else'marker'!==_0x9bcec0['type']&&(_0x9bcec0['baseVersion']=null,_0x9bcec0['isDocumentOperation']=!0x1,_0x234708['batch']['addOperation'](_0x9bcec0),_0x55f157['model']['applyOperation'](_0x9bcec0));});const _0x3bbd5b=Z(_0x55f157,_0x47e735,_0x955634);Q(_0x55f157['model'],_0x3bbd5b);const _0x309a73=_0x3bbd5b['getFirstRange']()['start']['path']['slice'](),_0x248524=_0x3bbd5b['getFirstRange']()['end']['path']['slice'](),_0x4d8f03=[];let _0xc7b149=_0x955634,_0x6431fc=_0x2068c5;for(let _0x569dc4=0x0;_0x569dc4<_0x248524['length'];_0x569dc4++){const _0x1669dd=_0xc7b149['maxOffset']-_0x248524[_0x569dc4];_0x4d8f03[_0x569dc4]=_0x6431fc['maxOffset']-_0x1669dd,_0xc7b149=_0xc7b149['getChildAtOffset'](_0x248524[_0x569dc4]),_0x6431fc=_0x6431fc['getChildAtOffset'](_0x4d8f03[_0x569dc4]);}const _0x5e7a02=_0x55f157['model']['createRange'](_0x55f157['model']['createPositionFromPath'](_0x2068c5,_0x309a73),_0x55f157['model']['createPositionFromPath'](_0x2068c5,_0x4d8f03)),_0x6d4891=_0x2068c5['getChild'](0x0)['getAttribute'](_0x359efb),_0x31a750=Array['from'](_0x331a27['getChildren']())['find'](_0x1cab7b=>_0x1cab7b['getAttribute'](_0x359efb)==_0x6d4891)['getPath'](),_0x505140=_0x5e7a02['start']['path']['slice'](),_0x4360db=_0x5e7a02['end']['path']['slice']();_0x505140[0x0]=_0x31a750[0x0]+_0x505140[0x0],_0x4360db[0x0]=_0x31a750[0x0]+_0x4360db[0x0];let _0x1a2ed6=_0x55f157['model']['createRange'](_0x55f157['model']['createPositionFromPath'](_0x55f157['model']['document']['getRoot'](),_0x505140),_0x55f157['model']['createPositionFromPath'](_0x55f157['model']['document']['getRoot'](),_0x4360db));const _0x4ca0af=_0x55f157['model']['document']['history']['getOperations'](_0x4c6800['version']);for(const _0x84bd6d of _0x4ca0af)_0x1a2ed6=_0x184fda['_createFromRanges'](_0x1a2ed6['getTransformedByOperation'](_0x84bd6d));return{'range':_0x1a2ed6,'currentIndex':_0x5280fa};}['_integrateEditor'](_0x284d1f){if(!_0x284d1f['plugins']['has']('Undo'))return;const _0x1e91a2=_0x284d1f['commands']['get']('undo'),_0x4c39c8=_0x284d1f['commands']['get']('redo');this['listenTo'](_0x1e91a2,'revert',(_0x248e25,_0x360bec,_0x4cd27b)=>{const _0x16c85c=this['_batchToChanges']['get'](_0x360bec);if(!_0x16c85c)return;const _0x4a1ae8=this['activeConversation']['getInteraction'](_0x16c85c['interactionId'])['getReply'](_0x16c85c['replyId']);_0x16c85c['indexes']['forEach'](_0x503a35=>_0x4a1ae8['setChangeGroupState'](_0x503a35,'pending')),this['_batchToChanges']['delete'](_0x360bec),this['_batchToChanges']['set'](_0x4cd27b,_0x16c85c);}),this['listenTo'](_0x4c39c8,'revert',(_0x1e257f,_0x429753,_0x3cbcfd)=>{const _0xdf4ce3=this['_batchToChanges']['get'](_0x429753);if(!_0xdf4ce3)return;const _0xceead3=this['activeConversation']['getInteraction'](_0xdf4ce3['interactionId'])['getReply'](_0xdf4ce3['replyId']);_0xdf4ce3['indexes']['forEach'](_0x38bf9d=>_0xceead3['setChangeGroupState'](_0x38bf9d,'accepted')),this['_batchToChanges']['delete'](_0x429753),this['_batchToChanges']['set'](_0x3cbcfd,_0xdf4ce3);});}async['loadConversation'](_0xeafdf7){this['context']['plugins']['get'](w)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{await this['_aiConnector']['fetchConversation'](_0xeafdf7)['getConversation'](),await this['_startConversationSafely'](_0xeafdf7),this['updateConversationTitle']('\x20');const {sessionId:_0x5e1675}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0xeafdf7,_0x5e1675),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](y(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x1eb61e){this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0xeafdf7}),this['_logError'](new _0x19ee7d('ai-chat-conversation-not-found',this,{'error':_0x1eb61e}));}finally{this['context']['plugins']['get']($)['view']['activateTab']('chat'),this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x372847){this['activeConversation']['id']===_0x372847&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x514c71=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x514c71),this['activeConversation']?.['addCurrentDocumentToContext'](y(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x3cfa25,quickActionData:_0x48eb03}){await this['_handleUIUserMessage']({'userMessage':_0x3cfa25,'quickActionData':_0x48eb03});}['getGroupId'](){const _0x2f28b3=this['context']['config']['get']('collaboration.channelId');if(!_0x2f28b3)throw new _0x19ee7d('ai-chat-missing-channel-id',this);return _0x2f28b3;}async['_startConversationSafely'](_0x409cdb){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x409cdb);}catch(_0x54d43e){_0x543541('ai-chat-conversation-start-failed',_0x54d43e),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0xa52882){const _0x5ba86a=this['context']['plugins']['get'](w);let _0x240cad;_0x5ba86a['isOpen']&&_0x5ba86a['close'](),_0xa52882||!this['activeConversation']?_0x240cad=this['context']['config']['get']('ai.chat.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x240cad=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x35d70a=this['getGroupId'](),_0x25c8de=_0xa52882||_0x3bb1ce();this['activeConversation']=new G({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x240cad,'conversationId':_0x25c8de,'group':_0x35d70a,'getEditor':()=>P(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x4dd9ed,_0x151044)=>{this['_aiChatUi']['createConversation'](_0x151044),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0xa52882||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](y(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x2744c8,_0x2dcba1)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x2dcba1['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0xae529d,_0x4270ae)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x4270ae);}),this['activeConversation']['on']('webSearchStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('webSearchFinished',(_0x5eb839,_0x496691)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x496691,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x583111,_0x16e0fd)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x16e0fd,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x54ef5d,_0x106ccf)=>{this['_aiChatUi']['removeFeedInteraction'](_0x106ccf['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x3c62a4,_0xdf51c4,_0x6d8311)=>{this['updateConversationTitle'](_0xdf51c4,_0x6d8311);}),this['activeConversation']['on']('replyCreated',(_0x1aeb81,_0x598288)=>{'text-delta'===_0x598288['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x598288):this['_aiChatUi']['addFeedItemAISuggestion'](_0x598288);}),this['activeConversation']['on']('replyContentUpdated',async(_0x22ddc8,_0x3505b9)=>{await this['_updateReplyContent']({'reply':_0x3505b9});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x57f070,{reply:_0x1df7c1,index:_0xfb6aa9,state:_0x163ffa})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x1df7c1['id'],'index':_0xfb6aa9,'state':_0x163ffa});}),this['activeConversation']['on']('contextItemAdded',(_0x15b8c8,_0x1de2ae)=>{if(this['_aiChatUi']['addContextItem'](_0x1de2ae['contextItem'],_0x1de2ae['isLoading']),'selection'===_0x1de2ae['contextItem']['type']){const _0x32b518=[...P(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x32b518,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x5c7692,_0x1ad939)=>{this['_aiChatUi']['removeContextItem'](_0x1ad939['uiId']),'current-document'==_0x1ad939['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x1ad939['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x3be097,_0x20f30c)=>{this['_aiChatUi']['setContextItemLoading'](_0x20f30c['contextItem']['uiId'],_0x20f30c['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x3a0d84,_0x273af9)=>{this['_aiChatUi']['setConversationContext'](_0x273af9['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x565ce5,_0x46e2b9)=>{this['_aiChatUi']['setAddContextOptions'](_0x46e2b9['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x3f030d,_0xe523a8)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0xe523a8['sourceId'],_0xe523a8['source'],_0xe523a8['resources'],_0xe523a8['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x426c55,_0xba54e9)=>{this['_aiChatUi']['updateResourceState'](_0xba54e9['sourceId'],_0xba54e9['resourceId'],_0xba54e9['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x3e3371,_0x87559)=>{this['_aiChatUi']['updateCapabilities'](_0x87559);}),this['activeConversation']['on']('modelSelected',(_0x2bf12c,_0x209ce3)=>{this['_aiChatUi']['setSelectedModel'](_0x209ce3['selectedModel'],_0x209ce3['isDisabled']);}),this['activeConversation']['on']('error',(_0x355d3e,{error:_0x5ec92b,interactionId:_0xbad1f0,fileName:_0x48547a,url:_0x7ba7f2,sourceId:_0x36e709,sourceLabel:_0x381e9d})=>{const _0x4b3369=_0xbad1f0?_0xbad1f0+':'+_0x3bb1ce():_0x3bb1ce();_0x5ec92b['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':y(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x4b3369}):_0x5ec92b['message']['startsWith']('ai-chat-conversation-init-failed')||_0x5ec92b['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x4b3369}),this['_logError'](_0x5ec92b)):_0x5ec92b['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x48547a),'id':_0x4b3369}):_0x5ec92b['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x7ba7f2),'id':_0x4b3369}):_0x5ec92b['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x4b3369}):_0x5ec92b['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x4b3369}):_0x5ec92b['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x36e709&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x36e709),this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x381e9d||'source'),'id':_0x4b3369}),this['_logError'](_0x5ec92b)):_0x5ec92b['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x4b3369}),this['_logError'](_0x5ec92b)):_0x5ec92b['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x4b3369}),this['_logError'](_0x5ec92b)):_0x5ec92b['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x4b3369}),this['_logError'](_0x5ec92b)):_0x5ec92b['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x4b3369}),this['_logError'](_0x5ec92b)):_0x5ec92b['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x4b3369}),this['_logError'](_0x5ec92b)):_0x5ec92b['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x4b3369}),this['_logError'](_0x5ec92b)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':y(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x4b3369}),this['_logError'](_0x5ec92b));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0xa52882||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x11e4a4,quickActionData:_0x2e8a4c}){if(!this['activeConversation'])throw new _0x19ee7d('ai-chat-controller-no-active-conversation');this['activeConversation']['isCurrentDocumentInContext']()&&await this['activeConversation']['updateCurrentDocumentInContext'](this['_aiEditing']['getDocumentData']()),this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x11e4a4,'quickActionData':_0x2e8a4c}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x2f2627=P(this['context'])['model'],_0x5d9fae=Array['from'](_0x2f2627['markers']['getMarkersGroup'](W));_0x2f2627['change'](_0x44873f=>{_0x5d9fae['forEach'](_0x47010e=>_0x44873f['removeMarker'](_0x47010e));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x1bb84e){this['_aiChatUi']['setIsMaximized'](_0x1bb84e);}['_logError'](_0x46a678){_0x543541(_0x46a678['message']);}['_removeFromContext'](_0x1c26c9){this['activeConversation']?.['removeFromContext'](_0x1c26c9);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x32170f){const [_0xd9eb52,_0x2d30b4]=_0x32170f['split'](':'),_0x8c8ad5=this['activeConversation']['getInteraction'](_0xd9eb52),_0x191bfc=_0x8c8ad5['getReply'](_0x2d30b4);return{'interaction':_0x8c8ad5,'reply':_0x191bfc};}['_scrollToSuggestionRange'](_0x10ff01,_0x2f2df9=!0x1){const _0x101a4e=P(this['context']),_0x8972a5={'target':_0x101a4e['editing']['view']['domConverter']['viewRangeToDom'](_0x101a4e['editing']['mapper']['toViewRange'](_0x10ff01)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x2f2df9};_0x2f2df9&&(_0x8972a5['alignToTop']=!0x0),_0x414134(_0x8972a5);}['updateConversationTitle'](_0x9b70c6,_0x214ff8=!0x1){this['_aiChatUi']['setConversationTitle'](_0x9b70c6||y(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x214ff8);}async['_updateReplyContent']({reply:_0x529901,renderingStrategy:_0x2fb980}){const {id:_0x3cd4fe,isDone:_0x394074,type:_0x12f663,parsedContent:_0xa1f85a}=_0x529901;if('modification-delta'===_0x12f663){const _0x5f5159=_0x529901['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3cd4fe,'parts':_0x5f5159,'renderingStrategy':_0x2fb980,'isDone':_0x394074});}else'text-delta'===_0x12f663&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x3cd4fe,'parsedContent':_0xa1f85a,'renderingStrategy':_0x2fb980,'isDone':_0x394074});_0x394074&&_0x529901['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x3cd4fe,_0x529901['sources']);}async['_stopLastInteraction'](){const _0x277cc4=this['activeConversation']?.['lastInteraction'];_0x277cc4&&(_0x277cc4['stop'](),this['_aiChatUi']['stopInteraction'](_0x277cc4));}async['_flushLastInteractionUI'](){const _0x15c846=this['activeConversation']?.['lastInteraction'];if(_0x15c846){for await(const _0x3656de of _0x15c846['replies'])await this['_updateReplyContent']({'reply':_0x3656de,'renderingStrategy':'static'});}}['_updateRatings'](_0x319345){const _0x445bed={'positiveCount':_0x319345['changeGroups']['filter'](_0x76d11b=>'accepted'===_0x76d11b['state'])['length'],'totalCount':_0x319345['changeGroups']['length'],'modificationId':_0x319345['id']},_0xf3662f=this['activeConversation']['getInteraction'](_0x319345['interactionId'])['messageId'];this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0xf3662f,_0x445bed);}}const ht=[...Ce,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ke extends xr{['containerView'];['actionsView'];constructor(_0x13ede6,_0x4e1acb){super(_0x4e1acb),this['set']('isTrackChangesOn',!0x1),this['containerView']=new e(_0x13ede6,{'showDiff':_0x4e1acb['showDiff'],'areActionsDisabled':_0x4e1acb['areActionsDisabled'],'availableActions':_0x4e1acb['availableActions']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x4f43cf,_0x1e0303)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x1e0303['showDiff']});}),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',(_0x3f75b5,{index:_0x5c6ee1})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x5c6ee1});}),this['containerView']['on']('insertSuggestion',(_0x14783f,{index:_0x556b29})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x556b29});}),this['containerView']['on']('rejectSuggestion',(_0x5ae54b,{index:_0x6a9163})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x6a9163});}),this['containerView']['on']('mouseOverSuggestion',(_0x35d2e1,{index:_0xf96e04})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0xf96e04});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x375b0c,{index:_0x4464c7})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4464c7});}),this['actionsView']=new ah(_0x13ede6,this['options']['availableActions']),this['actionsView']['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn'),this['actionsView']['on']('showChangeInText',()=>{this['fire']('showChangeInText',{'replyId':this['options']['id']});}),this['actionsView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'replyId':this['options']['id']});}),this['actionsView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'replyId':this['options']['id']});}),_0x4e1acb['areActionsDisabled']?this['actionsView']['isEnabled']=!0x1:this['actionsView']['bind']('isEnabled')['to'](this['containerView']['bodyView'],'hasPendingParts'),this['children']['addMany']([this['containerView'],this['actionsView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x451b72){await this['containerView']['updateContent'](_0x451b72),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x106254,_0x1c6293){this['containerView']['bodyView']['updatePartState'](_0x106254,_0x1c6293);}['updateSources'](_0x18932c){this['containerView']['updateSources'](_0x18932c);}['getPartView'](_0x4f9212){return this['containerView']['bodyView']['getPartView'](_0x4f9212);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class Se extends xr{['replyContainer'];constructor(_0x57c9fd,_0x1f7d13){super(_0x1f7d13),this['locale']=_0x57c9fd,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x492b6b(),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':Ne(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x40edd5,renderingStrategy:_0x36ba9a,abortSignal:_0x8a0909}){'streaming'===_0x36ba9a?await this['streamIntoElement'](_0x40edd5,this['replyContainer']['element'],_0x8a0909):this['replyContainer']['element']['innerHTML']=_0x20dcd7(_0x40edd5);}['updateSources'](_0xbd7816){const _0x14fb98=new yr(this['locale']);_0x14fb98['children']['addMany'](_0xbd7816['map'](_0xc477ad=>new Cr(this['locale'],_0xc477ad))),_0x14fb98['isVisible']=!0x0,this['children']['add'](_0x14fb98);}}const xn={'file':_0x241668,'document':_0x3fd5d1,'web-resource':_0x3fc296,'text':_0x241668,'selection':_0x25d747},oa='ck-ai-chat-context-chip',ca='ck-ai-chat-context-chip_wide',la='ck-ai-chat-context-chip_document',da='ck-ai-chat-context-chip__label',ua='ck-ai-chat-context-chip__type-icon',_a='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class Co extends _0x21bd9e{constructor(_0x455cf4,_0x577f69,_0x1e83f8,_0x2a442f,_0x2112b4=!0x1){super(_0x455cf4),this['_isAnimationOnEnterEnabled']=_0x2a442f,this['_initializeProperties'](_0x577f69,_0x1e83f8,_0x2112b4),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'](_0x24dd48,_0x30a7bf,_0x1dc218){this['set']('label',_0x24dd48['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x24dd48['type']),this['set']('id',_0x24dd48['uiId']),this['set']('readonly',_0x30a7bf),this['set']('isLoading',_0x1dc218);}['_setupTemplate'](){const _0x144c52=this['_createIconView'](),_0x1a7a73=this['_createRemoveButton'](),_0x1d70ed=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x1d70ed),'children':this['_createTemplateChildren'](_0x144c52,_0x1a7a73,_0x1d70ed)});}['_createTemplateAttributes'](_0x1b1996){return{'class':[oa,_0x1b1996['if']('itemType',la,_0x394d9e=>'document'==_0x394d9e),_0x1b1996['if']('itemType',ca,_0x1ea0c6=>'selection'==_0x1ea0c6)],'data-cke-tooltip-text':_0x1b1996['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':_a};}['_createTemplateChildren'](_0x82f7c,_0x526172,_0x145124){const _0x2fe9bc=this['_createLabelElement'](_0x145124),_0xe62c25=this['_createLoaderIcon']();return this['readonly']?[_0x82f7c,_0x2fe9bc]:[_0x82f7c,_0xe62c25,_0x2fe9bc,_0x526172];}['_createLabelElement'](_0x10b2a8){return{'tag':'span','attributes':{'class':da},'children':[{'text':_0x10b2a8['to']('label')}]};}['_createRemoveButton'](){const _0x30a701=new _0x21bd9e(this['locale']);return _0x30a701['set']({'label':y(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x3a2bed}),this['_setupRemoveButtonEvent'](_0x30a701),_0x30a701;}['_setupRemoveButtonEvent'](_0x1543c7){_0x1543c7['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x4f562e=this['bindTemplate'],_0x5a6277=new _0x25e498();return _0x5a6277['content']=xn[this['itemType']],_0x5a6277['extendTemplate']({'attributes':{'class':[ua,_0x4f562e['if']('isLoading','ck-hidden',_0xb273b=>_0xb273b)]}}),_0x5a6277;}['_handleAnimationEndOnce'](_0x320197,_0x44b2a1){if(!_0x320197)return;const _0x468a3c=()=>{_0x44b2a1(),_0x320197['removeEventListener']('animationend',_0x468a3c),_0x320197['removeEventListener']('webkitAnimationEnd',_0x468a3c);};_0x320197['addEventListener']('animationend',_0x468a3c),_0x320197['addEventListener']('webkitAnimationEnd',_0x468a3c);}['_createLoaderIcon'](){const _0xeb4d86=new je('small');return _0xeb4d86['bind']('isVisible')['to'](this,'isLoading',_0x3cfc6b=>_0x3cfc6b),_0xeb4d86;}}function In(_0x451dc3){if(!_0x451dc3)return _0x451dc3;if(_0x451dc3['length']<=0x78)return _0x451dc3;const _0x277748=_0x451dc3['slice'](0x0,0x78),_0x2efa4e=_0x277748['lastIndexOf']('\x20');return(_0x2efa4e>0x0?_0x277748['slice'](0x0,_0x2efa4e):_0x277748)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class mo{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0xe4e170,_0x5819b5,_0x4b774d,_0x57ac44,_0x24cc41){this['_locale']=_0xe4e170,this['_visibleChips']=_0x5819b5,this['_config']={...hn,..._0x4b774d,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x4b774d['cssClasses']}},this['_overflowChips']=new _0x1c36f7(),this['_bodyCollection']=_0x57ac44,this['_parentView']=_0x24cc41||null;}['setContainerElement'](_0x3c5f59){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x3c5f59,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 _0x50d713=[...this['_visibleChips'],...this['_overflowChips']],_0x45b037=this['_createCalculationContainer'](),_0x34da9b=this['_calculateOverflowInContainer'](_0x45b037,_0x50d713),_0x56688b=_0x45b037['_ancestorsToRestore'];_0x56688b&&this['_restoreAncestorVisibility'](_0x56688b),_0x45b037['remove'](),this['_applyOverflowResults'](_0x50d713,_0x34da9b);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),ts({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x4d3c31=new _0x21bd9e(this['_locale']);_0x4d3c31['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x215063=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x215063['push'](this['_config']['cssClasses']['controlsButton']),_0x4d3c31['extendTemplate']({'attributes':{'class':_0x215063}}),_0x4d3c31;}['_createShowMoreBalloonPanelView'](){const _0x91419=new _0x257cec(this['_locale']);return _0x91419['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x91419),_0x91419;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x345f1c=>{_0x345f1c['disableAnimationOnEnter']();});const _0x340548=new _0x492b6b(this['_locale']);_0x340548['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x340548);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x361d5a=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x361d5a?'':'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'](_0x5966ff){const _0x2b2e59=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x3f6528=this['_containerElement']?.['classList'];if(_0x3f6528){const _0x2c88b6=_0x3f6528[0x0]||'',_0x34d846=_0x5966ff['querySelector']('.'+_0x2c88b6),_0x15d9c3=_0x5966ff['querySelector'](_0x2b2e59);return _0x34d846||_0x15d9c3||_0x5966ff;}return _0x5966ff['querySelector'](_0x2b2e59)||_0x5966ff;}['_calculateContainerWidth'](){const _0x24e709=this['_parentView']?.['element']||this['_containerElement'];if(!_0x24e709)return an;const _0x166ae7=window['getComputedStyle'](_0x24e709)['width'];if('auto'===_0x166ae7||'0px'===_0x166ae7||!_0x166ae7){const _0x40b175=_0x24e709['parentElement'];if(_0x40b175){const _0x30bcc0=window['getComputedStyle'](_0x40b175);return'auto'!==_0x30bcc0['width']?_0x30bcc0['width']:an;}return an;}return _0x166ae7;}['_applyCalculationStyles'](_0x4ada0a,_0x28adf9){this['_config']['cssClasses']['calculationContainer']&&_0x4ada0a['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x4ada0a['style']['width']=_0x28adf9,_0x4ada0a['style']['position']='absolute',_0x4ada0a['style']['top']='-9999px',_0x4ada0a['style']['left']='-9999px',_0x4ada0a['style']['opacity']='0',_0x4ada0a['style']['pointerEvents']='none',_0x4ada0a['style']['zIndex']='-1',_0x4ada0a['style']['visibility']='visible\x20!important',_0x4ada0a['style']['display']='block\x20!important',_0x4ada0a['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x4b479a){_0x4b479a['forEach'](({element:_0x67095a,originalDisplay:_0x2df555,originalVisibility:_0x56eaf3})=>{_0x67095a['style']['display']=_0x2df555,_0x67095a['style']['visibility']=_0x56eaf3;});}['_makeAncestorsVisible'](_0x4adeaa){const _0x3b11ef=[];let _0x55c3fb=_0x4adeaa;for(;_0x55c3fb&&_0x55c3fb!==document['body'];){const _0x4d1bbe=window['getComputedStyle'](_0x55c3fb);'none'!==_0x4d1bbe['display']&&'hidden'!==_0x4d1bbe['visibility']||(_0x3b11ef['push']({'element':_0x55c3fb,'originalDisplay':_0x55c3fb['style']['display'],'originalVisibility':_0x55c3fb['style']['visibility']}),_0x55c3fb['style']['display']='block',_0x55c3fb['style']['visibility']='visible'),_0x55c3fb=_0x55c3fb['parentElement'];}return _0x3b11ef;}['_createContainerElements'](){let _0x33cc06,_0x56652c;return this['_parentView']?.['element']?(_0x33cc06=this['_parentView']['element']['cloneNode'](!0x0),_0x56652c=this['_findTargetContainer'](_0x33cc06)):(_0x33cc06=document['createElement']('div'),_0x56652c=_0x33cc06),{'calculationContainer':_0x33cc06,'targetContainer':_0x56652c};}['_createCalculationContainer'](){const {calculationContainer:_0x4edcce,targetContainer:_0x213877}=this['_createContainerElements'](),_0x116267=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x4edcce,_0x116267);const _0x4566d8=this['_parentView']?.['element']||this['_containerElement'],_0x31ac38=_0x4566d8?.['parentElement'];_0x31ac38?_0x31ac38['appendChild'](_0x4edcce):document['body']['appendChild'](_0x4edcce),_0x4edcce['_targetContainer']=_0x213877;const _0x51cdb8=this['_makeAncestorsVisible'](_0x31ac38||null);return _0x4edcce['offsetWidth'],_0x4edcce['_ancestorsToRestore']=_0x51cdb8,_0x4edcce;}['_calculateOverflowInContainer'](_0x18231b,_0x83c957){const _0x32cdb6=_0x18231b['_targetContainer']||_0x18231b,_0x10a860=[],{rowCount:_0x296516}=this['_renderChipsAndCountRows'](_0x32cdb6,_0x83c957);if(_0x296516<=this['_config']['maxVisibleRows'])return _0x10a860;const _0x466dc2=_0x83c957['slice']();for(;_0x466dc2['length']>0x0;){if(this['_testButtonFit'](_0x18231b,_0x32cdb6,_0x466dc2)){const _0x32fb43=_0x83c957['filter'](_0x17984=>!_0x466dc2['includes'](_0x17984));_0x10a860['push'](..._0x32fb43);break;}if(!_0x466dc2['pop']())break;}return _0x10a860;}['_renderChipsAndCountRows'](_0x2fda4a,_0x44476c){_0x2fda4a['innerHTML']='',_0x44476c['forEach'](_0xa14a3=>{if(_0xa14a3['element']){const _0x4af440=_0xa14a3['element']['cloneNode'](!0x0);_0x2fda4a['appendChild'](_0x4af440);}}),_0x2fda4a['offsetWidth'];const _0x386474=_0x2fda4a['children'],_0x2b5a1a=[];return Array['from'](_0x386474)['forEach'](_0x538044=>{const _0x15bd5a=_0x538044['getBoundingClientRect']()['top'];_0x2b5a1a['some'](_0x567b32=>Math['abs'](_0x567b32-_0x15bd5a)<this['_config']['rowDetectionTolerance'])||_0x2b5a1a['push'](_0x15bd5a);}),{'rowCount':_0x2b5a1a['length']};}['_createMockButton'](){const _0x30c472=document['createElement']('button');return _0x30c472['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x30c472['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x30c472['textContent']='+\x201',_0x30c472;}['_testButtonFit'](_0x40c5e0,_0x33f5ab,_0x22e179){this['_renderChipsAndCountRows'](_0x33f5ab,_0x22e179);const _0x11b859=this['_createMockButton']();_0x40c5e0['appendChild'](_0x11b859),_0x40c5e0['offsetWidth'];const _0x822efb=[..._0x33f5ab['children'],_0x11b859],_0x22697e=[];_0x822efb['forEach'](_0x2250cd=>{const _0x2dd55c=_0x2250cd['getBoundingClientRect']()['top'];_0x22697e['some'](_0x2483e1=>Math['abs'](_0x2483e1-_0x2dd55c)<this['_config']['rowDetectionTolerance'])||_0x22697e['push'](_0x2dd55c);});const _0x4550cb=_0x22697e['length'];return _0x11b859['remove'](),_0x4550cb<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x12af3e,_0xa55f31){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x12af3e['forEach'](_0x467dab=>{_0xa55f31['includes'](_0x467dab)?this['_overflowChips']['add'](_0x467dab):this['_visibleChips']['add'](_0x467dab);});}['_updateOverflowUI'](_0x28eedf){if(_0x28eedf>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x28eedf>0x0&&this['_showMoreButtonView']){const _0x200aa1=''+this['_config']['showMoreLabelPrefix']+(_0x28eedf<0x63?_0x28eedf:'99');this['_showMoreButtonView']['label']=_0x200aa1;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x2b1e4a,_0x4fea4c){this['_distributeChips'](_0x2b1e4a,_0x4fea4c),this['_updateOverflowUI'](_0x4fea4c['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x3e4015=>{_0x3e4015[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 _0x342e0a=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x342e0a['width']||0x0===_0x342e0a['height'])return!0x1;const _0x143b2a=window['innerHeight']||document['documentElement']['clientHeight'],_0x2389cd=window['innerWidth']||document['documentElement']['clientWidth'],_0x3fad77=0xc8;return _0x342e0a['bottom']>=-0xc8&&_0x342e0a['top']<=_0x143b2a+_0x3fad77&&_0x342e0a['right']>=-0xc8&&_0x342e0a['left']<=_0x2389cd+_0x3fad77;}}const Ia='ck-ai-chat__feed__context-chips',Aa='ck-ai-chat-context-chips-wrapper',ga='ck-ai-chat-context-chips-wrapper-balloon',Ea='ck-ai-chat-controls-button',ma='ck-ai-chat-controls_context_show-more-button',pa='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0x492b6b{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x12413a,_0x3f4b3a,_0x5b1b1b){super(_0x12413a),this['_bodyCollection']=_0x5b1b1b,this['_createContextChips'](_0x3f4b3a);const _0x3031ba={'cssClasses':{'showMoreButton':ma,'showMoreBalloon':pa,'overflowContainer':ga,'controlsButton':Ea}};this['_overflowManager']=new mo(_0x12413a,this['_contextChips'],_0x3031ba,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Ia,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Aa},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x3c0b82=this['element']['querySelector']('.'+Aa);_0x3c0b82&&(this['_overflowManager']['setContainerElement'](_0x3c0b82),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x478e8){for(const _0x3fe2f9 of _0x478e8){const _0xdb8ef6=new Co(this['locale'],_0x3fe2f9,!0x0,!0x1);this['_contextChips']['add'](_0xdb8ef6);}}}class ve extends xr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x2d9c41,_0x85f6de,_0x274777){super(_0x85f6de),this['_locale']=_0x2d9c41,this['_bodyCollection']=_0x274777,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'](_0x50ca7e=>!_0x50ca7e['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x492b6b(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 rt extends xr{['capabilities'];constructor(_0x5dea46,_0xd65f78){super(_0xd65f78);const {isWebSearchEnabled:_0x269052,isReasoningEnabled:_0x550549}=_0xd65f78['capabilities'],_0x2cbe0a=[];let _0xac84b8='';_0x269052&&_0x550549?(_0xac84b8=y(_0x5dea46,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x2cbe0a['push'](aa(_0x4f04ad)),_0x2cbe0a['push'](aa(_0x4bb0b4))):_0x269052?(_0xac84b8=y(_0x5dea46,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x2cbe0a['push'](aa(_0x4f04ad))):_0x550549&&(_0xac84b8=y(_0x5dea46,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x2cbe0a['push'](aa(_0x4bb0b4))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0xac84b8?'':'ck-hidden']}});const _0x2c2122=new _0x492b6b();_0x2c2122['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x2cbe0a,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0xac84b8]}]}),this['children']['add'](_0x2c2122),this['capabilities']=_0xd65f78['capabilities'];}}function aa(_0x4454fb){const _0x53ef78=new _0x25e498();return _0x53ef78['content']=_0x4454fb,_0x53ef78;}class _e extends _0x492b6b{constructor(_0x3b0ec7,_0x1615cc){super(_0x3b0ec7),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x1615cc)});}['_createSkeletonItems'](_0x45fb45){const _0x18d836=['ck','ck-ai-skeleton__item'];return _0x45fb45['map'](_0x45de46=>{let _0x1ece3a='';switch(_0x45de46['attributes']['align']){case'right':_0x1ece3a='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x1ece3a='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x1ece3a='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x45de46['tag'],'attributes':{'class':[..._0x18d836,_0x45de46['attributes']['class']?_0x45de46['attributes']['class']:''],'style':'width:\x20'+_0x45de46['attributes']['width']+';\x20height:\x20'+_0x45de46['attributes']['height']+';'+_0x1ece3a}};});}}const be={'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':ta(0x5,'100%','44px','right'),'aiChatResources':ta(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function ta(_0x5c9dcc,_0x213942,_0xb1cf67,_0x33e0f6){return new Array(_0x5c9dcc)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x213942,'height':_0xb1cf67,'align':_0x33e0f6}}));}class Bi extends _0x492b6b{['children'];['scrollManager'];['_bodyCollection'];constructor(_0xe81c7c,_0x31be9c){super(_0xe81c7c),this['_bodyCollection']=_0x31be9c,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...ht)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Jt(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x427e31,_0x342e69){let _0x1557c3;'ai-reply'===_0x427e31?_0x1557c3=new Se(this['locale'],_0x342e69):'ai-suggestion-reply'===_0x427e31?(_0x1557c3=new ke(this['locale'],_0x342e69),_0x1557c3['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn')):_0x1557c3='user-message'===_0x427e31?new ve(this['locale'],_0x342e69,this['_bodyCollection']):'interaction-header'===_0x427e31?new rt(this['locale'],_0x342e69):new ye(_0x342e69),this['children']['add'](_0x1557c3);}async['updateReplyItem']({id:_0x1288d4,parsedContent:_0x10f359,renderingStrategy:_0x4a5701,abortSignal:_0x170302}){const _0x593567=this['getItemById'](_0x1288d4);if(!(_0x593567 instanceof Se))throw new _0x19ee7d('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x593567,'id':_0x1288d4,'parsedContent':_0x10f359});await _0x593567['updateContent']({'parsedContent':_0x10f359,'renderingStrategy':_0x4a5701,'abortSignal':_0x170302});}async['updateWebSources'](_0x3d0d54,_0x5a4ca3){const _0x2a66a2=this['getItemById'](_0x3d0d54);if(_0x2a66a2 instanceof ke)_0x2a66a2['updateSources'](_0x5a4ca3);else{if(!(_0x2a66a2 instanceof Se))throw new _0x19ee7d('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x2a66a2,'id':_0x3d0d54,'sources':_0x5a4ca3});_0x2a66a2['updateSources'](_0x5a4ca3);}}async['updateSuggestionItem']({id:_0x10a209,parts:_0x4d8bcb,renderingStrategy:_0x5378ce,abortSignal:_0x15ea72}){const _0x36fd02=this['getItemById'](_0x10a209);if(!(_0x36fd02 instanceof ke))throw new _0x19ee7d('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x36fd02,'id':_0x10a209,'parts':_0x4d8bcb});await _0x36fd02['updateContent']({'parts':_0x4d8bcb,'renderingStrategy':_0x5378ce,'abortSignal':_0x15ea72});}['updateSuggestionPartState']({id:_0x1458cf,index:_0x2b6fe6,state:_0x94982f}){const _0x42b799=this['getItemById'](_0x1458cf);if(!(_0x42b799 instanceof ke))throw new _0x19ee7d('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x1458cf});_0x42b799['updatePartState'](_0x2b6fe6,_0x94982f);}['markItemAsDone'](_0x520c34){this['getItemById'](_0x520c34)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x1bdf35=>_0x1bdf35['options']['id']);}['removeItem'](_0x251340){this['children']['remove'](this['getItemById'](_0x251340));}['scrollToSuggestion'](_0x4412f7,_0x45b152){const _0x3abc49=this['getItemById'](_0x4412f7);if(!(_0x3abc49 instanceof ke))return void _0xe189d1('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x4412f7,'partIndex':_0x45b152});const _0x387fcc=_0x3abc49['getPartView'](_0x45b152);_0x387fcc?_0x414134({'target':_0x387fcc['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0xe189d1('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x4412f7,'partIndex':_0x45b152});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x2e8be1=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x2e8be1,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x36aeed=new _e(this['locale'],be['aiFeed']);return _0x36aeed['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x2d161f=>!_0x2d161f)]}}),_0x36aeed;}['_createFeedItems'](){const _0x379bcb=new _0x492b6b(this['locale']);return _0x379bcb['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x379bcb;}['_createFeedLoader'](){const _0x45f568=new _0x492b6b(this['locale']);return _0x45f568['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x520dbb=>!_0x520dbb)]},'children':this['_createLoaderChildren']()}),_0x45f568;}['_createLoaderChildren'](){const _0x1f4e14=new je();return _0x1f4e14['isVisible']=!0x0,[_0x1f4e14,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x4669f5){const _0x40f9ab=this['children']['find'](_0x3d333c=>_0x3d333c['options']['id']['includes'](_0x4669f5));if(!_0x40f9ab)throw new _0x19ee7d('ai-chat-feed-view-item-not-found',this,{'id':_0x4669f5});return _0x40f9ab;}['setLoadingMessage'](_0x527677){this['set']('loadingMessage',_0x527677);}['toggleLoadingSkeleton'](_0xb5a46f){this['set']('isLoadingSkeletonVisible',_0xb5a46f);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Br extends _0x24784f{['filter'](){let _0x52a650=0x0;for(const _0x57a9e1 of this['items'])_0x52a650+=_0x57a9e1['items']['length'];return{'resultsCount':_0x52a650,'totalItemsCount':_0x52a650};}}class es extends _0x143cba{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x4a1719,_0x381f28){super(_0x4a1719,{'queryView':{'label':'','creator':_0x1eaf41,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Br(_0x4a1719),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x381f28,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=es['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=es['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',(_0x213c99,_0x118b49)=>!_0x213c99&&!_0x118b49),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x3dd8f6,_0x67ce46)=>{this['isUploadInProgress']||this['isEmpty']||_0x3dd8f6['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x67ce46());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x20786f=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x20786f)return this['queryView']['errorText']=y(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x2e8c8c=Zt(_0x20786f);this['fire']('sendUserMessage',_0x2e8c8c),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x292bb1){this['queryView']['fieldView']['set']('placeholder',_0x292bb1);}['_createSubmitButton'](){const _0x257e9d=new _0x21bd9e(this['locale']);return _0x257e9d['set']({'icon':_0x47a449,'label':y(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x257e9d['on']('execute',()=>{this['submit']();}),_0x257e9d;}['setIsUploadInProgress'](_0x2d0c16){this['isUploadInProgress']=_0x2d0c16;}['_setUpAddContextButtonPositioning'](){const _0x34185b=this['locale'],_0x20e691=()=>{_0x384749['window']['requestAnimationFrame'](()=>{if(_0x1ec9b5(this['element'])){const _0x43395d=new _0x1ba12e(this['queryView']['fieldView']['element']),_0x3f60a7=new _0x1ba12e(this['_addContextButtonView']['element']),_0x2d7037=_0x43395d['width'],_0x406856='rtl'===_0x34185b['uiLanguageDirection']?'right':'left';_0x43395d['excludeScrollbarsAndBorders']();const _0x41ce96=_0x2d7037-_0x43395d['width']+0x1;this['_addContextButtonView']['element']['style'][_0x406856]='calc('+(_0x2d7037-_0x3f60a7['width']-_0x41ce96)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x20e691),this['on']('render',()=>{_0x20e691(),this['_queryViewResizeObserver']=new _0x488e19(this['queryView']['fieldView']['element'],()=>{_0x20e691();});});}}const Ta='ck-ai-chat__prompt-capabilities',Ca='ck-ai-chat-controls-button',wa='ck-ai-chat-controls-button--commands',fa='ck-ai-chat-controls__model-selection',Sa='ck-ai-chat-controls__model-selection__item-name',Oa='ck-ai-chat-controls__model-selection__item-description',ba='ck-ai-chat-controls__model-selection__item-capabilities',Ra='n';class is extends _0x492b6b{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x453e9f){super(_0x453e9f),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorVisible',!0x0),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,'modelSelectorVisible',_0x28b6d8=>_0x28b6d8),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x1d1b8a=>_0x1d1b8a?this['_modelSelectionDropdown']['buttonView']['label']:y(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0xc8a671=>_0xc8a671),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0xa6b247=>_0xa6b247),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x206a73=>!_0x206a73),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x5d88e9=>y(this['locale'],_0x5d88e9?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x24c0a0=>_0x24c0a0),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x3150d2=>!_0x3150d2),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x18bf29=>y(this['locale'],_0x18bf29?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Ta]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x1c36f7(),_0x1cd684(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x3dfe3f,_0x5d29b4){if(this['set']('modelSelectorVisible',!(_0x5d29b4&&_0x3dfe3f['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x3dfe3f?.['length']){const _0x4f9fc2=Mt['getLocalized'](this['locale'],_0x3dfe3f);for(const _0x59a4d2 of _0x4f9fc2){const _0x4c6da5=new _0x1bf3fd({'label':_0x59a4d2['name'],'withText':!0x0,'role':'menuitemradio','id':_0x59a4d2['id'],'model':_0x59a4d2});_0x4c6da5['bind']('isOn')['to'](this,'activeModelId',_0x412b29=>_0x412b29===_0x59a4d2['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x4c6da5,'labelView':new Na(this['locale'],_0x59a4d2)});}}}['setWebSearch'](_0x425a73){this['set']('webSearchActive',_0x425a73);}['setReasoning'](_0x5ce4e4){this['set']('reasoningActive',_0x5ce4e4);}['setModel'](_0xa8974e){if(!_0xa8974e)return;this['activeModelId']=_0xa8974e['id'],this['activeModelName']=_0xa8974e['name']||_0xa8974e['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0xa8974e['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0xa8974e['name']);const _0x38f10d=_0xa8974e['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x38f10d),this['_webSearchButton']['set']('isVisible',_0x38f10d);const _0x158762=_0xa8974e['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x158762),this['_reasoningButton']['set']('isVisible',_0x158762);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x443c24){this['set']('modelSelectorEnabled',!0x1),_0x443c24&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x393381=new _0x21bd9e();return _0x393381['set']({'label':y(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x4f04ad,'class':Ca,'isToggleable':!0x0,'tooltipPosition':Ra}),_0x393381['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x393381;}['_createReasoningButton'](){const _0x3a704d=new _0x21bd9e();return _0x3a704d['set']({'label':y(this['locale'],'AI_CHAT_REASONING'),'icon':_0x4bb0b4,'class':Ca,'isToggleable':!0x0,'tooltipPosition':Ra}),_0x3a704d['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x3a704d;}['_createCommandsButton'](){const _0x252da3=new _0x21bd9e();return _0x252da3['set']({'label':y(this['locale'],'AI_CHAT_COMMANDS'),'icon':et,'withText':!0x0,'class':Ca,'isToggleable':!0x0,'tooltip':y(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ra}),_0x252da3['extendTemplate']({'attributes':{'class':[wa]}}),_0x252da3['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x252da3;}['_createModelSelectionDropdown'](){const _0x8da767=_0x35c3bd(this['locale']);return _0x8da767['set']({'panelPosition':'ne','class':[fa]}),_0x8da767['buttonView']['set']({'label':y(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ra}),this['listenTo'](_0x8da767,'execute',_0x48efd8=>{this['fire']('selectModel',_0x48efd8['source']['model']);}),_0x8da767;}['_createModelNameView'](){const _0x25461a=new jo(this['locale']);return _0x25461a['bind']('text')['to'](this,'activeModelName',_0x224ae4=>_0x224ae4??''),_0x25461a['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x246f58,_0x3584de)=>!_0x246f58&&!_0x3584de?.['toLowerCase']()['startsWith']('agent')),_0x25461a;}}let Na=class extends _0xb0531d{constructor(_0x420cc7,_0x2151fa){super();const _0x4423ca=this['bindTemplate'],_0xe97ff=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x4423ca['to']('style'),'id':_0x4423ca['to']('id')},'children':[{'tag':'div','attributes':{'class':[Sa]},'children':[{'text':_0x4423ca['to']('text')}]},{'tag':'div','attributes':{'class':[Oa]},'children':[{'tag':'span','children':[{'text':_0x2151fa['description']}]}]},{'tag':'div','attributes':{'class':[ba]},'children':_0xe97ff}]}),_0xe97ff['addMany'](this['_getCapabilityParts'](_0x420cc7,_0x4f04ad,'AI_CHAT_SEARCH_WEB',_0x2151fa['capabilities']['webSearch']?.['enabled']??!0x1)),_0xe97ff['addMany'](this['_getCapabilityParts'](_0x420cc7,_0x4bb0b4,'AI_CHAT_REASONING',_0x2151fa['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x5a2e3a,_0x329d25,_0x38cf87,_0x122117){const _0x111a5d=new _0x25e498();_0x111a5d['content']=_0x329d25;const _0x822a4=new _0x492b6b(_0x5a2e3a);_0x822a4['setTemplate']({'tag':'span','children':[{'text':y(_0x5a2e3a,_0x38cf87)+':\x20'}]});const _0x228f0f=new _0x492b6b(_0x5a2e3a);return _0x228f0f['setTemplate']({'tag':'span','children':[{'text':y(_0x5a2e3a,_0x122117?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x111a5d,_0x822a4,_0x228f0f];}};class jo extends _0x492b6b{constructor(_0x5c8dbb){super(_0x5c8dbb),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x23ff46=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x23ff46['if']('isVisible','ck-hidden',_0x271d3a=>!_0x271d3a)]},'children':[{'text':_0x23ff46['to']('text')}]});}}const ka='ck-ai-chat-context-controls__url-form',ya='ck-ai-chat-context-controls__url-input-section';class xo extends _0x492b6b{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x227884){super(_0x227884),this['focusTracker']=new Bt(),this['keystrokes']=new Wt(),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 Vt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x349705=>{this['focusTracker']['add'](_0x349705['element']),this['keystrokes']['listenTo'](_0x349705['element']);}),_0x7b6908({'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'](_0x1ce63c){this['urlInputField']['errorText']=_0x1ce63c,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x1ccf4a=new _0x21bd9e(this['locale']);return _0x1ccf4a['set']({'icon':_0x48be9f,'tooltip':y(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x1ccf4a;}['_createUrlInputField'](){const _0x35876f=new _0x94787a(this['locale'],_0x52c7a3);return _0x35876f['set']({'label':y(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x35876f['fieldView']['set']({'placeholder':y(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x35876f;}['_createConfirmButton'](){const _0x1f1ed6=new _0x21bd9e(this['locale']);return _0x1f1ed6['set']({'icon':_0x347166,'tooltip':y(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x1f1ed6;}['_setupTemplate'](){const _0x4cc37c=new _0x5e5898(this['locale'],{'label':y(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x4cc37c['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':ka,'tabindex':'-1'},'children':[_0x4cc37c,{'tag':'div','attributes':{'class':ya},'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',_0x1db405=>{_0x1db405['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x39eeb9,_0xc850f0)=>{this['clear'](),this['fire']('cancel'),_0xc850f0();});}['_handleSubmit'](){const _0x149ed7=this['getValue']()['trim']();_0x149ed7?this['_isValidUrl'](_0x149ed7)?(this['clearError'](),this['fire']('submitUrl',_0x149ed7)):this['setError'](y(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](y(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x17dc54=this['getValue']()['trim'](),_0xfc13f7=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x17dc54['length']>0x0&&!_0xfc13f7;}['_isValidUrl'](_0x2a9836){try{return!!new URL(_0x2a9836);}catch{return!0x1;}}}const va='ck-ai-chat-resources__item',xa='ck-ai-chat-resources__item--in-context',La='ck-ai-chat-resources__item-title',Da='ck-ai-chat-resources__item__icon';class Xo extends _0x8a8c30{['resource'];['_titleView'];['_iconView'];constructor(_0x4207d4,_0x1c7b81){super(_0x4207d4),this['resource']=_0x1c7b81,this['set']('isInContext',!!_0x1c7b81['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x59827b){if(_0x59827b['isInContext'])return _0x347166;switch(_0x59827b['type']){case Ft['DOCUMENT']:return _0x3fd5d1;case Ft['URL']:return _0x3fc296;case Ft['FILE']:case Ft['TEXT']:return _0x241668;default:return _0x169e77;}}['highlightText'](_0x1123dc){if(!_0x1123dc||''===_0x1123dc['trim']())return void this['_titleView']['highlightText'](null);const _0x8e776d=new RegExp(_0xfb43f9(_0x1123dc),'gi');this['_titleView']['highlightText'](_0x8e776d);}['updateResourceState'](_0x17b676){this['resource']['isInContext']=_0x17b676,this['isInContext']=_0x17b676,this['_updateIcon']();}['_createTitleView'](){const _0x4f282d=new _0x1f83e8();return _0x4f282d['text']=this['resource']['label'],_0x4f282d['extendTemplate']({'tag':'span','attributes':{'class':[La]}}),_0x4f282d;}['_createIconView'](){const _0x292993=new _0x25e498();return _0x292993['content']=this['getResourceIcon'](this['resource']),_0x292993;}['_setupTemplate'](){const _0x135e6f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[va,_0x135e6f['if']('isVisible','ck-hidden',_0x104c6a=>!_0x104c6a),_0x135e6f['if']('isInContext',xa)]},'children':[{'tag':'div','attributes':{'class':[Da]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x135e6f['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const Pa='ck-ai-chat-resources__list';class Ur extends _0x24784f{['_source'];constructor(_0x4bbb8c,_0x3a9073){super(_0x4bbb8c),this['_source']=_0x3a9073,this['extendTemplate']({'attributes':{'class':[Pa]}});}['setResources'](_0x28201a,_0x369eea){this['items']['clear']();let _0xb83dee=_0x28201a;if(this['_source']['useDefaultFiltering']&&_0x369eea&&''!==_0x369eea['trim']()){const _0x4174ed=new RegExp(_0x369eea['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0xb83dee=_0x28201a['filter'](_0x2edca1=>_0x4174ed['test'](_0x2edca1['label']));}for(const _0x65cfee of _0xb83dee){const _0x3ff9d7=new Xo(this['locale'],_0x65cfee);_0x3ff9d7['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x65cfee);}),this['items']['add'](_0x3ff9d7);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x369eea);}['highlightText'](_0x569c5a){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x311ece=>{_0x311ece['highlightText'](_0x569c5a);});}['updateResourceState'](_0x562de9,_0x489c62){for(const _0x3cad38 of this['items']){const _0x511144=_0x3cad38;_0x511144['resource']['id']===_0x562de9&&_0x511144['updateResourceState'](_0x489c62);}}['_handleResourceSelection'](_0x3a2e4b,_0x402f09){this['fire']('addResourceToContext',{'source':_0x3a2e4b,'resource':_0x402f09});}}class zr extends _0x94787a{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x514609){const t=_0x514609['t'],_0x47cc0b={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x52c7a3,'label':y(_0x514609,'AI_CHAT_SEARCH_RESOURCES')};super(_0x514609,_0x47cc0b['creator']),this['label']=_0x47cc0b['label'],this['_viewConfig']=_0x47cc0b,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x514609,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x3b242b){this['fire']('search',_0x3b242b);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x25e498(),this['iconView']['content']=_0x23aea4,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x6921a1,t){this['resetButtonView']=new _0x21bd9e(_0x6921a1),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x2c2a0c,'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',_0x3af894=>!_0x3af894),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 Xr extends _0x492b6b{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0xd86e86,_0x33cedb){super(_0xd86e86),this['_source']=_0x33cedb['source'],this['_searchInputVisibleFrom']=_0x33cedb['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 _0x2b3021([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new zr(this['locale']);}['_createSearchSection'](){const _0x12aa14=new _0x492b6b(this['locale']);return _0x12aa14['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x295e8e,_0x2ce2f3)=>{this['loadResources'](_0x2ce2f3),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x2ce2f3);}),_0x12aa14;}['_createResourcesListView'](){const _0x19c54c=new Ur(this['locale'],this['_source']);return _0x19c54c['delegate']('addResourceToContext')['to'](this),_0x19c54c['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x19c54c;}['_createSkeletonView'](){const _0x4973de=new _e(this['locale'],be['aiChatResources']);return _0x4973de['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0xed65a5=>!_0xed65a5)]}}),_0x4973de;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x11a14e){const _0x3387da=_0x3bb1ce();this['_latestLoadResourcesUid']=_0x3387da,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x11a14e,'uid':_0x3387da}),this['isLoading']=!0x0;}['setResources'](_0x26d927,_0x2418f5){if(_0x2418f5&&_0x2418f5!==this['_latestLoadResourcesUid'])return;const _0x4d5ad8=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x26d927,_0x4d5ad8),_0x26d927['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x23a416,_0x12999f){this['_resourcesListView']['updateResourceState'](_0x23a416,_0x12999f);}}const Ha='ck-ai-chat-context-controls__source-balloon-panel',Ma='ck-button-icon\x20ck-button-back',Ua='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class wo{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x410f5e,_0x2c233c,_0x327b9d){this['_locale']=_0x410f5e,this['_bodyCollection']=_0x2c233c,this['_config']=_0x327b9d;}['showSourceResourcesBalloon'](_0x5a4641){let _0x12fd0a=this['_sourceResourceBalloons']['get'](_0x5a4641['id']);_0x12fd0a||(_0x12fd0a=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x5a4641['id'],_0x12fd0a),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x12fd0a)),this['_addSourceResourceContent'](_0x12fd0a,_0x5a4641),_0x12fd0a['show']();const _0x3818ba=this['_config']['getTargetElement']();_0x3818ba&&_0x12fd0a['pin']({'target':_0x3818ba,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0xdf965e,_0x473639,_0x2092f6){const _0x11a93d=this['_sourceResourceBalloons']['get'](_0xdf965e);if(!_0x11a93d)return;const _0x1eb6b0=this['_getResourcesViewFromBalloon'](_0x11a93d);_0x1eb6b0&&(_0x1eb6b0['setResources'](_0x473639,_0x2092f6),_0x1eb6b0['once']('change:isLoading',()=>{_0x11a93d['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x33a783){const _0x5adcc5=this['_sourceResourceBalloons']['get'](_0x33a783);_0x5adcc5&&requestAnimationFrame(()=>{_0x5adcc5['hide'](),this['_sourceResourceBalloons']['delete'](_0x33a783),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x45614e of this['_sourceResourceBalloons']['values']())if(_0x45614e['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x4437a6,_0x466214,_0x2318c4){const _0x1f542c=this['_sourceResourceBalloons']['get'](_0x4437a6);if(!_0x1f542c||!_0x1f542c['isVisible'])return;const _0x188489=this['_config']['getTargetElement']();if(!_0x188489)return;_0x1f542c['pin']({'target':_0x188489,'limiter':this['_config']['getLimiterElement']()});const _0x578884=this['_getResourcesViewFromBalloon'](_0x1f542c);_0x578884&&_0x578884['updateResourceState'](_0x466214,_0x2318c4);}['destroy'](){for(const _0x2a3eb3 of this['_sourceResourceBalloons']['values']())_0x2a3eb3['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x19c5d7=new _0x257cec(this['_locale']);return _0x19c5d7['extendTemplate']({'attributes':{'class':Ha}}),this['_bodyCollection']['add'](_0x19c5d7),_0x19c5d7;}['_addSourceResourceContent'](_0x9959,_0x289e8c){_0x9959['content']['clear']();const _0x9d51d2=this['_createBalloonHeader'](_0x9959,_0x289e8c);_0x9959['content']['add'](_0x9d51d2);const _0x1bf795=this['_createBalloonResourcesView'](_0x289e8c);_0x9959['content']['add'](_0x1bf795);}['_createBalloonHeader'](_0x5ee5e0,_0x3d5c45){const _0x5c1652=this['_createBackButton'](_0x5ee5e0),_0x4c3ddf=new _0x5e5898(this['_locale'],{'label':_0x3d5c45['label'],'class':Ua});return _0x4c3ddf['children']['add'](_0x5c1652,0x0),_0x4c3ddf;}['_createBackButton'](_0x1dffff){const _0x333ead=new _0x21bd9e(this['_locale']);return _0x333ead['set']({'icon':_0x48be9f,'tooltip':y(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Ma}),_0x333ead['on']('execute',()=>{_0x1dffff['hide'](),this['_config']['onBackToContext']();}),_0x333ead;}['_createBalloonResourcesView'](_0x2507f1){const _0x246935=new Xr(this['_locale'],{'source':_0x2507f1,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x246935['on']('loadSourceResources',(_0xb3149b,_0x1f630d)=>{this['_config']['onLoadSourceResources'](_0x1f630d);}),_0x246935['on']('addResourceToContext',(_0x37f869,_0x1a8f47)=>{this['_config']['onResourceSelected'](_0x1a8f47['source'],_0x1a8f47['resource']),this['closeSourceResourceBalloon'](_0x2507f1['id']);}),_0x246935;}['_getResourcesViewFromBalloon'](_0x370a3d){const _0x5de881=_0x370a3d['content']['get'](0x1);return _0x5de881 instanceof Xr?_0x5de881:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x4a1232){ts({'emitter':_0x4a1232,'contextElements':[_0x4a1232['element']],'callback':()=>{_0x4a1232['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x4a1232['isVisible']});}}const as=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],po='ck-ai-chat-context-controls',Bo='ck-ai-chat-context-controls__pending-contexts',bo='ck-ai-chat-context-controls__add-context-balloon-panel',To='ck-ai-chat-context-controls__add-context-button',Ao='ck-ai-chat-context-controls__url-balloon-panel',ko='ck-ai-chat-context-controls__balloon-button',Eo='ck-ai-chat-context-controls__balloon-button-source',vo='ck-ai-chat-controls-button',Vo='ck-ai-chat-context-chips-wrapper-balloon',fo='ck-ai-chat-controls_context_show-more-button',Io='ck-ai-chat-context-controls__show-more-balloon-panel',Po='ck-ai-chat',Ro=[_0x257cec['defaultPositions']['northArrowSouthWest'],_0x257cec['defaultPositions']['northArrowSouth'],_0x257cec['defaultPositions']['northArrowSouthEast'],_0x257cec['defaultPositions']['southArrowNorthWest'],_0x257cec['defaultPositions']['southArrowNorth'],_0x257cec['defaultPositions']['southArrowNorthEast']];class os extends _0x492b6b{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x18b164,_0x42e9e0){super(_0x18b164),this['bodyCollection']=_0x42e9e0['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x18b164),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x18b164),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x18b164),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x18b164,_0x42e9e0);const _0x3cea03={'cssClasses':{'showMoreButton':fo,'showMoreBalloon':Io,'overflowContainer':Vo,'controlsButton':vo}};this['_overflowManager']=new mo(_0x18b164,this['_currentContextsChips'],_0x3cea03,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'](_0x4cb7f8,_0x1ae2ba){const _0x168d35=this['_createContextButton'](_0x4cb7f8,'current',!0x0,_0x1ae2ba);this['_addContextToCollection'](_0x168d35,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x3bcb24){this['_removeContextFromCollection'](_0x3bcb24,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x3bcb24,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x264f1f,_0x432e37){let _0x2ac321=this['_currentContextsChips']['find'](_0x107803=>_0x107803['id']===_0x264f1f);_0x2ac321||(_0x2ac321=this['_overflowManager']['overflowChips']['find'](_0xa54764=>_0xa54764['id']===_0x264f1f)),_0x2ac321&&(_0x2ac321['isLoading']=_0x432e37);}['setConversationContext'](_0xc26d4e){this['_conversationContextsChips']['clear']();for(const _0x4d1f30 of _0xc26d4e){const _0x511918=this['_createContextButton'](_0x4d1f30,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x511918,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x24de6b,_0x17f840,_0x4a34ae){this['_resourcesBalloonView']['updateResourceState'](_0x24de6b,_0x17f840,_0x4a34ae);}['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'](_0x564aa9){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x564aa9),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0xce5574,_0xa774d9,_0x34a04c,_0x561ff3){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0xce5574,_0x34a04c,_0x561ff3);}['closeSourceResourceBalloon'](_0x368c3a){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x368c3a),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0xc56daa){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0xc56daa),this['_setAddContextButtonEnabled'](_0xc56daa);}['_setAddContextButtonEnabled'](_0x4669fa){const _0x335e49=!_0x4669fa['document']['isHidden']&&_0x4669fa['document']['enabled'],_0x3e092b=_0x4669fa['urls']['enabled'],_0x278311=_0x4669fa['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x335e49||_0x3e092b||_0x278311;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[po,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Bo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x435c90){const _0x10df98=new _0x21bd9e(_0x435c90);return _0x10df98['set']({'label':y(_0x435c90,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':vo+'\x20'+To,'icon':_0x4d54fb,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x10df98;}['_createAddContextBalloonPanelView'](_0x3e2859){return this['_createBaseBalloonPanel'](_0x3e2859,bo);}['_createUrlBalloonPanelView'](_0x1d388a){const _0x2160e2=this['_createBaseBalloonPanel'](_0x1d388a,Ao);return this['_addUrlContent'](_0x2160e2,_0x1d388a),_0x2160e2;}['_createResourcesBalloonView'](_0x18753e,_0x32b50c){const _0x6877a2={'searchInputVisibleFrom':_0x32b50c['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro});},'onResourceSelected':(_0xca2890,_0x2fef70)=>{this['fire']('addResourceToContext',{'source':_0xca2890,'resource':_0x2fef70});},'onLoadSourceResources':_0x4efaf1=>{this['fire']('loadSourceResources',_0x4efaf1);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new wo(_0x18753e,_0x32b50c['bodyCollection'],_0x6877a2);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Po)||document['body'];}['_createBaseBalloonPanel'](_0x2358aa,_0x1a2401){const _0x12a2c9=new _0x257cec(_0x2358aa);return _0x12a2c9['extendTemplate']({'attributes':{'class':_0x1a2401}}),this['bodyCollection']['add'](_0x12a2c9),_0x12a2c9;}['_setBalloonPanelContent'](_0x1d5173,_0x2502c0,_0x50f944){if(_0x1d5173['content']['clear'](),!_0x50f944['document']['isHidden']&&_0x50f944['document']['enabled']){const _0x3c9e6c=this['_createBalloonButton'](_0x2502c0,{'label':y(_0x2502c0,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x3fd5d1});_0x3c9e6c['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x1d5173['content']['add'](_0x3c9e6c);}if(_0x50f944['urls']['enabled']){const _0x5ee85e=this['_createBalloonButton'](_0x2502c0,{'label':y(_0x2502c0,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x3fc296});_0x5ee85e['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro}),this['_urlInputView']['focus']();}),_0x1d5173['content']['add'](_0x5ee85e);}if(_0x50f944['files']['enabled']){const _0x44fd82=new _0x45b20c(_0x2502c0);_0x44fd82['set']({'label':y(_0x2502c0,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x257af9,'withText':!0x0,'tooltip':!0x0,'class':ko,'allowMultipleFiles':!0x0}),_0x44fd82['on']('done',(_0xce940d,_0x44b6c2)=>{this['fire']('addFileToContext',_0x44b6c2),this['hideAddContextBalloonPanel']();}),_0x44fd82['tooltip']=!0x0,_0x1d5173['content']['add'](_0x44fd82);}for(const _0x1ba7d1 of _0x50f944['sources']){const _0x4af988=this['_createBalloonButton'](_0x2502c0,{'label':_0x1ba7d1['label'],'icon':_0x1ba7d1['icon']||_0x169e77,'type':'source'});_0x1d5173['content']['add'](_0x4af988),_0x4af988['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x1ba7d1);});}}['_addUrlContent'](_0x4d3942,_0x3a596f){this['_urlInputView']=new xo(_0x3a596f),this['_urlInputView']['on']('submitUrl',(_0x582865,_0x2809de)=>{this['_handleUrlSubmit'](_0x2809de);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro});}),_0x4d3942['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x37781a,_0x2a10ef){const _0x1008b4='source'===_0x2a10ef['type']?new Va(_0x37781a):new _0x21bd9e(_0x37781a);return _0x1008b4['set']({'label':_0x2a10ef['label'],'icon':_0x2a10ef['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':ko}),_0x1008b4;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){ts({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x10f895){const _0x47049f=this['_addContextBalloonConfig'];_0x47049f['buttonView']['isOn']=_0x10f895,_0x10f895?_0x47049f['balloonView']['show']():_0x47049f['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0xf37336,buttonView:_0x46aaa0,hideMethod:_0x4a6793}=this['_addContextBalloonConfig'];ts({'emitter':_0xf37336,'contextElements':[_0xf37336['element'],_0x46aaa0['element']],'callback':()=>{_0x4a6793();},'activator':()=>_0x46aaa0['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0xc5db2e,_0x117a69,_0x5698bb=!0x1,_0x399e0d=!0x1){const _0x407c8a='conversation'===_0x117a69||!0x0===_0xc5db2e['isReadOnly'],_0x7e5fee=new Co(this['locale'],_0xc5db2e,_0x407c8a,_0x5698bb,_0x399e0d);return _0x407c8a||_0x7e5fee['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x7e5fee['id']);}),_0x7e5fee;}['_addContextToCollection'](_0x8cebec,_0x495631){_0x495631['add'](_0x8cebec,0x0);}['_removeContextFromCollection'](_0x531936,_0x376643){const _0xc18ac=_0x376643['find'](_0x860e02=>_0x860e02['id']===_0x531936);_0xc18ac&&_0x376643['remove'](_0xc18ac);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro}));}['_handleUrlSubmit'](_0x4f4e04){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x4f4e04);}}class Va extends _0x21bd9e{['arrowView'];constructor(_0x197b0b){super(_0x197b0b),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Eo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0xa6dd9b=new _0x25e498();return _0xa6dd9b['content']=_0x39e693,_0xa6dd9b['extendTemplate']({'attributes':{'class':Eo+'__arrow'}}),_0xa6dd9b;}}class rs extends _0x492b6b{['_cancelButtonView'];['_loaderView'];constructor(_0x285b64){super(_0x285b64),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 _0x25a414=new _0x21bd9e(this['locale']);return _0x25a414['set']({'label':y(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x16a978}),_0x25a414['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x25a414;}['_createLoaderView'](){const _0x2ffea2=new _0x492b6b(this['locale']);return _0x2ffea2['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':y(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x2ffea2;}}class Vi extends _0x492b6b{['_displayedModels']=[];['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x296697,_0x2ab7f2){super(_0x296697),this['_contextPanelView']=this['_createContextPanelView'](_0x296697,{'bodyCollection':_0x2ab7f2['bodyCollection'],'searchInputVisibleFrom':_0x2ab7f2['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x296697),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x296697),this['_loaderView']=this['_createLoaderView'](_0x296697),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x296697),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'](...as)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x52da42=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x52da42['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x52da42['if']('isLoading','ck-hidden',_0x1256f7=>_0x1256f7||!this['isModelAvailable']),_0x52da42['if']('isModelAvailable','ck-hidden',_0x23bea1=>!_0x23bea1||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x52da42['if']('isLoading','ck-hidden',_0x433571=>!_0x433571)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x52da42['if']('isModelAvailable','ck-hidden',_0x204099=>_0x204099)]},'children':[this['_modelUnavailableMessageView']]}]}),ts({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x34031d,_0x3ab2b9){return new os(_0x34031d,_0x3ab2b9);}['_createPromptInputView'](_0x3c1c6a){return new es(_0x3c1c6a,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x157bfc){return new is(_0x157bfc);}['_createLoaderView'](_0x35326d){return new rs(_0x35326d);}['_createModelUnavailableMessageView'](_0x5adfdf){const _0x15eb18=new hs(_0x5adfdf);return _0x15eb18['delegate']('startConversation')['to'](this),_0x15eb18;}['_handlePromptInputFocus'](_0x5c2a32,_0x25fe99,_0x590a65){_0x590a65?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x1156f0,_0x49948e){this['_contextPanelView']['addContextItem'](_0x1156f0,_0x49948e);}['removeContextItem'](_0x763628){this['_contextPanelView']['removeContextItem'](_0x763628);}['setContextItemLoading'](_0x228bbe,_0x59cb27){this['_contextPanelView']['setContextItemLoading'](_0x228bbe,_0x59cb27);}['setIsUploadInProgress'](_0x3fbfaa){this['_promptInputView']['setIsUploadInProgress'](_0x3fbfaa);}['setConversationContext'](_0x2b3c83){this['_contextPanelView']['setConversationContext'](_0x2b3c83);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x14852f,_0x480aaa,_0x1cf5f9){this['_contextPanelView']['updateResourceState'](_0x14852f,_0x480aaa,_0x1cf5f9);}['setWebSearch'](_0x1016b6){this['_promptCapabilitiesView']['setWebSearch'](_0x1016b6);}['setReasoning'](_0x10403c){this['_promptCapabilitiesView']['setReasoning'](_0x10403c);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x2a1d00){this['_contextPanelView']['setAddContextOptions'](_0x2a1d00);}['setInputPlaceholder'](_0xfc1ce){this['_promptInputView']['setPlaceholderText'](_0xfc1ce);}['setModelList'](_0x4c379a,_0x5dbdf9){this['_displayedModels']=_0x4c379a,this['_promptCapabilitiesView']['setModelList'](_0x4c379a,_0x5dbdf9);}['setModel'](_0x474edf){(_0x474edf?this['_displayedModels']['find'](_0x14a74a=>_0x14a74a['id']===_0x474edf['id']):null)?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x474edf)):_0x474edf?.['id']['startsWith']('agent')?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](this['_displayedModels'][0x0])):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x3b889e){this['_promptCapabilitiesView']['disableModelSelector'](_0x3b889e);}['populateSourceResourceBalloon'](_0x37a8c7,_0x4947b,_0x48b022,_0x572e40){this['_contextPanelView']['populateSourceResourceBalloon'](_0x37a8c7,_0x4947b,_0x48b022,_0x572e40);}['closeSourceResourceBalloon'](_0x1dbc25){this['_contextPanelView']['closeSourceResourceBalloon'](_0x1dbc25);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class hs extends _0x492b6b{constructor(_0x39f58d){super(_0x39f58d);const _0x1348a7=new _0x21bd9e(_0x39f58d);_0x1348a7['set']({'label':y(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x1348a7['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':y(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x1348a7]}]});}}class Hi extends _0x5e5898{['conversationStartButton'];['resizeButton'];constructor(_0x3210d1,_0x26c42a){super(_0x3210d1,{'label':y(_0x3210d1,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':ot}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x3210d1),this['children']['add'](this['conversationStartButton']),_0x26c42a&&(this['resizeButton']=ms(_0x3210d1,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x482147){const _0x3a084b=new _0x21bd9e(_0x482147);return _0x3a084b['set']({'label':y(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x22fde5,'class':'ck-ai-chat__start-conversation'}),_0x3a084b['on']('execute',()=>{this['fire']('startConversation');}),_0x3a084b;}}class Ei extends _0x492b6b{constructor(_0x5db6b3){super(_0x5db6b3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':y(_0x5db6b3,'AI_DISCLAIMER_TEXT')}]}]});}}class nt extends _0x492b6b{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x332776,_0x3f80f3){super(_0x332776),this['_bodyCollection']=new Kt(_0x332776),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Hi(_0x332776,_0x3f80f3['showResizeButton']),this['chatHeader']['delegate'](...ht)['to'](this),this['chatFeed']=new Bi(_0x332776,this['_bodyCollection']),this['chatFeed']['delegate'](...ht)['to'](this),this['chatControls']=new Vi(_0x332776,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x3f80f3['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...ht)['to'](this),this['chatDisclaimer']=new Ei(_0x332776),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x332776['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x4e35b9,_0x10ecc7,_0xc00446,_0x2d3b35){this['chatControls']['populateSourceResourceBalloon'](_0x4e35b9,_0x10ecc7,_0xc00446,_0x2d3b35);}['closeSourceResourceBalloon'](_0x31fc48){this['chatControls']['closeSourceResourceBalloon'](_0x31fc48);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class F extends _0x4404b9{static get['requires'](){return[$];}['_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(_0x177c3b){super(_0x177c3b);const _0x59ed20=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new _(),this['_view']=new nt(this['context']['locale'],{'showResizeButton':_0x59ed20['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...ht)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x461361,{showDiff:_0x3662f2})=>{this['showDiff']=_0x3662f2;}),_0x59ed20['view']['addTab']({'id':'chat','buttonLabel':y(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':ot,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x30aed5=>_0x30aed5),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x375a00=>_0x375a00),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0xa73211){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0xa73211['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':y(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x345148,staticMessage:_0x3340c7}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x345148,'initialContent':'<p>'+_0x3340c7+'</p>'});}['addFeedItemUserMessage'](_0x225ed1){const _0x204e95=_0x225ed1['quickActionData']?.['displayedPrompt']||_0x225ed1['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x225ed1['contextItems']['values']()),'initialContent':'<p>'+_0x204e95+'</p>','id':_0x225ed1['id']});}['addFeedItemError']({errorMessage:_0x300bbe,id:_0x2f5525}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x300bbe+'</p>','id':_0x2f5525});}['addFeedItemAIReply'](_0x4b751c){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x4b751c['interactionId']+':'+_0x4b751c['id']}),this['setLoadingMessage'](null);});}async['addFeedItemAISuggestion'](_0x177677){const _0x235532=P(this['context']);let _0x19bd24=_0x235532['config']['get']('ai.availableReplyActions')||[...k];if(_0x235532['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0xa8a481=_0x235532['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0xa8a481,'value');}}else _0x19bd24=_0x19bd24['filter'](_0x84e0be=>'insertSuggestion'!=_0x84e0be);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x177677['interactionId']+':'+_0x177677['id'],'areActionsDisabled':_0x177677['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x19bd24}),this['setLoadingMessage'](null);});}['addFeedInteractionHeader'](_0x17a1bd,_0x25e7a2){const _0x2410b5=this['_view']['chatFeed']['children']['last'];if(_0x2410b5 instanceof rt)return this['_view']['chatFeed']['children']['remove'](_0x2410b5),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x17a1bd['id'],'capabilities':{'isWebSearchEnabled':_0x2410b5['capabilities']['isWebSearchEnabled']||_0x25e7a2['isWebSearchEnabled'],'isReasoningEnabled':_0x2410b5['capabilities']['isReasoningEnabled']||_0x25e7a2['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x17a1bd['id'],'capabilities':_0x25e7a2});}['updateFeedInteractionHeader'](_0x2171d5){const _0x4ab8e4=this['_view']['chatFeed']['children']['find'](_0x186696=>_0x186696['options']['id']==_0x2171d5['id']&&_0x186696 instanceof rt);_0x4ab8e4&&_0x4ab8e4['set']('isVisible',_0x2171d5['isVisible']);}async['updateFeedItemAIReplyContent'](_0x33c9c4){const _0xb1ce32=_0x33c9c4['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x417a04=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x33c9c4,'abortSignal':_0x417a04,'renderingStrategy':_0xb1ce32}),_0x33c9c4['isDone']&&this['markFeedItemAsDone'](_0x33c9c4['id']);});}['updateFeedItemAIReplySources'](_0x256887,_0x556311){this['_view']['chatFeed']['updateWebSources'](_0x256887,_0x556311);}async['updateFeedItemAIReplySuggestionContent'](_0x22a560){const _0x401fda=_0x22a560['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x16d24b=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x22a560,'abortSignal':_0x16d24b,'renderingStrategy':_0x401fda}),_0x22a560['isDone']&&this['markFeedItemAsDone'](_0x22a560['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0xd257ee){this['_view']['chatFeed']['updateSuggestionPartState'](_0xd257ee);}['markFeedItemAsDone'](_0x1a50dc){this['_view']['chatFeed']['markItemAsDone'](_0x1a50dc);}['removeFeedInteraction'](_0x15df18){this['_view']['chatFeed']['getItemIds']()['filter'](_0x47702b=>_0x47702b['startsWith'](_0x15df18))['forEach'](_0x15422f=>this['_view']['chatFeed']['removeItem'](_0x15422f));}['startInteraction'](){this['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1}),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x49299b){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x1ed6ed=>_0x1ed6ed['startsWith'](_0x49299b['id']))['forEach'](_0x442bf8=>this['markFeedItemAsDone'](_0x442bf8)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x1458b2,_0x4afe95){this['_view']['chatControls']['addContextItem'](_0x1458b2,_0x4afe95);}['removeContextItem'](_0x59914f){this['_view']['chatControls']['removeContextItem'](_0x59914f);}['setContextItemLoading'](_0x29f650,_0x5e4983){this['_view']['chatControls']['setContextItemLoading'](_0x29f650,_0x5e4983);}['setIsUploadInProgress'](_0x5db283){this['_view']['chatControls']['setIsUploadInProgress'](_0x5db283);}['setConversationContext'](_0x3c4617){this['_view']['chatControls']['setConversationContext'](_0x3c4617);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x2b0f14,_0x48d69a,_0x1191b8){this['_view']['chatControls']['updateResourceState'](_0x2b0f14,_0x48d69a,_0x1191b8);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x47cd23){this['_view']['chatControls']['setAddContextOptions'](_0x47cd23);}['updateCapabilities'](_0x3bf5f0){this['_view']['chatControls']['setWebSearch'](_0x3bf5f0['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x3bf5f0['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x3bf5f0));}['setSelectedModel'](_0x38b7b7,_0x26617c){this['_view']['chatControls']['setModel'](_0x38b7b7),_0x26617c&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x5be915){this['feedItemRenderingStrategy']=_0x5be915;}['toggleLoadingSkeleton'](_0x31d041){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x31d041);}['resetConversationTitle'](){this['setConversationTitle'](y(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x4226e1,_0x374886=!0x1){if(_0x374886&&!at()&&_0x4226e1['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x4226e1);this['_view']['chatHeader']['label']=_0x4226e1;}['setLoadingMessage'](_0x3b1e6e){const _0x2bb80a=this['_getLoadingMessage'](_0x3b1e6e);this['_view']['chatFeed']['setLoadingMessage'](_0x2bb80a);}['_animateConversationTitle'](_0xd89ba9){let _0x38861a=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0xd89ba9[_0x38861a],_0x38861a++,_0x38861a===_0xd89ba9['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x15d480){this['_view']['chatHeader']['isMaximized']=_0x15d480;}['_getLoadingMessage'](_0x156850){return _0x156850?_0x156850['isWebSearchEnabled']&&_0x156850['isReasoningEnabled']?y(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x156850['isWebSearchEnabled']?y(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x156850['isReasoningEnabled']?y(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):y(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR'):'';}['_getInputPlaceholder'](_0x21131e){return _0x21131e?_0x21131e['isWebSearchEnabled']&&_0x21131e['isReasoningEnabled']?y(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x21131e['isWebSearchEnabled']?y(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x21131e['isReasoningEnabled']?y(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):y(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):y(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x4ce342,_0x3ec611,_0x321d8c,_0x2a7909){this['_view']['populateSourceResourceBalloon'](_0x4ce342,_0x3ec611,_0x321d8c,_0x2a7909);}['closeSourceResourceBalloon'](_0x140fc8){this['_view']['closeSourceResourceBalloon'](_0x140fc8);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x5dfa2a,_0xab7623){this['_view']['chatFeed']['scrollToSuggestion'](_0x5dfa2a,_0xab7623);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class $i extends _0x24784f{['sections'];constructor(_0x29076b,_0x209a38){super(_0x29076b),this['sections']=_0x209a38,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x2e45fa){let _0x222624=0x0,_0x401e9d=0x0;for(const _0xe12dfa of this['sections']){const {resultsCount:_0x2b0379,totalItemsCount:_0x5da902}=_0xe12dfa['filter'](_0x2e45fa);_0x222624+=_0x2b0379,_0x401e9d+=_0x5da902;}return{'resultsCount':_0x222624,'totalItemsCount':_0x401e9d};}}class _s extends _0x8a8c30{['title'];['itemsViews'];['_itemsListView'];constructor(_0x9fbf6,{title:_0x5e4287,items:_0x3bc157}){super(_0x9fbf6);const _0x5ddaf2=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x5e4287,this['itemsViews']=_0x3bc157;const _0x7ea302=new _0x492b6b(_0x9fbf6);_0x7ea302['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x24784f(_0x9fbf6),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x5ddaf2['if']('isVisible','ck-hidden',_0x220b99=>!_0x220b99)]},'children':[_0x7ea302,this['_itemsListView']]});}['filter'](_0x55396d){const _0x5da006=this['itemsViews']['length'];let _0x260876=0x0;for(const _0x434810 of this['itemsViews']){if(_0x55396d){const _0x771d71=_0x434810['isMatching'](_0x55396d);_0x434810['isVisible']=!!_0x771d71,_0x434810['highlightText'](_0x55396d);}else _0x434810['isVisible']=!0x0,_0x434810['highlightText'](null);_0x434810['isVisible']&&_0x260876++;}return this['isVisible']=_0x260876>0x0,{'resultsCount':_0x260876,'totalItemsCount':_0x5da006};}['getItem'](_0x465901){return this['itemsViews']['find'](_0x1a934d=>_0x1a934d['id']===_0x465901);}['removeItem'](_0x257e58){const _0x5c8522=this['itemsViews']['indexOf'](_0x257e58);-0x1!==_0x5c8522&&(this['itemsViews']['splice'](_0x5c8522,0x1),this['_itemsListView']['items']['remove'](_0x257e58));}}class ls extends/* #__PURE__ -- @preserve */
27
- _0x4bf1f4(_0x8a8c30){['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(_0x567197,_0x19a83b){super(_0x567197);const _0x2ce224=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x19a83b['pinned']),this['set']('loadingState',null),this['id']=_0x19a83b['id'];const {title:_0x29efe3,createdAt:_0x30945c,active:_0x724661=!0x1}=_0x19a83b;this['_titleView']=new _0x1f83e8(),this['_titleView']['text']=_0x29efe3,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x477dbc=this['_createCheckView'](),_0x28cc6f=this['_createPinButtonView'](_0x567197),_0xa8a8fd=this['_createMenuDropdownView'](),_0x5613e5=this['_createEditInputView'](_0x567197,_0x29efe3),_0x6e3d1=this['_createAcceptEditButtonView'](_0x567197,_0x5613e5),_0xf97119=this['_createCancelEditButtonView'](_0x567197,_0x5613e5);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x28cc6f),this['actions']['add'](_0xa8a8fd),this['on']('change:isEdit',(_0x11187a,_0x2df324,_0x2d47a0)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x2d47a0?(this['actions']['add'](_0x6e3d1),this['actions']['add'](_0xf97119),this['mainContent']['add'](_0x5613e5),_0x5613e5['element']['focus']()):(this['actions']['add'](_0x28cc6f),this['actions']['add'](_0xa8a8fd),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x724661?'ck-ai-chat-history__item--active':'',_0x2ce224['if']('isVisible','ck-hidden',_0x3ecb21=>!_0x3ecb21),_0x2ce224['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',_0x2ce224['if']('loadingState','ck-hidden',_0x856b84=>!!_0x856b84)]},'children':_0x724661?[_0x477dbc]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x2ce224['if']('loadingState','ck-hidden',_0x484b21=>!_0x484b21)]},'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',_0x2ce224['if']('loadingState','ck-hidden',_0x4c8986=>!!_0x4c8986)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x2ce224['if']('loadingState','ck-hidden',_0x28f5e5=>!_0x28f5e5)]},'children':[{'text':_0x2ce224['to']('loadingState',_0x142c90=>_0x142c90?y(this['locale'],ls['LOADING_LABELS'][_0x142c90]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x30945c]}]},{'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'](_0x113958){this['_titleView']['text']=Zt(_0x113958);}['updateLoadingState'](_0x16d968,_0x3ef0db){this['set']('loadingState',_0x3ef0db?_0x16d968:null);}['_createCheckView'](){const _0x2ce2f0=new _0x25e498();return _0x2ce2f0['set']({'content':_0x2a5a64}),_0x2ce2f0;}['_createPinButtonView'](_0x13c5a5){const _0x4c0115=new _0x21bd9e(_0x13c5a5);return _0x4c0115['set']({'label':y(_0x13c5a5,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x1dd126,'withText':!0x1,'tooltip':!0x0}),_0x4c0115['bind']('isOn')['to'](this,'pinned'),_0x4c0115['on']('execute',()=>{const _0x139d9d=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x139d9d});}),_0x4c0115;}['_createMenuDropdownView'](){const _0x43a888=_0x35c3bd(this['locale'],_0x5a11e2),_0x218da2=_0x43a888['panelView']['children'];_0x43a888['buttonView']['set']({'label':y(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x40bfd1}),_0x43a888['panelPosition']='sw';const _0x15ced0=new _0x21bd9e(this['locale']);_0x15ced0['label']=y(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x15ced0['withText']=!0x0,_0x15ced0['on']('execute',()=>{this['isEdit']=!0x0;});const _0x4dec4e=new _0x21bd9e(this['locale']);_0x4dec4e['label']=y(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x4dec4e['withText']=!0x0,_0x4dec4e['on']('execute',()=>{this['showConfirm'](y(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x1b82b3=new _0x24784f(this['locale']),_0x72ed82=new _0x8a8c30(this['locale']);_0x72ed82['children']['add'](_0x15ced0);const _0x5d2f47=new _0x8a8c30(this['locale']);return _0x5d2f47['children']['add'](_0x4dec4e),_0x1b82b3['items']['addMany']([_0x72ed82,_0x5d2f47]),_0x218da2['add'](_0x1b82b3),_0x43a888;}['_createEditInputView'](_0x515042,_0x2cb25a){const _0x4630ca=new _0x257805(_0x515042),_0x1e561c=_0x4630ca['bindTemplate'];return _0x4630ca['value']=_0x2cb25a,_0x4630ca['extendTemplate']({'on':{'keydown':_0x1e561c['to'](_0x9384ce=>{'Enter'==_0x9384ce['key']&&this['_commitEditInputValue'](_0x4630ca);})}}),_0x4630ca;}['_createAcceptEditButtonView'](_0x10eca3,_0x53dee8){const _0x330d4d=new _0x21bd9e(_0x10eca3);return _0x330d4d['set']({'icon':_0x2a5a64,'withText':!0x1,'tooltip':y(_0x10eca3,'AI_CHAT_HISTORY_ACCEPT')}),_0x330d4d['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x330d4d['on']('execute',()=>{this['_commitEditInputValue'](_0x53dee8);}),_0x330d4d;}['_commitEditInputValue'](_0x7ca9e2){const _0x321796=_0x7ca9e2['element']['value']||'';this['_titleView']['text']=_0x321796,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x321796});}['_createCancelEditButtonView'](_0x26bace,_0x110012){const _0x4432e9=new _0x21bd9e(_0x26bace);return _0x4432e9['set']({'icon':_0x2c2a0c,'withText':!0x1,'tooltip':y(_0x26bace,'AI_CHAT_HISTORY_CANCEL')}),_0x4432e9['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x4432e9['on']('execute',()=>{this['isEdit']=!0x1,_0x110012['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x4432e9;}['_createSpinnerView'](){const _0x2e95c4=new je('tiny');return _0x2e95c4['isVisible']=!0x0,_0x2e95c4;}['isMatching'](_0x11bfb4){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x11bfb4)?{'title':!0x0}:null;}['highlightText'](_0x2cc09b){this['_titleView']['highlightText'](_0x2cc09b);}}class ut extends _0x492b6b{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x31b4f2,_0x18b448){super(_0x31b4f2),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0x40ae17=new _0x5e5898(_0x31b4f2,{'label':y(_0x31b4f2,'AI_CHAT_HISTORY_HEADING'),'icon':It,'class':'ck-ai-header\x20ck-ai-header_history'});_0x18b448&&(this['resizeButton']=ms(_0x31b4f2,this),_0x40ae17['children']['add'](this['resizeButton'])),this['sectionsView']=new $i(_0x31b4f2,[]),this['sectionsView']['delegate'](...ds)['to'](this),this['errorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),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':[_0x40ae17,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['errorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems']&&!this['errorMessage'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'];}['_createSearchView'](){const _0x4cfcbf=new _0xc3c8d(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':y(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x303b23=>y(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x303b23),'secondary':y(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0x4cfcbf['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0x4cfcbf['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x1c62ae=>!_0x1c62ae)]}}),_0x4cfcbf;}['_createSkeletonView'](){const _0x209eaf=new _e(this['locale'],be['aiHistory']);return _0x209eaf['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x3dfc24=>!_0x3dfc24)]}}),_0x209eaf;}['_createErrorView'](){const _0x30333f=new _0x492b6b(this['locale']),_0x9b95af=new _0x21bd9e(this['locale']);return _0x9b95af['set']({'withText':!0x1,'icon':_0x2c2a0c,'class':'ck-ai-notification_error__dismiss-button'}),_0x9b95af['bind']('isVisible')['to'](this,'hasItems',_0x3ff758=>!!_0x3ff758),_0x9b95af['on']('execute',()=>{this['errorMessage']='';}),_0x30333f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x51f632=>!_0x51f632)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x9b95af]}),_0x30333f;}['_createEmptyStateView'](){const _0x55ce52=new _0x21bd9e(this['locale']);_0x55ce52['set']({'label':y(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x22fde5,'class':'ck-ai-chat__start-conversation'}),_0x55ce52['on']('execute',()=>{this['fire']('openChat');});const _0x50eecc=new _0x492b6b(this['locale']);return _0x50eecc['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x34f1e5=>!_0x34f1e5)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[y(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x55ce52]}),_0x50eecc;}['_createListItemViews'](_0xc57524,_0x425327){const _0x25a3b6=[];for(const _0x5edcbb of _0xc57524){const _0x40b530=new ls(_0x425327,_0x5edcbb);_0x40b530['delegate'](...ds)['to'](this),_0x25a3b6['push'](_0x40b530);}return _0x25a3b6;}['updateHistoryItemsWithCategories'](_0x318610){const _0x23e598=this['locale']||'en',_0x310caf=[];for(const _0x52ed5b of _0x318610){const _0x2af04a=this['_createListItemViews'](_0x52ed5b['items'],_0x23e598);_0x310caf['push'](new _s(_0x23e598,{'title':_0x52ed5b['title'],'items':_0x2af04a}));}this['sectionsView']['sections']=_0x310caf,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x310caf),this['hasItems']=_0x318610['some'](_0x5705f7=>_0x5705f7['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x2c45b3){for(const _0x14a09a of this['sectionsView']['sections']){const _0x4d3f55=_0x14a09a['getItem'](_0x2c45b3);if(_0x4d3f55){if(_0x14a09a['removeItem'](_0x4d3f55),0x0===_0x14a09a['itemsViews']['length']){const _0x5d76bd=this['sectionsView']['sections']['indexOf'](_0x14a09a);-0x1!==_0x5d76bd&&(this['sectionsView']['sections']['splice'](_0x5d76bd,0x1),this['sectionsView']['items']['remove'](_0x14a09a));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x12a0f9,_0x5f468e){for(const _0x326838 of this['sectionsView']['sections']){const _0x42b7ed=_0x326838['getItem'](_0x12a0f9);if(_0x42b7ed){_0x42b7ed['updateTitle'](_0x5f468e);break;}}}['updateItemLoadingState'](_0x42fd4c,_0x4a3002,_0xb1ac3e){for(const _0x24695b of this['sectionsView']['sections']){const _0x27cac7=_0x24695b['getItem'](_0x42fd4c);if(_0x27cac7){_0x27cac7['updateLoadingState'](_0x4a3002,_0xb1ac3e);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x53648f=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x53648f);}}}const ds=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class mt extends _0x4404b9{static get['requires'](){return[$];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x106ffe){super(_0x106ffe);const _0x1a9d04=this['context']['plugins']['get']('AITabs');this['_historyView']=new ut(this['context']['locale'],_0x1a9d04['showResizeButton']),this['_historyView']['delegate'](...ds)['to'](this),_0x1a9d04['view']['addTab']({'id':'history','buttonLabel':y(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':It,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x33710b){this['_historyView']['removeHistoryItem'](_0x33710b);}['updateItems'](_0x531391){this['_historyView']['updateHistoryItemsWithCategories'](_0x531391);}['updateItemTitle'](_0x3700a2,_0xa278af){this['_historyView']['updateItemTitle'](_0x3700a2,_0xa278af);}['updateItemLoadingState'](_0x3e0806,_0x2d577d,_0x2a3184){this['_historyView']['updateItemLoadingState'](_0x3e0806,_0x2d577d,_0x2a3184);}['setLoadingSkeleton'](_0x3ea17f){this['_historyView']['isLoading']=_0x3ea17f;}['showError'](_0x183e14){this['_historyView']['errorMessage']=_0x183e14;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x498a10){this['_historyView']['isMaximized']=_0x498a10;}}class De extends $t(){['id'];['createdAt'];constructor({id:_0xf66d8d,title:_0x3ed37a,createdAt:_0x222471,updatedAt:_0x66632a,pinned:_0x3b01ce}){super(),this['id']=_0xf66d8d,this['createdAt']=new Date(_0x222471),this['set']('title',_0x3ed37a),this['set']('updatedAt',_0x66632a?new Date(_0x66632a):null),this['set']('pinned',_0x3b01ce||!0x1);}['updateTitle'](_0x26bf58){this['set']('title',Zt(_0x26bf58)),this['updatedAt']=new Date();}['updatePinned'](_0x9f9d26){this['set']('pinned',_0x9f9d26),this['updatedAt']=new Date();}}class _t extends _0x3dcb71(){['items']=[];['connector'];['group'];constructor({connector:_0x2feb0c,group:_0x4b750b}){super(),this['connector']=_0x2feb0c,this['group']=_0x4b750b;}async['init'](){try{const _0x542968=this['connector']['fetchConversations'](this['group']),_0x5c3b9b=await _0x542968['getConversations']();this['loadItems'](_0x5c3b9b);}catch(_0x56c41a){this['fire']('error',{'error':_0x56c41a,'operation':'init'});}}['addItem'](_0x5d3bc8){this['items']['push'](_0x5d3bc8);}async['removeItem'](_0x2640bd){const _0x59f7a0=this['items']['findIndex'](_0x109f2a=>_0x109f2a['id']===_0x2640bd);if(-0x1===_0x59f7a0)return!0x1;try{return await this['connector']['deleteConversation'](_0x2640bd)['execute'](),this['items']['splice'](_0x59f7a0,0x1),this['fire']('itemRemoved',{'itemId':_0x2640bd}),!0x0;}catch(_0x233289){return this['fire']('error',{'error':_0x233289,'operation':'removeItem','itemId':_0x2640bd}),!0x1;}}['getItem'](_0x34e650){return this['items']['find'](_0x4dd919=>_0x4dd919['id']===_0x34e650);}async['updateItemTitle'](_0xaad91c,_0x592f51){const _0x3b7703=this['getItem'](_0xaad91c);if(!_0x3b7703)return!0x1;try{return await this['connector']['updateConversation'](_0xaad91c,{'title':_0x592f51})['getResult'](),_0x3b7703['updateTitle'](_0x592f51),this['fire']('itemUpdated',{'itemId':_0xaad91c,'updates':{'title':_0x592f51}}),!0x0;}catch(_0x1bd329){return this['fire']('error',{'error':_0x1bd329,'operation':'updateItemTitle','itemId':_0xaad91c}),!0x1;}}async['updateItemPinned'](_0x590d5f,_0x38096f){const _0x527cf2=this['getItem'](_0x590d5f);if(!_0x527cf2)return!0x1;try{return await this['connector']['updateConversation'](_0x590d5f,{'pinned':_0x38096f})['getResult'](),_0x527cf2['updatePinned'](_0x38096f),this['fire']('itemUpdated',{'itemId':_0x590d5f,'updates':{'pinned':_0x38096f}}),!0x0;}catch(_0x581c97){return this['fire']('error',{'error':_0x581c97,'operation':'updateItemPinned','itemId':_0x590d5f}),!0x1;}}['loadItems'](_0x298066){try{this['items']=[],_0x298066['map'](_0x18f919=>{this['addItem'](new De(_0x18f919));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x39afd4){this['fire']('error',{'error':_0x39afd4,'operation':'loadItems'});}}['getItems'](_0x30bd9e={}){const _0x7df63=void 0x0!==_0x30bd9e['pinned']&&_0x30bd9e['pinned'],_0x3515e7=_0x30bd9e['from']?new Date(_0x30bd9e['from']['getFullYear'](),_0x30bd9e['from']['getMonth'](),_0x30bd9e['from']['getDate']()):null,_0x5bf5f0=_0x30bd9e['to']?new Date(_0x30bd9e['to']['getFullYear'](),_0x30bd9e['to']['getMonth'](),_0x30bd9e['to']['getDate']()):null;return this['items']['filter'](_0x1e04f4=>{if(_0x1e04f4['pinned']!==_0x7df63)return!0x1;if(_0x5bf5f0){const _0x32ae49=new Date(_0x1e04f4['createdAt']['getFullYear'](),_0x1e04f4['createdAt']['getMonth'](),_0x1e04f4['createdAt']['getDate']());return _0x3515e7?_0x3515e7['getTime']()===_0x5bf5f0['getTime']()?_0x32ae49['getTime']()===_0x3515e7['getTime']():_0x32ae49<_0x5bf5f0&&_0x32ae49>=_0x3515e7:_0x32ae49<_0x5bf5f0;}return!0x0;});}}class ct extends _0x4404b9{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[s,q,mt,$];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](s),this['_aiChatHistoryUi']=this['context']['plugins']['get'](mt),this['_aiChatController']=this['context']['plugins']['get'](q);const _0x397210=this['context']['plugins']['get']($),_0x19cf44=this['_aiChatController']['getGroupId']();this['history']=new _t({'connector':this['_aiConnector'],'group':_0x19cf44}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x2da82d,_0x3351e6)=>{this['_setItemLoading'](_0x3351e6['id'],'remove'),this['_handleRemove'](_0x3351e6['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x216bb4,_0x25e777)=>{this['_setItemLoading'](_0x25e777['id'],'rename'),this['_handleEditTitle'](_0x25e777['id'],_0x25e777['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x3eab71,_0x491f7f)=>{void 0x0!==_0x491f7f['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x491f7f['itemId'],_0x491f7f['updates']['title']),void 0x0!==_0x491f7f['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x491f7f['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x23132f,_0x1d9b16)=>{this['_aiChatController']['handleRemovedConversation'](_0x1d9b16['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x1d9b16['itemId']),this['_clearItemLoading'](_0x1d9b16['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x399e7b,_0x124aa5)=>{this['_handleHistoryErrorUI'](_0x124aa5['error'],_0x124aa5['operation'],_0x124aa5['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x61db9b,_0x3d8cb2)=>{this['_handleSelectConversation'](_0x3d8cb2['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x39d9b3,_0x2b78fe)=>{const _0x31b679=_0x2b78fe['pinned']?'pin':'unpin';this['_setItemLoading'](_0x2b78fe['id'],_0x31b679),this['_handleTogglePin'](_0x2b78fe['id'],_0x2b78fe['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x397210['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x397210['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x397210,'resizedTabs',(_0x23b9c9,_0xffee09)=>{this['_setIsMaximized'](_0xffee09);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x397210['resize']();});}async['_handleEditTitle'](_0x18eaec,_0x3b7e0d){await this['history']['updateItemTitle'](_0x18eaec,_0x3b7e0d);}async['_handleTogglePin'](_0x19b7a5,_0x5cd86e){await this['history']['updateItemPinned'](_0x19b7a5,_0x5cd86e);}async['_handleRemove'](_0x49f062){await this['history']['removeItem'](_0x49f062);}async['_handleSelectConversation'](_0xfbd13){await this['_aiChatController']['loadConversation'](_0xfbd13);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x45c83c=this['_aiChatController']['activeConversation']?.['id'],_0x260468=this['_getCategorizedItems']()['map'](_0xa6b2ef=>({'title':_0xa6b2ef['title'],'items':_0xa6b2ef['items']['map'](_0x3fe992=>({'id':_0x3fe992['id'],'title':_0x3fe992['title']||y(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x3fe992['createdAt'])['toLocaleDateString'](),'active':_0x3fe992['id']===_0x45c83c,'pinned':_0x3fe992['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x260468);}['_setItemLoading'](_0x9c60ab,_0x3723ac){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x9c60ab,_0x3723ac,!0x0);}['_clearItemLoading'](_0x228626){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x228626,null,!0x1);}['_handleHistoryErrorUI'](_0x562bf7,_0x3e8453,_0x58e877){const _0x3aaf60=this['_generateErrorMessage'](_0x3e8453,_0x58e877);this['_aiChatHistoryUi']['showError'](_0x3aaf60),_0x58e877&&this['_clearItemLoading'](_0x58e877),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x485aba,_0x5b23b1){const _0x47c65a=_0x5b23b1?this['history']['getItem'](_0x5b23b1):null,_0x470fbf=_0x47c65a?.['title']||y(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x485aba){case'updateItemTitle':return y(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x470fbf);case'updateItemPinned':{const _0x3e36ca=y(this['context']['locale'],_0x47c65a?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return y(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x3e36ca,_0x470fbf]);}case'removeItem':return y(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x470fbf);case'init':case'loadItems':return y(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return y(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x4caa99=new Date(),_0x398888=new Date(_0x4caa99['getFullYear'](),_0x4caa99['getMonth'](),_0x4caa99['getDate']()),_0x16438f=new Date(_0x398888);_0x16438f['setDate'](_0x16438f['getDate']()-0x1);const _0x263299=new Date(_0x398888);_0x263299['setDate'](_0x263299['getDate']()-0xe);const _0x322b30=this['history']['getItems']({'pinned':!0x0}),_0x198ad5=this['history']['getItems']({'from':_0x398888,'to':_0x398888}),_0x58193f=this['history']['getItems']({'from':_0x16438f,'to':_0x16438f}),_0x3c6e86=this['history']['getItems']({'from':_0x263299,'to':_0x16438f}),_0x490244=this['history']['getItems']({'to':_0x263299}),_0x274ee8=[];return _0x322b30['length']>0x0&&_0x274ee8['push']({'title':y(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x322b30}),_0x198ad5['length']>0x0&&_0x274ee8['push']({'title':y(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x198ad5}),_0x58193f['length']>0x0&&_0x274ee8['push']({'title':y(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x58193f}),_0x3c6e86['length']>0x0&&_0x274ee8['push']({'title':y(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x3c6e86}),_0x490244['length']>0x0&&_0x274ee8['push']({'title':y(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x490244}),_0x274ee8;}['_setIsMaximized'](_0x3e6920){this['_aiChatHistoryUi']['setIsMaximized'](_0x3e6920);}}class V extends _0x4404b9{static get['requires'](){return[ct,mt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ga extends _0x4404b9{static get['requires'](){return[q,c,F,V];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3a8b11){super(_0x3a8b11),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](q)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](q)['startConversation']();}async['sendMessage']({message:_0xa6fd5a,quickActionData:_0x2cc2fc}){await this['context']['plugins']['get'](q)['sendMessage']({'message':_0xa6fd5a,'quickActionData':_0x2cc2fc});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](q)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](q)['focusPromptInput']();}}class co extends At{constructor(_0x419e56){super(_0x419e56);const _0x1893f6=_0x419e56['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x1893f6,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x3f7524=this['editor']['plugins']['get']('AITabs')['view'];_0x3f7524['isVisible']=!_0x3f7524['isVisible'];}}class bt extends _0x2a4cc7{static get['requires'](){return[$];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x28827b=this['editor'];_0x28827b['commands']['add']('toggleAi',new co(_0x28827b)),_0x28827b['ui']['componentFactory']['add']('toggleAi',()=>{const _0x200c15=this['_createAIUIButton'](_0x21bd9e);return _0x200c15['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x200c15;}),_0x28827b['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x15c960=this['_createAIUIButton'](_0x4f4ee6);return _0x15c960['set']({'role':'menuitemcheckbox'}),_0x15c960;});}['_createAIUIButton'](_0x3c3334){const _0x16df4e=this['editor'],_0x139326=_0x16df4e['commands']['get']('toggleAi'),_0x167dbb=new _0x3c3334(_0x16df4e['locale']);return _0x167dbb['set']({'label':y(_0x16df4e['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x5bf2c9,'isToggleable':!0x0}),_0x167dbb['bind']('isEnabled')['to'](_0x139326),_0x167dbb['bind']('isOn')['to'](_0x139326,'value',_0x228f37=>!!_0x228f37),this['listenTo'](_0x167dbb,'execute',()=>{_0x139326['execute']();}),_0x167dbb;}}class Ba extends _0x2a4cc7{static get['requires'](){return[bt,kt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Pt(_0x24ffcc){const {editor:_0x59a468,action:_0x5bf960,withText:_0x22e483=!0x1,withIcon:_0x39177b=!0x0,isInDropdown:_0x2afe60=!0x0,shouldPreventFocus:_0x1bb2e7=!0x1}=_0x24ffcc;return()=>{const _0x51cbc7=_0x59a468['locale'],_0x2383fe=new _0x21bd9e(_0x51cbc7),_0x27dedf=_0x2383fe['bindTemplate'];_0x2afe60&&_0x2383fe['extendTemplate']({'on':{'mouseenter':_0x27dedf['to'](()=>{_0x1bb2e7&&_0x1bb2e7()||_0x2383fe['focus']();})}});const _0x5d5fc5=_0x5bf960['icon']??_0x5bf960['parent']?.['icon'];return _0x2383fe['set']({'label':_0x5bf960['displayedPrompt'],'withText':_0x22e483,'role':'menuitem','icon':_0x39177b?_0x5d5fc5??_0x2e8536:void 0x0,'tooltip':!_0x22e483,'class':'ck-ai-quick-actions-button','isEnabled':_0x5bf960['isEnabled']}),_0x2383fe['on']('execute',()=>{_0x59a468['editing']['view']['focus'](),_0x59a468['commands']['execute']('aiQuickAction',_0x5bf960);}),_0x2383fe;};}class Ss extends _0x1bb418{['arrowView'];constructor(_0xb963d,_0x496d6d){super(_0xb963d,_0x496d6d);const _0x58c351=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',_0x284f5e=>String(_0x284f5e)),'data-cke-tooltip-disabled':_0x58c351['to']('isOn')},'on':{'mouseenter':_0x58c351['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x4c5be3=new _0x25e498();return _0x4c5be3['content']=_0x39e693,_0x4c5be3['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x4c5be3;}}class ys extends _0x24784f{['_allListItems'];['_allSearchableItems'];constructor(_0xa82bde,_0x1a71a5,_0x8d6a3e){super(_0xa82bde),this['_allListItems']=_0x1a71a5,this['_allSearchableItems']=_0x8d6a3e;}['filter'](_0x380794){if(!_0x380794)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x4e5d70=_0x380794['source']['toLowerCase']()['trim'](),_0x450ecb=this['_allSearchableItems']['filter'](_0x531be2=>(_0x531be2['groupLabel']?_0x531be2['label']+'\x20('+_0x531be2['groupLabel']+')':_0x531be2['label'])['toLowerCase']()['includes'](_0x4e5d70));return this['items']['clear'](),this['items']['addMany'](_0x450ecb['map'](_0x5cc809=>_0x5cc809['item'])),this['_highlightQuery'](_0x4e5d70,_0x450ecb),{'resultsCount':_0x450ecb['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x570932,_0x13c018){if(!_0x570932)return;const _0x7ad856=new RegExp(_0xfb43f9(_0x570932),'gi');_0x13c018['forEach'](_0x5790e9=>{_0x5790e9['highlightViews']&&_0x5790e9['highlightViews']['forEach'](_0x410261=>{'function'==typeof _0x410261['highlightText']&&_0x410261['highlightText'](_0x7ad856);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x3a66c4=>{_0x3a66c4['highlightViews']&&_0x3a66c4['highlightViews']['forEach'](_0x45c3e9=>{'function'==typeof _0x45c3e9['highlightText']&&_0x45c3e9['highlightText'](null);});});}}const Ts='menu',Rs='menuitem';class ao extends _0x492b6b{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x29b917,_0x52aa02,_0x2a407a,_0x2ec3ea,_0x5eadb1=!0x1){const _0x94ef87=_0x29b917['locale'];super(_0x94ef87),this['_bodyCollection']=_0x2ec3ea,this['_hasSearch']=_0x5eadb1;const _0x4360fc=this['_createListItems'](_0x29b917,_0x52aa02,_0x2a407a);this['optionsListView']=new ys(_0x94ef87,_0x4360fc,this['_allSearchableItems']),this['optionsListView']['role']=Ts,this['optionsListView']['items']['addMany'](_0x4360fc),this['focusTracker']=new Bt(),this['keystrokes']=new Wt(),_0x5eadb1&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x4360fc,this['focusCycler']=new Vt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x5eadb1&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x1ec83b=_0x5eadb1&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x2b3021(_0x1ec83b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x94ef87['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0xc3c8d(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':y(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':y(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x466d14=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x466d14);}['_createListItems'](_0x12824b,_0x22d10b,_0x244039){const _0x1f59fc=new _0x2b3021();return _0x22d10b['forEach'](_0x437462=>{if('actions'in _0x437462){const {listItem:_0x39f5df}=this['_createActionGroupButton'](_0x12824b,_0x437462,_0x244039);_0x1f59fc['add'](_0x39f5df),_0x437462['actions']['forEach'](_0x4dc5eb=>{this['_createActionButton'](_0x12824b,_0x4dc5eb,_0x437462['label'],_0x437462['icon']);const {listItem:_0xce6895,highlightViews:_0x255548}=this['_createSearchResultActionButton'](_0x12824b,_0x4dc5eb,_0x437462['label'],_0x437462['icon']);this['_allSearchableItems']['push']({'item':_0xce6895,'label':_0x4dc5eb['displayedPrompt'],'groupLabel':_0x437462['label'],'highlightViews':_0x255548});});}else{const {listItem:_0x4c0785}=this['_createActionButton'](_0x12824b,_0x437462);_0x1f59fc['add'](_0x4c0785);const _0x3cbe82=_0x4c0785['children']['first'];if(_0x3cbe82){const {listItem:_0x3cbf8c,highlightViews:_0x471393}=this['_createSearchResultActionButton'](_0x12824b,_0x437462);this['_allSearchableItems']['push']({'item':_0x3cbf8c,'label':_0x3cbe82['label']||'','highlightViews':_0x471393});}}}),_0x1f59fc;}['_createActionButton'](_0x13c166,_0x5b0f37,_0x2547f9,_0x29741b){const _0x183bc7=new _0x8a8c30(this['locale']);if(_0x2547f9&&_0x29741b){const _0x32215c=new _0x21bd9e(this['locale']),_0x14d23f=_0x32215c['bindTemplate'],_0x5ecf24=new _0x1f83e8();_0x5ecf24['text']=_0x5b0f37['displayedPrompt'];const _0x5d4e11=new _0x1f83e8();_0x5d4e11['text']=_0x2547f9;const _0x2bfb70=new _0x25e498();_0x2bfb70['content']=_0x29741b,_0x2bfb70['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0xb37c69=new _0x492b6b(this['locale']);_0xb37c69['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x29737e=new _0x492b6b(this['locale']);return _0x29737e['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x32215c['set']({'label':_0x5b0f37['displayedPrompt']+'\x20('+_0x2547f9+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x32215c['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':[_0x5ecf24,_0xb37c69,_0x2bfb70,_0x5d4e11,_0x29737e],'on':{'mouseenter':_0x14d23f['to'](()=>{this['_isSearchFocused']()||_0x32215c['focus']();}),'click':_0x14d23f['to'](()=>{_0x32215c['fire']('execute');})}}),_0x32215c['on']('execute',()=>{_0x13c166['editing']['view']['focus'](),_0x13c166['commands']['execute']('aiQuickAction',_0x5b0f37);}),_0x183bc7['children']['add'](_0x32215c),{'listItem':_0x183bc7,'highlightViews':[_0x5ecf24,_0x5d4e11]};}{const _0x2502fc=new _0x1c8ce8(),_0xc03044=new _0x21bd9e(this['locale'],_0x2502fc),_0x54194b=_0xc03044['bindTemplate'],_0x34341d=_0x5b0f37['icon']??_0x5b0f37['parent']?.['icon'],_0x49e416=void 0x0!==_0x5b0f37['icon'];return _0xc03044['set']({'label':_0x5b0f37['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x49e416?_0x34341d??_0x2e8536:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0xc03044['extendTemplate']({'on':{'mouseenter':_0x54194b['to'](()=>{this['_isSearchFocused']()||_0xc03044['focus']();})}}),_0xc03044['on']('execute',()=>{_0x13c166['editing']['view']['focus'](),_0x13c166['commands']['execute']('aiQuickAction',_0x5b0f37);}),_0x183bc7['children']['add'](_0xc03044),{'listItem':_0x183bc7,'highlightViews':[_0x2502fc]};}}['_createSearchResultActionButton'](_0xea41fc,_0x496a17,_0x100f91,_0x42b0ad){return _0x100f91&&_0x42b0ad?this['_createSearchResultGroupedActionButton'](_0xea41fc,_0x496a17,_0x100f91,_0x42b0ad):this['_createSearchResultIndividualActionButton'](_0xea41fc,_0x496a17);}['_createSearchResultGroupedActionButton'](_0x126127,_0x30b0ff,_0x1b5178,_0x46d0ef){const _0x4b4b04=new _0x8a8c30(this['locale']),_0x2be3dc=new _0x21bd9e(this['locale']),_0x248136=_0x2be3dc['bindTemplate'],{view:_0x5d3220,highlightView:_0x1a9271}=this['_createSearchResultGroupRow'](_0x1b5178,_0x46d0ef),{view:_0x4f80ec,highlightView:_0x8f5780}=this['_createSearchResultActionRow'](_0x30b0ff['displayedPrompt']),_0x5af8b4=this['_createSearchResultContentView'](_0x5d3220,_0x4f80ec);return _0x2be3dc['set']({'label':_0x30b0ff['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}),_0x2be3dc['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':[_0x5af8b4],'on':{'mouseenter':_0x248136['to'](()=>{this['_isSearchFocused']()||_0x2be3dc['focus']();}),'click':_0x248136['to'](()=>{this['_handleSearchResultButtonClick'](_0x2be3dc);})}}),this['_setupActionButtonExecution'](_0x2be3dc,_0x126127,_0x30b0ff),_0x4b4b04['children']['add'](_0x2be3dc),{'listItem':_0x4b4b04,'highlightViews':[_0x1a9271,_0x8f5780]};}['_createSearchResultIndividualActionButton'](_0x5e12b8,_0x52d9ce){const _0x2e1b81=new _0x8a8c30(this['locale']),_0x5a01df=new _0x1c8ce8(),_0x2be4a7=new _0x21bd9e(this['locale'],_0x5a01df),_0x2a731f=_0x2be4a7['bindTemplate'];return _0x2be4a7['set']({'label':_0x52d9ce['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x2be4a7['extendTemplate']({'on':{'mouseenter':_0x2a731f['to'](()=>{this['_isSearchFocused']()||_0x2be4a7['focus']();})}}),this['_setupActionButtonExecution'](_0x2be4a7,_0x5e12b8,_0x52d9ce),_0x2e1b81['children']['add'](_0x2be4a7),{'listItem':_0x2e1b81,'highlightViews':[_0x5a01df]};}['_createSearchResultGroupRow'](_0xe2515f,_0x2604fe){const _0x199228=new _0x492b6b(this['locale']),_0x293d2b=new _0x25e498();_0x293d2b['content']=_0x2604fe,_0x293d2b['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x24616e=new _0x1f83e8();return _0x24616e['text']=_0xe2515f,_0x199228['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x293d2b,_0x24616e]}),{'view':_0x199228,'highlightView':_0x24616e};}['_createSearchResultActionRow'](_0x145d5f){const _0x2a19c1=new _0x492b6b(this['locale']),_0xc8b80a=new _0x1f83e8();return _0xc8b80a['text']=_0x145d5f,_0x2a19c1['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0xc8b80a]}),{'view':_0x2a19c1,'highlightView':_0xc8b80a};}['_createSearchResultContentView'](_0x53433c,_0x189598){const _0x37b2b0=new _0x492b6b(this['locale']);return _0x37b2b0['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x53433c,_0x189598]}),_0x37b2b0;}['_setupActionButtonExecution'](_0x1a0020,_0x3774bb,_0x2dd6f9){_0x1a0020['on']('execute',()=>{_0x3774bb['editing']['view']['focus'](),_0x3774bb['commands']['execute']('aiQuickAction',_0x2dd6f9);});}['_createActionGroupButton'](_0x1be027,_0x3d9e89,_0x42666a){const _0x41cd88=new _0x8a8c30(this['locale']),_0x225b8a=new _0x1c8ce8(),_0x567a36=new Ss(this['locale'],_0x225b8a),_0x471eb9=_0x567a36['bindTemplate'],_0x5bf88b=this['_getPanelKeystroke'](_0x42666a),_0x1225a6=this['_createGroupActionsList'](_0x1be027,_0x3d9e89['actions'],_0x42666a);_0x567a36['set']({'label':_0x3d9e89['label'],'withText':!0x0,'role':Rs,'icon':_0x3d9e89['icon']??_0x2e8536,'isEnabled':_0x3d9e89['actions']['some'](_0x589ea5=>_0x589ea5['isEnabled'])}),_0x567a36['extendTemplate']({'on':{'mouseenter':_0x471eb9['to'](()=>{this['_isSearchFocused']()||_0x567a36['focus']();})}});const _0xddf4c=new _0x257cec(this['locale']);return _0xddf4c['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x471eb9['to'](_0x2f5450=>{this['_handlePanelKeydown'](_0x2f5450,_0x5bf88b,_0x567a36,_0xddf4c);})}}),_0x567a36['bind']('isOn')['to'](_0xddf4c,'isVisible'),this['_bodyCollection']['add'](_0xddf4c),_0xddf4c['content']['add'](_0x1225a6),this['_setupGroupMenuBehavior'](_0x567a36,_0xddf4c),_0x41cd88['children']['add'](_0x567a36),{'listItem':_0x41cd88,'highlightView':_0x225b8a};}['_createGroupActionsList'](_0x3aa3a3,_0x4eacd9,_0x5156c9){const _0x3ab81c=new _0x24784f(this['locale']);return _0x3ab81c['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x4eacd9['forEach'](_0x488b55=>{const _0x3e7694=new _0x8a8c30(this['locale']),_0x281245=Pt({'editor':_0x3aa3a3,'action':_0x488b55,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x3e7694['children']['add'](_0x281245),_0x5156c9['focusTracker']['add'](_0x281245),_0x3ab81c['items']['add'](_0x3e7694);}),_0x3ab81c;}['_setupGroupMenuBehavior'](_0x72897d,_0x422b91){const _0x133b0f=_0x72897d['bindTemplate'],_0x174351=this['_getButtonKeystroke'](_0x72897d);_0x72897d['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x133b0f['to'](()=>{this['_showNestedPanel'](_0x422b91,_0x72897d);}),'mouseleave':_0x133b0f['to'](_0xfce333=>{const _0x886b31=_0xfce333['relatedTarget'];this['_isMovingToNestedMenu'](_0x886b31,_0x422b91)||this['_hideNestedPanel'](_0x422b91);}),'keydown':_0x133b0f['to'](_0x2d88e3=>{_0x2d88e3['key']==_0x174351&&(this['_showNestedPanel'](_0x422b91,_0x72897d),_0x422b91['content']['get'](0x0)['focus']());})}}),_0x422b91['on']('render',()=>{_0x422b91['element']?.['addEventListener']('mouseleave',_0xcbe7ef=>{const _0x5873ac=_0xcbe7ef['relatedTarget'];_0x72897d['element']?.['contains'](_0x5873ac)||this['_isMovingToNestedMenu'](_0x5873ac,_0x422b91)||this['_hideNestedPanel'](_0x422b91);});});}['_showNestedPanel'](_0x3be0f6,_0x1be810){this['_openNestedPanels']['forEach'](_0x2b733f=>{_0x2b733f!==_0x3be0f6&&_0x2b733f['isVisible']&&_0x2b733f['hide']();}),_0x3be0f6['show'](),_0x3be0f6['pin']({'positions':[_0x3f95b9['eastSouth']],'target':_0x1be810['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x3be0f6);}['_hideNestedPanel'](_0x5a3aac){_0x5a3aac['hide'](),this['_openNestedPanels']['delete'](_0x5a3aac);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x1823a0=>_0x1823a0['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x2cfc4d,_0x192398){if(!_0x2cfc4d)return!0x1;if(_0x192398['element']?.['contains'](_0x2cfc4d))return!0x0;const _0x24788f=_0x2cfc4d;return _0x24788f['closest']&&(null!==_0x24788f['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x24788f['closest']('.ck-ai-quick-actions-group-list')||null!==_0x24788f['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'](_0xb5b093){return'rtl'===_0xb5b093['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x980caf){return'rtl'===_0x980caf['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x246ef7,_0xaf50b7,_0x39c933,_0x1fd313){_0x246ef7['key']==_0xaf50b7&&(_0x39c933['focus'](),this['_hideNestedPanel'](_0x1fd313));}['_handleSearchResultButtonClick'](_0x1126e1){_0x1126e1['fire']('execute');}}function Ut(_0x25252c){const {editor:_0x5aea41,content:_0x58dd57,buttonDefinition:_0x164701,bodyCollection:_0x1e3518,hasSearch:_0x48f0b4=!0x1}=_0x25252c;return()=>{const _0x47dd53=_0x5aea41['locale'],_0x4e8227=_0x35c3bd(_0x47dd53);_0x4e8227['buttonView']['set']({'icon':_0x164701['icon']??_0x2e8536,'label':_0x164701['label'],'tooltip':!0x0}),_0x4e8227['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x22fc81=new ao(_0x5aea41,_0x58dd57,_0x4e8227,_0x1e3518,_0x48f0b4);if(_0x4e8227['panelView']['children']['add'](_0x22fc81),_0x48f0b4){const _0x17d7ef='ai-quick-actions-dropdown-selection';_0x4e8227['on']('change:isOpen',(_0x92f098,_0x3e5e0d,_0x35be8b)=>{if(_0x35be8b){if(_0x5aea41['plugins']['has']('AIEditing')){const _0x531592=_0x5aea41['plugins']['get'](c),_0x377f3e=_0x5aea41['model']['document']['selection'],_0x5bb0a1=Array['from'](_0x377f3e['getRanges']());_0x5bb0a1['length']>0x0&&_0x531592['showFakeVisualSelection'](_0x5bb0a1,_0x17d7ef,!0x1,!0x0);}}else _0x5aea41['plugins']['has']('AIEditing')&&_0x5aea41['plugins']['get'](c)['hideFakeVisualSelection'](_0x17d7ef),_0x22fc81['resetSearch']();});}return _0x4e8227;};}const Lt='<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>',Dt='<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>',Ht='<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 Nt=function(_0x18c4e2){return _0x18c4e2['CHAT']='CHAT',_0x18c4e2['ACTION']='ACTION',_0x18c4e2['REVIEW']='REVIEW',_0x18c4e2;}({}),Ka=function(_0x588cad){return _0x588cad['CHAT']='AIChat',_0x588cad['ACTION']='AIActions',_0x588cad['REVIEW']='AIReviewMode',_0x588cad;}({});class gi extends _0x2a4cc7{static get['requires'](){return[Rt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x13979f=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x13979f),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x31a452){return function(_0x118573){const _0xed06a1=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x118573['uiLanguage']),_0x2e8a61=_0xed06a1||'English',_0x29b14f=[{'id':'ask-ai','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Qt},{'id':'chat-commands','label':y(_0x118573,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Qt,'actions':[{'id':'explain','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Lt['replace']('%0',_0x2e8a61),'type':'CHAT'},{'id':'summarize','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Dt['replace']('%0',_0x2e8a61),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Ht['replace']('%0',_0x2e8a61),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Ot},{'id':'continue','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':St},{'id':'fix-grammar','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':xt},{'id':'adjust-length','label':y(_0x118573,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':yt,'actions':[{'id':'make-shorter','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':y(_0x118573,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Tt,'actions':[{'id':'make-tone-casual','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':vt,'actions':[{'id':'translate-to-english','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':y(_0x118573,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':y(_0x118573,'AI_QUICK_ACTIONS_OTHER'),'icon':Et,'actions':[]}];return _0x29b14f;}(_0x31a452);}async['_getDefaultAndCustomActions'](){const _0x5b59cf=gi['getDefaultQuickActions'](this['editor']['locale']),_0x230f83=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x2441c3=[];try{_0x2441c3=await new Mt({'connector':this['editor']['plugins']['get']('AIConnector'),'availableModels':this['editor']['config']['get']('ai.chat.models.displayedModels')})['getAvailableModels']();}catch(_0x176f1f){const _0x51bcde=new _0x19ee7d('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x176f1f});_0x543541(_0x51bcde['message']);}finally{const _0x448d35=_0x230f83['map'](_0x8fee36=>({..._0x8fee36,'icon':void 0x0}));_0x5b59cf['find'](_0x190376=>'other'===_0x190376['id'])['actions']['push'](..._0x448d35),_0x5b59cf['forEach'](_0x3cf452=>{if('actions'in _0x3cf452)_0x3cf452['actions']['forEach'](_0x1c9dcd=>{if(_0x1c9dcd['isEnabled']=!!_0x2441c3['find'](_0x5d5dbc=>_0x5d5dbc['id']===_0x1c9dcd['model'])||void 0x0===_0x1c9dcd['model'],!_0x1c9dcd['isEnabled']){const _0x41fe29=new _0x19ee7d('ai-quick-actions-unavailable-model',this,{'actionId':_0x1c9dcd['id'],'modelId':_0x1c9dcd['model']});_0x543541(_0x41fe29['message']);}});else{if(_0x3cf452['isEnabled']=!!_0x2441c3['find'](_0x4a725e=>_0x4a725e['id']===_0x3cf452['model'])||void 0x0===_0x3cf452['model'],!_0x3cf452['isEnabled']){const _0x165f26=new _0x19ee7d('ai-quick-actions-unavailable-model',this,{'actionId':_0x3cf452['id'],'modelId':_0x3cf452['model']});_0x543541(_0x165f26['message']);}}});}return _0x5b59cf;}['_initializeQuickActionsComponentsAndCommands'](){const _0xede036=new Kt(this['editor']['locale']);_0xede036['attachToDom'](),this['_initializeQuickActionsDropdown'](_0xede036),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0xede036);}['_initializeQuickActionsDropdown'](_0x272e80){const _0x54ab8b=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Ut({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x2e8536,'label':y(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x272e80,'hasSearch':_0x54ab8b}));}['_prepareQuickActionsDefinition'](_0x294225){this['_quickActionsDefinition']=_0x294225['map'](_0x48a1b3=>{if('actions'in _0x48a1b3){const _0x4f57e1=_0x48a1b3;return{..._0x4f57e1,'actions':_0x4f57e1['actions']['map'](_0x3dffe7=>{const {actions:_0xb85a02,..._0x5f4561}=_0x4f57e1;return{..._0x3dffe7,'parent':_0x5f4561};})['filter'](_0xac5a91=>this['_shouldIncludeAction'](_0xac5a91))};}return _0x48a1b3;})['filter'](_0x584f6e=>'actions'in _0x584f6e?_0x584f6e['actions']['length']>0x0:this['_shouldIncludeAction'](_0x584f6e));}['_shouldIncludeAction'](_0x210634){const _0x48ca7b=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ka[_0x210634['type']])&&!_0x48ca7b['includes'](_0x210634['id']);}['_initializeQuickActionsComponents'](_0x42e16f){this['_quickActionsDefinition']['forEach'](_0x5c47b2=>{if('actions'in _0x5c47b2){const _0x10cfb8=Ut({'editor':this['editor'],'content':_0x5c47b2['actions'],'buttonDefinition':_0x5c47b2,'bodyCollection':_0x42e16f});this['editor']['ui']['componentFactory']['add'](_0x5c47b2['id'],_0x10cfb8),_0x5c47b2['actions']['forEach'](_0x81a6c8=>{const _0x368555=Pt({'editor':this['editor'],'action':_0x81a6c8});this['editor']['ui']['componentFactory']['add'](_0x81a6c8['id'],_0x368555);});}else{const _0x4733b0=Pt({'editor':this['editor'],'action':_0x5c47b2,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x5c47b2['id'],_0x4733b0);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x75e355=>{const _0x41b11c=new _0xc03205(_0x75e355),_0x171470=y(_0x75e355,'AI_QUICK_ACTIONS_HEADING');_0x41b11c['buttonView']['set']({'label':_0x171470,'icon':_0x2e8536});const _0xd4aa3=new _0x1c5a64(_0x75e355);_0xd4aa3['set']({'ariaLabel':_0x171470,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x54ca23=>{if('actions'in _0x54ca23){const _0x118eb6=_0x54ca23,_0xf5aace=new _0x4b1a57(_0x75e355,_0x41b11c),_0xa8efee=new _0xc03205(_0x75e355),_0x49d75a=new _0x1c5a64(_0x75e355);_0xa8efee['buttonView']['set']({'label':_0x118eb6['label'],'icon':_0x118eb6['icon']}),_0x118eb6['actions']['forEach'](_0x356b39=>{const _0x3a5dc1=new _0x4b1a57(_0x75e355,_0xa8efee),_0x6ff6d9=new _0x4f4ee6(_0x75e355);_0x6ff6d9['set']({'label':_0x356b39['displayedPrompt'],'icon':_0x356b39['icon'],'role':'menuitem','isEnabled':_0x356b39['isEnabled']}),_0x6ff6d9['on']('execute',()=>{this['_executeQuickAction'](_0x356b39);}),_0x6ff6d9['delegate']('execute')['to'](_0xa8efee),_0x3a5dc1['children']['add'](_0x6ff6d9),_0x49d75a['items']['add'](_0x3a5dc1);}),_0xa8efee['panelView']['children']['add'](_0x49d75a),_0xf5aace['children']['add'](_0xa8efee),_0xd4aa3['items']['add'](_0xf5aace);}else{const _0x237447=_0x54ca23,_0x401096=new _0x4b1a57(_0x75e355,_0x41b11c),_0x5028fa=new _0x4f4ee6(_0x75e355);_0x5028fa['set']({'label':_0x237447['displayedPrompt'],'icon':_0x237447['icon'],'role':'menuitem','isEnabled':_0x237447['isEnabled']}),_0x5028fa['on']('execute',()=>{this['_executeQuickAction'](_0x237447);}),_0x5028fa['delegate']('execute')['to'](_0x41b11c),_0x401096['children']['add'](_0x5028fa),_0xd4aa3['items']['add'](_0x401096);}});const _0xf71241=Object['values'](Ka)['some'](_0x4ceaad=>this['editor']['plugins']['has'](_0x4ceaad));return _0x41b11c['set']({'isEnabled':_0xf71241}),_0x41b11c['panelView']['children']['add'](_0xd4aa3),_0x41b11c;});}['_executeQuickAction'](_0xd95f14){const _0x51615f=this['editor'];_0x51615f['editing']['view']['focus'](),_0x51615f['commands']['execute']('aiQuickAction',_0xd95f14);const _0x18679c=_0x51615f['ui']['view']['menuBarView'];_0x18679c&&_0x18679c['close']&&_0x18679c['close']();}}class Ii extends At{['execute'](_0xd7750f){switch(this['_expandSelectionIfCollapsed'](),_0xd7750f['type']){case Nt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x158aaf=y(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x19ee7d('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x158aaf});}this['_handleAIChatAction'](_0xd7750f);break;case Nt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x2dc3f6=y(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x19ee7d('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x2dc3f6});}this['_handleAIActionsAction'](_0xd7750f);break;case Nt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x2e5f7c=y(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x19ee7d('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x2e5f7c});}this['_handleAIReviewAction'](_0xd7750f);}}async['_handleAIChatAction'](_0x1a5cb2){const _0x5d6080=this['editor']['plugins']['get']('AIChat'),_0x537af5=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x1a5cb2['id'])_0x537af5['removeSelectionFromChatContext'](),await _0x5d6080['addSelectionToChatContext'](),_0x5d6080['focusPromptInput']();else await _0x5d6080['startConversation'](),_0x537af5['removeSelectionFromChatContext'](),await _0x5d6080['addSelectionToChatContext'](),_0x5d6080['focusPromptInput'](),await _0x5d6080['sendMessage']({'message':_0x1a5cb2['prompt']||_0x1a5cb2['displayedPrompt'],'quickActionData':{'id':_0x1a5cb2['id'],'displayedPrompt':_0x1a5cb2['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x1f7c4f=this['editor'],_0x44f153=_0x1f7c4f['model']['document']['selection'];if(!_0x44f153['isCollapsed'])return;const _0x1c17e0=_0x4e3c0f(_0x44f153['getSelectedBlocks']())||_0x1f7c4f['model']['schema']['getLimitElement'](_0x44f153);_0x1f7c4f['model']['change'](_0x1dac7a=>{_0x1dac7a['setSelection'](_0x1c17e0,'in');});}['_handleAIActionsActionLabel'](_0x54235b){return _0x54235b['parent']?.['label']&&'other'!==_0x54235b['parent']?.['id']?_0x54235b['parent']['label']+':\x20'+_0x54235b['displayedPrompt']:_0x54235b['displayedPrompt'];}async['_handleAIActionsAction'](_0x4a5d9b){const _0x36c6a7=this['editor']['plugins']['get']('AIActions'),_0x286bb3=_0x4a5d9b['prompt']?{'userMessage':_0x4a5d9b['prompt'],'model':_0x4a5d9b['model']}:{'actionName':_0x4a5d9b['actionName']||_0x4a5d9b['id'],'args':_0x4a5d9b['args']},_0x3d4cb6=this['_handleAIActionsActionLabel'](_0x4a5d9b);await _0x36c6a7['executeAction'](_0x286bb3,_0x3d4cb6,_0x4a5d9b['icon']);}async['_handleAIReviewAction'](_0x199acb){console['log']('handleAIReviewAction',_0x199acb);}}class ki extends _0x2a4cc7{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x39704a=this['editor'],_0x2ffa73=new Ii(this['editor']);if(_0x39704a['commands']['add']('aiQuickAction',_0x2ffa73),_0x39704a['plugins']['has']('AIChat')){const _0x46a783=this['editor']['plugins']['get']('AIChat');_0x39704a['model']['document']['selection']['on']('change:range',(_0x41131c,_0x15e8b3)=>{_0x15e8b3['directChange']&&_0x46a783['removeSelectionFromChatContext']();});}}}class zt extends pe{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0xc84277=this['documentContextContent']['children']['map'](_0x4447d0=>({'node':_0x4447d0,'id':K(_0x4447d0,'data-id')})),_0x5621c9=this['parsedMergedContent']['children']['map'](_0x4653ab=>({'node':_0x4653ab,'id':K(_0x4653ab,'data-id')||_0x3bb1ce()})),_0x126175=_0x26ee2a(_0xc84277,_0x5621c9,{'comparator':(_0x25e74b,_0x1945a3)=>_0x25e74b['id']==_0x1945a3['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x126175['length']&&_0x126175[_0x126175['length']-0x1]['removed'];)_0x126175['pop']();}const _0x2a7191=_0x126175['map'](_0x1267fc=>{const _0x1d6ca4=_0x1267fc['added']?'new':_0x1267fc['removed']?'removed':'modified';return{'node':_0x1267fc['value'][0x0]['node'],'type':_0x1d6ca4,'id':_0x1267fc['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x2a7191,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x551e4c,_0x4b9732){return _0x4b9732;}}class l extends jt{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x2228d2){super(_0x2228d2),this['content']=_0x2228d2['content'],this['version']=_0x2228d2['version'],this['actionName']=_0x2228d2['actionName'],this['args']=_0x2228d2['args'],this['userMessage']=_0x2228d2['userMessage'],this['model']=_0x2228d2['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':Ft['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x551756){const _0xa28130=new zt({'editor':this['editor'],'documentContextContent':this['content'],..._0x551756});return this['replies']['push'](_0xa28130),_0xa28130['delegate'](...qt)['to'](this),this['fire']('replyCreated',_0xa28130),_0xa28130;}}class ji extends _0x2a4cc7{static get['requires'](){return[s,_0x43b27c,c,w,_0x1f61c4];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x2b3021();['_navigationPreviousButton'];['_navigationCounter'];['_isNavigationCounterInView']=!0x1;['_navigationNextButton'];['_isNavigationPreviousButtonInView']=!0x1;['_isNavigationNextButtonInView']=!0x1;['_promiseQueue'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}constructor(_0x6a0249){super(_0x6a0249),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new _(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x4da1df,_0x490756,_0xd9f14f){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x39c505,anchorData:_0x3f0b4a}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x4da1df,_0x39c505,_0x3f0b4a,_0x490756,_0xd9f14f);}}const {modelFragment:_0x2b13cb,anchorData:_0x4c0f45}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x4da1df,_0x2b13cb,_0x4c0f45,_0x490756,_0xd9f14f);}['_getExecuteDataRegular'](){const _0x486d79=this['editor']['model']['document']['selection'];if(_0x486d79['isCollapsed']){const _0x8faf0b=_0x4e3c0f(_0x486d79['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x486d79);this['editor']['model']['change'](_0xda9a78=>{_0xda9a78['setSelection'](_0x8faf0b,'in');});}const _0x558efc=_0x486d79['getFirstRange'](),_0x27419d=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x486d79),_0x558efc['start'],_0x558efc['end']),_0x3b65c5=_0x486d79['getFirstRange']()['start'],_0xc74ef5=new Map();let _0x3bbacf=_0x27419d;for(let _0x4fa76e=0x0;_0x4fa76e<_0x3b65c5['path']['length'];_0x4fa76e++)_0xc74ef5['set'](_0x3bbacf,_0x3b65c5['path'][_0x4fa76e]),_0x3bbacf=_0x3bbacf['getChild'](0x0);return{'modelFragment':_0x27419d,'anchorData':_0xc74ef5};}['_getExecuteDataInTable'](){const _0x4705d6=this['editor']['model']['document']['selection'],_0x537156=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x4af8eb=_0x4705d6['getFirstRange']()['start']['parent']['parent'],_0x470479=this['_wrapWithCommonAncestors'](_0x537156,this['editor']['model']['createPositionBefore'](_0x4af8eb),this['editor']['model']['createPositionAfter'](_0x4af8eb)),_0x316a13=_0x4705d6['getFirstRange']()['start'],_0x1449e5=new Map();let _0x56304b=_0x470479;for(let _0x25ecf1=0x0;_0x25ecf1<_0x316a13['path']['length'];_0x25ecf1++)if(_0x1449e5['set'](_0x56304b,_0x316a13['path'][_0x25ecf1]),_0x25ecf1<_0x316a13['path']['length']-0x1)_0x56304b=_0x56304b['getChild'](0x0);else{let _0x2d0286=_0x56304b['nextSibling'];for(;_0x2d0286;)_0x1449e5['set'](_0x2d0286,_0x316a13['path'][_0x25ecf1]),_0x2d0286=_0x2d0286['nextSibling'];}return{'modelFragment':_0x470479,'anchorData':_0x1449e5};}['_executeAction'](_0xa03494,_0x36a47a,_0x194111,_0x30d8f8,_0x1257aa){const _0x4bca4f=this['editor']['plugins']['get'](c),_0x12014d=this['editor']['plugins']['get'](w),_0x51610f=this['editor']['model']['document']['selection'],_0xf28e81=_0x4bca4f['modelToViewWithIds'](_0x36a47a),_0x3646c9=this['editor']['data']['processor']['toData'](_0xf28e81),_0x1f6724=this['editor']['model']['document']['version'],_0x4752be=[..._0x51610f['getRanges']()];let _0x5d7c0a=this['editor']['config']['get']('ai.availableReplyActions')||[...k];this['editor']['plugins']['has']('TrackChanges')||(_0x5d7c0a=_0x5d7c0a['filter'](_0x379806=>'insertSuggestion'!=_0x379806));const _0x3d1c30=new e(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0,'availableActions':_0x5d7c0a});return _0x12014d['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x30d8f8,'icon':_0x1257aa||_0x2e8536,'mainView':_0x3d1c30,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':this['editor']['plugins']['has']('TrackChanges'),'ranges':_0x4752be}),this['_setLoadingState'](_0x3d1c30,_0x12014d),this['listenTo'](_0x12014d,'applySuggestion',()=>{this['_applyChanges'](_0x36a47a,_0x194111,!0x1);}),this['listenTo'](_0x12014d,'insertSuggestion',()=>{this['_applyChanges'](_0x36a47a,_0x194111,!0x0);}),this['listenTo'](_0x12014d,'selectionRemoved',()=>{this['_stopInteraction'](),this['_disableCustomViews']();}),this['listenTo'](_0x12014d,'dialogClosed',()=>{if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x33a7fc=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x463282=_0x33a7fc['changeGroups'][0x0];_0x463282&&'pending'===_0x463282['state']&&_0x33a7fc['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x12014d);}),this['_createInteraction'](_0x3646c9,_0x1f6724,_0x3d1c30,_0x12014d,_0xa03494);}['_wrapWithCommonAncestors'](_0x22e717,_0x6beec9,_0x1e7b0b){const _0x374f41=this['editor']['model']['createRange'](_0x6beec9,_0x1e7b0b)['getCommonAncestor'](),_0x13a5cf=_0x374f41['is']('documentFragment')?[]:_0x374f41['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x13a5cf['length']){const _0x2decc2=_0x13a5cf['map'](_0x4a131b=>_0x4a131b['_clone'](!0x1));for(let _0x58cb53=0x1;_0x58cb53<_0x2decc2['length'];_0x58cb53++)_0x2decc2[_0x58cb53-0x1]['_appendChild'](_0x2decc2[_0x58cb53]);return _0x2decc2[_0x2decc2['length']-0x1]['_appendChild'](_0x22e717),new _0x246996(_0x2decc2[0x0]);}return _0x22e717;}async['_createInteraction'](_0x3ebfc4,_0x3d0cae,_0x3f0880,_0x158acc,_0x5b53e8){const _0x3000f4=this['editor'];this['_interactionParams']={'action':_0x5b53e8,'content':_0x3ebfc4,'version':_0x3d0cae,'mainView':_0x3f0880,'aiBalloon':_0x158acc};const _0x32114d=new l({'connector':this['_aiConnector'],'editor':_0x3000f4,'content':_0x3ebfc4,'version':_0x3d0cae,..._0x5b53e8});this['_interactions']['push'](_0x32114d),_0x3f0880['hideError']();const _0x251ae0=(_0xe5791f,_0x143b18,_0x133ab4=!0x1,_0x119916='streaming')=>this['_promiseQueue']['enqueue'](async _0x495f85=>{try{const _0x272246=C({'editor':_0x3000f4,'changeGroups':_0xe5791f['changeGroups'],'documentContextContent':_0xe5791f['documentContextContent'],'showDiff':_0x133ab4,'trimUnchanged':!0x1});await _0x143b18['updateContent']({'parts':_0x272246,'renderingStrategy':_0x119916,'abortSignal':_0x495f85});}catch(_0x40f7f5){if(this['_isAbortError'](_0x40f7f5))return;throw _0x40f7f5;}});this['_interaction']['on']('replyCreated',(_0x4fe03c,_0x14898f)=>{_0x3f0880['hideLoader'](),_0x158acc['startAutoScroll'](),_0x251ae0(_0x14898f,_0x3f0880)['catch'](_0x1d9441=>{this['_isAbortError'](_0x1d9441)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x1d9441),this['_setErrorState'](_0x32114d,_0x3f0880));});}),this['_interaction']['on']('replyContentUpdated',(_0x52e101,_0x463038)=>{_0x251ae0(_0x463038,_0x3f0880)['catch'](_0x361e8a=>{this['_isAbortError'](_0x361e8a)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x361e8a),this['_setErrorState'](_0x32114d,_0x3f0880));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x3f0880,_0x158acc),this['_updateNavigationUI'](),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x31aa9d){this['_isAbortError'](_0x31aa9d)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x31aa9d),this['_setErrorState'](_0x32114d,_0x3f0880));}finally{_0x158acc['stopAutoScroll']();}}),this['listenTo'](_0x3f0880,'toggleSuggestionDisplayMode',async(_0x1afff5,{showDiff:_0x4709d4})=>{try{this['_balloonShowDiff']=_0x4709d4;const _0x4675f9=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x4675f9&&await _0x251ae0(_0x4675f9,_0x3f0880,_0x4709d4,'static');}catch(_0x395a77){this['_isAbortError'](_0x395a77)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x395a77),this['_setErrorState'](_0x32114d,_0x3f0880));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x4bb128,{reply:_0x2fe850})=>{const _0x5487fa={'positiveCount':_0x2fe850['changeGroups']['filter'](_0x2c4961=>'accepted'===_0x2c4961['state'])['length'],'totalCount':_0x2fe850['changeGroups']['length']},_0x307d4a=this['_interaction']['actionCallId'],_0x276a99=this['_interaction']['actionName'];_0x276a99?this['_aiConnector']['upsertAIActionRating'](_0x276a99,_0x307d4a,_0x5487fa):this['_aiConnector']['upsertCustomAIActionRating'](_0x307d4a,_0x5487fa);}),this['_setLoadingState'](_0x3f0880,_0x158acc);try{const _0x1c3523=await this['_interaction']['start']();return this['_updateNavigationUI'](),_0x1c3523;}catch(_0x24d3b5){if(this['_isAbortError'](_0x24d3b5))return;_0x3f0880['hideLoader'](),this['_setErrorState'](_0x32114d,_0x3f0880);}}['_applyChanges'](_0xd50c05,_0x4f6c6e,_0x51f31b){const _0x47d577=this['editor'];if(_0x51f31b&&!_0x47d577['plugins']['has']('TrackChanges'))throw new _0x19ee7d('ai-no-track-changes',null);const _0x4bfb39=this['editor']['plugins']['get'](_0x1f61c4),_0xbb8c3=this['_interaction'],_0x4a5657=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x49d146=_0x4a5657['changeGroups'];_0x4a5657['setChangeGroupState'](0x0,'accepted');let _0x10cb57=v({'editor':_0x47d577,'reply':_0x4a5657,'interaction':_0xbb8c3,'groups':_0x49d146,'transform':!0x1,'documentCompare':_0x4bfb39,'documentCompareOptions':{'anchor':_0x47d577['model']['createPositionAt'](_0xd50c05,0x0),'markDeletions':_0x51f31b}});_0x10cb57=this['_filterOperationsOutsideRange'](_0x10cb57,_0x4f6c6e);for(const _0x4b4849 of _0x10cb57)this['_anchorOperation'](_0x4f6c6e,_0x4b4849,_0x47d577['model']['document']['getRoot']());const _0x72c723=_0xbb8c3['getDocumentContext']()['version'],_0x7a32af=_0x47d577['model']['document']['history']['getOperations'](_0x72c723),_0x4d68a3={'document':_0x47d577['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x13eb0c=_0x39cd19(_0x10cb57,_0x7a32af,_0x4d68a3)['operationsA'];_0x47d577['model']['change'](_0x31fce5=>{if(_0x31fce5['setSelection'](_0x47d577['model']['document']['selection']['focus']),_0x51f31b)_0x47d577['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x13eb0c);else{for(const _0x59c530 of _0x13eb0c)_0x59c530['baseVersion']=_0x47d577['model']['document']['version'],b(_0x47d577,_0x59c530),_0x31fce5['batch']['addOperation'](_0x59c530),_0x47d577['model']['applyOperation'](_0x59c530);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x125c76,_0x22fbc3){return _0x125c76['filter'](_0x24dcaf=>{if('rename'==_0x24dcaf['type']){const _0xc1a4db=_0x24dcaf['position']['nodeAfter'];return!_0x22fbc3['has'](_0xc1a4db);}if(_0x24dcaf['type']['indexOf']('Attribute')>-0x1){const _0x2b9082=_0x24dcaf['range']['start']['nodeAfter'];return!_0x22fbc3['has'](_0x2b9082);}return!0x0;});}['_anchorOperation'](_0x141145,_0xc4ff74,_0x319c21){const _0x1e1244=_0xc4ff74['clone']();for(const _0x3ec564 in _0xc4ff74){const _0x49258d=_0xc4ff74[_0x3ec564];_0x49258d instanceof _0x184fda?_0xc4ff74[_0x3ec564]=new _0x184fda(_0x32bf2e(_0x49258d['start']),_0x32bf2e(_0x49258d['end'])):_0x49258d instanceof _0x5a23f1&&(_0xc4ff74[_0x3ec564]=_0x32bf2e(_0x49258d));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x1e1244['type'])){if(_0x1e1244['isDocumentOperation']=!0x1,_0x1e1244['baseVersion']=null,'remove'==_0x1e1244['type']){const _0x38a4b6=_0x1e1244['sourcePosition'],_0x2e132f=_0x1e1244['howMany'];new _0x253f92(_0x38a4b6,_0x2e132f)['_execute']();}else _0x1e1244['_execute']();}function _0x32bf2e(_0x51ae91){if('$graveyard'==_0x51ae91['root']['rootName'])return _0x51ae91;const _0x34dd88=[];let _0x3cea4e=_0x51ae91['root'];for(let _0x111c1c=0x0;_0x111c1c<_0x51ae91['path']['length'];_0x111c1c++){const _0x4961f9=_0x141145['get'](_0x3cea4e)||0x0;_0x34dd88[_0x111c1c]=_0x51ae91['path'][_0x111c1c]+_0x4961f9,_0x3cea4e=_0x3cea4e['getChildAtOffset'](_0x51ae91['path'][_0x111c1c]);}return new _0x5a23f1(_0x319c21,_0x34dd88,_0x51ae91['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x2281c5,content:_0x431aaa,version:_0x34e979,mainView:_0x4b3a32,aiBalloon:_0xebe38d}=this['_interactionParams'];_0x4b3a32['areChangesVisible']=!0x1,_0x4b3a32['hideError'](),this['_clearErrorState'](_0x4b3a32,_0xebe38d);const _0x4efab7=_0x4b3a32;_0x4efab7['miniToolbarView']&&_0x4efab7['miniToolbarView']['showChangesButton']&&_0x4efab7['miniToolbarView']['showChangesButton']['set']({'isOn':!0x1,'icon':_0x376600}),this['_clearSuggestionContent'](_0x4b3a32),_0x4b3a32['showLoader'](),this['_updateNavigationUI'](),this['stopListening'](_0x4b3a32),this['_createInteraction'](_0x431aaa,_0x34e979,_0x4b3a32,_0xebe38d,_0x2281c5)['catch'](_0x4c5ec2=>{this['_isAbortError'](_0x4c5ec2)||console['error']('Error\x20refreshing\x20interaction:',_0x4c5ec2);});}['_clearSuggestionContent'](_0x303c9d){const _0x449935=_0x303c9d['bodyView']['_children'];for(;_0x449935['length']>0x0;)_0x449935['remove'](_0x449935['first']);_0x303c9d['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x19c473){return!!_0x19c473['message']&&_0x19c473['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_updateNavigationUI']();}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_interactionParams']['aiBalloon']['stopAutoScroll']();}['_setupCustomViews'](){const _0x826cf5=new _0x21bd9e(this['editor']['locale']),_0x25e4a0=new _0x21bd9e(this['editor']['locale']),_0x55f268=new _0x492b6b(this['editor']['locale']),_0x5716e9=new _0x21bd9e(this['editor']['locale']);_0x826cf5['set']({'icon':_0x4e53d3,'label':y(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x25e4a0['set']({'icon':_0x48be9f,'tooltip':y(this['editor']['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x55f268['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':['1/1']}),_0x5716e9['set']({'icon':_0x395cb2,'tooltip':y(this['editor']['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x826cf5['bind']('isEnabled')['to'](this,'isBusy',_0x457e9c=>!_0x457e9c),_0x826cf5['on']('execute',()=>{this['_refreshInteraction']();}),_0x25e4a0['bind']('isEnabled')['to'](this,'isBusy',_0x206a42=>!_0x206a42),_0x25e4a0['on']('execute',()=>{this['_navigateToPrevious']();}),_0x5716e9['bind']('isEnabled')['to'](this,'isBusy',_0x21d052=>!_0x21d052),_0x5716e9['on']('execute',()=>{this['_navigateToNext']();}),this['_navigationPreviousButton']=_0x25e4a0,this['_navigationCounter']=_0x55f268,this['_navigationNextButton']=_0x5716e9,this['_customViews']['add'](_0x826cf5);}['_navigateToPrevious'](){const _0x16c219=this['_interactions']['length'];this['_currentInteractionIndex']<_0x16c219-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x4fb78a){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x4fb78a;const {mainView:_0x23a8b0}=this['_interactionParams'],_0x3b26fe=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x3b26fe)return;if(_0x3b26fe['hasError'])return this['_setErrorState'](_0x3b26fe,_0x23a8b0),void this['_updateNavigationUI']();if(!_0x3b26fe['replies']['length'])return;_0x23a8b0['hideError'](),this['_interactionParams']&&this['_clearErrorState'](_0x23a8b0,this['_interactionParams']['aiBalloon']);const _0x2fe4b7=_0x3b26fe['replies'][_0x3b26fe['replies']['length']-0x1];if(_0x2fe4b7){const _0x881225=this['editor'];this['_clearSuggestionContent'](_0x23a8b0);try{const _0x5d928b=C({'editor':_0x881225,'changeGroups':_0x2fe4b7['changeGroups'],'documentContextContent':_0x2fe4b7['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});this['_clearSuggestionContent'](_0x23a8b0),await new Promise(_0x5bfcf3=>setTimeout(_0x5bfcf3,0x32)),await _0x23a8b0['updateContent']({'parts':_0x5d928b,'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x4cc839){this['_isAbortError'](_0x4cc839)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x4cc839);}}this['_updateNavigationUI']();}['_updateNavigationUI'](){if(!this['_navigationPreviousButton']||!this['_navigationCounter']||!this['_navigationNextButton'])return;const _0xfbdb8d=this['_interactions']['length'],_0x10df58=_0xfbdb8d>0x1,_0x5eb52a=this['_interactionParams']?.['mainView'];if(_0x10df58){this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView']||(this['_customViews']['add'](this['_navigationPreviousButton']),_0x5eb52a?.['addNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x0,this['_customViews']['add'](this['_navigationCounter']),_0x5eb52a?.['addNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x0,this['_customViews']['add'](this['_navigationNextButton']),_0x5eb52a?.['addNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x0);const _0x744859=_0xfbdb8d-this['_currentInteractionIndex'];this['_navigationCounter']['element']&&(this['_navigationCounter']['element']['textContent']=_0x744859+'/'+_0xfbdb8d),this['_navigationPreviousButton']['isEnabled']=this['_currentInteractionIndex']<_0xfbdb8d-0x1,this['_navigationNextButton']['isEnabled']=this['_currentInteractionIndex']>0x0;}else(this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView'])&&(this['_customViews']['remove'](this['_navigationPreviousButton']),_0x5eb52a?.['removeNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x1,this['_customViews']['remove'](this['_navigationCounter']),_0x5eb52a?.['removeNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x1,this['_customViews']['remove'](this['_navigationNextButton']),_0x5eb52a?.['removeNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x1);}['_setLoadingState'](_0x1dd0fb,_0x380928){_0x1dd0fb['setLoading'](),_0x380928['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_setErrorState'](_0x490b89,_0x13eb2b){const _0x1c5e4b=y(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');_0x13eb2b['showError'](_0x1c5e4b),_0x490b89['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],_0x13eb2b['setErrorState'](),this['_interactionParams']?.['aiBalloon']['balloonView']['toolbar']&&(this['_interactionParams']['aiBalloon']['balloonView']['toolbar']['isLoading']=!0x0);}['_clearErrorState'](_0x5a546c,_0x4d21f2){_0x5a546c['clearErrorState'](),_0x4d21f2['balloonView']['toolbar']&&(_0x4d21f2['balloonView']['toolbar']['isLoading']=!0x1);}async['_clearLoadingState'](_0x4d2014,_0x50b00a){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x4d2014['clearLoading'](),_0x50b00a['balloonView']['clearLoading']();}['_disableCustomViews'](){this['_customViews']['forEach'](_0x102aaa=>{'isEnabled'in _0x102aaa&&(_0x102aaa['isEnabled']=!0x1);});}}class Wa extends _0x2a4cc7{static get['requires'](){return[gi,ki,ji];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x9d3bc9){super(_0x9d3bc9),_0x9d3bc9['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class js{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x19935c,title:_0x213fef,description:_0x349a09,isParameterized:_0x31339d,useArgs:_0x3dd923,options:_0x221592}){this['id']=_0x19935c,this['title']=_0x213fef,this['description']=_0x349a09,this['isParameterized']=_0x31339d,this['useArgs']=_0x3dd923,this['options']=_0x221592;}}class Bs extends js{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x5ee0a1){this['_models']=_0x5ee0a1;}}class Ri extends $t(){['_checks'];constructor(_0x2f622d){super(),this['_checks']=this['_mapCheckDefinitions'](_0x2f622d);}get['checks'](){return this['_checks'];}['getCheckById'](_0x11a407){return this['checks']['find'](_0x1c8a43=>_0x1c8a43['id']===_0x11a407);}['removeCheckById'](_0x23b172){this['_checks']=this['_checks']['filter'](_0x4916eb=>_0x4916eb['id']!==_0x23b172);}['_mapCheckDefinitions'](_0x53bce1){return _0x53bce1['map'](_0x53cbb8=>'custom'===_0x53cbb8['id']?new Bs(_0x53cbb8):new js(_0x53cbb8));}}class Ds extends _0x3dcb71(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x16183f,contentNew:_0x2997ab,contentInitial:_0x3309f1,documentVersion:_0x1cce16}){super(),this['id']=_0x16183f,this['contentNew']=_0x2997ab,this['contentInitial']=_0x3309f1,this['documentVersion']=_0x1cce16;}}class Es extends $t(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x59dae2,_0x4fab11,_0x10bb10){super(),this['id']=_0x59dae2,this['parent']=_0x10bb10,this['_data']=_0x4fab11,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 zs extends $t(){['id']=_0x3bb1ce();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x5a059f,_0x385f4d,_0x250a4f,_0xb1f14b,_0x1d4a83){super(),this['_sourceCheck']=_0x385f4d,this['_documentData']=_0x5a059f,this['_aiConnector']=_0x250a4f,this['_reviewParams']=_0xb1f14b,this['_reviewArgs']=_0x1d4a83,this['on']('change:status',(_0x5aa44d,_0x5ed137,_0x68dbbe)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x68dbbe,'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'](_0x586d8f=>'pending'===_0x586d8f['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x482e28){this['_documentData']=_0x482e28;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x3082ee=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x18944b of _0x3082ee)'unmodified'!==_0x18944b['data']['operation']&&('error'!==_0x18944b['data']['operation']?'review-metadata'!==_0x18944b['event']?this['_addReviewCheckResult'](_0x18944b['data']['dataId'],_0x18944b['data']['textDelta']):this['callId']=_0x18944b['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']?this['status']='unmodified':this['status']='ready');}catch(_0x317920){this['_currentError']=_0x317920,_0x317920 instanceof Error&&_0x317920['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'](_0x378ea8,_0x53c8c4){const _0xaff160=this['_results']['get'](_0x378ea8);if(!_0xaff160)return;const _0x2dab24=[];_0x53c8c4['forEach']((_0x10bcb0,_0x105b24)=>{const _0x1cc74d=new Es(_0xaff160['id']+'-'+_0x105b24,_0x10bcb0,_0xaff160);_0x1cc74d['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x1cc74d,'status':_0x1cc74d['status']});}),_0x1cc74d['on']('change:isActivated',()=>{_0x1cc74d['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x1cc74d}):this['fire']('reviewCheckResultDeactivated',{'change':_0x1cc74d});}),this['_changes']['push'](_0x1cc74d),_0x2dab24['push'](_0x1cc74d);}),this['fire']('reviewCheckResultReady',{'changes':_0x2dab24,'result':_0xaff160,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x16e0d9){const _0x14c27e=this['_changes']['find'](_0x44e995=>_0x44e995['id']===_0x16e0d9);return!(!_0x14c27e||'pending'!==_0x14c27e['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0xf9ed58=>!0x0===_0xf9ed58['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x5a91c2=>'pending'===_0x5a91c2['status']);}['getChangeById'](_0xa2930d){return this['_changes']['find'](_0x58c033=>_0x58c033['id']===_0xa2930d);}['markAllChangesAsAccepted'](){for(const _0x3bb7fa of this['_changes'])'pending'===_0x3bb7fa['status']&&(_0x3bb7fa['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x1b3426){const _0x58eddd=this['_changes']['find'](_0x240f47=>_0x240f47['id']===_0x1b3426);_0x58eddd&&'pending'===_0x58eddd['status']&&(_0x58eddd['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x502678){const _0x572770=this['_changes']['find'](_0xf8f2e5=>_0xf8f2e5['id']===_0x502678);_0x572770&&'pending'===_0x572770['status']&&(_0x572770['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0xa90690){const _0x5912b2=this['_changes']['find'](_0x244e52=>_0x244e52['id']===_0xa90690);_0x5912b2&&'pending'===_0x5912b2['status']&&(_0x5912b2['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x43ff15){const _0x3d2aa0=this['_changes']['find'](_0x89bc85=>_0x89bc85['id']===_0x43ff15);_0x3d2aa0&&'outdated'===_0x3d2aa0['status']&&(_0x3d2aa0['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x3eb3ab){this['_changes']['filter'](_0x5f3a1d=>_0x5f3a1d['isActivated']&&_0x5f3a1d['id']!==_0x3eb3ab)['forEach'](_0x2281e6=>{_0x2281e6['isActivated']=!0x1;});const _0x17952b=this['_changes']['find'](_0x3895c9=>_0x3895c9['id']===_0x3eb3ab);_0x17952b&&'pending'===_0x17952b['status']&&(_0x17952b['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x3f5e90=>_0x3f5e90['isActivated'])['forEach'](_0x30edcd=>{_0x30edcd['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x446e29){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x63d52;if(_0x446e29){const _0x531a06=this['_changes']['find'](_0x4568f4=>_0x4568f4['id']===_0x446e29);if(_0x531a06&&_0x531a06['isRated'])return;_0x531a06&&(_0x63d52=_0x531a06['parent']['id'],_0x531a06['isRated']=!0x0);}const _0x54fe9c={'positiveCount':this['_changes']['filter'](_0x3c1b96=>'accepted'===_0x3c1b96['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x54fe9c,this['callId'],_0x63d52);}['_addReviewCheckResult'](_0x3bdc9b,_0x5c1944){const _0x59fab4=this['_documentData']['elements']['get'](_0x3bdc9b);if(!_0x59fab4)return;const _0x3e38c9=_0x59fab4['getContent']();if(_0x3e38c9===_0x5c1944)return;const _0x58dac4=new Ds({'id':_0x3bdc9b,'contentInitial':_0x3e38c9,'contentNew':_0x5c1944,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x58dac4['id'],_0x58dac4),this['fire']('reviewCheckResultAdded',{'result':_0x58dac4,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x55ba65=>'pending'===_0x55ba65['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x243e3b=>'pending'===_0x243e3b['status'])['length']&&(this['status']='finished'));}}class _i extends zs{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x4affce=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x171df2=0x0;_0x171df2<this['_reviewParams']['length'];_0x171df2++){if(!this['_reviewParams'][_0x171df2]||!this['_sourceCheck']['options'][_0x171df2])continue;const _0x456c8=this['_sourceCheck']['options'][_0x171df2],_0xf441f9=_0x456c8['data']?.['find'](_0x5d7758=>_0x5d7758['id']===this['_reviewParams'][_0x171df2]);_0xf441f9&&_0x4affce['push'](_0xf441f9['label']);}return _0x4affce['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x3378b4,_0x249164,_0x518fb2){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x249164,_0x3378b4,_0x518fb2);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class Ci extends zs{['_prompt'];['_model'];constructor(_0xbd2ea0,_0x339e9a,_0x4493dd,_0x2a9487,_0x50b9e4){super(_0x4493dd,_0x2a9487,_0x50b9e4),this['_prompt']=_0xbd2ea0,this['_model']=_0x339e9a;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0xfe653e,_0x44ca7b,_0xb217b2){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x44ca7b,_0xfe653e,_0xb217b2);}}const Mi=[{'id':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'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':'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'}]}]},{'id':'translate','title':'Translate','description':'Translate\x20the\x20text\x20into\x20another\x20language.','isParameterized':!0x0,'useArgs':!0x0,'options':[{'formType':'dropdown','label':'Select\x20language','argsKey':'language','data':[{'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'}]}]}];class ie extends _0x4404b9{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[s];}static get['pluginName'](){return'AIReviewModeController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiReviewModeUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewModeEditing']=this['context']['plugins']['get']('AIReviewModeEditing');const _0x46dee2=this['context']['config']['get']('ai.reviewMode.translations');if(_0x46dee2){for(const _0x245727 of Mi)'translate'===_0x245727['id']&&(_0x245727['options'][0x0]['data']=_0x46dee2);}const _0x53185c=this['_translateReviewChecks'](Mi);this['_aiReviewCheckList']=new Ri(_0x53185c);const _0x1991cf=this['_aiReviewCheckList']['checks']['find'](_0x11c693=>'custom'===_0x11c693['id']);if(_0x1991cf)try{const _0x2821cf=await new Mt({'connector':this['_aiConnector']})['getAll']();_0x1991cf['models']=_0x2821cf['map'](_0xd0993e=>({..._0xd0993e,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0xd0993e['id']['toUpperCase'](),_0xd0993e['description'])}));}catch(_0x1255b0){this['_aiReviewCheckList']['removeCheckById']('custom'),this['_logError'](new _0x19ee7d('ai-review-mode-models-unable-to-retrieve',this,{'error':_0x1255b0}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x43955b,_0x5d1654)=>{const _0x8cd2af=this['_aiReviewCheckList']['getCheckById'](_0x5d1654['id']);if(_0x8cd2af){this['_onDiffChange'](this['_isDiffOn']),_0x5d1654['isCustom']?this['_currentReviewCheckRun']=new Ci(_0x5d1654['args']['prompt'],_0x5d1654['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x8cd2af,this['_aiConnector']):this['_currentReviewCheckRun']=new _i(this['_aiReviewModeEditing']['getDocumentData'](),_0x8cd2af,this['_aiConnector'],_0x5d1654['params'],_0x5d1654['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x74cbfe,_0x54500d)=>{'data'===_0x54500d['status']||'loading'===_0x54500d['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x54500d)):'finished'===_0x54500d['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x54500d['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'unmodified'===_0x54500d['status']?this['_aiReviewModeUi']['showNoChangesView']():'error-general'===_0x54500d['status']?(this['_aiReviewModeUi']['showGeneralResultsErrorView'](),this['_logError'](new _0x19ee7d('ai-review-mode-check-run-general-error',this,this['_currentReviewCheckRun']?.['currentError']))):'error-chunk'===_0x54500d['status']?(this['_aiReviewModeUi']['showChunkErrorView'](),this['_logError'](new _0x19ee7d('ai-review-mode-check-run-chunk-error',this,this['_currentReviewCheckRun']?.['currentError']))):'aborted'===_0x54500d['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0)),'ready'!==_0x54500d['status']&&'error-chunk'!==_0x54500d['status']&&'error-general'!==_0x54500d['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x80fa57,_0x29d25d)=>{if(!this['_currentReviewCheckRun'])throw new _0x19ee7d('ai-review-mode-no-current-check-run',this);const _0x528996=this['_aiReviewModeEditing']['diffContent'](_0x29d25d['result']['contentInitial'],_0x29d25d['result']['contentNew']);_0x29d25d['source']['addResultChanges'](_0x29d25d['result']['id'],_0x528996);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x990327,_0x1580a7)=>{for(const _0x78be4 of _0x1580a7['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x78be4);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x1580a7['changes'],_0x1580a7['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x46e4e9,_0x53f7d5)=>{this['_aiReviewModeUi']['updateChangeState'](_0x53f7d5['change']['id'],_0x53f7d5['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x4b3ce7,_0x33cac4)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x33cac4['change']['id']);const _0x7f1de1=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x33cac4['change']['id']);if(!_0x7f1de1)return;if('content'===this['_changeActivationSource']){const _0x495c8f=this['_aiReviewModeUi']['getChangeElement'](_0x33cac4['change']['id']);_0x495c8f&&_0x4446ba(_0x495c8f['closest']('.ck-ai-review-mode__check-run-result')||_0x495c8f);}else{if('panel'===this['_changeActivationSource']){const _0x4a8427={'target':_0x7f1de1['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};_0x414134(_0x4a8427);}}const _0x17f2b7=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x33cac4['change'],_0x7f1de1['domElement'],void 0x0,'click',_0x17f2b7?.['editing']?.['view']?.['getDomRoot'](),_0x17f2b7?.['ui']?.['viewportOffset']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults'](),this['_aiReviewModeUi']['hideChangeBalloon']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x44abc1){_0x44abc1 instanceof Error&&_0x44abc1['message']['includes']('ai-request-aborted')||(_0x44abc1 instanceof _0x19ee7d?this['_logError'](_0x44abc1):this['_logError'](new _0x19ee7d('ai-review-mode-check-run-failed',this,{'error':_0x44abc1})));}}else this['_logError'](new _0x19ee7d('ai-review-mode-source-check-not-found',this,{'checkId':_0x5d1654['id']}));}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewMode',()=>{this['_onReviewModeRunLeave']();}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewModeResultList',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewModeUi'],'finishReview',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x1dd161=this['_currentReviewCheckRun']['getActiveChanges']();_0x1dd161['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x1dd161['map'](_0x257455=>_0x257455['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted'](),this['_currentReviewCheckRun']['sendRating']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x4bf30a,_0x3730ff)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x3730ff['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x3730ff['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x3730ff['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x3730ff['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x82c649,_0x5374b8)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5374b8['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x5374b8['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x5374b8['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5374b8['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x38e9f8,_0x5d64be)=>{this['_isDiffOn']=_0x5d64be['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewModeEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewModeEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x3faf8c,_0x3f5a99)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x3f5a99['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x57302d,_0x493e4c)=>{if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x493e4c['changeId']);const _0x1d213a=this['_currentReviewCheckRun']['getChangeById'](_0x493e4c['changeId']);if(!_0x1d213a)return;const _0x4c3a38=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x1d213a,_0x493e4c['markerElement'],_0x493e4c['domEvent'],'click',_0x4c3a38?.['editing']?.['view']?.['getDomRoot'](),_0x4c3a38?.['ui']?.['viewportOffset']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerHovered',(_0x3943de,_0x435768)=>{if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x3e9441=this['_currentReviewCheckRun']['getChangeById'](_0x435768['changeId']);if(!_0x3e9441)return;const _0x569f23=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x3e9441,_0x435768['markerElement'],_0x435768['domEvent'],'hover',_0x569f23?.['editing']?.['view']?.['getDomRoot'](),_0x569f23?.['ui']?.['viewportOffset']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerBlurred',()=>{if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewModeUi']['hideChangeBalloon']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRemoved',(_0x40564b,_0x5a88de)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x5a88de['changeId']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRestored',(_0xb51f98,_0x1ac734)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x1ac734['changeId']);});}['_onReviewModeRunLeave'](_0x51aae8=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x51aae8&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x9befc3=this['_aiReviewModeEditing']['getEditor']();_0x9befc3&&_0x9befc3['editing']['view']['change'](_0x338007=>{const _0x16a943=_0x9befc3['editing']['view']['document']['getRoot']();_0x338007['removeClass']('ck-ai-review-mode-diff',_0x16a943),_0x338007['removeClass']('ck-ai-review-mode-highlights',_0x16a943);});}['_onDiffChange'](_0x439a79){const _0x4e529c=this['_aiReviewModeEditing']['getEditor']();_0x439a79?this['_aiReviewModeUi']['hideDiffInBalloon']():this['_aiReviewModeUi']['showDiffInBalloon'](),_0x4e529c&&_0x4e529c['editing']['view']['change'](_0x35bc78=>{const _0x16b1b4=_0x4e529c['editing']['view']['document']['getRoot']();_0x35bc78['removeClass']('ck-ai-review-mode-diff',_0x16b1b4),_0x35bc78['removeClass']('ck-ai-review-mode-highlights',_0x16b1b4),_0x35bc78['addClass'](_0x439a79?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights',_0x16b1b4);});}['_translateReviewChecks'](_0xb655a8){return _0xb655a8['map'](_0x10335d=>{const _0x5682da='AI_REVIEW_CHECK_'+_0x10335d['id']['toUpperCase']()['replaceAll']('-','_'),_0x364db3={..._0x10335d,'title':this['_getTranslationWithDefault'](_0x5682da+'_TITLE',_0x10335d['title']),'description':this['_getTranslationWithDefault'](_0x5682da+'_DESCRIPTION',_0x10335d['description'])};return _0x10335d['options']&&(_0x364db3['options']=_0x10335d['options']['map'](_0x5c6c6d=>({..._0x5c6c6d,'label':this['_getTranslationWithDefault'](_0x5682da+'_OPTIONS_LABEL',_0x5c6c6d['label']||''),'data':_0x5c6c6d['data']?_0x5c6c6d['data']['map'](_0x42d283=>({..._0x42d283,'label':this['_getTranslationWithDefault'](_0x5682da+'_OPTIONS_DATA_'+_0x42d283['id']['toUpperCase'](),_0x42d283['label'])})):void 0x0}))),_0x364db3;});}['_getTranslationWithDefault'](_0x3f6d57,_0x3a2e63){const _0x3f085a=y(this['context']['locale'],_0x3f6d57);return _0x3f085a===_0x3f6d57?_0x3a2e63:_0x3f085a;}['_logError'](_0x5c552c){_0x543541(_0x5c552c['message']),_0x5c552c['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewModeUi']['showGeneralReviewModeErrorView']():this['_aiReviewModeUi']['showGeneralResultsErrorView']();}}class Mr extends _0x492b6b{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0xb1d784,_0x1e25ea){super(_0xb1d784),this['_defaultValue']=_0x1e25ea['default']||(_0x1e25ea['data']['length']>0x0?_0x1e25ea['data'][0x0]['id']:''),this['_defaultLabel']=_0x1e25ea['data']['find'](_0xc4c8ef=>_0xc4c8ef['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x35c3bd(this['locale']);const _0x4e2f43=this['_prepareListOptions'](_0x1e25ea['data']);_0x1cd684(this['_dropdownView'],_0x4e2f43,{'role':'menu','ariaLabel':_0x1e25ea['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x289c46=>{_0x289c46['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x4a61c1=>{this['formValue']=_0x4a61c1['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x4a61c1['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode__check-list-item-parameterized-form-element','ck-ai-review-mode__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x5c3710=[]){const _0x53258c=new _0x1c36f7();this['resetToDefault']();for(const _0x45c861 of _0x5c3710){const _0x3b619a=new _0x1bf3fd({'label':_0x45c861['label'],'withText':!0x0,'role':'menuitemradio','id':_0x45c861['id'],'model':_0x45c861});_0x3b619a['bind']('isOn')['to'](this,'formValue',_0x16d875=>_0x16d875===_0x3b619a['id']);const _0x111155={'type':'button','model':_0x3b619a};_0x53258c['add'](_0x111155);}return _0x53258c;}}class ic extends _0x8a8c30{['_formItem']=null;constructor(_0x599d5d,_0x3132ad,_0x10357c){super(_0x599d5d),this['argsKey']=_0x3132ad?.['argsKey'];if('dropdown'===_0x3132ad['formType'])this['_formItem']=new Mr(this['locale'],_0x3132ad);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x39711f=new _0x523985(this['locale'],{'children':[this['_formItem']],'class':[_0x10357c?'ck-form__row_with-submit':'']});_0x10357c&&_0x39711f['children']['add'](_0x10357c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x39711f]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Us extends _0x225711{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x62ee02){super(_0x62ee02),this['set']('isEmpty',!0x0),this['keystrokes']=new Wt(),this['minRows']=Us['MIN_ROWS'],this['maxRows']=Us['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-mode-prompt-input','class':['ck','ck-review-mode__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class tc extends _0x492b6b{['focusTracker']=new Bt();['keystrokes']=new Wt();['focusCycler'];['_focusables']=new _0x2b3021();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x456a22,_0x2d894b){super(_0x456a22),this['_check']=_0x2d894b,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x2d894b['models']&&_0x2d894b['models']['length']>0x0?_0x2d894b['models'][0x0]['id']:'',this['_defaultLabel']=_0x2d894b['models']&&_0x2d894b['models']['length']>0x0?_0x2d894b['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x94787a(this['locale'],()=>new Us(_0x456a22)),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 _0x1c36f7(),this['_setModelList'](),_0x1cd684(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions']},'children':[new _0x523985(this['locale'],{'children':[this['promptInputView']]}),new _0x523985(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x444b93,_0x511476)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x511476()):_0x511476();}),this['focusCycler']=new Vt({'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'](_0xfc7e4d=>{this['_focusables']['add'](_0xfc7e4d),this['focusTracker']['add'](_0xfc7e4d['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 _0x217883 of this['_getFormValidators']()){const _0x2e4884=_0x217883();if(_0x2e4884)return this['promptInputView']['errorText']=_0x2e4884,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return y(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x1386d9=new _0x21bd9e(this['locale']),t=this['locale']['t'];return _0x1386d9['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x1386d9['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x1386d9;}['_createCancelButtonView'](){const _0x2c2ddf=new _0x21bd9e(this['locale']),t=this['locale']['t'];return _0x2c2ddf['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x2c2ddf['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x29289d=>{_0x29289d['stopPropagation']();})}}),_0x2c2ddf['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x2c2ddf;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x1b029a=this['_check']['models'];if(this['resetToDefault'](),_0x1b029a?.['length']){const _0x5861ab=Mt['getLocalized'](this['locale'],_0x1b029a);for(const _0xe72a6d of _0x5861ab){const _0x1d1763=new _0x1bf3fd({'label':_0xe72a6d['name'],'withText':!0x0,'role':'menuitemradio','id':_0xe72a6d['id'],'model':_0xe72a6d});_0x1d1763['bind']('isOn')['to'](this,'modelId',_0x211bff=>_0x211bff===_0xe72a6d['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x1d1763,'labelView':new Xs(this['locale'],_0xe72a6d)});}}}['_createModelSelectionDropdown'](){const _0x3bf808=_0x35c3bd(this['locale']);return _0x3bf808['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x3bf808['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x3bf808,'execute',_0x257407=>{this['modelId']=_0x257407['source']['model']['id'],_0x3bf808['buttonView']['label']=_0x257407['source']['label'];}),_0x3bf808;}['_createActionsFooterView'](){const _0x5ac25c=new _0x492b6b(this['locale']);return _0x5ac25c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x5ac25c;}}class Xs extends _0xb0531d{constructor(_0xaab448,_0x6e24c4){super();const _0x8b50d7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x8b50d7['to']('style'),'id':_0x8b50d7['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x8b50d7['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x6e24c4['description']||'']}]}]});}}class Zs extends _0x8a8c30{['_formItemsCollection']=new _0x2b3021();['_customCheckView']=null;constructor(_0x23c5f7,_0x48c959,_0x23cbcb){super(_0x23c5f7),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x48c959['isParameterized']);const _0x5af996=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai-review-mode__check-list-item_selected',_0x150eaf=>_0x150eaf),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x24692d=>_0x24692d)],'style':{'--ck-ai-review-check-list-item-index':_0x23cbcb}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-list-item-title-text']},'children':[{'text':_0x48c959['title']}]},_0x5af996]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x48c959['description']}]}]}]},..._0x48c959['isParameterized']?[this['_createParameterizedView'](_0x48c959)]:[],...'custom'===_0x48c959['id']?[this['_createCustomView'](_0x48c959)]:[]]}),this['on']('click',()=>{_0x48c959['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x48c959['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&ts({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x386b16=>{_0x386b16['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x834098=new _0x25e498();return _0x834098['content']=_0x341b4d,_0x834098['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x834098;}['_createParameterizedView'](_0x2fae89){const _0x4a2848=new _0x492b6b(),_0x14d03a=this['_createFormView'](_0x2fae89);return _0x4a2848['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x4cc25d=>!_0x4cc25d)]},'children':[_0x14d03a]}),_0x4a2848;}['_createFormView'](_0x299945){const _0xd4ace9=new _0x492b6b(),_0x2ed619=Array['isArray'](_0x299945['options'])?_0x299945['options']:[],_0x44d3f2=new _0x21bd9e(this['locale']),t=this['locale']['t'];_0x44d3f2['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x44d3f2['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2916f6=>{_0x2916f6['stopPropagation']();})}}),_0x44d3f2['on']('execute',()=>{const _0x18b01d=[],_0x40e0d8={};this['_formItemsCollection']['forEach'](_0x588948=>{_0x18b01d['push'](_0x588948['value']),_0x299945['useArgs']&&_0x299945['options']&&(_0x40e0d8[_0x588948['argsKey']]=_0x588948['value']);}),this['fire']('runReviewCheck',{'id':_0x299945['id'],'params':_0x18b01d['length']?_0x18b01d:void 0x0,'args':Object['keys'](_0x40e0d8)['length']?_0x40e0d8:void 0x0});});const _0x7adf02=_0x2ed619['length'];return _0x2ed619['forEach']((_0x3bd3e4,_0x454ffd)=>{const _0x49757a=_0x454ffd===_0x7adf02-0x1;this['_formItemsCollection']['add'](new ic(this['locale'],_0x3bd3e4,_0x49757a?_0x44d3f2:null));}),_0xd4ace9['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0xd4ace9;}['_createCustomView'](_0x316c09){return this['_customCheckView']=new tc(this['locale'],_0x316c09),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized','ck-ai-review-mode__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x3359ae=>!_0x3359ae)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x180e28,_0x30d71e,_0x7e29e4)=>{_0x7e29e4||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class ih extends _0x8a8c30{['_checkViews'];constructor(_0x216777){super(_0x216777),this['_checkViews']=new _0x2b3021();const _0x703232=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x703232['if']('isVisible','ck-hidden',_0x111374=>!_0x111374)]},'children':this['_checkViews']});}['setChecks'](_0xc32c25){this['_checkViews']['clear']();for(const [_0x29086a,_0x437a88]of _0xc32c25['entries']()){const _0x1cc719=new Zs(this['locale'],_0x437a88,_0x29086a);_0x1cc719['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x1cc719);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x18114c of this['_checkViews'])_0x18114c instanceof Zs&&_0x18114c['resetToDefault']();}}class Ps extends _0x492b6b{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['statusButtonView'];constructor(_0x5db3e2,_0x1b8402){super(_0x5db3e2),this['id']=_0x1b8402,this['set']('status','pending'),this['set']('changeId',_0x1b8402),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['statusButtonView']=this['_createStatusButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result',this['bindTemplate']['if']('isActive','ck-ai-review-mode__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['statusButtonView']]},this['infoButtonView']]}]}),this['on']('click',()=>{this['fire']('activateChange',{'id':_0x1b8402,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x4679be=new _0x492b6b(this['locale']);return _0x4679be['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-content-direct-excluded','ck-ai-review-mode__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x26a9b2=>!_0x26a9b2)]}}),_0x4679be;}['_createAcceptButtonView'](){const _0x22956e=new _0x21bd9e(this['locale']);return _0x22956e['set']({'label':y(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x22956e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4f1615=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x4f1615['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x166f4c=>'pending'!==_0x166f4c)]}}),_0x22956e;}['_createDismissButtonView'](){const _0x5a8e36=new _0x21bd9e(this['locale']);return _0x5a8e36['set']({'label':y(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x5a8e36['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x8f2397=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x8f2397['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-result-dismiss-button',this['bindTemplate']['if']('status','ck-hidden',_0x2c6be4=>'pending'!==_0x2c6be4)]}}),_0x5a8e36;}['_createInfoButtonView'](){const _0x1d37fc=new _0x21bd9e(this['locale']);return _0x1d37fc['set']({'label':y(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x1e356f,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x1d37fc['bind']('isOn')['to'](this,'isInfoToggleOn',_0x482cce=>_0x482cce),_0x1d37fc['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x1d37fc;}['_createStatusButtonView'](){const _0x26e0b1=new _0x21bd9e(this['locale']);return _0x26e0b1['set']({'withText':!0x0,'isEnabled':!0x1}),_0x26e0b1['bind']('label')['to'](this,'status',_0x20d964=>y(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_'+_0x20d964['toUpperCase']())),_0x26e0b1['bind']('icon')['to'](this,'status',_0xefdc0f=>'ACCEPTED'===_0xefdc0f['toUpperCase']()?_0x2a5a64:'REJECTED'===_0xefdc0f['toUpperCase']()?_0x2c2a0c:_0x596197),_0x26e0b1['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x35cb86=>'pending'===_0x35cb86)],'disabled':'disabled'}}),_0x26e0b1;}}class vr extends _0x21bd9e{constructor(_0x26a240){super(_0x26a240),this['set']({'label':y(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class eh extends _0x8a8c30{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];constructor(_0x5f49cc){super(_0x5f49cc),this['_resultViews']=new _0x2b3021(),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 Ei(_0x5f49cc),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 _0x4a0d2c=this['_createCombinedSkeletonLoader'](),_0x12c5eb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x12c5eb['if']('isVisible','ck-hidden',_0x1635d4=>!_0x1635d4)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x24a81d=>_0x24a81d)]},'children':this['_resultViews']},_0x4a0d2c]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0xe74906){const _0x2f333b=new Ps(this['locale'],_0xe74906['id']);_0x2f333b['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x2f333b),_0x2f333b['resultResponseView']['element']['innerHTML']=_0xe74906['contentDiffed'];}['hideResult'](_0x16934f,_0x2d3909){if('pending'===_0x2d3909)return;const _0x2e2f29=this['_resultViews']['find'](_0x4645d0=>_0x4645d0['id']===_0x16934f);_0x2e2f29&&(_0x2e2f29['status']=_0x2d3909,_0x2e2f29['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_grayout'));}['showResult'](_0x118df5,_0x1b6034){if('pending'!==_0x1b6034)return;const _0x4e7e2b=this['_resultViews']['find'](_0x2ffffb=>_0x2ffffb['id']===_0x118df5);_0x4e7e2b&&(_0x4e7e2b['status']=_0x1b6034,_0x4e7e2b['element']?.['classList']['remove']('ck-ai-review-mode__check-run-result_grayout'));}['setTitle'](_0x364787,_0x183a35){this['headerTitle']=_0x364787,this['headerSubtitle']=_0x183a35||'';}['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 _e(this['locale'],be['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x245d1e=new _0x492b6b(this['locale']),_0x8551a=[];for(let _0x78aadc=0x0;_0x78aadc<0x10;_0x78aadc++){const _0x276d68=this['_createSkeletonLoader']();_0x276d68['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x8551a['push'](_0x276d68);}return _0x245d1e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x1e912e=>!_0x1e912e)]},'children':_0x8551a}),_0x245d1e;}['_createErrorView'](){const _0x2fd74a=new _0x492b6b(this['locale']),_0x59ae95=new _0x21bd9e(this['locale']),t=this['locale']['t'];return _0x2fd74a['delegate']('retryReview')['to'](this),_0x59ae95['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x59ae95['on']('execute',()=>{this['fire']('retryReview');}),_0x2fd74a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x229412=>!_0x229412),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x55e21a=>'chunk'===_0x55e21a)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x5167bb=>'chunk'===_0x5167bb)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x23749e=>'general'!==_0x23749e)]},'children':[{'text':y(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x29b220=>'chunk'!==_0x29b220)]},'children':[{'text':y(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x59ae95]}),_0x2fd74a;}['_createCancelButtonView'](){const _0x5ad1bb=new _0x21bd9e(this['locale']);return _0x5ad1bb['set']({'label':y(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x16a978}),_0x5ad1bb['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x50d3a6=>_0x50d3a6),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1c52af=>_0x1c52af)]}}),_0x5ad1bb['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x5ad1bb;}['_createToggleDiffButtonView'](){const _0x44eb41=new _0x21bd9e(this['locale']);_0x44eb41['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x44eb41['bind']('isEnabled')['to'](this,'isError',_0x4ce2e7=>!_0x4ce2e7),_0x44eb41['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x238d90=>!_0x238d90),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x523cab=>_0x523cab)]}});const _0x3d324e=y(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x8409f5=y(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x44eb41['bind']('isOn')['to'](this,'isToggleDiffOn',_0x2e9c9e=>_0x2e9c9e),_0x44eb41['bind']('icon')['to'](this,'isToggleDiffOn',_0x33d59a=>_0x33d59a?_0x3868ae:_0x4a4f33),_0x44eb41['bind']('label')['to'](this,'isToggleDiffOn',_0x10d09f=>_0x10d09f?_0x3d324e:_0x8409f5),_0x44eb41['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x44eb41;}['_createAcceptAllButtonView'](){const _0x3585f1=new _0x21bd9e(this['locale']);return _0x3585f1['set']({'label':y(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x3585f1['bind']('isEnabled')['to'](this,'isError',_0x2287a8=>!_0x2287a8),_0x3585f1['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2ee36e=>!_0x2ee36e),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x47b6cf=>_0x47b6cf)]}}),_0x3585f1['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x3585f1;}['_createExitReviewButtonView'](){const _0xd0b164=new _0x21bd9e(this['locale']);return _0xd0b164['set']({'label':y(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0xd0b164['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0xd5ee17=>!_0xd5ee17),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x338626=>_0x338626)]}}),_0xd0b164['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0xd0b164;}['_createResultHeaderView'](){const _0x2f62f3=new _0x492b6b(this['locale']),_0x4ac4ea=this['_createTitleView']();return _0x2f62f3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai-review-mode__review-completed-header',_0x746575=>_0x746575)]},'children':[_0x4ac4ea,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x2f62f3;}['_createTitleView'](){const _0x3a3ff9=new _0x492b6b(this['locale']),_0x438a90=new je();return _0x438a90['bind']('isVisible')['to'](this,'isResultReady',_0xbff822=>!_0xbff822),_0x3a3ff9['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-wrapper']},'children':[_0x438a90,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3b0c5f=>_0x3b0c5f)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4a14bc=>!_0x4a14bc)]},'children':[{'text':y(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x3a3ff9;}['_createFinishReviewButtonView'](){const _0x15b4d1=new vr(this['locale']);return _0x15b4d1['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3ddc4f=>!_0x3ddc4f)]}}),_0x15b4d1['delegate']('finishReview')['to'](this),_0x15b4d1;}}class th extends _0x8a8c30{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x155987){super(_0x155987),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x364c0c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x364c0c['if']('isVisible','ck-hidden',_0x3cf2bb=>!_0x3cf2bb)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai-review-mode__review-completed-content-text']},'children':[{'text':y(_0x155987,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x54edda=new vr(this['locale']);return _0x54edda['delegate']('finishReview')['to'](this),_0x54edda;}['_createResultHeaderView'](){const _0x4ac394=new _0x492b6b(this['locale']);return _0x4ac394['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title']},'children':[{'text':y(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x4ac394;}}class hh extends _0x492b6b{constructor(_0x2fceb8){super(_0x2fceb8),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x2e22e7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__general-error-container',_0x2e22e7['if']('isVisible','ck-hidden',_0x4c0565=>!_0x4c0565)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x2e22e7['to']('errorMessage')}]}]});}}class ue extends _0x492b6b{['reviewModeHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x183699){super(_0x183699),this['reviewModeHeader']=new _0x5e5898(_0x183699,{'label':y(_0x183699,'AI_REVIEW_MODE'),'icon':_0x48c39b,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['generalErrorView']=new hh(_0x183699),this['reviewCheckListView']=new ih(_0x183699),this['reviewCheckListView']['delegate'](...sh)['to'](this),this['reviewCheckResultsView']=new eh(_0x183699),this['reviewCheckResultsView']['delegate'](...sh)['to'](this),this['reviewCompletedView']=new th(_0x183699),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-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],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'](_0x1c59e3){this['reviewCheckResultsView']['addResult'](_0x1c59e3),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;}['showGeneralReviewModeErrorView'](_0x5dc6f1){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x5dc6f1;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class Re extends _0x257cec{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x1d73cf,_0x5d3179){super(_0x1d73cf),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']()),_0x5d3179['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x8a98e0){this['resultItemView']['changeId']=_0x8a98e0['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x8a98e0['contentDiffed'];}['showBalloon'](_0x2bd245,_0x1db0de,_0x535ab5,_0x133ef5,_0x25776a,_0x478133){this['_removeActiveClassFromMarkers'](),this['updateContent'](_0x2bd245),this['show']();const _0x5b9555=Array['from'](_0x1db0de['getClientRects']())['reverse'](),_0x308bbb=this['_getPointedRectIndexFromEvent'](_0x535ab5,_0x5b9555);'click'===_0x133ef5?(this['isDiffActive']=!0x0,this['_setActiveClassOnMarker'](_0x2bd245['id']),this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x1db0de,_0x308bbb,_0x2bd245['id'],_0x25776a,_0x478133)})):'hover'===_0x133ef5&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x1db0de,_0x308bbb,_0x2bd245['id'])}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_removeActiveClassFromMarkers'](),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');}['_removeActiveClassFromMarkers'](){_0x384749['document']['querySelectorAll']('.ck-ai-review-mode__change_active')['forEach'](_0x3cd19f=>{_0x3cd19f['classList']['remove']('ck-ai-review-mode__change_active');});}['_setActiveClassOnMarker'](_0x3935eb){_0x384749['document']['querySelectorAll']('span[data-marker-id*=\x22'+_0x3935eb+'\x22]')['forEach'](_0x7129d1=>{_0x7129d1['classList']['add']('ck-ai-review-mode__change_active');});}['_setupClickOutsideHandler'](){ts({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x1425c3=[this['element']];return this['_pinnedTargetElement']&&_0x1425c3['push'](this['_pinnedTargetElement']),_0x1425c3;},'callback':()=>{this['hide'](),this['unpin'](),this['_removeActiveClassFromMarkers'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0xca325c=new _0x492b6b();return this['resultItemView']=new Ps(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0xca325c['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai-review-mode-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0xca325c;}['_getBestRectPositionOnClick'](_0x595945,_0xefdea1,_0x371c96,_0x6b909d,_0xfeb17a){const _0x25fae5=this['position']['replace']('arrow_',''),_0x22db20=Array['from'](_0x595945['getClientRects']());let _0x402021,_0x5b95de=_0x22db20['reverse']();return void 0x0!==_0xefdea1&&this['_isPinnedRectVisible'](_0x5b95de[_0xefdea1],_0x6b909d,_0xfeb17a)?(_0x402021=_0x5b95de[_0xefdea1],this['_pinnedRectIndex']=_0xefdea1):this['_isPinnedRectVisible'](_0x5b95de[0x0],_0x6b909d,_0xfeb17a)&&void 0x0===_0xefdea1?_0x402021=_0x5b95de[0x0]:(_0x5b95de='s'==_0x25fae5[0x0]?[..._0x22db20]['reverse']():_0x22db20,_0x5b95de['forEach'](_0x318912=>{this['_isPinnedRectVisible'](_0x318912,_0x6b909d,_0xfeb17a)&&(_0x402021=_0x318912);})),this['_pinnedTargetChangeId']=_0x371c96,this['_pinnedTargetElement']=_0x595945,_0x402021||_0x595945['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x312bb5,_0x1b50cc,_0x42304e){const _0x35eb45=Array['from'](_0x312bb5['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x1b50cc&&this['_pinnedTargetChangeId']!==_0x42304e)return this['_pinnedRectIndex']=_0x1b50cc,this['_pinnedTargetElement']=_0x312bb5,this['_pinnedTargetChangeId']=_0x42304e,_0x35eb45[_0x1b50cc];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x42304e){if(_0x312bb5!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x35eb45[this['_pinnedRectIndex']];}return void 0x0!==_0x1b50cc&&this['_pinnedTargetChangeId']!==_0x42304e?(this['_pinnedRectIndex']=_0x1b50cc,this['_pinnedTargetElement']=_0x312bb5,this['_pinnedTargetChangeId']=_0x42304e,_0x35eb45[_0x1b50cc]):_0x312bb5['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x1912c9,_0x5422ec){if(_0x1912c9)for(let _0x10c893=0x0;_0x10c893<_0x5422ec['length'];_0x10c893++){const _0x7f9d7d=_0x5422ec[_0x10c893];if(_0x1912c9['clientX']>=_0x7f9d7d['left']-0x3&&_0x1912c9['clientX']<=_0x7f9d7d['right']+0x3&&_0x1912c9['clientY']>=_0x7f9d7d['top']-0x3&&_0x1912c9['clientY']<=_0x7f9d7d['bottom']+0x3)return _0x10c893;}}['_isPinnedRectVisible'](_0x39730c,_0x492d4a,_0x31fa71){const _0x3dff6a=new _0x1ba12e(_0x39730c),_0x4d0664=_0x492d4a||document['documentElement'],_0xa93ef9=_0x3dff6a['getIntersection'](_0x4fae9d(_0x31fa71)),_0x41ff26=new _0x1ba12e(_0x4d0664)['getIntersection'](_0x3dff6a);return!!(_0xa93ef9&&_0x41ff26&&_0x3dff6a['width']>0x0);}}const sh=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class re extends _0x4404b9{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[$];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x808258){super(_0x808258),this['_bodyCollection']=new Kt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new ue(this['context']['locale']),this['_reviewModeView']['delegate'](...sh)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new Re(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x2faeea=this['context']['plugins']['get']('AITabs');_0x2faeea['view']['on']('activateTab',(_0x33fc5c,_0x4afd1f)=>{'reviewMode'===_0x4afd1f?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x2faeea['view']['addTab']({'id':'reviewMode','buttonLabel':y(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x48c39b,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x3979d1){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x3979d1),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x3c45fe){_0x3c45fe&&('error-general'!==_0x3c45fe['status']?'error-chunk'!==_0x3c45fe['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x3b24ab){this['_reviewModeView']['addCheckRunResult'](_0x3b24ab);}['showGeneralResultsErrorView'](){this['_reviewModeView']['showGeneralResultsErrorView']();}['showGeneralReviewModeErrorView'](_0x15c815){this['_reviewModeView']['showGeneralReviewModeErrorView'](_0x15c815??y(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x45f578,_0x30112d){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x45f578,_0x30112d);}['setActiveStateInResults'](_0x27a2bf){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x4cf0fe=>{_0x4cf0fe['id']===_0x27a2bf&&_0x4cf0fe['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0xe49218=>_0xe49218['setItemAsInactive']());}['updateChangeState'](_0x8cd51a,_0x28594c){'accepted'===_0x28594c||'rejected'===_0x28594c||'outdated'===_0x28594c?this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x8cd51a,_0x28594c):this['_reviewModeView']['reviewCheckResultsView']['showResult'](_0x8cd51a,_0x28594c);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x1fb931,_0xcc8f5c,_0x215e19,_0x241c7b,_0x1339e8,_0x592901){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x1fb931,_0xcc8f5c,_0x215e19,_0x241c7b,_0x1339e8,_0x592901);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['hideDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['showDiffInBalloon']();}['getChangeElement'](_0x297d15){const _0x51b47c=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x23c2a2=>_0x23c2a2['id']===_0x297d15);return _0x51b47c?_0x51b47c['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const le='reviewmode-';class oe extends _0x4404b9{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x1f61c4,c];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x59c220){super(_0x59c220),this['_domEmitter']=new(_0x22fceb())(),this['_eventEmitter']=new(_0x3dcb71())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x43090d=P(this['context']);_0x43090d['conversion']['for']('editingDowncast')['markerToElement']({'model':le+'insert','view':(_0x5e1e3e,{writer:_0x224776})=>{const _0xb4914d=this['_markers']['get'](_0x5e1e3e['markerName']),_0x479f81={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x5e1e3e['markerName']};return _0x224776['createUIElement']('span',_0x479f81,function(_0x4c5c0b){const _0x3e7eda=this['toDomElement'](_0x4c5c0b);return _0x3e7eda['innerHTML']=_0xb4914d?.['text']||'',_0x3e7eda;});}}),_0x43090d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':le+'remove-only','view':_0x41d829=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x41d829['markerName']}})}),_0x43090d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':le+'remove-context','view':_0x390d10=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x390d10['markerName']}})}),_0x43090d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':le+'remove-text','view':_0x26bd95=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x26bd95['markerName']}})}),_0x43090d['conversion']['for']('dataDowncast')['markerToElement']({'model':le+'suggestion-context','view':(_0x1f8413,{writer:_0x3c21d5})=>_0x3c21d5['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x1f8413['isOpening']?'start':'end')})}),_0x43090d['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x359efb,'view':_0x5438d9}),this['_domEmitter']['listenTo'](document,'click',(_0x4dfae3,_0x13e257)=>{const _0x148dfc=_0x13e257['target'],_0x232fff=this['_findMarkerElement'](_0x148dfc);if(!_0x232fff)return;const _0x4acb06=_0x232fff['getAttribute']('data-marker-id'),_0x2b219c=_0x4acb06['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x4acb06,'changeId':_0x2b219c,'markerElement':_0x232fff,'domEvent':_0x13e257});}),this['_domEmitter']['listenTo'](document,'mouseover',(_0x4f9f80,_0x1b03b5)=>{const _0x22a5f9=_0x1b03b5['target'],_0x45f62a=_0x1b03b5['relatedTarget'];let _0x37acaf=this['_findMarkerElement'](_0x22a5f9);if(!_0x37acaf&&_0x45f62a&&(_0x37acaf=this['_findMarkerElement'](_0x45f62a)),!_0x37acaf)return;const _0x2e719d=_0x37acaf['getAttribute']('data-marker-id'),_0x36b5ea=_0x2e719d['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x36b5ea,'markerElement':_0x37acaf,'domEvent':_0x1b03b5});}),this['_domEmitter']['listenTo'](document,'mouseover',_0xa4b43((_0x343acf,_0xbd4efe)=>{const _0x342c9f=_0xbd4efe['target'];if(this['_findMarkerElement'](_0x342c9f))return;_0x342c9f['closest']('.ck-reset.ck-ai-review-mode-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x43090d['model']['document']['registerPostFixer'](_0x513d9=>this['_validateMarkers'](_0x43090d,_0x513d9)),_0x43090d['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x43090d));}['getDocumentData'](){const _0x29480d=this['context']['plugins']['get']('AIEditing'),_0x1f4e20=P(this['context']),_0x3d5487=_0x1f4e20['model'],_0x58a84e=new _0x246996();for(const _0x182f68 of _0x3d5487['document']['getRoot']()['getChildren']()){const _0x5319b3=_0x182f68['_clone'](!0x0);_0x58a84e['_appendChild'](_0x5319b3);}for(const _0x2e1321 of _0x3d5487['markers'])_0x58a84e['markers']['set'](_0x2e1321['name'],this['_changeRangeOwnerDocument'](_0x2e1321['getRange']()['clone'](),_0x58a84e));const _0x5ef2de=new _0x31667d({'ignoreElementEnd':!0x0,'startPosition':_0x3d5487['createPositionAt'](_0x58a84e,0x0)}),_0x44ad4c=new Set(),_0x3f875b=new Map();for(const {item:_0x358c1e}of _0x5ef2de){if(!_0x358c1e['is']('$textProxy'))continue;const _0x5e7d80=_0x358c1e['parent'];if(_0x5e7d80&&_0x5e7d80['is']('element')){const _0x2b4057=this['_upsertDataId'](_0x5e7d80,()=>_0x29480d['_nextDataId'](_0x44ad4c));_0x44ad4c['add'](_0x2b4057);for(const _0xc66eaf of _0x5e7d80['getChildren']())_0xc66eaf['is']('element')&&_0x44ad4c['add'](this['_upsertDataId'](_0xc66eaf,()=>_0x29480d['_nextDataId'](_0x44ad4c)));let _0x5c0758=_0x5e7d80;for(;_0x5c0758['parent']&&!_0x5c0758['parent']['is']('documentFragment');)_0x5c0758=_0x5c0758['parent'],_0x5c0758['hasAttribute'](_0x359efb)&&_0x5c0758['_removeAttribute'](_0x359efb);_0x3f875b['set'](_0x2b4057,{'path':_0x5e7d80['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x5c0758['_clone'](!0x0),_0x2b4057,_0x1f4e20['data'])}),_0x5ef2de['jumpTo'](_0x3d5487['createPositionAfter'](_0x5e7d80));}}return{'content':_0x1f4e20['data']['processor']['toData'](_0x1f4e20['data']['toView'](_0x58a84e)),'version':_0x1f4e20['model']['document']['version'],'elements':_0x3f875b};}['diffContent'](_0x45d34f,_0x5de3f4){const _0x147e79=[],_0x6397fd=P(this['context']),_0x483c8f=_0x6397fd['data']['parse'](_0x5de3f4,'$documentFragment'),_0x27e0f3=_0x6397fd['data']['parse'](_0x45d34f,'$documentFragment'),_0x1b926d=_0x6397fd['model']['createPositionAt'](_0x27e0f3,0x0);if(this['_haveSingleTopLevelElement'](_0x483c8f)){if(!this['_hasSameTopLevelElement'](_0x27e0f3,_0x483c8f))return _0x147e79;}else{const _0x55e567=_0x6397fd['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x27e0f3,_0x55e567)||!this['_haveOnlyInlineContent'](_0x483c8f,_0x55e567))return _0x147e79;}const _0x56581e=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x45d34f,_0x5de3f4,{'anchor':_0x1b926d,'markDeletions':!0x0})['getOperations']()['filter'](_0x55c8f7=>'insert'===_0x55c8f7['type']||'marker'===_0x55c8f7['type']&&_0x55c8f7['name']['startsWith']('$markedRemove')),_0x44cc9f=this['_groupAdjacentOperations'](_0x56581e);let _0xd5afbd=0x0;return _0x6397fd['model']['change'](_0xf4e93a=>{for(let _0x3b981a=0x0;_0x3b981a<_0x44cc9f['length'];_0x3b981a++){const _0x5c889a=_0x44cc9f[_0x3b981a],_0x3e6199=_0xf4e93a['createDocumentFragment']();for(const _0xe0a14b of _0x27e0f3['getChildren']())_0xf4e93a['append'](_0xe0a14b['_clone'](!0x0),_0x3e6199);for(const _0x44af29 of _0x5c889a['operationsIsolated'])if('insert'===_0x44af29['type']){const _0x19e756=_0x44af29;_0x19e756['baseVersion']=null,_0x19e756['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x19e756,_0x3e6199),_0xf4e93a['batch']['addOperation'](_0x44af29),_0x6397fd['model']['applyOperation'](_0x44af29);const _0x17c77c='suggestion:insertion:id:authorId:'+_0xd5afbd++,_0x23260d=_0x6397fd['model']['createRange'](_0x19e756['position'],_0x19e756['position']['getShiftedBy'](_0x19e756['howMany']));_0x3e6199['markers']['set'](_0x17c77c,_0x23260d);}else{if('marker'===_0x44af29['type']&&_0x44af29['name']['startsWith']('$markedRemove')){const _0x3eb5b6=_0x44af29,_0x4cde53='suggestion:deletion:id:authorId:'+_0xd5afbd++;this['_changeOperationOwnerDocument'](_0x3eb5b6,_0x3e6199),_0x3e6199['markers']['set'](_0x4cde53,_0x3eb5b6['newRange']);}}const _0x584fc0=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x5c889a['operationsIsolated'][0x0]),_0x3e6199),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x5c889a['operationsIsolated'][_0x5c889a['operationsIsolated']['length']-0x1]),_0x3e6199));_0x3e6199['markers']['set'](le+'suggestion-context',new _0x184fda(_0x584fc0['start'],_0x584fc0['end'])),_0x147e79['push']({..._0x5c889a,'context':this['_createGetContextFn'](_0x3e6199,_0x6397fd['data'],{'ellipsisBefore':_0x584fc0['hasContentBefore'],'ellipsisAfter':_0x584fc0['hasContentAfter']}),'content':this['_createGetContentFn'](_0x3e6199,_0x6397fd['data'])});}}),_0x147e79;}['markChangePositionInEditorContent'](_0x53cc02,_0x43d3e1){if(!_0x53cc02['length'])return;const _0x44577e=_0x53cc02[0x0]['parent']['id'],_0x5ee02d=_0x43d3e1['elements']['get'](_0x44577e);if(!_0x5ee02d)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x44577e);const _0x23ae62=_0x5ee02d['path'],_0x2251b4=P(this['context']),_0x548846=_0x2251b4['model']['document']['history']['getOperations'](_0x43d3e1['version']),_0x423235=[];for(const _0x1f8b44 of _0x53cc02){const _0x17b728=_0x1f8b44['operationsIsolated']['map'](_0x4f319f=>this['_translateOperationToEditorContent'](_0x4f319f,_0x23ae62,_0x2251b4['model']['document']['getRoots']()[0x0]));if(!_0x17b728||!_0x17b728['length'])continue;const _0x4de2a3=_0x17b728['every'](_0x403f6e=>'marker'===_0x403f6e['type']&&_0x403f6e['name']['startsWith']('$markedRemove')),_0x16493d={'document':_0x2251b4['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x14c693=_0x39cd19(_0x17b728,_0x548846,_0x16493d)['operationsA'];for(const _0x13d503 of _0x14c693)if('insert'===_0x13d503['type']){const _0x34e9a5=_0x13d503,_0x25852f=_0x34e9a5['nodes'];let _0x25ce95='';for(const _0x1d7ee0 of _0x25852f)_0x1d7ee0&&_0x1d7ee0['is']('model:$text')&&(_0x25ce95+=_0x1d7ee0['data']);_0x423235['push']({'start':_0x34e9a5['position'],'end':_0x34e9a5['position'],'type':'insert','groupId':_0x1f8b44['id'],'text':_0x25ce95});}else{if('marker'===_0x13d503['type']&&_0x13d503['name']['startsWith']('$markedRemove')){const _0x14c8e5=_0x13d503;let _0x633ea0='remove-text';if(_0x4de2a3){const _0x4063f5=this['_findAdjacentContextDistance'](_0x14c8e5['newRange']['start'],'backward',_0x2251b4['model']['schema']),_0xfdb7b9=this['_findAdjacentContextDistance'](_0x14c8e5['newRange']['end'],'forward',_0x2251b4['model']['schema']);if(_0x4063f5||_0xfdb7b9){const _0x717540=_0x14c8e5['newRange']['start']['getShiftedBy'](-_0x4063f5),_0x4fa7e2=_0x14c8e5['newRange']['end']['getShiftedBy'](_0xfdb7b9);_0x423235['push']({'start':_0x717540,'end':_0x4fa7e2,'groupId':_0x1f8b44['id'],'type':'remove-context'});}else _0x633ea0='remove-only';}_0x423235['push']({'start':_0x14c8e5['newRange']['start'],'end':_0x14c8e5['newRange']['end'],'groupId':_0x1f8b44['id'],'type':_0x633ea0});}}}this['_insertMarkers'](_0x423235);}['clearAllMarkers'](){const _0x4769db=P(this['context']);_0x4769db['model']['change'](_0x1e5b9f=>{for(const _0x1c7e5c of this['_markers']['keys']())_0x4769db['model']['markers']['get'](_0x1c7e5c)&&_0x1e5b9f['removeMarker'](_0x1c7e5c);}),this['_markers']['clear']();}['switchToReadOnly'](){P(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){P(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x584e30){const _0x571b2e=P(this['context']),_0x453dc4=_0x571b2e['model'],_0x29a13b=_0x584e30['map'](_0x55e374=>this['_getMarkersDataForGroup'](_0x55e374))['flat']();_0x453dc4['change'](_0x25e332=>{for(const _0x3cfecd of _0x29a13b){const _0x549af0=_0x571b2e['model']['markers']['get'](_0x3cfecd['id']);_0x549af0&&('insert'===_0x3cfecd['type']?_0x453dc4['insertContent'](_0x25e332['createText'](_0x3cfecd['text']||''),_0x549af0['getRange']()['start']):'remove-text'!==_0x3cfecd['type']&&'remove-only'!==_0x3cfecd['type']||_0x453dc4['deleteContent'](_0x453dc4['createSelection'](_0x549af0['getRange']())),_0x25e332['removeMarker'](_0x3cfecd['id']),this['_markers']['delete'](_0x3cfecd['id']));}});}['rejectChange'](_0x1ad72a){const _0x1b35d0=P(this['context']),_0x4fa63b=this['_getMarkersDataForGroup'](_0x1ad72a);_0x1b35d0['model']['change'](_0x44e72f=>{for(const _0x25bc8d of _0x4fa63b)_0x44e72f['removeMarker'](_0x25bc8d['id']),this['_markers']['delete'](_0x25bc8d['id']);});}['getEditor'](){return P(this['context']);}['getMarkerElementForChange'](_0x33283){const _0x3a82b9=Array['from'](this['_markers']['values']())['filter'](_0x1a2718=>_0x1a2718['groupId']===_0x33283);if(!_0x3a82b9['length'])return null;const _0x3b1aa6=0x1===_0x3a82b9['length']?_0x3a82b9[0x0]:this['_sortMarkers'](_0x3a82b9)[0x0],_0x34a9a2=P(this['context']),_0xe8240b=_0x34a9a2['model']['markers']['get'](_0x3b1aa6['id']);if(!_0xe8240b)return null;const _0x3bd558=_0xe8240b['getRange'](),_0x4ddf6c=_0x34a9a2['editing']['view']['getDomRoot']();if(!_0x4ddf6c||!_0x3bd558)return null;const _0x480db8=_0x4ddf6c['querySelector']('[data-marker-id=\x22'+_0x3b1aa6['id']+'\x22]');return _0x480db8?{'modelRange':_0x3bd558,'domElement':_0x480db8}:null;}['_validateMarkers'](_0x2751f1,_0x4b75fe){const _0x5a2c07=Array['from'](this['_markers']['keys']()),_0xbd597d=new Map();for(const _0x1356db of _0x5a2c07){const _0x183848=_0x2751f1['model']['markers']['get'](_0x1356db);if(!_0x183848)continue;const _0x565593=_0x183848['getStart']()['path'][0x0];_0xbd597d['has'](_0x565593)||_0xbd597d['set'](_0x565593,[]),_0xbd597d['get'](_0x565593)['push'](_0x183848);}const _0x1b3425=new Set();for(const _0x3e2f91 of _0x2751f1['model']['document']['differ']['getChanges']()){let _0x751451=-0x1,_0x113b26=null;if('insert'===_0x3e2f91['type'])_0x113b26=new _0x184fda(_0x3e2f91['position'],_0x3e2f91['position']['getShiftedBy'](_0x3e2f91['length'])),_0x751451=_0x3e2f91['position']['path'][0x0];else{if('remove'!==_0x3e2f91['type'])continue;_0x113b26=new _0x184fda(_0x3e2f91['position']),_0x751451=_0x3e2f91['position']['path'][0x0];}const _0x439bb7=_0xbd597d['get'](_0x751451)||[];if(_0x439bb7['length']){for(const _0xaa0df of _0x439bb7)if(_0x113b26['root']['rootName']===_0xaa0df['getRange']()['root']['rootName']&&('insert'!==_0x3e2f91['type']||!_0x113b26['containsRange'](_0xaa0df['getRange']()))&&(_0x113b26['isIntersecting'](_0xaa0df['getRange']())||_0x113b26['start']['isTouching'](_0xaa0df['getRange']()['end'])||_0x113b26['end']['isTouching'](_0xaa0df['getRange']()['start']))){const _0x3ff015=this['_parseMarkerName'](_0xaa0df['name']);Array['from'](this['_markers']['values']())['filter'](_0x3a3976=>_0x3a3976['groupId']===_0x3ff015['groupId'])['forEach'](_0x57569a=>_0x1b3425['add'](_0x57569a['id']));}}}if(_0x1b3425['size']){for(const _0x10084f of _0x1b3425)_0x4b75fe['removeMarker'](_0x10084f);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x304bc9){for(const {name:_0x52c1aa,data:_0xe4f177}of _0x304bc9['model']['document']['differ']['getChangedMarkers']()){if(!_0x52c1aa['startsWith'](le))continue;const _0x58b381=_0xe4f177['oldRange'],_0x3a5c56=_0xe4f177['newRange'],_0x1e7502=_0x58b381&&'$graveyard'===_0x58b381['root']['rootName'],_0x454b2e=_0x3a5c56&&'$graveyard'===_0x3a5c56['root']['rootName'];if(_0x1e7502&&_0x454b2e)continue;const _0x55b0f8=this['_parseMarkerName'](_0x52c1aa);this['_markers']['get'](_0x52c1aa)&&(_0x454b2e||!_0x3a5c56?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x52c1aa,'changeId':_0x55b0f8['groupId']}):_0x1e7502&&_0x3a5c56&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x52c1aa,'changeId':_0x55b0f8['groupId']}));}}['_parseMarkerName'](_0x2b4ecf){const _0x6d8e8f=_0x2b4ecf['split'](':'),_0x1a85fd=(_0x6d8e8f[0x1]||'')['split']('_');return{'prefix':_0x6d8e8f[0x0],'groupId':_0x1a85fd[0x0],'suffix':_0x1a85fd[0x1]};}['_translateOperationToEditorContent'](_0x272812,_0x514aed,_0x3bf8f1){if('insert'===_0x272812['type']){const _0x357a1d=_0x272812;return new _0x207529(this['_changePosition'](_0x514aed['concat'](_0x357a1d['position']['offset']),_0x3bf8f1),_0x357a1d['nodes'],_0x357a1d['baseVersion']);}if('marker'===_0x272812['type']&&_0x272812['name']['startsWith']('$markedRemove')){const _0x5a132c=_0x272812;return new _0xd05c7f(_0x5a132c['name'],_0x5a132c['oldRange'],this['_changeRange'](_0x5a132c['newRange'],_0x514aed['concat'](_0x5a132c['newRange']['start']['offset']),_0x514aed['concat'](_0x5a132c['newRange']['end']['offset']),_0x3bf8f1),_0x5a132c['_markers'],_0x5a132c['affectsData'],_0x5a132c['baseVersion']);}return _0x272812;}['_groupAdjacentOperations'](_0x51eaec){if(!_0x51eaec['length'])return[];const _0x31167d=[];let _0x2267bd=0x0,_0x58616f=0x0,_0x95526=[];for(let _0x48cc2e=0x0;_0x48cc2e<=_0x51eaec['length'];_0x48cc2e++){const _0x567add=_0x51eaec[_0x48cc2e],_0x4e2ba7=_0x51eaec[_0x48cc2e-0x1];!_0x567add||_0x4e2ba7&&!this['_getOperationEnd'](_0x4e2ba7)['isTouching'](this['_getOperationStart'](_0x567add))?(_0x31167d['push']({'operations':_0x95526,'operationsIsolated':_0x95526['map'](_0xcad83e=>this['_shiftOperation'](_0xcad83e['clone'](),-_0x58616f)),'groupOffset':_0x2267bd}),_0x95526=_0x567add?[_0x567add]:[],_0x58616f+=_0x2267bd,_0x2267bd=0x0):_0x95526['push'](_0x567add),_0x567add&&'insert'===_0x567add['type']&&(_0x2267bd+=_0x567add['howMany']);}return _0x31167d;}['_findAdjacentContextDistance'](_0x4ce89d,_0x22370c,_0x48ab4a,_0x38602e=0x1){const _0x3d6f39=new _0x31667d({'startPosition':_0x4ce89d,'direction':_0x22370c});let _0x4aceb1=0x0;for(let _0x17e885=0x0;_0x17e885<_0x38602e;_0x17e885++){let _0x2452b5=0x0,_0xa2093=!0x1,_0x312cea='forward'===_0x22370c?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x54ac67}of _0x3d6f39)if(_0x54ac67['is']('$textProxy')){const _0x54ae64=_0x312cea['exec'](_0x54ac67['data']);if(_0x54ae64&&_0x54ae64['length']){if(_0x2452b5+='forward'===_0x22370c?_0x54ae64['index']+_0x54ae64[0x0]['length']:_0x54ac67['data']['length']-_0x54ae64['index'],_0x54ae64[0x0]['length']!==_0x54ac67['data']['length'])break;_0xa2093=!0x0,_0x312cea='forward'===_0x22370c?/^\w+/:/\w+$/;}else{if(_0xa2093)break;_0x2452b5+=_0x54ac67['offsetSize'];}}else{if(_0x54ac67['is']('element')){_0x48ab4a['isInline'](_0x54ac67)&&!_0xa2093&&(_0x2452b5+=0x1);break;}}_0x4aceb1+=_0x2452b5,_0x3d6f39['jumpTo'](_0x4ce89d['getShiftedBy']('forward'===_0x22370c?_0x4aceb1:-_0x4aceb1));}return _0x4aceb1;}['_getChangeContext'](_0x120206,_0x158030){const _0x4bb5fd=P(this['context'])['model']['schema'],_0x279935=this['_findAdjacentContextDistance'](_0x120206,'backward',_0x4bb5fd,0x6),_0x756a13=this['_findAdjacentContextDistance'](_0x158030,'forward',_0x4bb5fd,0x6),_0x1e6408=_0x120206['getShiftedBy'](-_0x279935),_0x536f76=_0x158030['getShiftedBy'](_0x756a13);return{'start':_0x1e6408,'end':_0x536f76,'hasContentBefore':!_0x1e6408['isAtStart'],'hasContentAfter':!_0x536f76['isAtEnd']};}['_insertMarkers'](_0x3b6f70){const _0x201682=this['context']['plugins']['get']('AIEditing'),_0x5a3b21=new Set();P(this['context'])['model']['change'](_0x314954=>{for(const _0x5b3f62 of _0x3b6f70){const _0x8ac840=''+le+_0x5b3f62['type']+':'+_0x5b3f62['groupId']+'_'+_0x201682['_nextDataId'](_0x5a3b21);this['_markers']['set'](_0x8ac840,{'id':_0x8ac840,'groupId':_0x5b3f62['groupId'],'type':_0x5b3f62['type'],'text':_0x5b3f62['text']}),_0x314954['addMarker'](_0x8ac840,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x314954['createRange'](_0x5b3f62['start'],_0x5b3f62['end'])});}});}['_createGetContextFn'](_0x13866e,_0x4bc667,_0x992a36){let _0x2d7d5d='';return()=>{if(!_0x2d7d5d){const _0x3c0e2d=_0x4bc667['toView'](_0x13866e,{'showSuggestionHighlights':!0x0});let _0x2406d9=_0x3c0e2d['getChild'](0x0);if(_0x2406d9['is']('containerElement')||(_0x2406d9=_0x3c0e2d),!_0x2406d9)return'';let _0x2a23b5=!0x1;const _0x34853f=[];for(const _0x17fe2c of _0x2406d9['getChildren']())_0x17fe2c['is']('element','span')&&_0x17fe2c['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x2a23b5=!0x1),_0x2a23b5&&_0x34853f['push'](_0x17fe2c),_0x17fe2c['is']('element','span')&&_0x17fe2c['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x2a23b5=!0x0);_0x2406d9['_removeChildren'](0x0,_0x2406d9['childCount']),_0x992a36?.['ellipsisBefore']&&_0x2406d9['_appendChild']('…'),_0x2406d9['_appendChild'](_0x34853f),_0x992a36?.['ellipsisAfter']&&_0x2406d9['_appendChild']('…');const _0x8858d9=_0x4bc667['htmlProcessor']['domConverter']['viewToDom'](_0x3c0e2d),_0x821a25=_0x4bc667['htmlProcessor']['htmlWriter']['getHtml'](_0x8858d9);_0x2d7d5d=_0x821a25;}return _0x2d7d5d;};}['_createGetContentFn'](_0x5b967c,_0x4a6b8e){let _0x279cd2='';return()=>(_0x279cd2||(_0x279cd2=_0x4a6b8e['stringify'](_0x5b967c,{'showSuggestionHighlights':!0x0})),_0x279cd2);}['_createGetContentUsingDataIdFn'](_0x3f1ef8,_0x166fae,_0x2ba8ce){let _0x5925cd='';return()=>{if(!_0x5925cd){const _0x333c3d=_0x2ba8ce['toView'](new _0x246996(_0x3f1ef8)),_0x98dcca=_0x2ba8ce['htmlProcessor']['domConverter']['viewToDom'](_0x333c3d)['querySelector']('[data-id=\x22'+_0x166fae+'\x22]');_0x5925cd=_0x98dcca?.['outerHTML']||'';}return _0x5925cd;};}['_findMarkerElement'](_0x16d653,_0x840f2b=0x5){let _0x3916db=_0x16d653,_0x1f73d9=null;for(let _0x242c69=0x0;_0x242c69<_0x840f2b&&_0x3916db;_0x242c69++){if(!_0x3916db['className']){_0x3916db=_0x3916db['parentElement'];continue;}if(!(''+_0x3916db['className'])['includes']('ck-ai_review-mode-marker_')){_0x3916db=_0x3916db['parentElement'];continue;}if(!_0x3916db['getAttribute']('data-marker-id'))break;_0x1f73d9=_0x3916db;break;}return _0x1f73d9;}['_getMarkersDataForGroup'](_0x727e1b){return Array['from'](this['_markers']['values']())['filter'](_0x4508b4=>_0x4508b4['groupId']===_0x727e1b);}['_getOperationStart'](_0x5f3405){return'insert'===_0x5f3405['type']?_0x5f3405['position']:_0x5f3405['newRange']['start'];}['_getOperationEnd'](_0x4a94b1,_0x5f5dd3=!0x1){return'insert'===_0x4a94b1['type']?_0x5f5dd3?_0x4a94b1['position']:_0x4a94b1['position']['getShiftedBy'](_0x4a94b1['howMany']):_0x4a94b1['newRange']['end'];}['_shiftOperation'](_0x2ad849,_0x3fa26b){return'insert'===_0x2ad849['type']?_0x2ad849['position']=_0x2ad849['position']['getShiftedBy'](_0x3fa26b):'marker'===_0x2ad849['type']&&_0x2ad849['newRange']&&(_0x2ad849['newRange']=new _0x184fda(_0x2ad849['newRange']['start']['getShiftedBy'](_0x3fa26b),_0x2ad849['newRange']['end']['getShiftedBy'](_0x3fa26b))),_0x2ad849;}['_changeOperationOwnerDocument'](_0x1c7bae,_0x1a6566){'insert'===_0x1c7bae['type']?_0x1c7bae['position']=this['_changePositionOwnerDocument'](_0x1c7bae['position'],_0x1a6566):'marker'===_0x1c7bae['type']&&_0x1c7bae['newRange']&&(_0x1c7bae['newRange']=this['_changeRangeOwnerDocument'](_0x1c7bae['newRange'],_0x1a6566));}['_changePositionOwnerDocument'](_0x34cba8,_0x240cc9){return new _0x5a23f1(_0x240cc9,_0x34cba8['path']);}['_changeRangeOwnerDocument'](_0x22ac5a,_0x5a7356){return new _0x184fda(this['_changePositionOwnerDocument'](_0x22ac5a['start'],_0x5a7356),this['_changePositionOwnerDocument'](_0x22ac5a['end'],_0x5a7356));}['_changePosition'](_0x12ee4d,_0x38fd21){return new _0x5a23f1(_0x38fd21,[..._0x12ee4d]);}['_changeRange'](_0x150115,_0xd4b007,_0xdbb0c0,_0x19a32a){return new _0x184fda(this['_changePosition'](_0xd4b007,_0x19a32a),this['_changePosition'](_0xdbb0c0,_0x19a32a));}['_sortMarkers'](_0x5a748d){const _0x38ab31=_0x3a3bd8=>{switch(_0x3a3bd8){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x5a748d['sort']((_0x3ffa26,_0x90dade)=>_0x38ab31(_0x3ffa26['type'])-_0x38ab31(_0x90dade['type']));}['_hasSameTopLevelElement'](_0x2c6783,_0x539b0f){const _0x4aad9d=_0x2c6783['getChild'](0x0),_0x5b7b54=_0x539b0f['getChild'](0x0);return!(!_0x4aad9d||!_0x5b7b54)&&((!_0x4aad9d['is']('element')||!_0x5b7b54['is']('element')||_0x4aad9d['name']===_0x5b7b54['name'])&&!(_0x4aad9d['is']('element')&&!_0x5b7b54['is']('element')||!_0x4aad9d['is']('element')&&_0x5b7b54['is']('element')));}['_haveSingleTopLevelElement'](_0x462b66){return 0x1===_0x462b66['childCount'];}['_haveOnlyInlineContent'](_0x1177f,_0x3bf80b){for(const _0x4d5fb7 of _0x1177f['getChildren']())if(_0x4d5fb7['is']('element')&&!_0x3bf80b['isInline'](_0x4d5fb7))return!0x1;return!0x0;}['_upsertDataId'](_0xf4dab6,_0x1d7e8d){let _0x41694b=_0xf4dab6['getAttribute'](_0x359efb);return _0x41694b||(_0x41694b=_0x1d7e8d(),_0xf4dab6['_setAttribute'](_0x359efb,_0x41694b)),_0x41694b;}}class Fa extends _0x4404b9{static get['requires'](){return[ie,re,oe];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ji as AIActions,li as AIAdapter,$n as AIAssistant,ee as AIAssistantUI,w as AIBalloon,Ga as AIChat,q as AIChatController,V as AIChatHistory,ct as AIChatHistoryController,mt as AIChatHistoryUI,F as AIChatUI,s as AIConnector,c as AIEditing,Ba as AIEditorIntegration,Nt as AIQuickActionType,Wa as AIQuickActions,gi as AIQuickActionsUI,tr as AIRequestError,js as AIReviewCheck,Ds as AIReviewCheckResult,zs as AIReviewCheckRun,Fa as AIReviewMode,ie as AIReviewModeController,oe as AIReviewModeEditing,re as AIReviewModeUI,$ as AITabs,Te as AITextAdapter,bt as AIToggleButtonUI,Xn as AWSTextAdapter,Qn as OpenAITextAdapter,hi as ShowAIAssistantCommand,co as ToggleAICommand,ms as createResizeButton,qn as getDefaultAICommands};
23
+ import{Plugin as _0x2a032b,Command as Qt,ContextPlugin as _0x24ce56,Editor as pt}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x3b393d,IconCheck as _0x33d7d6,IconError as _0x271edd,IconSubmit as _0x265ec2,IconAIHistory as Nt,IconMagicWand as _0x2b1c79,IconRobotPencil as _0x59bdc2,IconMaximize as _0x45bbdf,IconMinimize as to,IconDocumentWithLoupe as _0x558df1,IconAddComment as _0x5aa8bc,IconShowChangesOn as _0x4b2741,IconShowChangesOff as _0x4db50e,IconDocument as _0x261f32,IconThreeStars as _0x30761e,IconRemove as _0x5c2b7a,IconDocumentWithCheckmark as _0x42e278,IconDocumentWithCross as _0x2cf6fc,IconLoupe as _0x115b67,IconCancel as _0x15e321,IconStop as _0x4a18d1,IconAIChat as Ht,IconPlus as _0x51df24,IconPin as _0x1a2605,IconThreeHorizontalDots as _0x33c4b0,IconChevronRight as _0x2c5965,IconInfo as _0x10c8fd,IconOutdated as _0x30c3f5,IconEye as _0x3fcade,IconEyeCrossedOut as _0x66bceb,IconAIReview as _0x18e785}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x1cb0e0,CKEditorError as _0x5cac2e,ObservableMixin as ts,global as _0x38b85c,isVisible as _0x36678f,Rect as _0x2063b2,Collection as _0x128d2a,FocusTracker as _0x5e98a3,KeystrokeHandler as _0x3678f9,first as _0x5f540c,toArray as _0x335512,EmitterMixin as _0x5194ed,logWarning as _0x200ccb,logError as _t,scrollViewportToShowTarget as _0x1a71b0,ResizeObserver as _0x5e59a0,_isMotionReduced as Pt,scrollAncestorsToShowTarget as _0x444aef,getConstrainedViewportRect as _0x2c67a3,DomEmitterMixin as _0x27b81b}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x384aff,ButtonView as _0x5be5f6,View as _0x1f124f,SpinnerView as _0x2f6b47,IconView as _0x26d10b,AutocompleteView as _0x1018e6,ListView as _0x5f8d0a,ListItemGroupView as _0x5a3051,ListItemView as _0x19da3d,ButtonLabelView as _0x3a2a12,FocusCycler as _0x12ca41,createLabeledTextarea as _0x4f979b,Dialog as _0xc33e8e,createDropdown as _0x12dfeb,addMenuToDropdown as _0x9e1579,MenuBarMenuView as _0x104620,MenuBarMenuListItemButtonView as _0x33defb,DialogViewPosition as _0xa39f85,MenuBarMenuListView as _0x4a8496,MenuBarMenuListItemView as _0x200fb1,UIModel as _0x2b6af7,SplitButtonView as _0x40793f,BalloonPanelView as _0x134db1,BodyCollection as _0x1e472e,clickOutsideHandler as _0x5e494e,ListItemButtonView as _0xa5864f,ViewCollection as _0x840caa,addListToDropdown as _0x8575d7,submitHandler as _0x4ef42a,LabeledFieldView as _0x448875,createLabeledInputText as _0x156742,FormHeaderView as _0xb4a1f4,HighlightedTextView as _0x1df954,FileDialogButtonView as _0x5337e2,InputTextView as _0x5d2b74,SearchTextView as _0x2c0dee,ButtonLabelWithHighlightView as _0x5f2692,DropdownMenuPanelPositioningFunctions as _0x8c845f,BalloonToolbar as _0x563d6a,FormRowView as _0x1dd36b,TextareaView as _0x31868f}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x308317,ClipboardMarkersUtils as _0x7c9b46}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x59a5a2,ViewDataTransfer as _0x54373c,ViewUpcastWriter as _0x509b4f,Matcher as _0x93dc7d,_DetachOperation as lt,_insertIntoModelNodeList as _0x1b31f9,_removeFromModelNodeList as _0x4c0e49,ModelRange as ht,ViewDowncastWriter as kt,transformOperationSets as ut,ModelDocumentFragment as at,ModelPosition as ct,ModelTreeWalker as _0x1ada95,InsertOperation as _0x5477f4,MarkerOperation as _0x34ebe2}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x2cda43,escape as _0x257ef5,escapeRegExp as _0x38bbb1,debounce as _0x2f0749}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x3318e1,InvokeModelWithResponseStreamCommand as _0x40a93f,InvokeModelCommand as _0x4d0ec4}from'@aws-sdk/client-bedrock-runtime';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x3eef3f}from'htmlparser2';import{isTag as _0x3cb149,findOne as St,getParent as _0x182a67,findAll as _0x41c79e,removeElement as _0x5d80a9,replaceElement as _0x158c15,prepend as _0x5e539d,prependChild as _0x57cbd0,appendChild as _0x292f5b,append as _0x186aa3,find as _0x5e6545,isComment as _0xfc9395,getChildren as _0x4bd440,textContent as _0x273932}from'domutils';import _0x1ff74f from'dom-serializer';import{Document as Ot,Element as _0x5847fe,Text as _0x38f6b5,cloneNode as _0x3fdce8,isDocument as _0x1ae2c2,isText as _0x1c2d69,NodeWithChildren as _0x276e08}from'domhandler';import{MarkdownGfmMdToHtml as _0x3839e3}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x988dda,getAllMarkersDomElementsSorted as _0xfe97ed,DocumentCompare as nt,DATA_ID_MODEL_ATTRIBUTE as At,ConfirmMixin as _0x1cf7a0,LateFocusDropdownButtonView as _0x491d60,DATA_ID_VIEW_ATTRIBUTE as _0x3ee98d}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x3caf73}from'es-toolkit';import{IconThumbUp as _0x551c36,IconThumbDown as _0x126149,IconCopy as _0x621568,IconCheck as _0x2e7acd,IconShowChangesOff as tt,IconShowChangesOn as _0x48d429,IconWeb as _0xcb7d20,IconNextArrow as _0x5af157,IconPreviousArrow as _0x31357f,IconAI as Dt,IconClose as _0xeed3e4,IconSelection as _0x533588,IconFileUpload as _0x2286ef,IconLink as _0x3c7071,IconDocument as _0x327358,IconBulb as _0x33af03,IconDocumentOutline as _0x3c36c7,IconPaperClip as _0x28b660,IconBrowseFiles as _0x38bdbd,IconDropdownArrow as _0x4deb05,IconAIAskAI as _0x5166a7,IconAIQuickActions as _0x1201c9,IconAIChatCommands as Wt,IconAIImproveWriting as Vt,IconAIContinueWriting as Bt,IconAIGrammarCheck as Jt,IconAIAdjustLength as Kt,IconAIChangeTone as Gt,IconAITranslate as Zt,IconAIOther as Xt,IconRefresh as _0x4fb256}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x51bf13 from'morphdom';import{SuggestionsConversion as zt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{diffArrays as _0x582dcc}from'diff';const K='_ungrouppedCommands';function o(_0x2fbf30,_0x4a1f5f){const _0x1b7fa6=(0x0,_0x4a1f5f['t'])('Other');return _0x2fbf30['length']?'groupId'in _0x2fbf30[0x0]?_0x2fbf30:[{'groupId':K,'groupLabel':_0x1b7fa6,'order':0x1/0x0,'commands':_0x2fbf30}]:[{'groupId':K,'groupLabel':_0x1b7fa6,'order':0x1/0x0,'commands':[]}];}const Yn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x2a032b{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x15857f}=this,_0x289015=['ck-fake-ai-selection'];_0x15857f['config']['get']('ai.assistant.useTheme')&&_0x289015['push']('ck-ai-assistant-ui_theme'),_0x15857f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x289015,'priority':0xc}}),_0x15857f['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x3a19da,{writer:_0x4df285})=>{if(!_0x3a19da['markerRange']['isCollapsed'])return null;const _0xadbaf6=_0x4df285['createUIElement']('span');return _0x4df285['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0xadbaf6),_0xadbaf6;}});}['afterInit'](){!async function(_0x17032b){const _0x425151=_0x50b79a([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]),_0x869df6=0x3dffc4e1,_0x12380b=0x3df8be71^_0x869df6,_0x23667d=window[_0x50b79a([0x44,0x61,0x74,0x65])][_0x50b79a([0x6e,0x6f,0x77])](),_0x4831a8=_0x17032b[_0x50b79a([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x37272c=new window[(_0x50b79a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4680d7=>{_0x4831a8[_0x50b79a([0x6f,0x6e,0x63,0x65])](_0x50b79a([0x72,0x65,0x61,0x64,0x79]),_0x4680d7);}),_0x23a8db={[_0x50b79a([0x6b,0x74,0x79])]:_0x50b79a([0x45,0x43]),[_0x50b79a([0x75,0x73,0x65])]:_0x50b79a([0x73,0x69,0x67]),[_0x50b79a([0x63,0x72,0x76])]:_0x50b79a([0x50,0x2d,0x32,0x35,0x36]),[_0x50b79a([0x78])]:_0x50b79a([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]),[_0x50b79a([0x79])]:_0x50b79a([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]),[_0x50b79a([0x61,0x6c,0x67])]:_0x50b79a([0x45,0x53,0x32,0x35,0x36])},_0x30301a=_0x4831a8[_0x50b79a([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x50b79a([0x67,0x65,0x74])](_0x50b79a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x28ea89(){let _0x430b1e,_0xbe736e=null,_0x1bb202=null;try{if(_0x30301a==_0x50b79a([0x47,0x50,0x4c]))return _0x50b79a([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x430b1e=_0x40864a(),!_0x430b1e)return _0x50b79a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x430b1e[_0x50b79a([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x1bb202=_0x5d6d1a(_0x430b1e[_0x50b79a([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x430b1e[_0x50b79a([0x6a,0x74,0x69])])),await _0x1a1711()?_0x20589a()?_0x5388a4()?_0x50b79a([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x340643()?(_0x430b1e[_0x50b79a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x50b79a([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0xbe736e=_0x39e5e1(_0x50b79a([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x430b1e[_0x50b79a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x50b79a([0x74,0x72,0x69,0x61,0x6c])&&(_0xbe736e=_0x39e5e1(_0x50b79a([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x47b2d5()):_0x50b79a([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x50b79a([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x50b79a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x50b79a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5388a4(){const _0x2705e=[_0x50b79a([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x50b79a([0x74,0x72,0x69,0x61,0x6c])][_0x50b79a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x430b1e[_0x50b79a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x23667d/0x3e8:0xe10*_0x12380b;return _0x430b1e[_0x50b79a([0x65,0x78,0x70])]<_0x2705e;}function _0x20589a(){const _0x342fc2=_0x430b1e[_0x50b79a([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x342fc2&&(!!_0x342fc2[_0x50b79a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x50b79a([0x2a]))||!!_0x342fc2[_0x50b79a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x50b79a([0x41,0x49])));}function _0x340643(){const _0x49bcac=_0x430b1e[_0x50b79a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x49bcac||0x0==_0x49bcac[_0x50b79a([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x4ed29}=new URL(window[_0x50b79a([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x49bcac[_0x50b79a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4ed29))return!0x0;const _0x3bfd9e=_0x4ed29[_0x50b79a([0x73,0x70,0x6c,0x69,0x74])](_0x50b79a([0x2e]));return _0x49bcac[_0x50b79a([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x29c785=>_0x29c785[_0x50b79a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x50b79a([0x2a])))[_0x50b79a([0x6d,0x61,0x70])](_0x33f4cf=>_0x33f4cf[_0x50b79a([0x73,0x70,0x6c,0x69,0x74])](_0x50b79a([0x2e])))[_0x50b79a([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5cf199=>_0x5cf199[_0x50b79a([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x3bfd9e[_0x50b79a([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x50b79a([0x6d,0x61,0x70])](_0x7b0812=>Array(_0x3bfd9e[_0x50b79a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x7b0812[_0x50b79a([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x50b79a([0x66,0x69,0x6c,0x6c])](_0x7b0812[0x0]===_0x50b79a([0x2a])?_0x50b79a([0x2a]):'')[_0x50b79a([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x7b0812))[_0x50b79a([0x73,0x6f,0x6d,0x65])](_0x55536c=>_0x3bfd9e[_0x50b79a([0x65,0x76,0x65,0x72,0x79])]((_0x3e034a,_0x212906)=>_0x55536c[_0x212906]===_0x3e034a||_0x55536c[_0x212906]===_0x50b79a([0x2a])));}function _0x47b2d5(){return _0xbe736e&&_0x1bb202?new window[(_0x50b79a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xeb874b,_0x58a595)=>{_0xbe736e[_0x50b79a([0x74,0x68,0x65,0x6e])](_0xeb874b,_0x58a595),_0x1bb202[_0x50b79a([0x74,0x68,0x65,0x6e])](_0x538120=>{_0x538120!=_0x50b79a([0x56,0x61,0x6c,0x69,0x64])&&_0xeb874b(_0x538120);},_0x58a595);}):_0xbe736e||_0x1bb202||_0x50b79a([0x56,0x61,0x6c,0x69,0x64]);}}function _0x5d6d1a(_0x59e711,_0x390cb7){return new window[(_0x50b79a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x54f7e5=>{if(_0x171957())return _0x54f7e5(_0x50b79a([0x56,0x61,0x6c,0x69,0x64]));_0x4aac51(),_0x4831a8[_0x50b79a([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x50b79a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x10c12c=!0x1;const _0x1a30ad=_0x1cb0e0();function _0x407aea(_0x1a6181){return!!_0x1a6181&&(typeof _0x1a6181===_0x50b79a([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x1a6181===_0x50b79a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x1a6181[_0x50b79a([0x74,0x68,0x65,0x6e])]===_0x50b79a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x1a6181[_0x50b79a([0x63,0x61,0x74,0x63,0x68])]===_0x50b79a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x29f17d(_0x5ee1a0){_0x3c311f(_0x5ee1a0)[_0x50b79a([0x74,0x68,0x65,0x6e])](_0x44aaae=>{if(!_0x44aaae||_0x44aaae[_0x50b79a([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x50b79a([0x6f,0x6b]))return _0x50b79a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x2a3071(_0x7300e5(_0x1a30ad+_0x390cb7))!=_0x44aaae[_0x50b79a([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x50b79a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x50b79a([0x56,0x61,0x6c,0x69,0x64]);})[_0x50b79a([0x74,0x68,0x65,0x6e])](_0x57f78e=>(_0x3de4f4(),_0x57f78e),()=>{const _0x58d770=_0x4f26d9();return null==_0x58d770?(_0x3de4f4(),_0x50b79a([0x56,0x61,0x6c,0x69,0x64])):_0x50b79a(_0x23667d-_0x58d770>(0x19f340e1^_0x869df6)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x50b79a([0x74,0x68,0x65,0x6e])](_0x54f7e5)[_0x50b79a([0x63,0x61,0x74,0x63,0x68])](()=>{_0x54f7e5(_0x50b79a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x4d2dff=0x3dc92a61^_0x869df6;function _0x3de4f4(){const _0x201d99=_0x50b79a([0x6c,0x6c,0x63,0x74,0x2d])+_0x2a3071(_0x7300e5(_0x59e711)),_0xc6237f=_0x19daba(_0x2a3071(window[_0x50b79a([0x4d,0x61,0x74,0x68])][_0x50b79a([0x63,0x65,0x69,0x6c])](_0x23667d/_0x4d2dff)));window[_0x50b79a([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x50b79a([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x201d99,_0xc6237f);}function _0x4f26d9(){const _0x5a38f7=_0x50b79a([0x6c,0x6c,0x63,0x74,0x2d])+_0x2a3071(_0x7300e5(_0x59e711)),_0x53c88d=window[_0x50b79a([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x50b79a([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5a38f7);return _0x53c88d?window[_0x50b79a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x19daba(_0x53c88d),0x10)*_0x4d2dff:null;}function _0x3c311f(_0x3f5160){return new window[(_0x50b79a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5cf0d7,_0x1e35a0)=>{_0x3f5160[_0x50b79a([0x74,0x68,0x65,0x6e])](_0x5cf0d7,_0x1e35a0),window[_0x50b79a([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x1e35a0,0x3dfe1021^_0x869df6);});}}_0x4831a8[_0x50b79a([0x6f,0x6e])](_0x50b79a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x37060e,_0x3d630b)=>{if(_0x3d630b[0x0]!=_0x59e711)return _0x54f7e5(_0x50b79a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3d630b[0x1]={..._0x3d630b[0x1],[_0x50b79a([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x1a30ad};},{[_0x50b79a([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x50b79a([0x68,0x69,0x67,0x68])}),_0x4831a8[_0x50b79a([0x6f,0x6e])](_0x50b79a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x1bb83d=>{_0x407aea(_0x1bb83d[_0x50b79a([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x10c12c=!0x0,_0x29f17d(_0x1bb83d[_0x50b79a([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x50b79a([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x50b79a([0x6c,0x6f,0x77])}),_0x37272c[_0x50b79a([0x74,0x68,0x65,0x6e])](()=>{_0x10c12c||_0x54f7e5(_0x50b79a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x171957(){return _0x4831a8[_0x50b79a([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x50b79a([0x76,0x69,0x65,0x77])][_0x50b79a([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x50b79a([0x61,0x75,0x74,0x6f]);}function _0x4aac51(){_0x4831a8[_0x50b79a([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x50b79a([0x76,0x69,0x65,0x77])][_0x50b79a([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x50b79a([0x61,0x75,0x74,0x6f]);}}function _0x39e5e1(_0x34600d){const _0x45a118=[new window[(_0x50b79a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4c2bfb=>setTimeout(_0x4c2bfb,0x3df6fa2d^_0x869df6)),_0x37272c[_0x50b79a([0x74,0x68,0x65,0x6e])](()=>new window[(_0x50b79a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5ca3ba=>{let _0x340348=0x0;_0x4831a8[_0x50b79a([0x6d,0x6f,0x64,0x65,0x6c])][_0x50b79a([0x6f,0x6e])](_0x50b79a([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x35744e,_0x3a268c)=>{_0x3a268c[0x0][_0x50b79a([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x340348++,_0x340348==(0x3dffc519^_0x869df6)&&(_0x5ca3ba(),_0x35744e[_0x50b79a([0x6f,0x66,0x66])]());});}))];return window[_0x50b79a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x50b79a([0x72,0x61,0x63,0x65])](_0x45a118)[_0x50b79a([0x74,0x68,0x65,0x6e])](()=>_0x34600d);}async function _0x2e454c(){await _0x37272c,_0x4831a8[_0x50b79a([0x6d,0x6f,0x64,0x65,0x6c])][_0x50b79a([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x410e0f,_0x4831a8[_0x50b79a([0x6d,0x6f,0x64,0x65,0x6c])][_0x50b79a([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x410e0f,_0x4831a8[_0x50b79a([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x50b79a([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x4a6d17(_0x9f4de7){const _0x509724=_0x25a38e();_0x4831a8[_0x509724]=_0x50b79a([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x9f4de7,_0x9f4de7!=_0x50b79a([0x56,0x61,0x6c,0x69,0x64])&&_0x2e454c();}function _0x25a38e(){const _0x4bfb00=window[_0x50b79a([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x50b79a([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x50b79a([0x6e,0x6f,0x77])]())[_0x50b79a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x50b79a([0x2e]),'');let _0x4661dd=_0x50b79a([0x6e]);for(let _0x348202=0x0;_0x348202<_0x4bfb00[_0x50b79a([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x348202+=0x2){let _0x304843=window[_0x50b79a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4bfb00[_0x50b79a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x348202,_0x348202+0x2));_0x304843>=_0x425151[_0x50b79a([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x304843-=_0x425151[_0x50b79a([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x4661dd+=_0x425151[_0x304843];}return _0x4661dd;}function _0x40864a(){const _0x3d2c9a=_0x30301a[_0x50b79a([0x73,0x70,0x6c,0x69,0x74])](_0x50b79a([0x2e]));if(0x3!=_0x3d2c9a[_0x50b79a([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x2821c6(_0x3d2c9a[0x1]);function _0x2821c6(_0x4494dd){const _0x32df96=_0xfa2ed3(_0x4494dd);return _0x32df96&&_0x49648d()?_0x32df96:null;function _0x49648d(){const _0x2c34bb=_0x32df96[_0x50b79a([0x6a,0x74,0x69])],_0x135558=window[_0x50b79a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2c34bb[_0x50b79a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2c34bb[_0x50b79a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2e260c={..._0x32df96,[_0x50b79a([0x6a,0x74,0x69])]:_0x2c34bb[_0x50b79a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x2c34bb[_0x50b79a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2e260c[_0x50b79a([0x76,0x63])],_0x7300e5(_0x2e260c)==_0x135558;}}}async function _0x1a1711(){let _0x5b2ff9=!0x0;try{const _0x22561e=_0x30301a[_0x50b79a([0x73,0x70,0x6c,0x69,0x74])](_0x50b79a([0x2e])),[_0x36543b,_0x23cf93,_0x29dc8]=_0x22561e;return _0x4b9425(_0x36543b),await _0x50b818(_0x36543b,_0x23cf93,_0x29dc8),_0x5b2ff9;}catch{return!0x1;}function _0x4b9425(_0xa493fc){const _0x9a47e4=_0xfa2ed3(_0xa493fc);_0x9a47e4&&_0x9a47e4[_0x50b79a([0x61,0x6c,0x67])]==_0x50b79a([0x45,0x53,0x32,0x35,0x36])||(_0x5b2ff9=!0x1);}async function _0x50b818(_0x4e9be1,_0x5180c6,_0x2d4819){const _0x2d20a7=window[_0x50b79a([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x50b79a([0x66,0x72,0x6f,0x6d])](_0x3a44e5(_0x2d4819),_0x322b6e=>_0x322b6e[_0x50b79a([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x261642=new window[(_0x50b79a([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x50b79a([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4e9be1+_0x50b79a([0x2e])+_0x5180c6),_0x7cdae4=window[_0x50b79a([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x50b79a([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x7cdae4)return;const _0x2af3c9=await _0x7cdae4[_0x50b79a([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x50b79a([0x6a,0x77,0x6b]),_0x23a8db,{[_0x50b79a([0x6e,0x61,0x6d,0x65])]:_0x50b79a([0x45,0x43,0x44,0x53,0x41]),[_0x50b79a([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x50b79a([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x50b79a([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x7cdae4[_0x50b79a([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x50b79a([0x6e,0x61,0x6d,0x65])]:_0x50b79a([0x45,0x43,0x44,0x53,0x41]),[_0x50b79a([0x68,0x61,0x73,0x68])]:{[_0x50b79a([0x6e,0x61,0x6d,0x65])]:_0x50b79a([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2af3c9,_0x2d20a7,_0x261642)||(_0x5b2ff9=!0x1);}}function _0xfa2ed3(_0x4c9453){return _0x4c9453[_0x50b79a([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x50b79a([0x65,0x79]))?JSON[_0x50b79a([0x70,0x61,0x72,0x73,0x65])](_0x3a44e5(_0x4c9453)):null;}function _0x3a44e5(_0x18a68a){return window[_0x50b79a([0x61,0x74,0x6f,0x62])](_0x18a68a[_0x50b79a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x50b79a([0x2b]))[_0x50b79a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x50b79a([0x2f])));}function _0x7300e5(_0x2517bc){let _0xbe4ac=0x1505;function _0x549b15(_0x3f70dd){for(let _0x45dc81=0x0;_0x45dc81<_0x3f70dd[_0x50b79a([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x45dc81++){const _0x26eebc=_0x3f70dd[_0x50b79a([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x45dc81);_0xbe4ac=(_0xbe4ac<<0x5)+_0xbe4ac+_0x26eebc,_0xbe4ac&=_0xbe4ac;}}function _0x3f0781(_0x4b443a){Array[_0x50b79a([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x4b443a)?_0x4b443a[_0x50b79a([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x3f0781):_0x4b443a&&typeof _0x4b443a==_0x50b79a([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x50b79a([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x4b443a)[_0x50b79a([0x73,0x6f,0x72,0x74])]()[_0x50b79a([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x1f134e,_0x4899dd])=>{_0x549b15(_0x1f134e),_0x3f0781(_0x4899dd);}):_0x549b15(window[_0x50b79a([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x4b443a));}return _0x3f0781(_0x2517bc),_0xbe4ac>>>0x0;}function _0x2a3071(_0x1db224){return _0x1db224[_0x50b79a([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x50b79a([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x50b79a([0x30]));}function _0x19daba(_0x5de669){return _0x5de669[_0x50b79a([0x73,0x70,0x6c,0x69,0x74])]('')[_0x50b79a([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x50b79a([0x6a,0x6f,0x69,0x6e])]('');}function _0x410e0f(){}function _0x50b79a(_0x51eda9){return _0x51eda9['map'](_0x624f67=>String['fromCharCode'](_0x624f67))['join']('');}_0x4a6d17(await _0x28ea89());}(this);}['showFakeVisualSelection'](){const _0x25878b=this['editor']['model'];_0x25878b['change'](_0x4a1e81=>{const _0x5e975b=_0x25878b['document']['selection']['getRanges']();let _0x2eac01=0x0;for(const _0x162ca0 of _0x5e975b){const _0xd111db=f+':'+_0x2eac01;if(_0x25878b['markers']['has'](_0xd111db))_0x4a1e81['updateMarker'](_0xd111db,{'range':_0x162ca0});else{if(_0x162ca0['start']['isAtEnd']){const _0x56b5c3=_0x162ca0['start']['getLastMatchingPosition'](({item:_0x43e8d0})=>!_0x25878b['schema']['isContent'](_0x43e8d0),{'boundaries':_0x162ca0});_0x4a1e81['addMarker'](_0xd111db,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4a1e81['createRange'](_0x56b5c3,_0x162ca0['end'])});}else _0x4a1e81['addMarker'](_0xd111db,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x162ca0});}_0x2eac01++;}});}['hideFakeVisualSelection'](){const _0x190aee=this['editor']['model'],_0x562a0f=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x562a0f['length']&&_0x190aee['change'](_0x8516c5=>{_0x562a0f['forEach'](_0x2cf8da=>{_0x8516c5['removeMarker'](_0x2cf8da);});});}['insertContent'](_0x190cbf,_0x1d9964){const _0x37a8d0=this['_getAISelection'](),_0x189585=_0x1d9964||_0x37a8d0['getFirstRange']();this['editor']['model']['canEditAt'](_0x189585)&&this['editor']['model']['change'](_0x4d4420=>{this['hideFakeVisualSelection'](),_0x1d9964||this['_resetContentOfSelectedTableCells'](_0x4d4420,_0x37a8d0),this['_pasteHTMLUsingClipboard']({'insertAt':_0x189585,'writer':_0x4d4420,'html':_0x190cbf});});}['insertContentBelow'](_0x4c3cb8){const {model:_0x5ea309}=this['editor'],_0x56d6c8=this['_getAISelection']();_0x5ea309['change'](()=>{const _0x29de0b=this['_prepareTableInsertBelowPosition'](_0x4c3cb8,_0x56d6c8)||this['_getDefaultInsertBelowPosition'](_0x56d6c8);this['insertContent'](_0x4c3cb8,_0x29de0b);});}['_getAISelection'](){const _0xd1c019=this['editor']['model'],_0x486c89=Array['from'](_0xd1c019['markers']['getMarkersGroup'](f))['map'](_0x145d25=>_0x145d25['getRange']());return _0xd1c019['createSelection'](_0x486c89);}['_pasteHTMLUsingClipboard']({writer:_0x5f3f9e,html:_0x3c4cd7,insertAt:_0xcf8886}){const {view:_0x15cd41}=this['editor']['editing'],_0x1a60f6=this['editor']['plugins']['get'](_0x308317),_0x2fc506=new Yn();_0x2fc506['setData']('text/html',_0x3c4cd7);const _0x2d3a5e=new ClipboardEvent('paste',{'clipboardData':_0x2fc506}),_0x2dcd7a=new _0x59a5a2(_0x15cd41,_0x2d3a5e,{'dataTransfer':new _0x54373c(_0x2fc506)});_0x5f3f9e['setSelection'](_0xcf8886);const _0x534407=(_0x286de2,_0x280cfc)=>{_0x280cfc['resultRange']&&_0x5f3f9e['setSelection'](_0x280cfc['resultRange']);};_0x1a60f6['once']('contentInsertion',_0x534407,{'priority':'lowest'}),_0x15cd41['document']['fire']('paste',_0x2dcd7a),_0x1a60f6['off']('contentInsertion',_0x534407);}['_getDefaultInsertBelowPosition'](_0x35ff34){const {model:_0x30bcb0}=this['editor'],_0x993105=Array['from'](_0x35ff34['getSelectedBlocks']());return _0x993105['length']?_0x30bcb0['createPositionAfter'](_0x993105['pop']()):_0x35ff34['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3cde06,_0x5275e2){const {model:_0x22a1f0,plugins:_0x245bdb}=this['editor'];if(_0x245bdb['has']('TableUtils')){const _0xe43472=_0x245bdb['get']('TableUtils')['getSelectedTableCells'](_0x5275e2);if(_0xe43472['length']){const _0x334b00=this['_getTableRowCountFromContent'](_0x3cde06),_0x260372=this['_createEmptyTableRows'](_0xe43472,_0x334b00);return _0x22a1f0['createPositionAt'](_0x260372,0x0);}}return null;}['_getTableRowCountFromContent'](_0x4137ce){const _0x411985=this['editor']['plugins']['get']('TableUtils'),_0x5dc1f0=this['editor']['data']['parse'](_0x4137ce),_0x552ed7=Array['from'](_0x5dc1f0['getChildren']())['filter'](_0x5375c9=>_0x5375c9['is']('element','table'));let _0x3aaaa4=0x0;return _0x552ed7['forEach'](_0x57fe18=>{_0x3aaaa4+=_0x411985['getRows'](_0x57fe18);}),_0x3aaaa4;}['_createEmptyTableRows'](_0x216b67,_0xd9083d){const _0x386b2c=this['editor']['plugins']['get']('TableUtils'),_0x4614f5=_0x386b2c['getRowIndexes'](_0x216b67),_0x26b2b3=_0x386b2c['getColumnIndexes'](_0x216b67),_0x22a9b3=_0x4614f5['last']+0x1,_0x69891=_0x26b2b3['first'],_0x35facd=_0x216b67[0x0]['findAncestor']('table');for(let _0x14ce7c=0x0;_0x14ce7c<_0xd9083d;_0x14ce7c++)_0x386b2c['insertRows'](_0x35facd,{'at':_0x22a9b3});return _0x35facd['getChild'](_0x22a9b3)['getChild'](_0x69891);}['_resetContentOfSelectedTableCells'](_0x2343be,_0x1dd91e){const {plugins:_0x2c181c}=this['editor'],{model:_0x137181}=_0x2343be;if(!_0x2c181c['has']('TableUtils'))return;_0x2c181c['get']('TableUtils')['getSelectedTableCells'](_0x1dd91e)['length']&&_0x137181['deleteContent'](_0x1dd91e);}}class x extends _0x2a032b{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x5cac2e('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x378fca){super(_0x378fca),this['name']='AIRequestError';}}function $n(_0x3b56e8,_0xea6620,_0x2950c9){const t=_0x3b56e8['t'];switch(_0xea6620){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',_0x2950c9);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2950c9);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'},_0x2950c9);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 _0xea6620;}}class E extends Qt{['_commandDefinitions'];constructor(_0x2fce72,_0x1b7743){super(_0x2fce72),this['_commandDefinitions']=_0x1b7743,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x2f3334,_0x1ca575,_0x156303)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x156303));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x8b73fa,_0x5e4ec7,_0x549330)=>{this['enabledCommandsIds']=_0x549330?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x182f47=this['editor']['model'];this['_hasContext']=function(_0x34dd7a){const _0x1930d9=_0x34dd7a['document']['selection'];return _0x1930d9['isCollapsed']?0x0!==[..._0x1930d9['getSelectedBlocks']()]['length']&&![..._0x1930d9['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x34dd7a['hasContent'](_0x1930d9['getFirstRange']());}(_0x182f47);const _0x2b1d7f=_0x182f47['document']['selection'],_0x596dfc=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0xf6d60b of _0x2b1d7f['getRanges']())for(const _0x5970b3 of _0xf6d60b['getItems']())if(_0x5970b3['is']('element')&&_0x596dfc['includes'](_0x5970b3['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0xf33904='',_0x53e2a1='',_0x2a3882='custom'){this['editor']['plugins']['get'](n)['showUI'](_0xf33904,_0x53e2a1,_0x2a3882);}}function ns(_0x5d5a57,_0x5dbc08){const _0xd24136=new Set();for(const _0x479264 of _0x5d5a57['values']())(_0x5dbc08||!0x1===_0x479264['requiresContent'])&&_0xd24136['add'](_0x479264['id']);return Array['from'](_0xd24136);}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(_0x1ab224,_0xa0b4cc,_0x59d580){super(),this['editor']=_0x1ab224,this['textAdapter']=_0xa0b4cc,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x59d580,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x3f791a,_0x23b170,_0xef13ed)=>{this['view']['value']=this['_sanitizeHTML'](_0xef13ed);}),this['listenTo'](this['view'],'submitPrompt',(_0x5edb78,_0x371333)=>{const _0x6c4395=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x371333,_0x6c4395,'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:_0x233d72,query:_0x1540cb,htmlContent:_0x208def,label:_0x3064ae,mainActionLabel:_0x28675b}){this['view']['prompt']=_0x3064ae,this['view']['mainAction']=_0x28675b,this['initialContext']=_0x208def,_0x1540cb&&(this['view']['isRendered']?this['_handleQuery'](_0x1540cb,_0x208def,_0x233d72,_0x3064ae):this['view']['once']('render',()=>{this['_handleQuery'](_0x1540cb,_0x208def,_0x233d72,_0x3064ae);}));}['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'](_0x17ae71,_0x5e1f7c,_0x29d13e,_0x39ac61){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x5e1f7c,this['previousQuery']=_0x17ae71,this['previousLabel']=_0x39ac61||_0x17ae71,this['previousActionId']=_0x29d13e,new Promise(_0x553a33=>{this['textAdapter']['makeRequest']({'query':_0x17ae71,'context':_0x5e1f7c,'onData':_0xfa947e=>{this['currentResponse']=_0xfa947e,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x29d13e})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x402aee=>{_0x402aee instanceof tr?this['view']['handleError'](_0x402aee['message']):this['view']['handleError'](),_0x553a33();})['finally'](()=>{this['stopProcessing'](),_0x553a33();});});}['_parseAndNormalizeContent'](_0x238f62,_0x503ac3=!0x1){const _0x1e8a14=hs['exec'](_0x238f62);_0x238f62=_0x1e8a14?_0x238f62['substring'](_0x1e8a14[0x1]['length']):_0x238f62['length']<0x64&&!_0x503ac3?'':this['_stripMarkdownSyntax'](_0x238f62);const _0x30a92e=this['_domParser']['parseFromString'](_0x238f62,'text/html');if(_0x1e8a14){const _0x20a434=Array['from'](_0x30a92e['body']['childNodes']);_0x20a434['reverse']();for(const _0x806412 of _0x20a434){if(_0x806412['nodeType']==Node['ELEMENT_NODE'])break;_0x806412['remove']();}}const _0x26bad0=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x30a92e['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x26bad0);const _0xddb6cf=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x2f854f=this['editor']['data']['toModel'](_0x26bad0);return _0xddb6cf||_0x2f854f['markers']['clear'](),this['editor']['data']['stringify'](_0x2f854f);}['_normalizeResponseHeadings'](_0x315892){const _0x1d3b4d=new _0x509b4f(this['editor']['editing']['view']['document']),_0x984914=new _0x93dc7d({'name':/^h[1-5]$/}),_0xb5038f=[];let _0x71ee21=!0x1;for(const _0x3d7d2a of _0x315892)_0x3d7d2a['is']('element')&&_0x984914['match'](_0x3d7d2a)&&(_0xb5038f['push'](_0x3d7d2a),'h1'==_0x3d7d2a['name']&&(_0x71ee21=!0x0));if(_0x71ee21){for(const _0x501c6a of _0xb5038f)_0x1d3b4d['rename']('h'+(parseInt(_0x501c6a['name'][0x1])+0x1),_0x501c6a);}}['_isH1TagSupportEnabled'](){const {data:_0x54df36,editing:_0x21e8c1}=this['editor'],_0x3458e4=_0x54df36['htmlProcessor']['toView']('<h1></h1>'),_0x240ea4=_0x54df36['toView'](_0x54df36['toModel'](_0x3458e4));return!!_0x21e8c1['view']['domConverter']['viewToDom'](_0x240ea4)['querySelector']('h1');}['_sanitizeHTML'](_0x3c6b46){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3c6b46),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x2b2fde){const _0x3c2dbd=_0x2b2fde['trim']();return _0x3c2dbd['startsWith']('```html')?_0x3c2dbd['endsWith']('```')?_0x3c2dbd['substring'](0x7,_0x3c2dbd['length']-0x3):_0x3c2dbd['substring'](0x7):_0x2b2fde;}}const _={'REPLACE':'replace','INSERT':'insert'};class yr extends _0x384aff{constructor(_0xcf02a4){super(_0xcf02a4),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x32435e=>$n(_0xcf02a4,'AI_'+_0x32435e['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton']($n(_0xcf02a4,'Insert\x20below')),this['tryAgainButton']=this['_createButton']($n(_0xcf02a4,'Try\x20again')),this['stopButton']=this['_createButton']($n(_0xcf02a4,'Stop'));const _0x38ed61=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x38ed61['if']('isVisible','ck-hidden',_0x3aa406=>!_0x3aa406)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x345bf0,_0x3051d2){const _0x398b88=new _0x5be5f6(this['locale']);return _0x398b88['set']({'label':_0x345bf0,'class':_0x3051d2||'','isVisible':!0x0,'withText':!0x0}),_0x398b88;}}class gr extends _0x1f124f{['contentFieldView'];['copyButtonView'];constructor(_0x707cf4,_0x47e600=''){super(_0x707cf4),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x5f071a=this['bindTemplate'];this['contentFieldView']=new qn(_0x707cf4,_0x47e600),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x5f071a['if']('isVisible','ck-hidden',_0x3ca683=>!_0x3ca683)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x5f071a['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 _0x22b948=!0x1;this['on']('change:value',(_0x37db6e,_0x33df8a,_0x1c4edb)=>{const _0x4f18a4=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x1c4edb),this['isProcessing']&&_0x4f18a4&&!_0x22b948&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x9b39c3,_0x43ffe4,_0x55ce4e)=>{_0x22b948=!0x1,_0x55ce4e?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x22b948=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x22b948=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x2ba8e3=this['locale'],_0x3dc0e2=new _0x5be5f6(this['locale']),_0x4d9804='ck-ai-form__copy-button';return _0x3dc0e2['set']({'label':$n(_0x2ba8e3,'Copy'),'icon':_0x3b393d,'class':_0x4d9804,'tooltip':!0x0}),_0x3dc0e2['bind']('isVisible')['to'](this,'value',_0x5879d7=>!!_0x5879d7),_0x3dc0e2['bind']('isEnabled')['to'](this,'isProcessing',_0x3c5bfb=>!_0x3c5bfb),_0x3dc0e2['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x3dc0e2['icon']=_0x33d7d6,_0x3dc0e2['class']=_0x4d9804+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x3dc0e2['icon']=_0x3b393d,_0x3dc0e2['class']=_0x4d9804;},0x3e8);}),_0x3dc0e2;}['_copyHTMLToClipboard'](_0x53c532){const {window:_0x26e874,document:_0x103d71}=_0x38b85c;if(_0x26e874['ClipboardItem']){const {Blob:_0x45ef97,ClipboardItem:_0x5e12f1}=_0x26e874,_0x402d02=[new _0x5e12f1({'text/html':new _0x45ef97([_0x53c532['innerHTML']],{'type':'text/html'}),'text/plain':new _0x45ef97([_0x53c532['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x402d02);}else{const _0x3b1e80=_0x103d71['createElement']('div');_0x3b1e80['style']['position']='absolute',_0x3b1e80['style']['left']='-9999px',_0x3b1e80['innerHTML']='<span>[</span>'+_0x53c532['innerHTML']+'<span>]</span>',_0x103d71['body']['appendChild'](_0x3b1e80);const _0x2c9ac2=_0x103d71['createRange']();_0x2c9ac2['setStartAfter'](_0x3b1e80['firstElementChild']),_0x2c9ac2['setEndBefore'](_0x3b1e80['lastElementChild']);const _0x5cc934=_0x26e874['getSelection']();_0x5cc934['removeAllRanges'](),_0x5cc934['addRange'](_0x2c9ac2),_0x103d71['execCommand']('copy'),_0x3b1e80['remove']();}}}class qn extends _0x1f124f{constructor(_0x477c4f,_0x2921b9=''){super(_0x477c4f),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2921b9,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x33ab00){this['element']['innerHTML']=_0x33ab00;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x38af23=new _0x1f124f(),_0x1f0597=this['locale'],_0x21a432=new _0x2f6b47();return _0x21a432['isVisible']=!0x0,_0x38af23['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x21a432,{'text':$n(_0x1f0597,'AI\x20is\x20writing...')}]}),_0x38af23['render'](),_0x38af23;}}class Er extends _0x1f124f{constructor(_0x5dca39,_0xf5da20=''){super(_0x5dca39);const _0x5dccca=new _0x26d10b(),_0x3451cc=this['bindTemplate'];this['set']('text',_0xf5da20),_0x5dccca['content']=_0x271edd,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x5dccca,{'text':_0x3451cc['to']('text')}]});}}class vr extends _0x1018e6{['submitButtonView'];['showHistoryButtonView'];constructor(_0x5c1620,_0x1c4382){super(_0x5c1620,_0x1c4382),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',(_0x2c4d82,_0x37fbc2)=>{_0x2c4d82['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x37fbc2());});}['_createSubmitButton'](){const _0x1074cf=new _0x5be5f6(this['locale']),_0x2968e2=this['locale'];return _0x1074cf['set']({'icon':_0x265ec2,'label':$n(_0x2968e2,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1074cf['on']('execute',()=>{this['submit']();}),_0x1074cf['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4097d8,_0x58e33b)=>!_0x4097d8&&_0x58e33b),_0x1074cf;}['_createShowHistoryButton'](){const _0x4b8ca4=new _0x5be5f6(this['locale']),_0x36d7b7=this['resultsView'],_0x11897e=this['locale'];_0x4b8ca4['set']({'label':$n(_0x11897e,'History'),'withText':!0x1,'icon':Nt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4b8ca4['bind']('isOn')['to'](_0x36d7b7,'isVisible'),_0x4b8ca4['bind']('isEnabled')['to'](this,'isEnabled'),_0x4b8ca4['on']('execute',()=>{_0x36d7b7['isVisible']=!_0x36d7b7['isVisible'],_0x36d7b7['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x4a375a=()=>{_0x38b85c['window']['requestAnimationFrame'](()=>{if(_0x36678f(this['element'])){const _0x570e5a=new _0x2063b2(this['queryView']['fieldView']['element']),_0x2728cf=_0x570e5a['width'],_0x4046e3='rtl'===_0x11897e['uiLanguageDirection']?'left':'right';_0x570e5a['excludeScrollbarsAndBorders'](),_0x4b8ca4['element']['style'][_0x4046e3]=_0x2728cf-_0x570e5a['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x4a375a),this['on']('render',_0x4a375a),_0x4b8ca4;}['submit'](){const _0x231983=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x231983);}['focus'](_0x12a9ea){-0x1===_0x12a9ea?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Ar extends _0x5f8d0a{['historyGroupView'];['clearHistoryButton'];constructor(_0x3e2dc9){super(_0x3e2dc9),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x5a3051(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=$n(_0x3e2dc9,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x58ba88=0x0;for(const _0x2a76a8 of this['items'])_0x58ba88+=_0x2a76a8['items']['length'];return{'resultsCount':_0x58ba88,'totalItemsCount':_0x58ba88};}['_createClearHistoryButton'](){const _0x16e427=this['locale'],_0x57d4d7=new _0x5be5f6(this['locale']);return _0x57d4d7['set']({'label':'('+$n(_0x16e427,'Clear')+')','withText':!0x0}),_0x57d4d7['on']('execute',()=>this['fire']('clearHistory')),_0x57d4d7;}}class Pr extends _0x19da3d{constructor(_0x2b531c){super();const _0x48a664=new _0x3a2a12(),_0x8907c9=new _0x5be5f6(this['locale'],_0x48a664);this['children']['add'](_0x8907c9),_0x8907c9['set']({'label':_0x2b531c['prompt'],'withText':!0x0}),_0x8907c9['on']('execute',()=>{this['fire']('execute',{'value':_0x2cda43(_0x2b531c['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class jr extends _0x128d2a{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4bf7e0,_0x3c5dc7)=>{const _0x4029e1=fo(_0x3c5dc7['prompt']);for(const _0x183e89 of this)if(_0x183e89!=_0x3c5dc7&&fo(_0x183e89['prompt'])===_0x4029e1){this['remove'](_0x183e89);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0xb927b4=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0xb927b4));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x5bbb18=>_0x5bbb18)));}}function fo(_0x5d5ef6){return _0x5d5ef6['toLowerCase']()['trim']();}class k extends _0x1f124f{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1edf86,_0x43a4ea,_0xf538c2=''){super(_0x1edf86),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 jr(),this['errorView']=new Er(_0x1edf86),this['contentArea']=new gr(_0x1edf86,_0xf538c2),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 _0x5e98a3(),this['keystrokes']=new _0x3678f9(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x12ca41({'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 _0x5947e2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x43a4ea],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x5947e2['if']('isError','ck-hidden',_0x342481=>!_0x342481)]},'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'](_0x54b5de=0x1){-0x1===_0x54b5de?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 _0x1ba9f1=this['locale'],_0x1c1e00=new vr(_0x1ba9f1,{'queryView':{'label':$n(_0x1ba9f1,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x4f979b,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':$n(_0x1ba9f1,'Empty\x20history'),'secondary':$n(_0x1ba9f1,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x1c1e00['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x15e372,_0xefda28)=>_0x15e372&&!_0xefda28),this['listenTo'](_0x1c1e00,'submit',(_0x5e3d64,_0x2b077a)=>{this['prompt']=_0x2b077a;const _0x2d33a5=_0x257ef5(_0x2b077a);this['fire']('submitPrompt',_0x2d33a5),_0x2b077a['trim']()&&this['_promptHistory']['add']({'prompt':_0x2d33a5},0x0);},{'priority':'high'}),_0x1c1e00;}['_createHistoryView'](){const _0x50dbf6=new Ar(this['locale']);return _0x50dbf6['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Pr),_0x50dbf6['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x50dbf6;}['_createToolbar'](){const _0x44bfd0=new yr(this['locale']);return _0x44bfd0['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4a57bb,_0x51ccb4,_0x1f74c1)=>_0x4a57bb&&!_0x51ccb4&&!!_0x1f74c1),_0x44bfd0['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x44bfd0['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x58b05d,_0x426b36,_0x1b5afe)=>_0x58b05d&&!_0x426b36&&!!_0x1b5afe),_0x44bfd0['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x44bfd0['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x20c085,_0x19f83d)=>_0x20c085&&!_0x19f83d),_0x44bfd0['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x44bfd0['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x44bfd0['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x44bfd0;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x38118d=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=$n(_0x38118d,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x1351ac){const _0x492168=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x1351ac||$n(_0x492168,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x2a032b{['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[_0x7c9b46,a,x,_0xc33e8e];}constructor(_0x241a42){super(_0x241a42),_0x241a42['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x241a42['config']['define']('ai.assistant.contentAreaCssClass',''),_0x241a42['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x241a42['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x4c295e}=this;this['_aiAdapter']=_0x4c295e['plugins']['get'](x),this['_dialog']=_0x4c295e['plugins']['get'](_0xc33e8e),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x38e980=new E(_0x4c295e,Array['from'](this['_commandDefinitions']['values']()));_0x4c295e['commands']['add']('showAIAssistant',_0x38e980),_0x4c295e['ui']['componentFactory']['add']('aiCommands',_0x499ec9=>{const _0x3fcddf=_0x12dfeb(_0x499ec9);return _0x3fcddf['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x3fcddf['buttonView']['set']({'label':$n(_0x499ec9,'AI\x20Commands'),'icon':_0x2b1c79,'tooltip':!0x0}),_0x3fcddf['on']('execute',_0x5ef894=>this['_onExecute'](_0x5ef894['source']['id'])),_0x9e1579(_0x3fcddf,_0x4c295e['ui']['view']['body'],function(_0x54f941){const _0x3d792f=o(_0x54f941['config']['get']('ai.assistant.commands'),_0x54f941['locale']),_0x1b015f=U(_0x54f941,_0x3d792f)['filter'](_0xbaca00=>_0xbaca00['commands']['length']);if(0x1===_0x1b015f['length'])return U(_0x54f941,_0x1b015f[0x0]['commands'])['map'](_0x588fea=>({'id':_0x588fea['id'],'label':_0x588fea['label']}));return _0x1b015f['map'](_0x484316=>{const {groupId:_0x1db45f,groupLabel:_0x3d7eb9,commands:_0x3ff312}=_0x484316,_0x442856=U(_0x54f941,_0x3ff312)['map'](_0x220d64=>({'id':_0x220d64['id'],'label':_0x220d64['label']}));return{'id':_0x1db45f,'menu':_0x3d7eb9||_0x1db45f,'children':_0x442856};});}(_0x4c295e),{'ariaLabel':$n(_0x499ec9,'AI\x20Commands')}),_0x3fcddf['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x38e980['on']('change:enabledCommandsIds',_0x2ac5d2),_0x3fcddf['menuView']['once']('render',_0x2ac5d2),_0x3fcddf;function _0x2ac5d2(){_0x3fcddf['isEnabled']=_0x38e980['enabledCommandsIds']['length']>0x0;for(const _0xf30cf of _0x3fcddf['menuView']['buttons'])_0xf30cf['isEnabled']=_0x38e980['enabledCommandsIds']['includes'](_0xf30cf['id']);}}),_0x4c295e['ui']['componentFactory']['add']('menuBar:aiCommands',_0x44c099=>{const _0x5d34ab=new _0x104620(_0x44c099);_0x5d34ab['buttonView']['set']({'label':$n(_0x44c099,'AI\x20Commands'),'icon':_0x2b1c79}),_0x5d34ab['bind']('isEnabled')['to'](_0x38e980,'enabledCommandsIds',_0x27ee84=>_0x27ee84['length']>0x0);const _0x228f3a=o(_0x4c295e['config']['get']('ai.assistant.commands'),_0x44c099);return this['_populateMenuBarMenu'](_0x38e980,_0x5d34ab,_0x228f3a,_0x189fde=>this['_onExecute'](_0x189fde)),_0x5d34ab;}),_0x4c295e['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x5f8c3d=this['_createAIAssistantUIButton'](_0x5be5f6);return _0x5f8c3d['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x5f8c3d;}),_0x4c295e['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x58cab9=this['_createAIAssistantUIButton'](_0x33defb);return _0x58cab9['set']({'role':'menuitemcheckbox'}),_0x58cab9;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x10bc7b=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x587598;for(const _0x364f1d in _0x10bc7b){const _0x449bee=_0x364f1d,_0x2096ff=_0x10bc7b[_0x449bee];if('aiLicenseKeyValid'==_0x2096ff||'aiLicenseKeyInvalid'==_0x2096ff||'aiLicenseKeyExpired'==_0x2096ff||'aiLicenseKeyDomainLimit'==_0x2096ff||'aiLicenseKeyNotAllowed'==_0x2096ff||'aiLicenseKeyEvaluationLimit'==_0x2096ff||'aiLicenseKeyTrialLimit'==_0x2096ff||'aiLicenseKeyUsageLimit'==_0x2096ff){delete _0x10bc7b[_0x449bee],_0x587598=_0x2096ff,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x587598&&_0x10bc7b['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x587598&&_0x10bc7b['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x587598&&_0x10bc7b['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x587598&&_0x10bc7b['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x587598&&_0x10bc7b['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x587598&&_0x10bc7b['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x587598&&_0x10bc7b['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x437b32='',_0x1fd883='',_0x86342b='custom'){const _0x5bfc14=this['editor'],_0x69e8b3=_0x5bfc14['editing']['view'],_0x2dd344=_0x5bfc14['plugins']['get'](a),_0x229de1=_0x5bfc14['plugins']['get'](_0x7c9b46);_0x2dd344['showFakeVisualSelection']();const _0x2e4aba=new w(),_0x578e61=new ClipboardEvent('copy',{'clipboardData':_0x2e4aba}),_0x3fd986=new _0x54373c(_0x2e4aba),_0x1cfd6c=new _0x59a5a2(_0x69e8b3,_0x578e61,{'dataTransfer':_0x3fd986});_0x229de1['_forceMarkersCopy']('comment',()=>{_0x69e8b3['document']['fire']('copy',_0x1cfd6c);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x5bfc14,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x4f14b5=_0x3fd986['getData']('text/html');const _0x5c02c5=_0x5bfc14['model']['document']['selection'],_0x379403=Array['from'](_0x5c02c5['getRanges']());0x1===_0x379403['length']&&_0x379403[0x0]['isFlat']&&!_0x5c02c5['getSelectedElement']()&&''!==_0x4f14b5['replace'](/&nbsp;/g,'')['trim']()&&(_0x4f14b5='<p>'+_0x4f14b5+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x86342b,'query':_0x437b32,'htmlContent':_0x4f14b5,'label':_0x1fd883,'mainActionLabel':_[_0x5bfc14['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x59bdc2,'title':$n(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0xa39f85['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x2dd344['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x15d8b9=new Map(),_0x55ecec=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x5242d7 of _0x55ecec)for(const _0x1df2c1 of _0x5242d7['commands'])_0x15d8b9['set'](_0x1df2c1['id'],{..._0x1df2c1,'groupId':_0x5242d7['groupId'],'groupLabel':_0x5242d7['groupLabel']||_0x5242d7['groupId']});return _0x15d8b9;}['_createAIAssistantUIButton'](_0x3d5cc8){const _0x52263f=this['editor'],_0x4b2c66=_0x52263f['commands']['get']('showAIAssistant'),_0x1e4b6c=new _0x3d5cc8(_0x52263f['locale']);return _0x1e4b6c['set']({'label':$n(_0x52263f['locale'],'AI\x20Assistant'),'icon':_0x59bdc2,'isToggleable':!0x0}),_0x1e4b6c['bind']('isEnabled')['to'](_0x4b2c66),_0x1e4b6c['bind']('isOn')['to'](this['_dialog'],'id',_0xacaa4=>'aiAssistant'===_0xacaa4),this['listenTo'](_0x1e4b6c,'execute',()=>{_0x1e4b6c['isOn']?this['hideUI']():_0x4b2c66['execute']();}),_0x1e4b6c;}['_initView'](){const _0x7afe6e=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',()=>{_0x7afe6e['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x7afe6e['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x1e825c,ui:{ariaLiveAnnouncer:_0x22cb87}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x5e54b5,_0x48d840,_0x17e828)=>{const _0x4cb272=this['_aiAssistantController']['currentContext'];_0x17e828?_0x22cb87['announce']($n(_0x1e825c,'AI\x20is\x20writing')):_0x4cb272&&_0x22cb87['announce']($n(_0x1e825c,'Generated\x20content:\x20%0',_0x4cb272),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x52fb96,_0x1dce8b,_0x561dee)=>{if(_0x561dee){const _0x1cc16d=this['_formView']['errorView']['text'];_0x22cb87['announce']($n(_0x1e825c,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x1cc16d));}});}['_onExecute'](_0x47ce88){const _0x4f721f=this['_commandDefinitions']['get'](_0x47ce88),_0x5a05e7=this['editor'],_0x37c6da=_0x5a05e7['model']['document']['selection'],_0x41dc23=_0x5a05e7['commands']['get']('showAIAssistant'),_0x5ba9da=_0x5a05e7['plugins']['get'](a),_0x10e64d=''+(_0x4f721f['groupId']!==K?_0x4f721f['groupLabel']+':\x20':'')+_0x4f721f['label'];if(!0x1!==_0x4f721f['requiresContent']&&_0x37c6da['isCollapsed']){const _0x42b316=_0x5f540c(_0x37c6da['getSelectedBlocks']())||_0x5a05e7['model']['schema']['getLimitElement'](_0x37c6da);_0x5a05e7['model']['change'](_0x59e207=>{_0x59e207['setSelection'](_0x42b316,'in');});}_0x5ba9da['showFakeVisualSelection'](),_0x41dc23['execute'](_0x4f721f['prompt'],_0x10e64d,'command:'+_0x47ce88);}['_populateMenuBarMenu'](_0x170323,_0x3e96a9,_0x53ef92,_0x4db680){const _0x41cea7=this['editor'],_0x2b28d4=_0x41cea7['locale'],_0x5c23f7=new _0x4a8496(_0x2b28d4),_0x218803=U(_0x41cea7,_0x53ef92)['filter'](_0x370dff=>_0x370dff['commands']['length']);0x1===_0x218803['length']?this['_getMenuBarGroupButtons']({'command':_0x170323,'commands':_0x218803[0x0]['commands'],'parentMenuView':_0x3e96a9,'onExecute':_0x4db680})['forEach'](_0x5208ba=>_0x5c23f7['items']['add'](_0x5208ba)):_0x218803['forEach'](({groupId:_0x4cb490,groupLabel:_0x306138,commands:_0x50fad3})=>{const _0x3c6f0b=new _0x200fb1(_0x2b28d4,_0x3e96a9),_0x1cff6e=new _0x104620(_0x2b28d4),_0x1a1d03=new _0x4a8496(_0x2b28d4),_0x13e3bb=this['_getMenuBarGroupButtons']({'command':_0x170323,'commands':_0x50fad3,'parentMenuView':_0x1cff6e,'onExecute':_0x4db680});_0x1cff6e['buttonView']['set']({'label':_0x306138||_0x4cb490}),_0x1cff6e['delegate']('execute')['to'](_0x3e96a9),_0x1a1d03['items']['addMany'](_0x13e3bb),_0x1cff6e['panelView']['children']['add'](_0x1a1d03),_0x3c6f0b['children']['add'](_0x1cff6e),_0x5c23f7['items']['add'](_0x3c6f0b);}),_0x3e96a9['panelView']['children']['add'](_0x5c23f7);}['_getMenuBarGroupButtons']({command:_0x52344d,commands:_0x372db7,parentMenuView:_0x5b3948,onExecute:_0x4669eb}){const _0x21dce4=this['editor'],_0x57ce70=_0x21dce4['locale'];return U(_0x21dce4,_0x372db7)['map'](_0x327060=>{const _0x15ffbe=new _0x200fb1(_0x57ce70,_0x5b3948),_0x420d99=new _0x33defb(_0x57ce70);return _0x420d99['set']({'label':_0x327060['label']}),_0x420d99['delegate']('execute')['to'](_0x5b3948),_0x420d99['on']('execute',()=>_0x4669eb(_0x327060['id'])),_0x420d99['bind']('isEnabled')['to'](_0x52344d,'enabledCommandsIds',_0x231f69=>_0x231f69['includes'](_0x327060['id'])),_0x15ffbe['children']['add'](_0x420d99),_0x15ffbe;});}}function T(_0x4e8b43,_0x52a3d9){return void 0x0!==_0x4e8b43['order']&&void 0x0===_0x52a3d9['order']?0x1:void 0x0===_0x4e8b43['order']&&void 0x0!==_0x52a3d9['order']?-0x1:void 0x0!==_0x4e8b43['order']&&void 0x0!==_0x52a3d9['order']?_0x4e8b43['order']-_0x52a3d9['order']:0x0;}function U(_0x18430e,_0x5a7535){_0x5a7535['sort'](T);const _0x5dab25={},_0x320383=[];for(const _0x3a24ed of _0x5a7535)if(void 0x0!==_0x3a24ed['order']){if(_0x3a24ed['order']in _0x5dab25)throw new _0x5cac2e('ai-commands-config-order-collision',_0x18430e,{'conflictingDefinitions':[_0x3a24ed,_0x5dab25[_0x3a24ed['order']]]});_0x5dab25[_0x3a24ed['order']]=_0x3a24ed,_0x320383['splice'](_0x3a24ed['order'],0x0,_0x3a24ed);}else _0x320383['push'](_0x3a24ed);return _0x320383;}class Qn extends _0x2a032b{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3be859){super(_0x3be859);const _0x184991=_0x3be859['config'],_0x173b79=_0x3be859['locale'];_0x184991['define']('ai.assistant.preserveComments',!0x0),_0x184991['define']('ai.assistant.commands',Xn(_0x173b79)),_0x184991['define']('ai.assistant.extraCommandGroups',[]),_0x184991['define']('ai.assistant.removeCommands',[]);let _0x49591b=o(_0x184991['get']('ai.assistant.commands'),_0x173b79);const _0x369091=_0x184991['get']('ai.assistant.extraCommandGroups'),_0x216706=_0x184991['get']('ai.assistant.removeCommands');_0x369091['forEach'](_0x39e659=>{const _0x54a5df=_0x49591b['find'](_0x5494bc=>_0x5494bc['groupId']===_0x39e659['groupId']);_0x54a5df?_0x54a5df['commands']=_0x54a5df['commands']['concat'](_0x39e659['commands']):_0x49591b['push'](_0x39e659);}),_0x49591b=_0x49591b['filter'](_0x16161c=>!_0x216706['includes'](_0x16161c['groupId'])),_0x49591b['forEach'](_0x21a25d=>{_0x21a25d['commands']=_0x21a25d['commands']['filter'](_0x17d7ee=>!_0x216706['includes'](_0x17d7ee['id']));}),_0x184991['set']('ai.assistant.commands',_0x49591b);}}function Xn(_0x41ffb2){return[{'groupId':'editOrReview','groupLabel':$n(_0x41ffb2,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':$n(_0x41ffb2,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':$n(_0x41ffb2,'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':$n(_0x41ffb2,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':$n(_0x41ffb2,'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':$n(_0x41ffb2,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':$n(_0x41ffb2,'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':$n(_0x41ffb2,'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':$n(_0x41ffb2,'Change\x20tone'),'commands':[{'id':'professional','label':$n(_0x41ffb2,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':$n(_0x41ffb2,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':$n(_0x41ffb2,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':$n(_0x41ffb2,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':$n(_0x41ffb2,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':$n(_0x41ffb2,'Change\x20style'),'commands':[{'id':'business','label':$n(_0x41ffb2,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':$n(_0x41ffb2,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':$n(_0x41ffb2,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':$n(_0x41ffb2,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':$n(_0x41ffb2,'Translate'),'commands':[{'id':'translateEnglish','label':$n(_0x41ffb2,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':$n(_0x41ffb2,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':$n(_0x41ffb2,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':$n(_0x41ffb2,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':$n(_0x41ffb2,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':$n(_0x41ffb2,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':$n(_0x41ffb2,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':$n(_0x41ffb2,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ye extends _0x2a032b{['abortController'];static get['requires'](){return[x];}constructor(_0x56e889){super(_0x56e889),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x5f408b){return this['sendRequest'](_0x5f408b)['catch'](_0x18a670=>{if(_0x18a670 instanceof tr)return Promise['reject'](_0x18a670);if('AbortError'==_0x18a670['name'])return Promise['resolve']();throw console['error'](_0x18a670),new _0x5cac2e('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0xac1652,_0x3c65d9){const _0xb3127e=this['editor']['locale'],_0x1a42b1={'Content-Type':'application/json'};if('object'==typeof _0xac1652)Object['assign'](_0x1a42b1,_0xac1652);else{if(_0xac1652)try{const _0x1e04f3=await _0xac1652(_0x3c65d9);Object['assign'](_0x1a42b1,_0x1e04f3);}catch{return Promise['reject'](new tr($n(_0xb3127e,'AI_ERROR_GET_HEADERS')));}}return _0x1a42b1;}async['_prepareRequestParameters'](_0x3ecfd4,_0x40dc8e){const _0x2ab2c4=this['editor']['locale'];if('object'==typeof _0x3ecfd4)return _0x3ecfd4;try{return await _0x3ecfd4(_0x40dc8e);}catch{return Promise['reject'](new tr($n(_0x2ab2c4,'AI_ERROR_GET_PARAMETERS')));}}}class zn extends ye{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x305a7a){super(_0x305a7a),_0x305a7a['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x305a7a['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x305a7a['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x305a7a['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x305a7a['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x305a7a['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x988041,context:_0x2795b4,onData:_0x402900,actionId:_0x596c3a}){const _0x4d6dea=this['editor']['locale'],_0x5add58=await this['prepareMessages'](_0x988041,_0x2795b4,_0x596c3a),_0x4d1d06=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x596c3a),_0x41fa2a=await this['_prepareRequestParameters'](this['_requestParameters'],_0x596c3a),_0x47d5c8={'messages':_0x5add58,..._0x41fa2a},_0x4dd8b3={'method':'POST','headers':_0x4d1d06,'body':JSON['stringify'](_0x47d5c8),'signal':this['abortController']['signal']},_0x5d3e39=await fetch(this['_apiUrl'],_0x4dd8b3);if(_0x5d3e39['ok'])return _0x41fa2a['stream']?await this['_readStreamableResponse'](_0x5d3e39,_0x402900):await this['_readStaticResponse'](_0x5d3e39,_0x402900),Promise['resolve']();{const _0x5a29f1=await _0x5d3e39['text']();return _0x5a29f1['includes']('context_length_exceeded')?Promise['reject'](new tr($n(_0x4d6dea,'AI_ERROR_CONTEXT_LENGTH'))):_0x5a29f1['includes']('Moderation')?Promise['reject'](new tr($n(_0x4d6dea,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x5a29f1));}}async['prepareMessages'](_0x151635,_0x254397,_0x344bb8){let _0x5d4e07,_0x360d4b;return _0x254397?(_0x5d4e07='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.',_0x360d4b='Instruction:\x0a'+_0x151635+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x254397):(_0x5d4e07='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.',_0x360d4b=_0x151635),[{'role':'system','content':_0x5d4e07},{'role':'user','content':_0x360d4b}];}async['_readStreamableResponse'](_0x76122b,_0x2c9616){const _0xd1bece=_0x76122b['body']['getReader'](),_0x427135=new TextDecoder();let _0x2c2a6b='',_0x4064d1='',_0x3fef1e='',_0x2c407=!0x1;for(;!_0x2c407;){const {done:_0x26950a,value:_0xfe6357}=await _0xd1bece['read'](),_0x546011=_0x2c2a6b+_0x427135['decode'](_0xfe6357);let _0x5d95a1='';_0x2c407=_0x26950a;try{_0x5d95a1=this['_cleanUpData'](_0x546011),_0x2c2a6b='';}catch{_0x2c2a6b=_0x546011;continue;}_0x4064d1+=_0x5d95a1,!_0x2c407&&this['_isBufferIncomplete'](_0x4064d1)||_0x4064d1&&(_0x3fef1e+=_0x4064d1,_0x4064d1='',_0x2c9616(_0x3fef1e));}return Promise['resolve']();}async['_readStaticResponse'](_0x381492,_0x3d127c){return _0x3d127c((await _0x381492['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x2766a2){const _0x3b65c3=_0x2766a2['split']('<')['length']!==_0x2766a2['split']('>')['length'],_0x1756ae=_0x2766a2['length']<0x1e;return _0x3b65c3&&_0x1756ae;}['_cleanUpData'](_0x55c939){return _0x55c939['split'](/\n(?![^{]*\})/g)['map'](_0x7ef6f6=>_0x7ef6f6['replace']('data:\x20',''))['filter'](_0x5aad3e=>_0x5aad3e&&_0x5aad3e['length']>0x0&&'[DONE]'!==_0x5aad3e)['map'](_0x457e17=>{const {choices:_0x5593ec}=JSON['parse'](_0x457e17);if(_0x5593ec[0x0]?.['delta']?.['content'])return _0x5593ec[0x0]['delta']['content'];})['filter'](_0x25472a=>_0x25472a)['join']('');}}class Jn extends ye{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x477f47){super(_0x477f47),_0x477f47['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x477f47['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']=_0x477f47['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x477f47['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x477f47['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x477f47['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x2096ae,context:_0x5c8cda,onData:_0x31245d,actionId:_0x2dd76c}){const {model:_0x140ffe,stream:_0x477c8d,..._0x37dd4b}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2dd76c),_0x4f852b={'prompt':await this['preparePrompt'](_0x2096ae,_0x5c8cda,_0x140ffe,_0x2dd76c),..._0x37dd4b};this['_apiUrl']?await this['_processProxyRequest'](_0x4f852b,_0x140ffe,_0x477c8d,_0x31245d,_0x2dd76c):await this['_processAWSRequest'](_0x4f852b,_0x140ffe,_0x477c8d,_0x31245d);}async['preparePrompt'](_0x2dd5c8,_0x1044f8,_0xd3dc34,_0x533052){let _0x1356ec,_0x5dc5a6;return _0x1044f8?(_0x1356ec='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.',_0x5dc5a6='Instruction:\x0a'+_0x2dd5c8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1044f8):(_0x1356ec='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.',_0x5dc5a6=_0x2dd5c8),'meta.llama'==this['getModelFamily'](_0xd3dc34)?'<<SYS>>\x0a'+_0x1356ec+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x5dc5a6+'\x0a[/INST]':'Human:\x0a'+_0x1356ec+'\x0a'+_0x5dc5a6+'\x0a\x0aAssistant:';}['getModelFamily'](_0x13eb54){if(/^anthropic\.claude/['test'](_0x13eb54))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x13eb54))return'ai21.j2';if(/^cohere\.command/['test'](_0x13eb54))return'cohere.command';if(/^meta\.llama/['test'](_0x13eb54))return'meta.llama';throw new tr($n(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x13eb54));}async['_processProxyRequest'](_0x6d9bab,_0x44f2bb,_0x5ced02,_0x9f59b9,_0x2e8168){const _0x16573b={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2e8168),'body':JSON['stringify']({..._0x6d9bab,'model':_0x44f2bb,'stream':_0x5ced02}),'signal':this['abortController']['signal']},_0x529847=await fetch(this['_apiUrl'],_0x16573b);_0x5ced02?await this['_readStreamableResponse'](_0x529847,_0x44f2bb,_0x9f59b9):await this['_readStaticResponse'](_0x529847,_0x44f2bb,_0x9f59b9);}async['_processAWSRequest'](_0x337940,_0x152676,_0x3f9126,_0x3677e4){const _0x53aa4d=new _0x3318e1(this['_bedrockClientConfig']),_0x32a357={'body':JSON['stringify'](_0x337940),'contentType':'application/json','accept':'application/json','modelId':_0x152676};let _0x125c12;if(_0x3f9126){const _0x3def20=new _0x40a93f(_0x32a357);_0x125c12=await _0x53aa4d['send'](_0x3def20,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x125c12,_0x152676,_0x3677e4);}else{const _0x32e639=new _0x4d0ec4(_0x32a357);_0x125c12=await _0x53aa4d['send'](_0x32e639,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x125c12,_0x152676,_0x3677e4);}}async['_readAsyncIterableResponse'](_0x4dcfbf,_0x1c393f,_0x23a67b){const _0x58f3e2=_0x4dcfbf['body'],_0x304b3c=new TextDecoder('utf-8');let _0x2ebcc8='';for await(const _0x2602b5 of _0x58f3e2)if(_0x2602b5['chunk']){const _0x42dcdb=_0x304b3c['decode'](_0x2602b5['chunk']['bytes']),_0x59f093=JSON['parse'](_0x42dcdb);_0x2ebcc8+=this['_getGeneratedText'](_0x59f093,_0x1c393f),_0x23a67b(_0x2ebcc8);}return Promise['resolve']();}async['_readStreamableResponse'](_0x29afff,_0x13b6ec,_0x1d4674){const _0x51fd0b=_0x29afff['body'],_0x1fd09e=new TextDecoder('utf-8'),_0x5d6b34=_0x51fd0b['getReader']();let _0x22d53e='',_0x2939b4='',_0x2bcdc7=!0x1;for(;!_0x2bcdc7;){const {done:_0x5bc1dc,value:_0x2e8425}=await _0x5d6b34['read']();if(_0x2bcdc7=_0x5bc1dc,_0x2bcdc7)break;const _0x443947=(_0x22d53e+_0x1fd09e['decode'](_0x2e8425))['split']('\x0a')['map'](_0x4316d0=>{try{return _0x22d53e='',JSON['parse'](_0x4316d0);}catch{return _0x22d53e=_0x4316d0,null;}})['filter'](_0x78a4cf=>null!==_0x78a4cf);_0x443947['length']&&(_0x2939b4+=_0x443947['map'](_0xb530c7=>this['_getGeneratedText'](_0xb530c7,_0x13b6ec))['join'](''),_0x1d4674(_0x2939b4));}return Promise['resolve']();}async['_readStaticResponse'](_0x4903be,_0x2541b4,_0x7f5da){let _0x4242b9;return _0x4242b9=_0x4903be instanceof Response?await _0x4903be['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x4903be['body'])),(_0x7f5da(this['_getGeneratedText'](_0x4242b9,_0x2541b4)),Promise['resolve']());}['_getGeneratedText'](_0x22015b,_0x374249){switch(this['getModelFamily'](_0x374249)){case'anthropic.claude':return _0x22015b['completion'];case'ai21.j2':return _0x22015b['completions'][0x0]['data']['text'];case'cohere.command':return _0x22015b['generations'][0x0]['text'];case'meta.llama':return _0x22015b['generation'];}}}class ia extends _0x5be5f6{constructor(_0x545b16,_0x2a5782={}){super(_0x545b16),this['isToggleable']=!0x0,this['set']('side',_0x2a5782['side']||'top');const _0x136a94=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x335512(_0x2a5782['class']||[]),_0x136a94['to']('side',_0x4621aa=>'ck-tab-button_'+_0x4621aa),_0x136a94['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x1f124f{['children'];constructor(_0x12e62c,_0x36f13={}){super(_0x12e62c);const _0x3c8f58=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x335512(_0x36f13['class']||[]),_0x3c8f58['to']('class'),_0x3c8f58['if']('isVisible','ck-hidden',_0x15a61b=>!_0x15a61b)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x1f124f{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x305565,_0x37e7d5={}){super(_0x305565),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x37e7d5['side']||'top'),this['set']('isMaximized',!0x1);const _0x2ca140=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x335512(_0x37e7d5['class']||[]),_0x2ca140['to']('side',_0x3a534b=>'ck-tabs_'+_0x3a534b),_0x2ca140['to']('class'),_0x2ca140['to']('isMaximized',_0xb57dd5=>_0xb57dd5?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x2ca140['to']('side',_0x5d22b6=>'ck-tabs__buttons-container_'+_0x5d22b6)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x2ca140['to']('side',_0x3297db=>'ck-tabs__panels-container_'+_0x3297db)]},'children':this['panelViews']},..._0x335512(_0x37e7d5['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x50950a){const _0x1967b0=this['_tabs']['get'](_0x50950a);return _0x1967b0||null;}['addTab'](_0x13a34f){const _0x216c0d=this['_setupButton']({'id':_0x13a34f['id'],'label':_0x13a34f['buttonLabel'],'icon':_0x13a34f['buttonIcon'],'order':_0x13a34f['order']}),_0x24f3c2=new ea(this['locale']);return _0x24f3c2['render'](),_0x13a34f['content']&&_0x24f3c2['children']['add'](_0x13a34f['content']),this['panelViews']['add'](_0x24f3c2),this['_tabs']['set'](_0x13a34f['id'],{'button':_0x216c0d,'panel':_0x24f3c2,'order':void 0x0!==_0x13a34f['order']?_0x13a34f['order']:null}),this['fire']('addTab:'+_0x13a34f['id'],{'id':_0x13a34f['id'],'button':_0x216c0d,'panel':_0x24f3c2}),null===this['activeTab']?this['activateTab'](_0x13a34f['id']):this['_hidePanel'](_0x13a34f['id']),{'button':_0x216c0d,'panel':_0x24f3c2};}['activateTab'](_0x13d45f){if(null!==_0x13d45f&&!this['getTab'](_0x13d45f))throw new _0x5cac2e('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x13d45f});this['activeTab']!==_0x13d45f&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x13d45f,_0x13d45f&&this['_showPanel'](_0x13d45f),this['fire']('activateTab:'+_0x13d45f,_0x13d45f));}['showTab'](_0x39f80f){if(!this['getTab'](_0x39f80f))throw new _0x5cac2e('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x39f80f});this['_showPanel'](_0x39f80f),this['_showButton'](_0x39f80f),this['fire']('show:'+_0x39f80f,_0x39f80f);}['hideTab'](_0x2857d2){if(!this['getTab'](_0x2857d2))throw new _0x5cac2e('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x2857d2});const _0x535fc6=this['activeTab'];this['_hidePanel'](_0x2857d2),this['_hideButton'](_0x2857d2);const _0x5f44a2=this['getTabIds']();_0x535fc6===_0x2857d2&&_0x5f44a2['length']>0x1&&this['activateTab'](_0x5f44a2['find'](_0xf463ac=>_0xf463ac!==_0x2857d2)),this['fire']('hide:'+_0x2857d2,_0x2857d2);}['_getPanel'](_0x57ddcd){const _0x5d8c05=this['_tabs']['get'](_0x57ddcd);return _0x5d8c05?_0x5d8c05['panel']:null;}['_showPanel'](_0x19b3d4){null!==this['activeTab']&&this['activeTab']!==_0x19b3d4||this['_getPanel'](_0x19b3d4)['show']();}['_hidePanel'](_0x3c0682){const _0x4b4376=this['_getPanel'](_0x3c0682);_0x4b4376['isVisible']&&(this['activeTab']===_0x3c0682&&(this['activeTab']=null),_0x4b4376['hide']());}['_getButton'](_0x320707){const _0x1a1b17=this['_tabs']['get'](_0x320707);return _0x1a1b17?_0x1a1b17['button']:null;}['_showButton'](_0x503b73){this['_getButton'](_0x503b73)['show']();}['_hideButton'](_0x16601a){this['_getButton'](_0x16601a)['hide']();}['_setupButton'](_0x21f8be){const _0x5a6bfb=new ia(this['locale'],{'side':this['side']}),_0x11c0b7=this['buttonViews'];if(_0x5a6bfb['set']({'label':_0x21f8be['label'],'icon':_0x21f8be['icon'],'tooltip':!0x0,'withText':!0x0}),_0x5a6bfb['bind']('isOn')['to'](this,'activeTab',_0x31a93e=>_0x31a93e===_0x21f8be['id']),_0x5a6bfb['bind']('side')['to'](this,'side'),_0x21f8be['order']){const _0x517e35=[...this['_tabs']]['reduce']((_0x3e58d7,_0x3550d5)=>{const _0x4cd5df=_0x3550d5[0x0],{order:_0xb9f72e}=_0x3550d5[0x1];return!_0xb9f72e||_0xb9f72e>_0x21f8be['order']?_0x3e58d7:_0xb9f72e>=_0x3e58d7['order']?{'id':_0x4cd5df,'order':_0xb9f72e}:_0x3e58d7;},{'id':'','order':0x0}),_0x53ea50=_0x11c0b7['getIndex'](this['_getButton'](_0x517e35['id']));_0x11c0b7['add'](_0x5a6bfb,_0x53ea50+0x1);}else _0x11c0b7['add'](_0x5a6bfb);return _0x5a6bfb['on']('execute',()=>{this['activateTab'](_0x21f8be['id']);}),_0x5a6bfb;}}const di=['overlay','sidebar','custom'],ui=['left','right'];class ai extends ss{constructor(_0x1c490f,_0xf0acd8={}){super(_0x1c490f,_0xf0acd8),this['set']('type',_0xf0acd8['type']||'sidebar'),this['set']('side',_0xf0acd8['side']||'right'),this['set']('isVisible',_0xf0acd8['visibleByDefault']??!0x0);const _0x44beb2=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x44beb2['if']('type','ck-ai-tabs__overlay',_0x4c5ba0=>'overlay'===_0x4c5ba0),_0x44beb2['if']('type','ck-ai-tabs__sidebar',_0x4f129a=>'sidebar'===_0x4f129a),_0x44beb2['if']('isVisible','ck-hidden',_0x4048a1=>!_0x4048a1)]}}),this['buttonViews']['on']('add',(_0x35b3cc,_0x50601a)=>{_0x50601a['set']('withText',!0x1);});}}class ft extends _0x24ce56{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4e7c30){super(_0x4e7c30);const _0xbd9dc6=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0xbd9dc6)throw new _0x5cac2e('ai-tabs-configuration-not-found');if(void 0x0!==_0xbd9dc6['showResizeButton']&&(this['showResizeButton']=_0xbd9dc6['showResizeButton']),'sidebar'!==_0xbd9dc6['type']&&'overlay'!==_0xbd9dc6['type']||_0xbd9dc6['side']&&(this['side']=_0xbd9dc6['side']),'sidebar'===_0xbd9dc6['type']){if(this['container']=_0xbd9dc6['element'],this['set']('type','sidebar'),!this['container'])throw new _0x5cac2e('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0xbd9dc6['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new ai(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0xbd9dc6['visibleByDefault']||_0xbd9dc6['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 pt&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x297cdc){if(_0x297cdc&&this['type']!==_0x297cdc){if(!di['includes'](_0x297cdc))throw new _0x5cac2e('ai-tabs-unsupported-ui-type');this['type']=_0x297cdc;}}['switchSide'](_0xd522fb){if(_0xd522fb&&this['side']!==_0xd522fb){if(!ui['includes'](_0xd522fb))throw new _0x5cac2e('ai-tabs-unsupported-ui-side');this['side']=_0xd522fb;}}['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 R extends _0x24ce56{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1a9bfb){super(_0x1a9bfb),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 _0x2d065a=this['context']['plugins']['get']('CloudServices');if(!_0x2d065a['token'])throw new _0x5cac2e('ai-missing-token',this);this['_token']=_0x2d065a['token'];}['startConversation'](_0x30dde7,_0x1b9e58){const _0x4a4cef=this['_sendApiRequest']('/conversations','POST',{'id':_0x30dde7,'group':_0x1b9e58});return{'getConversation':async()=>(await _0x4a4cef['request'])['json'](),'abortController':_0x4a4cef['abortController']};}['queryAssistant']({message:_0x3a9f99,conversationId:_0x3f5ff6,parts:_0x333170,capabilities:_0x405635,model:_0x164882,quickActionData:_0x5f232a}){const _0xa01d81={..._0x5f232a&&{'quickActionData':_0x5f232a}},_0x55dad2={'prompt':_0x3a9f99,'content':_0x333170,'model':_0x164882,..._0x405635&&{'capabilities':_0x405635},...Object['keys'](_0xa01d81)['length']>0x0&&{'attributes':_0xa01d81}},_0x1fbe0e=this['_sendApiRequest']('/conversations/'+_0x3f5ff6+'/messages','POST',_0x55dad2);return{'getStream':async()=>{const _0x5608a2=(await _0x1fbe0e['request'])['body'];return this['_getStreamReader'](_0x5608a2);},'abortController':_0x1fbe0e['abortController']};}['executeCustomAction']({content:_0x576986,message:_0x5c2e10,model:_0xb1a7b4,outputFormat:_0x2255b0}){const _0x1f93d9={'content':[{'type':'text','content':_0x576986}],'prompt':_0x5c2e10,'model':_0xb1a7b4,'outputFormat':_0x2255b0},_0x268230=this['_sendApiRequest']('/actions/custom/calls','POST',_0x1f93d9);return{'getStream':async()=>{const _0x5b23c4=(await _0x268230['request'])['body'];return this['_getStreamReader'](_0x5b23c4);},'abortController':_0x268230['abortController']};}['executeAction']({actionName:_0x336392,content:_0x9ead6c,args:_0x85a552}){const _0xb6e88b={'content':[{'type':'text','content':_0x9ead6c}],'args':_0x85a552},_0x3be9a4=this['_sendApiRequest']('/actions/system/'+_0x336392+'/calls','POST',_0xb6e88b);return{'getStream':async()=>{const _0x4dc0f7=(await _0x3be9a4['request'])['body'];return this['_getStreamReader'](_0x4dc0f7);},'abortController':_0x3be9a4['abortController']};}['uploadFile'](_0x29e8cb,_0x165942,_0x25bcd7){const _0x40c5ae=new FormData();_0x40c5ae['append']('file',_0x165942,_0x165942['name']),_0x25bcd7&&_0x40c5ae['append']('attributes',JSON['stringify'](_0x25bcd7));const _0x314f3d=this['_sendApiRequest']('/conversations/'+_0x29e8cb+'/files','POST',_0x40c5ae);return{'getId':async()=>(await _0x314f3d['request'])['json'](),'abortController':_0x314f3d['abortController']};}['fetchDocument'](_0x1667d8,_0x421bb7){const _0x749da7=this['_sendApiRequest']('/conversations/'+_0x1667d8+'/documents/'+_0x421bb7,'GET');return{'getDocument':async()=>(await _0x749da7['request'])['json'](),'abortController':_0x749da7['abortController']};}['uploadDocument'](_0x4c0f54,_0x1796b1,_0x29adb7){const _0x467aaa={'content':_0x1796b1};_0x29adb7&&(_0x467aaa['attributes']=_0x29adb7);const _0x4ed39c=this['_sendApiRequest']('/conversations/'+_0x4c0f54+'/documents','POST',_0x467aaa);return{'getId':async()=>(await _0x4ed39c['request'])['json'](),'abortController':_0x4ed39c['abortController']};}['fetchConversations'](_0x1bc0d1,_0x3499c6){const _0xeb4b11=new URLSearchParams();_0xeb4b11['append']('excludeEmpty','true'),_0xeb4b11['append']('limit','100'),_0xeb4b11['append']('group',_0x1bc0d1),_0x3499c6&&_0xeb4b11['append']('search',_0x3499c6);const _0x31de55=this['_sendApiRequest']('/conversations?'+_0xeb4b11['toString'](),'GET');return{'getConversations':async()=>{const _0x48e81c=await _0x31de55['request'];return(await _0x48e81c['json']())['items'];},'abortController':_0x31de55['abortController']};}['deleteConversation'](_0x12e099){const _0x3e8c96=this['_sendApiRequest']('/conversations/'+_0x12e099,'DELETE');return{'execute':async()=>{await _0x3e8c96['request'];},'abortController':_0x3e8c96['abortController']};}['updateConversation'](_0x3c7335,_0x52b17a){const _0x4e38cc=this['_sendApiRequest']('/conversations/'+_0x3c7335,'PATCH',_0x52b17a);return{'getResult':async()=>(await _0x4e38cc['request'],_0x52b17a),'abortController':_0x4e38cc['abortController']};}['fetchConversation'](_0x88719c){const _0x7fb27=this['_sendApiRequest']('/conversations/'+_0x88719c,'GET');return{'getConversation':async()=>(await _0x7fb27['request'])['json'](),'abortController':_0x7fb27['abortController']};}['fetchConversationMessages'](_0xf754ea){const _0x367b83=this['_sendApiRequest']('/conversations/'+_0xf754ea+'/messages','GET');return{'getMessages':async()=>{const _0x375b44=await _0x367b83['request'];return(await _0x375b44['json']())['items'];},'abortController':_0x367b83['abortController']};}['uploadUrl'](_0x203453,_0x33441c,_0x15097a){const _0x5cbb65=this['_sendApiRequest']('/conversations/'+_0x203453+'/web-resources','POST',{'url':_0x33441c,'attributes':_0x15097a});return{'getId':async()=>(await _0x5cbb65['request'])['json'](),'abortController':_0x5cbb65['abortController']};}['getModels'](){const _0x245a8e=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>await(await _0x245a8e['request'])['json'](),'abortController':_0x245a8e['abortController']};}['deleteFile'](_0x480c8d,_0x49baac){const _0x4eede8=this['_sendApiRequest']('/conversations/'+_0x480c8d+'/files/'+_0x49baac,'DELETE');return{'execute':async()=>{await _0x4eede8['request'];},'abortController':_0x4eede8['abortController']};}['deleteDocument'](_0x28d7f9,_0x5ad03d){const _0xdf1695=this['_sendApiRequest']('/conversations/'+_0x28d7f9+'/documents/'+_0x5ad03d,'DELETE');return{'execute':async()=>{await _0xdf1695['request'];},'abortController':_0xdf1695['abortController']};}['deleteWebResource'](_0x44e5d7,_0x5d875a){const _0x345c4c=this['_sendApiRequest']('/conversations/'+_0x44e5d7+'/web-resources/'+_0x5d875a,'DELETE');return{'execute':async()=>{await _0x345c4c['request'];},'abortController':_0x345c4c['abortController']};}['callSystemReview']({reviewName:_0x2786f2,content:_0x63a5e5,args:_0x333400}){const _0x1bd330=this['_sendApiRequest']('/reviews/system/'+_0x2786f2+'/calls','POST',{'content':[{'type':'text','content':_0x63a5e5}],'args':_0x333400});return{'getStream':async()=>{const _0xc205b8=(await _0x1bd330['request'])['body'];return this['_getStreamReader'](_0xc205b8);},'abortController':_0x1bd330['abortController']};}['callCustomReview']({content:_0x437e4f,prompt:_0x12c5e8,model:_0x1a4992}){const _0x1a10d1=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x437e4f}],'prompt':_0x12c5e8,'model':_0x1a4992});return{'getStream':async()=>{const _0x34450e=(await _0x1a10d1['request'])['body'];return this['_getStreamReader'](_0x34450e);},'abortController':_0x1a10d1['abortController']};}['upsertAIChatRating'](_0x39aac7,_0x420bfe,_0x10c29b){const _0x5c22b1=this['_sendApiRequest']('/conversations/'+_0x39aac7+'/messages/'+_0x420bfe+'/ratings','PUT',{'positiveCount':_0x10c29b['positiveCount'],'totalCount':_0x10c29b['totalCount'],'modificationId':_0x10c29b['modificationId']});return{'execute':async()=>{await _0x5c22b1['request'];},'abortController':_0x5c22b1['abortController']};}['upsertAIActionRating'](_0x2108a3,_0x3027f2,_0x12d56d){const _0x32a21b=this['_sendApiRequest']('/actions/system/'+_0x2108a3+'/calls/'+_0x3027f2+'/ratings','PUT',{'positiveCount':_0x12d56d['positiveCount'],'totalCount':_0x12d56d['totalCount']});return{'execute':async()=>{await _0x32a21b['request'];},'abortController':_0x32a21b['abortController']};}['upsertCustomAIActionRating'](_0x33ca3c,_0x15f51d){const _0x21b692=this['_sendApiRequest']('/actions/custom/calls/'+_0x33ca3c+'/ratings','PUT',{'positiveCount':_0x15f51d['positiveCount'],'totalCount':_0x15f51d['totalCount']});return{'execute':async()=>{await _0x21b692['request'];},'abortController':_0x21b692['abortController']};}['upsertAIReviewRating'](_0x25e018,_0x42910a,_0x205bf6,_0x1ccb94){const _0x3fe88b=this['_sendApiRequest']('/reviews/system/'+_0x25e018+'/calls/'+_0x42910a+'/ratings','PUT',{'positiveCount':_0x205bf6['positiveCount'],'totalCount':_0x205bf6['totalCount'],'dataId':_0x1ccb94});return{'execute':async()=>{await _0x3fe88b['request'];},'abortController':_0x3fe88b['abortController']};}['upsertCustomAIReviewRating'](_0x37d4e4,_0x3c4d8e,_0x2a9b6c){const _0x5afdde=this['_sendApiRequest']('/reviews/custom/calls/'+_0x37d4e4+'/ratings','PUT',{'positiveCount':_0x3c4d8e['positiveCount'],'totalCount':_0x3c4d8e['totalCount'],'dataId':_0x2a9b6c});return{'execute':async()=>{await _0x5afdde['request'];},'abortController':_0x5afdde['abortController']};}['_sendApiRequest'](_0xc09b64,_0x542ef5,_0x1ec5c6){const _0x314a5b=new AbortController(),_0x1d23fa=_0x1ec5c6 instanceof FormData,_0x410e4d={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x1ec5c6&&!_0x1d23fa&&(_0x410e4d['Content-Type']='application/json');const _0x28de97={'method':_0x542ef5,'headers':_0x410e4d,'signal':_0x314a5b['signal']};return _0x1ec5c6&&(_0x28de97['body']=_0x1d23fa?_0x1ec5c6:JSON['stringify'](_0x1ec5c6)),{'request':fetch(''+this['_apiUrl']+_0xc09b64,_0x28de97)['catch'](_0x2de6b2=>{this['_handleError'](_0x2de6b2);})['then'](_0x3fc642=>_0x3fc642['ok']?_0x3fc642:_0x3fc642['json']()['then'](_0x536b60=>{throw{'url':this['_apiUrl'],'path':_0xc09b64,'method':_0x542ef5,'body':_0x1ec5c6,'status':(_0x3fc642||{})['status'],'statusText':(_0x3fc642||{})['statusText'],'code':_0x536b60['code'],'message':_0x536b60['message'],'traceId':_0x536b60['traceId']};})),'abortController':_0x314a5b};}async*['_getStreamReader'](_0x108ee7){const _0x2c1799=[],_0x2bae6c=_0x108ee7['getReader'](),_0x2aacdb=$t({'onError':_0x4cb4ba=>{this['_handleError'](_0x4cb4ba);},'onEvent':_0x120bf3=>{_0x120bf3['data']=JSON['parse'](_0x120bf3['data']),_0x2c1799['push'](_0x120bf3);}});try{let _0x16da0f=!0x1;for(;!_0x16da0f;){const {done:_0x3f98ae,value:_0x133a2c}=await _0x2bae6c['read']();_0x3f98ae&&(_0x16da0f=!0x0),_0x2aacdb['feed'](this['_decoder']['decode'](_0x133a2c,{'stream':!0x0})),yield*_0x2c1799,_0x2c1799['length']=0x0;}}catch(_0x54a818){this['_handleError'](_0x54a818);}finally{_0x2bae6c['releaseLock'](),_0x2aacdb['reset']();}}['_handleError'](_0x46ab47){if(_0x46ab47 instanceof _0x5cac2e)throw _0x46ab47;if(_0x46ab47 instanceof Error&&'AbortError'===_0x46ab47['name'])throw new _0x5cac2e('ai-request-aborted',this,{'originalError':_0x46ab47});throw new _0x5cac2e('ai-request-failed',this,{'originalError':_0x46ab47});}}function i(_0x371724,_0x80102e,_0x89eed0){const t=_0x371724['t'];switch(_0x80102e){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'},_0x89eed0);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_SHOW_IN_THE_TEXT':return t({'id':'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT','string':'Preview'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Insert\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Reject'});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_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\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});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.'},_0x89eed0);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.'},_0x89eed0);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_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.'},_0x89eed0);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_SHOW_CHANGE_IN_TEXT':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','string':'Preview','plural':'Preview'},_0x89eed0);case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP','string':'Show\x20change\x20in\x20the\x20document','plural':'Show\x20changes\x20in\x20the\x20document'},_0x89eed0);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x89eed0);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP','string':'Insert\x20change\x20as\x20suggestion','plural':'Insert\x20changes\x20as\x20suggestions'},_0x89eed0);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x89eed0);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20changes\x20immediately','plural':'Apply\x20all\x20changes\x20immediately'},_0x89eed0);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x89eed0);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.'},_0x89eed0);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.'},_0x89eed0);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.'},_0x89eed0);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.'},_0x89eed0);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'},_0x89eed0);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_TOOLTIP':return t({'id':'AI_BALLOON_NEXT_TOOLTIP','string':'Next'});case'AI_BALLOON_PREVIOUS_TOOLTIP':return t({'id':'AI_BALLOON_PREVIOUS_TOOLTIP','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_MODEL_DESCRIPTION_AUTO':return t({'id':'AI_MODEL_DESCRIPTION_AUTO','string':'Automatically\x20selects\x20best\x20model\x20for\x20speed,\x20quality,\x20and\x20cost.'});case'AI_MODEL_DESCRIPTION_GPT-5':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5','string':'OpenAI\x27s\x20flagship\x20model\x20for\x20advanced\x20reasoning,\x20creativity,\x20and\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GPT-5-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5-MINI','string':'A\x20lightweight\x20version\x20of\x20GPT-5\x20-\x20faster,\x20more\x20cost-efficient'});case'AI_MODEL_DESCRIPTION_GPT-4.1':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1','string':'OpenAI\x27s\x20model\x20for\x20reliable\x20reasoning,\x20speed,\x20and\x20versatility'});case'AI_MODEL_DESCRIPTION_GPT-4.1-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1-MINI','string':'A\x20lighter\x20variant\x20of\x20GPT-4.1\x20that\x20balances\x20speed\x20and\x20cost\x20while\x20maintaining\x20solid\x20accuracy'});case'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU','string':'Anthropic\x27s\x20fast,\x20cost-efficient\x20model\x20for\x20simpler\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-5-HAIKU','string':'Cost-efficient\x20model\x20for\x20quick\x20interactions\x20with\x20improved\x20reasoning'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET','string':'Advanced\x20model\x20with\x20strong\x20reasoning\x20and\x20reliability\x20for\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-5-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-5-SONNET','string':'Advanced\x20model\x20with\x20improved\x20creativity,\x20reliability,\x20and\x20reasoning'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO','string':'Google\x27s\x20advanced\x20model\x20for\x20versatile\x20problem-solving\x20and\x20research'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH','string':'Lightweight\x20Gemini\x20model\x20for\x20fast,\x20cost-efficient\x20interactions'});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.'},_0x89eed0);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_ACTIONS_SELECTION_REMOVED_ERROR':return t({'id':'AI_ACTIONS_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'});default:return _0x80102e;}}function ks(_0x489c22,_0x523b2d){const _0x520327=new _0x5be5f6(_0x489c22),_0x18217b=i(_0x489c22,'AI_TABS_LABEL_MINIMIZE'),_0x5de48a=i(_0x489c22,'AI_TABS_LABEL_MAXIMIZE');return _0x520327['set']({'withText':!0x1,'icon':_0x45bbdf,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x520327['bind']('label')['to'](_0x523b2d,'isMaximized',_0x4e31b5=>_0x4e31b5?_0x18217b:_0x5de48a),_0x520327['bind']('icon')['to'](_0x523b2d,'isMaximized',_0x25bb6a=>_0x25bb6a?to:_0x45bbdf),_0x520327['bind']('isOn')['to'](_0x523b2d,'isMaximized'),_0x520327['on']('execute',()=>{_0x523b2d['fire']('resizeTabs');}),_0x520327;}function Je(_0x3bc87f){return _0x3eef3f(_0x3bc87f);}function vt(_0x33f7ae){return _0x1ff74f(_0x33f7ae);}function Rt(_0xef39b3,_0x46e8d5,_0x112d2a){const _0x53649b=null!==_0x46e8d5?_0x2f18c5=>_0x2f18c5['attribs'][_0xef39b3]===_0x46e8d5:_0x312409=>Boolean(_0x312409['attribs'][_0xef39b3]);return St(_0xcdb240=>_0x3cb149(_0xcdb240)&&_0x53649b(_0xcdb240),_0x112d2a);}function $e(_0xb1f7b8,_0x519647,_0x2d35b5){const _0x37d56c=null!==_0x519647?_0x2898da=>_0x2898da['attribs'][_0xb1f7b8]===_0x519647:_0x50f727=>Boolean(_0x50f727['attribs'][_0xb1f7b8]);return _0x41c79e(_0x15910c=>_0x3cb149(_0x15910c)&&_0x37d56c(_0x15910c),_0x2d35b5);}function wt(_0x256526,_0x5c571d){return _0x256526&&_0x3cb149(_0x256526)?_0x256526['attribs'][_0x5c571d]:null;}function Ki(_0x1bb223,_0x2b8d3d,_0x2fdf3b){_0x3cb149(_0x1bb223)&&(null===_0x2fdf3b?delete _0x1bb223['attribs'][_0x2b8d3d]:_0x1bb223['attribs'][_0x2b8d3d]=_0x2fdf3b);}function Pi(_0x38d2e9,_0x446296,_0x4bfe8d){const _0x4fb8f5=_0x446296['cloneNode'](!0x0);'beforebegin'===_0x4bfe8d?_0x5e539d(_0x38d2e9,_0x4fb8f5):'afterbegin'===_0x4bfe8d?_0x57cbd0(_0x38d2e9,_0x4fb8f5):'beforeend'===_0x4bfe8d?_0x292f5b(_0x38d2e9,_0x4fb8f5):'afterend'===_0x4bfe8d&&_0x186aa3(_0x38d2e9,_0x4fb8f5);}function He(_0x383b23){const _0x5367b7=[];let _0x5b8183=_0x383b23;for(;_0x5b8183;)_0x5b8183=_0x182a67(_0x5b8183),_0x5b8183&&_0x5367b7['push'](_0x5b8183);return _0x5367b7;}function Zn(_0x13d6f3){return _0x13d6f3['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Zi(_0x13be94){let _0x430559=0x0;for(;_0x13be94['parentNode'];)_0x13be94=_0x13be94['parentNode'],_0x430559++;return _0x430559;}function fs(_0x4b4f9d){const _0x57ae6a=[];let _0x49d687=_0x4b4f9d['nextSibling'];for(;_0x49d687;)_0x57ae6a['push'](_0x49d687),_0x49d687=_0x49d687['nextSibling'];_0x57ae6a['forEach'](_0x45be43=>{_0x5d80a9(_0x45be43);});}class Qe extends/* #__PURE__ -- @preserve */
25
+ ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x3839e3();}['convertMarkdownToHTML'](_0x580849){const _0x5a041d=this['_m2html']['parse'](_0x580849);return this['parseAndNormalizeHTML'](_0x5a041d);}['parseAndNormalizeHTML'](_0x479300){return this['_parseHTML'](_0x479300);}['_parseHTML'](_0x167ae1){const _0x37c8f2=Je('<dummy>'+_0x167ae1['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x37c8f2['children']=_0x37c8f2['children'][0x0]['children'],_0x37c8f2;}}class Xe extends/* #__PURE__ -- @preserve */
26
+ ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0xb84bd8){super(),this['_generateUid']=_0xb84bd8||_0x1cb0e0;}['merge'](_0xdddb12,_0x31fbd1,_0x3ae0f4){const _0x56f70b=_0xdddb12['cloneNode'](!0x0);if(0x0===_0x31fbd1['childNodes']['length']){const _0x1c43f1=[];return $e('data-id','new-element',_0x56f70b)['forEach'](_0x3d4fa6=>{const _0x1a7b0a=this['_generateUid']();Ki(_0x3d4fa6,'data-id',_0x1a7b0a),_0x1c43f1['push'](_0x1a7b0a);}),this['_removeSpecialComments'](_0x56f70b),{'parsedContent':_0x56f70b,'newNodeIds':_0x1c43f1,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x3ae0f4&&_0x3ae0f4['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x56f70b),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set($e('data-id',null,_0x31fbd1)['map'](_0x125554=>wt(_0x125554,'data-id'))['filter'](_0x1e1028=>!!_0x1e1028));let _0x1a85ba=-0x1,_0xdea598=!0x1;const _0x2087e1=_0x56f70b['childNodes'],_0x34838b=Array['from'](_0x2087e1)['filter'](_0x14c8bf=>!(0x3===_0x14c8bf['nodeType']&&''===vt(_0x14c8bf)['trim']())),_0x196c88=_0x34838b['length'];for(let _0x16c2bc=0x0;_0x16c2bc<_0x196c88;_0x16c2bc++){const _0x467d20=_0x34838b[_0x16c2bc],_0x2dc561=_0x34838b[_0x16c2bc+0x1];if(this['_isNewNode'](_0x467d20)){if(-0x1===_0x1a85ba&&(_0x1a85ba=_0x16c2bc),this['_markWrappedElements'](_0x467d20),!this['_isNewNode'](_0x2dc561)){const [_0x4aec21,_0x92348b]=this['_findReferenceNode'](_0x467d20,_0xdea598,_0x31fbd1);if(_0x4aec21){const _0x40cfa6=Array['from'](_0x34838b)['slice'](_0x1a85ba,_0x16c2bc+0x1);this['_insertNodes'](_0x4aec21,_0x40cfa6,_0x92348b),_0x1a85ba=-0x1;}}}else{if(this['_isExistingContentComment'](_0x467d20))_0xdea598=!0x0;else{if(this['_isExistingNode'](_0x467d20)){const _0x258c17=wt(_0x467d20,'data-id');if(_0x258c17&&this['_existingDataIds']['has'](_0x258c17)){const _0x79595d=Rt('data-id',_0x258c17,_0x31fbd1);this['_replaceNode'](_0x79595d,_0x467d20);}if(this['_touchedNodesState']['removedIds']['includes'](_0x258c17)){const _0x250a9a=this['_touchedNodesState']['removedIds']['indexOf'](_0x258c17);this['_touchedNodesState']['removedIds']['splice'](_0x250a9a,0x1);}}else{if(this['_isDelNode'](_0x467d20)){const _0x5edea0=wt(_0x467d20,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x5edea0)||this['_storeDeletedElementIds'](_0x467d20);}}}}}for(const _0x4a0617 of this['_touchedNodesState']['removedIds']){const _0x3af279=Rt('data-id',_0x4a0617,_0x31fbd1);if(_0x3af279){if(_0x3ae0f4&&_0x3ae0f4['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x4a0617;const _0x681aa8=_0x3ae0f4['replaceRemovedWith']['cloneNode'](!0x0);Ki(_0x681aa8,'data-id',_0x4a0617),Ki(_0x681aa8,'data-removed','true'),_0x158c15(_0x3af279,_0x681aa8);}else _0x5d80a9(_0x3af279);}}if($e('data-wrapped-id',null,_0x31fbd1)['forEach'](_0x3b1656=>{const _0x539845=Rt('data-id',wt(_0x3b1656,'data-wrapped-id'),_0x31fbd1);var _0xf90821,_0x249576;_0x539845&&(_0x249576=_0x3b1656,_0x5d80a9(_0xf90821=_0x539845),_0x158c15(_0x249576,_0xf90821));}),$e('data-id','new-element',_0x31fbd1)['forEach'](_0x19b5ab=>{const _0x107fa3=this['_getUid'](_0x19b5ab);Ki(_0x19b5ab,'data-id',_0x107fa3),this['_touchedNodesState']['newIds']['push'](_0x107fa3);}),this['_removeSpecialComments'](_0x31fbd1),_0x3ae0f4&&_0x3ae0f4['markUnstableElements']&&this['_markUnstableElements'](_0x31fbd1,_0x3ae0f4['markUnstableElementsDepth']||0x0),_0x3ae0f4&&_0x3ae0f4['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x3682d7=Rt('data-id',this['_touchedNodesState']['lastTouchedId'],_0x31fbd1);for(;_0x3682d7;)fs(_0x3682d7),_0x3682d7=_0x3682d7['parentNode'];}return{'parsedContent':_0x31fbd1,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x289b26,_0x12f03e,_0x1a2c43){for(const _0x42bbaa of _0x12f03e){const _0xb510de=this['_getUid'](_0x42bbaa);Ki(_0x42bbaa,'data-id',_0xb510de),this['_touchedNodesState']['newIds']['push'](_0xb510de),this['_touchedNodesState']['lastTouchedId']=_0xb510de;}const _0x4c8d01='afterbegin'===_0x1a2c43||'afterend'===_0x1a2c43?_0x12f03e['reverse']():_0x12f03e;for(const _0x423e63 of _0x4c8d01)Pi(_0x289b26,_0x423e63,_0x1a2c43);}['_replaceNode'](_0x386831,_0x20a8be){if(!_0x386831)return;if(_0x41bc4f=_0x20a8be,Zn(vt(_0x386831))===Zn(vt(_0x41bc4f)))return;var _0x41bc4f;const _0x4ce65c=this['_getUid'](_0x386831);Ki(_0x20a8be,'data-id',_0x4ce65c),this['_touchedNodesState']['modifiedIds']['push'](_0x4ce65c),this['_touchedNodesState']['lastTouchedId']=_0x4ce65c,_0x158c15(_0x386831,_0x20a8be['cloneNode'](!0x0));}['_findReferenceNode'](_0x28e53e,_0x1f451b,_0x1d739f){const _0x66ae6b=this['_findPrevElementWithDataId'](_0x28e53e,!0x1);if(_0x66ae6b){const _0x596e3c=this['_getNodeDataId'](_0x66ae6b),_0x4533c2=Rt('data-id',_0x596e3c,_0x1d739f);if(_0x4533c2)return[_0x4533c2,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x596e3c);}const _0x14c1bc=this['_findNextElementWithDataId'](_0x28e53e,!0x1);if(_0x14c1bc){const _0x54f574=this['_getNodeDataId'](_0x14c1bc),_0x281cb5=Rt('data-id',_0x54f574,_0x1d739f);if(_0x281cb5)return[_0x281cb5,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x54f574);}return _0x1f451b?_0x28e53e['nextSibling']?this['_findFallbackReferenceNode'](_0x28e53e,_0x1d739f):[_0x1d739f['childNodes'][_0x1d739f['childNodes']['length']-0x1],'afterend']:[_0x1d739f['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x1da84b,_0x32f0f7){const _0x55e1fd=[],_0x34889c=this['_findPrevElementWithDataId'](_0x1da84b,!0x0);if(_0x34889c){const _0x3d4fb0=Rt('data-id',this['_getNodeDataId'](_0x34889c),_0x32f0f7);_0x3d4fb0&&_0x55e1fd['push']([_0x3d4fb0,'afterend']);}const _0x5cd9dc=this['_findNextElementWithDataId'](_0x1da84b,!0x0);if(_0x5cd9dc){const _0x5777dc=Rt('data-id',this['_getNodeDataId'](_0x5cd9dc),_0x32f0f7);_0x5777dc&&_0x55e1fd['push']([_0x5777dc,'beforebegin']);}if(_0x55e1fd['length']>0x1)return Zi(_0x55e1fd[0x0][0x0])<=Zi(_0x55e1fd[0x1][0x0])?_0x55e1fd[0x0]:_0x55e1fd[0x1];return 0x1===_0x55e1fd['length']?_0x55e1fd[0x0]:[_0x32f0f7['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0xf26410,_0x41f110){let _0x4ff6e5=_0xf26410['nextSibling'],_0x4b361f=null,_0x48ff16=!0x1;for(;_0x4ff6e5;){if(_0xfc9395(_0x4ff6e5)){if(this['_isDelNode'](_0x4ff6e5)&&(_0x4b361f=_0x4ff6e5),this['_isExistingContentComment'](_0x4ff6e5)&&_0x41f110&&!_0x48ff16){_0x48ff16=!0x0,_0x4ff6e5=_0x4ff6e5['nextSibling'];continue;}break;}const _0x178494=wt(_0x4ff6e5,'data-id');if(_0x178494&&'new-element'!==_0x178494&&this['_existingDataIds']['has'](_0x178494)){_0x4b361f=_0x4ff6e5;break;}_0x4ff6e5=_0x4ff6e5['nextSibling'];}return _0x4b361f;}['_findPrevElementWithDataId'](_0x1e15a2,_0x41913c){let _0x13cbc5=_0x1e15a2['previousSibling'],_0x4ccfdc=null,_0x4c5263=!0x1;for(;_0x13cbc5;){if(_0xfc9395(_0x13cbc5)){if(this['_isDelNode'](_0x13cbc5)&&(_0x4ccfdc=_0x13cbc5),this['_isExistingContentComment'](_0x13cbc5)&&_0x41913c&&!_0x4c5263){_0x4c5263=!0x0,_0x13cbc5=_0x13cbc5['previousSibling'];continue;}break;}const _0x50fd01=wt(_0x13cbc5,'data-id');if(_0x50fd01&&'new-element'!==_0x50fd01&&this['_existingDataIds']['has'](_0x50fd01)){_0x4ccfdc=_0x13cbc5;break;}_0x13cbc5=_0x13cbc5['previousSibling'];}return _0x4ccfdc;}['_markWrappedElements'](_0x49d47a){_0x3cb149(_0x49d47a)&&$e('data-id',null,_0x49d47a)['forEach'](_0x407090=>{this['_isExistingNode'](_0x407090)&&!this['_hasWrappedParent'](_0x407090)&&(Ki(_0x407090,'data-wrapped-id',wt(_0x407090,'data-id')),Ki(_0x407090,'data-id',null));});}['_getNodeDataId'](_0x566abf){if(!_0x566abf)return null;if(_0x3cb149(_0x566abf))return wt(_0x566abf,'data-id');if(_0xfc9395(_0x566abf)){const _0x46f343=vt(_0x566abf)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x46f343&&_0x46f343[0x1])return _0x46f343[0x1];}return null;}['_storeDeletedElementIds'](_0x541037){if(_0xfc9395(_0x541037)){const _0x314798=vt(_0x541037)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x314798&&_0x314798[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x314798[0x1]);}}['_getUid'](_0x5362c2){return this['_isExistingNode'](_0x5362c2)?wt(_0x5362c2,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x4fdc26){(function(_0x1c8712){return _0x5e6545(_0x2a2d6c=>_0xfc9395(_0x2a2d6c),_0x1c8712,!0x0,0x1/0x0);}(_0x4fdc26)['filter'](_0x41e810=>this['_isDelNode'](_0x41e810)||this['_isExistingContentComment'](_0x41e810))['forEach'](_0x7c3476=>{_0x5d80a9(_0x7c3476);}));}['_markLastTagElementUnstable'](_0x45451a){const _0x35c711=_0x45451a['childNodes'],_0x12bed9=_0x35c711[_0x35c711['length']-0x1];_0x12bed9&&_0x3cb149(_0x12bed9)&&Ki(_0x12bed9,'data-unstable','true');}['_markUnstableElements'](_0x423aba,_0x558123){const _0x5d725f=Rt('data-unstable','true',_0x423aba);if(!_0x5d725f)return;const _0x55358b=He(_0x5d725f)['slice'](0x0,-0x1),_0xd5c6df=_0x55358b['length'];let _0x2f4300=_0x5d725f;if(_0xd5c6df>_0x558123){let _0x53d8fa=_0xd5c6df,_0x5d055f=null;for(;_0x53d8fa>_0x558123&&_0x53d8fa>=0x0;)_0x53d8fa--,_0x5d055f=_0x55358b[_0x53d8fa];_0x5d055f&&(_0x2f4300=_0x5d055f,Ki(_0x5d725f,'data-unstable',null),Ki(_0x5d055f,'data-unstable','true'));}else{if(_0xd5c6df<_0x558123){let _0x2f0e3b=_0xd5c6df,_0x2bedfb=_0x5d725f;for(;_0x2f0e3b<_0x558123;){const _0x43224a=_0x2bedfb['childNodes']['filter'](_0x471efd=>_0x3cb149(_0x471efd));if(0x0===_0x43224a['length'])break;_0x2f0e3b++,_0x2bedfb=_0x43224a[_0x43224a['length']-0x1];}_0x2bedfb&&(_0x2f4300=_0x2bedfb,Ki(_0x5d725f,'data-unstable',null),Ki(_0x2bedfb,'data-unstable','true'));}}let _0x3daf32=_0x2f4300;for(;_0x3daf32;){for(;_0x3daf32['nextSibling'];)_0x3daf32=_0x3daf32['nextSibling'],_0x3cb149(_0x3daf32)&&Ki(_0x3daf32,'data-unstable','true');_0x3daf32=_0x3daf32['parentNode'];}}['_isNewNode'](_0x4ef19a){return Boolean('new-element'===wt(_0x4ef19a,'data-id'));}['_isExistingNode'](_0x1a3269){return Boolean((wt(_0x1a3269,'data-id')||'')['length']>0x0&&'new-element'!==wt(_0x1a3269,'data-id'));}['_isDelNode'](_0x5eb034){return!!_0x5eb034&&Boolean(_0xfc9395(_0x5eb034)&&vt(_0x5eb034)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x5d616f){let _0x5c568b=_0x5d616f['parentNode'];for(;_0x5c568b;){if(wt(_0x5c568b,'data-wrapped-id'))return!0x0;_0x5c568b=_0x5c568b['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x16c718){return Boolean(_0xfc9395(_0x16c718)&&vt(_0x16c718)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function et({editor:_0x5c8a75,changeGroups:_0x18458f,documentContextContent:_0x48deef,showDiff:_0x31b530,trimUnchanged:_0x584415=!0x0}){return _0x18458f['map'](_0x4216da=>{const _0xa070a4=new Ot([]),_0x50f9fd=new Ot([]);for(const _0x2921ce of _0x4216da['changes'])if(_0x31b530&&'removed'==_0x2921ce['type']||_0x50f9fd['children']['push'](_0x2921ce['node']['cloneNode'](!0x0)),'new'!=_0x2921ce['type']&&(_0x31b530||'removed'!=_0x2921ce['type'])){const _0x13b88a=St(_0x5b91a3=>wt(_0x5b91a3,'data-id')==_0x2921ce['id'],_0x48deef,!0x0);_0x13b88a&&_0xa070a4['children']['push'](_0x13b88a['cloneNode'](!0x0));}const {content:_0x56e1de,hasChanges:_0x3acc68}=function(_0x38ab46,_0x25f652,_0x6b9cc6,_0x1a0517,_0x5e3530=!0x0){const _0x5a6fd7=_0x38ab46['plugins']['get']('DocumentCompare'),_0x2c0677=vt(_0x25f652),_0x3f1bec=vt(_0x6b9cc6),_0x471596=_0x38ab46['data']['parse'](_0x2c0677,'$root'),_0x46b13e=_0x38ab46['model']['createPositionAt'](_0x471596,0x0),_0xf327f2=_0x5a6fd7['getDiff'](_0x2c0677,_0x3f1bec,{'anchor':_0x46b13e,'markDeletions':_0x1a0517}),_0x1136f0=_0xf327f2['getOperations']();if(0x0==_0x1136f0['length'])return{'content':_0x25f652['cloneNode'](!0x0),'hasChanges':!0x1};_0x1a0517?function(_0x49215d,_0x5ed979,_0x12bc7d){if(0x0==_0x49215d['length'])return;const _0x34ebe1=_0x12bc7d['plugins']['get']('DocumentCompare'),_0x51f5ed=_0x12bc7d['plugins']['get']('SuggestionsConversion');_0x12bc7d['model']['change'](_0x216a26=>{const _0x291571=new Set();for(let _0x56a37c=0x0;_0x56a37c<_0x49215d['length'];_0x56a37c++){const _0x50f7c0=_0x49215d[_0x56a37c];if(_0x50f7c0['baseVersion']=null,_0x50f7c0['isDocumentOperation']=!0x1,_0x34ebe1['isMarkedRemoveOperation'](_0x50f7c0)){const _0x3ab65f=_0x988dda(_0x50f7c0['newRange'],_0x12bc7d['model']),_0x2e82f7='suggestion:deletion:'+_0x1cb0e0()+':$aiSuggestion';_0x5ed979['markers']['set'](_0x2e82f7,_0x3ab65f);}else switch(_0x50f7c0['type']){case'rename':{if(_0x50f7c0['oldName']==_0x50f7c0['newName'])break;_0x216a26['batch']['addOperation'](_0x50f7c0),_0x12bc7d['model']['applyOperation'](_0x50f7c0);const _0x70b551='$elementName',_0x466b24=_0x50f7c0['position'],_0x2f3a2e=_0x12bc7d['model']['createRange'](_0x466b24,_0x12bc7d['model']['createPositionAt'](_0x466b24['nodeAfter'],'end')),_0x2807cb='suggestion:attribute:'+_0x70b551+':'+_0x1cb0e0()+':$aiSuggestion';_0x5ed979['markers']['set'](_0x2807cb,_0x2f3a2e);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x50f7c0['oldValue']==_0x50f7c0['newValue'])break;_0x216a26['batch']['addOperation'](_0x50f7c0),_0x12bc7d['model']['applyOperation'](_0x50f7c0);const _0x4ca093=_0x50f7c0['key'];if(!_0x51f5ed['isRegisteredAttribute'](_0x4ca093))break;const _0x290d5e=_0x988dda(_0x50f7c0['range'],_0x12bc7d['model']),_0x3b5780='suggestion:attribute:'+_0x4ca093+':'+_0x1cb0e0()+':$aiSuggestion';_0x5ed979['markers']['set'](_0x3b5780,_0x290d5e);break;}case'insert':{_0x216a26['batch']['addOperation'](_0x50f7c0),_0x12bc7d['model']['applyOperation'](_0x50f7c0);if(_0x49215d[_0x56a37c+0x1]&&'move'==_0x49215d[_0x56a37c+0x1]['type']){ro(_0x5ed979,_0x50f7c0);break;}const _0xf50a4b=_0x50f7c0['position'],_0x4d666c=_0x50f7c0['howMany'],_0x1dd1e7=_0x988dda(_0x12bc7d['model']['createRange'](_0xf50a4b,_0xf50a4b['getShiftedBy'](_0x4d666c)),_0x12bc7d['model']),_0x25fb09='suggestion:insertion:'+_0x1cb0e0()+':$aiSuggestion';_0x5ed979['markers']['set'](_0x25fb09,_0x1dd1e7);break;}case'split':{_0x216a26['batch']['addOperation'](_0x50f7c0),_0x12bc7d['model']['applyOperation'](_0x50f7c0);const _0x21ff8a=_0x50f7c0['splitPosition'],_0x24cf77=_0x50f7c0['moveTargetPosition'],_0x2e83a4=_0x12bc7d['model']['createRange'](_0x21ff8a,_0x24cf77),_0x3e8caa='suggestion:insertion:'+_0x1cb0e0()+':$aiSuggestion';_0x5ed979['markers']['set'](_0x3e8caa,_0x2e83a4);break;}case'move':{_0x216a26['batch']['addOperation'](_0x50f7c0),_0x12bc7d['model']['applyOperation'](_0x50f7c0),_0x49215d[_0x56a37c-0x1]&&'insert'==_0x49215d[_0x56a37c-0x1]['type']&&ro(_0x5ed979,_0x50f7c0);const _0x35da67=_0x50f7c0['getMovedRangeStart'](),_0x4d3029=_0x50f7c0['howMany'];for(let _0x250922=0x0;_0x250922<_0x4d3029;_0x250922++){const _0x254e32=_0x35da67['getShiftedBy'](_0x250922)['nodeAfter'];_0x291571['add'](_0x254e32);}break;}case'remove':{const _0x39c51a=_0x50f7c0['sourcePosition'],_0x3f70a5=_0x50f7c0['howMany'],_0x3ce816=new lt(_0x39c51a,_0x3f70a5);_0x216a26['batch']['addOperation'](_0x3ce816),_0x12bc7d['model']['applyOperation'](_0x3ce816);break;}}}for(const _0x2ae918 of _0x291571){const _0x3c62e9=_0x12bc7d['model']['createRangeOn'](_0x2ae918),_0x226044='suggestion:formatBlock:$fakeWrap:'+_0x1cb0e0()+':$aiSuggestion';_0x5ed979['markers']['set'](_0x226044,_0x988dda(_0x3c62e9,_0x12bc7d['model']));}});}(_0x1136f0,_0x471596,_0x38ab46):_0x38ab46['model']['change'](_0x5cdd7a=>{for(const _0xf838ab of _0x1136f0)if('remove'==_0xf838ab['type']){const _0x387cda=_0xf838ab['sourcePosition'],_0x37089e=_0xf838ab['howMany'],_0x3ee0f3=new lt(_0x387cda,_0x37089e);_0x5cdd7a['batch']['addOperation'](_0x3ee0f3),_0x38ab46['model']['applyOperation'](_0x3ee0f3);}else{if('marker'==_0xf838ab['type']){const _0x3a3088=_0xf838ab['name'],_0x530af3=_0xf838ab['newRange'];_0x471596['markers']['set'](_0x3a3088,_0x530af3);}else _0xf838ab['baseVersion']=null,_0xf838ab['isDocumentOperation']=!0x1,_0x5cdd7a['batch']['addOperation'](_0xf838ab),_0x38ab46['model']['applyOperation'](_0xf838ab);}});if(_0x5e3530){const _0x3a0bbd=Et(_0x38ab46,_0x1136f0,_0x471596);yt(_0x38ab46['model'],_0x3a0bbd),function(_0x307b51,_0x2fa8e2){const _0x1f89ee=_0x2fa8e2['getFirstRange']()['start'];let _0x158c24=_0x2fa8e2['getFirstRange']()['end'];const _0x5cc22b=_0x1f89ee['root'];(_0x158c24['textNode']||_0x158c24['nodeAfter']&&_0x158c24['nodeAfter']['is']('$text'))&&(_0x1b31f9(_0x158c24,'...'),_0x158c24=_0x158c24['getShiftedBy'](0x3)),(_0x1f89ee['textNode']||_0x1f89ee['nodeBefore']&&_0x1f89ee['nodeBefore']['is']('$text'))&&(_0x1b31f9(_0x1f89ee,'...'),function(_0x2877b,_0x2f0509,_0x15c153){for(let [_0x4393ba,_0x52e477]of _0x2877b['markers']){const _0x3e5e17=_0x52e477['_getTransformedByInsertion'](_0x2f0509,_0x15c153,!0x1);_0x52e477=_0x3e5e17[0x0],_0x2877b['markers']['set'](_0x4393ba,_0x52e477);}}(_0x5cc22b,_0x1f89ee,0x3),_0x1f89ee['parent']==_0x158c24['parent']&&(_0x158c24=_0x158c24['getShiftedBy'](0x3)));const _0x3b8b1e=_0x307b51['createRange'](_0x307b51['createPositionAt'](_0x5cc22b,0x0),_0x1f89ee),_0x3ef745=_0x307b51['createRange'](_0x158c24,_0x307b51['createPositionAt'](_0x5cc22b,'end')),_0x4fbc4d=[..._0x3b8b1e['getMinimalFlatRanges'](),..._0x3ef745['getMinimalFlatRanges']()];_0x4fbc4d['reverse']();for(const _0x47d772 of _0x4fbc4d)_0x4c0e49(_0x47d772),Wr(_0x5cc22b,_0x47d772);}(_0x38ab46['model'],_0x3a0bbd);}const _0x55de05=_0x38ab46['data']['stringify'](_0x471596,{'showSuggestionHighlights':!0x0});return{'content':Je(_0x55de05),'hasChanges':!0x0};}(_0x5c8a75,_0xa070a4,_0x50f9fd,_0x31b530,_0x584415);return{'type':_0x4216da['changes'][0x0]['type'],'index':_0x4216da['index'],'content':_0x56e1de,'hasChanges':_0x3acc68};});}function ro(_0x339c4b,_0x3e3958){for(const [_0x1e6bb4,_0xde8896]of _0x339c4b['markers']){const _0x47d50e=ht['_createFromRanges'](_0xde8896['getTransformedByOperation'](_0x3e3958));_0x339c4b['markers']['set'](_0x1e6bb4,_0x47d50e);}}function Et(_0x4f3737,_0x23a8ab,_0x40b4b1){const _0x5a897a=_0x4f3737['plugins']['get']('DocumentCompare');let _0x197b3d=_0x4f3737['model']['createPositionAt'](_0x40b4b1,Number['POSITIVE_INFINITY']),_0x126bad=_0x4f3737['model']['createPositionAt'](_0x40b4b1,0x0);for(const _0x4f7f6a of _0x23a8ab){let _0xdca2a3,_0x18f76e;if(_0x5a897a['isMarkedRemoveOperation'](_0x4f7f6a))_0xdca2a3=_0x4f7f6a['newRange']['start'],_0x18f76e=_0x4f7f6a['newRange']['end'];else switch(_0x197b3d=_0x197b3d['getTransformedByOperation'](_0x4f7f6a),_0x126bad=_0x126bad['getTransformedByOperation'](_0x4f7f6a),_0x4f7f6a['type']){case'rename':_0xdca2a3=_0x4f7f6a['position'],_0x18f76e=_0xdca2a3['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0xdca2a3=_0x4f7f6a['range']['start'],_0x18f76e=_0x4f7f6a['range']['end'];break;case'insert':_0xdca2a3=_0x4f7f6a['position'],_0x18f76e=_0xdca2a3['getShiftedBy'](_0x4f7f6a['howMany']);break;case'split':_0xdca2a3=_0x4f7f6a['splitPosition'],_0x18f76e=_0x4f7f6a['moveTargetPosition'];break;case'merge':{const _0x479d11=_0x4f7f6a['targetPosition']['path']['slice'](0x0,-0x1);_0xdca2a3=_0x4f3737['model']['createPositionFromPath'](_0x40b4b1,_0x479d11),_0x18f76e=_0xdca2a3['getShiftedBy'](0x1);break;}case'remove':{const _0x57a7bd=_0x4f7f6a['howMany'],_0x19d8ed=_0x4f7f6a['sourcePosition']['_getTransformedByInsertion'](_0x4f7f6a['targetPosition'],_0x57a7bd),_0xa49485=_0x4f7f6a['getMovedRangeStart']();'remove'==_0x4f7f6a['type']?(_0xdca2a3=_0x19d8ed,_0x18f76e=_0x19d8ed):(_0xdca2a3=_0xa49485,_0x18f76e=_0xa49485['getShiftedBy'](_0x57a7bd));break;}}_0xdca2a3&&_0xdca2a3['isBefore'](_0x197b3d)&&(_0x197b3d=_0xdca2a3['clone'](),_0x197b3d['stickiness']='toNone'),_0x18f76e&&_0x18f76e['isAfter'](_0x126bad)&&(_0x126bad=_0x18f76e['clone'](),_0x126bad['stickiness']='toNone');}return _0x4f3737['model']['createSelection'](_0x4f3737['model']['createRange'](_0x197b3d,_0x126bad));}function yt(_0x2408af,_0x413477){so(_0x2408af,_0x413477,'forward');const _0x110289=_0x413477['getFirstRange']();_0x413477['setTo']([]),_0x413477['setTo'](_0x110289,{'backward':!0x0}),so(_0x2408af,_0x413477,'backward');}function so(_0xbdf170,_0x358227,_0x428999){let _0xf9ef9a=0x14;for(;_0xf9ef9a;){_0xbdf170['modifySelection'](_0x358227,{'unit':'word','direction':_0x428999}),_0xf9ef9a--;const _0x46b1e7=_0x358227['focus']['forward'==_0x428999?'nodeBefore':'nodeAfter'];if(_0x46b1e7&&_0x46b1e7['is']('element')&&_0xbdf170['schema']['isBlock'](_0x46b1e7)&&_0xbdf170['schema']['isObject'](_0x46b1e7))break;}}function Wr(_0x51c6bc,_0x4b5364){for(const [_0x3c3ede,_0x18404e]of _0x51c6bc['markers']){const _0x44df0a=_0x18404e['_getTransformedByDeletion'](_0x4b5364['start'],_0x4b5364['end']['offset']-_0x4b5364['start']['offset']);null!=_0x44df0a?_0x51c6bc['markers']['set'](_0x3c3ede,_0x44df0a):_0x51c6bc['markers']['delete'](_0x3c3ede);}}const Yr=['modification-delta','text-delta','web-search','reasoning'],$r=['conversation-title'];class Ge extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new Ot([]);['parsedMergedContent']=new Ot([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x49f5f0,content:_0x522b66='',isDone:_0x37c0f3=!0x1,interactionId:_0x19e663,areActionsDisabled:_0x41550f,documentContextContent:_0x4b9717,editor:_0x532900,id:_0x583f07}){super(),this['id']=_0x583f07||_0x1cb0e0(),this['interactionId']=_0x19e663,this['type']=_0x49f5f0,this['areActionsDisabled']=!!_0x41550f,this['editor']=_0x532900,this['aiResponseParser']=new Qe(),this['aiResponseApplier']=new Xe(),this['documentContextContent']=Je(_0x4b9717||''),this['set']('isDone',_0x37c0f3),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x522b66);}['appendContent'](_0x47ca41){this['set']('content',this['content']+_0x47ca41);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x20ca35,_0xc786b){this['changeGroups'][_0x20ca35]['state']=_0xc786b,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x20ca35,'state':_0xc786b});}['getContentParts']({showDiff:_0x385c38,groupIndex:_0x3b5e78}){if(!this['editor'])throw new _0x5cac2e('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x1bf146=this['_getCachedContentParts'](_0x385c38,_0x3b5e78);if(_0x1bf146)return _0x1bf146;let _0x5a297b=[];if(void 0x0===_0x3b5e78)_0x5a297b=this['changeGroups'];else{const _0x2d4420=this['changeGroups']['find'](({index:_0x1e1001})=>_0x1e1001===_0x3b5e78);if(!_0x2d4420)throw new _0x5cac2e('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x3b5e78});_0x5a297b=[_0x2d4420];}const _0x3888fe=et({'editor':this['editor'],'showDiff':_0x385c38,'changeGroups':_0x5a297b,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x385c38,_0x3888fe),_0x3888fe;}['_getCachedContentParts'](_0x42e1b7,_0x59b74f){const _0x46bb98=_0x42e1b7?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x46bb98]['length'])return null;const _0x571319=this['cachedSuggestionContentParts'][_0x46bb98];if(void 0x0===_0x59b74f)return _0x3caf73(_0x571319);{const _0x23f99d=_0x571319['find'](({index:_0x157bf7})=>_0x157bf7===_0x59b74f);if(_0x23f99d)return[_0x3caf73(_0x23f99d)];}return null;}['_setCachedContentParts'](_0x3a6408,_0x3e99db){const _0x234f55=_0x3a6408?'withDiff':'withoutDiff';_0x3e99db['forEach'](_0x18aad5=>{const _0x1e430a=this['cachedSuggestionContentParts'][_0x234f55],_0x1286ec=_0x1e430a['find'](({index:_0x3d6b87})=>_0x3d6b87===_0x18aad5['index']);if(_0x1286ec){const _0x162b56=_0x1e430a['indexOf'](_0x1286ec);_0x1e430a['splice'](_0x162b56,0x1,_0x18aad5);}else _0x1e430a['push'](_0x18aad5);});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x81e4db=this['changeGroups'];this['updateChangeGroups']();const _0x527934=this['_getDifferentChangeGroups'](_0x81e4db,this['changeGroups']);(_0x527934['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x527934),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x49bc95,_0x23d5ab){const _0x406e4c=[];for(const _0x762f8d of _0x23d5ab){const _0x1900ba=_0x49bc95[_0x762f8d['index']];_0x1900ba?_0x1900ba['changes']['length']!==_0x762f8d['changes']['length']?_0x406e4c['push'](_0x762f8d):_0x1900ba['changes']['forEach']((_0x1a2665,_0x4a19dc)=>{const _0x4aa3bc=_0x762f8d['changes'][_0x4a19dc];_0x1a2665['id']!==_0x4aa3bc['id']&&_0x406e4c['push'](_0x762f8d);}):_0x406e4c['push'](_0x762f8d);}return _0x406e4c;}['updateChangeGroups'](){const _0x5a6edc=new _0x5847fe('p',{},[new _0x5847fe('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x38f6b5(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x24171c=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x5a6edc,'cutAfterLastChange':!this['isDone']});if(!_0x24171c['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x24171c['parsedContent'];let _0x4f84da=[];if(_0x41c79e(_0x5e2865=>{const _0x4787db=wt(_0x5e2865,'data-id');if(!_0x4787db||!_0xfeae52(_0x4787db))return!0x1;const _0x176152=[_0x5e2865,...He(_0x5e2865)]['at'](-0x2);if(_0x5e2865!=_0x176152){const _0x674648=wt(_0x176152,'data-id');_0xfeae52(_0x674648)||(_0x4f84da['push']({'node':_0x176152,'id':_0x674648,'type':'modified'}),_0x24171c['modifiedNodeIds']['push'](_0x674648));}else _0x24171c['modifiedNodeIds']['includes'](_0x4787db)?_0x4f84da['push']({'node':_0x5e2865,'type':'modified','id':_0x4787db}):_0x24171c['newNodeIds']['includes'](_0x4787db)?_0x4f84da['push']({'node':_0x5e2865,'type':'new','id':_0x4787db,'anchorId':wt(_0x5e2865['previousSibling'],'data-id')}):_0x4f84da['push']({'node':_0x5e2865,'type':'removed','id':_0x4787db});return!0x0;},this['parsedMergedContent']),_0x4f84da=_0x4f84da['filter'](({node:_0x2e2c31})=>[...He(_0x2e2c31),_0x2e2c31]['every'](_0x24b525=>!wt(_0x24b525,'data-unstable'))),0x0==_0x4f84da['length'])return;const _0x349ad0=[[_0x4f84da[0x0]]];for(let _0x1e2c70=0x1;_0x1e2c70<_0x4f84da['length'];_0x1e2c70++){const _0x4d75f0=_0x349ad0[_0x349ad0['length']-0x1],_0xf436d0=_0x4d75f0[_0x4d75f0['length']-0x1];_0x4f84da[_0x1e2c70]['node']['previousSibling']==_0xf436d0['node']&&'modified'!=_0x4f84da[_0x1e2c70]['type']&&'modified'!=_0xf436d0['type']?_0x4d75f0['push'](_0x4f84da[_0x1e2c70]):_0x349ad0['push']([_0x4f84da[_0x1e2c70]]);}for(const _0x4f4b0f of _0x349ad0){const _0x2a1879=_0x4f4b0f[0x0],_0x3a843d=_0x4f4b0f[_0x4f4b0f['length']-0x1],_0x134957=_0x516307(_0x2a1879['node']['previousSibling']);_0x134957&&_0x4f4b0f['unshift'](_0x134957);const _0x151b76=_0x516307(_0x3a843d['node']['nextSibling']);_0x151b76&&_0x4f4b0f['push'](_0x151b76);}function _0xfeae52(_0x101bd1){return _0x24171c['modifiedNodeIds']['includes'](_0x101bd1)||_0x24171c['newNodeIds']['includes'](_0x101bd1)||_0x24171c['removedNodeIds']['includes'](_0x101bd1);}function _0x516307(_0x861404){if(_0x861404&&wt(_0x861404,'data-id')&&!wt(_0x861404,'data-unstable')){const _0x1ff737=wt(_0x861404,'data-id');if(!_0xfeae52(_0x1ff737))return{'node':_0x861404,'type':'context','id':_0x1ff737};}return null;}this['changeGroups']=_0x349ad0['map']((_0x567cfb,_0x227357)=>({'changes':_0x567cfb,'state':'pending','index':_0x227357}));}}function Di(_0x4e4f83){return Object['values'](Yr)['includes'](_0x4e4f83);}function Fi(_0x566dbe){return $r['includes'](_0x566dbe);}function Ui(_0x3f22c1){return'conversation-title'===_0x3f22c1;}function qi(_0x55e39a){return'source'===_0x55e39a;}const Ce=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','error'];class xe extends _0x5194ed(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x40d9eb,editor:_0x150afe}){super(),this['id']=_0x1cb0e0(),this['connector']=_0x40d9eb,this['isStopped']=!0x0,this['editor']=_0x150afe;}async['start'](){let _0xb7d193;const _0x19fe0e=[];this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x214cb7=await this['currentRequest']['getStream']();for await(const _0x82e60a of _0x214cb7){if(this['isStopped'])return;if('error'===_0x82e60a['event'])return void this['fire']('error',{'error':new _0x5cac2e('ai-chat-interaction-error',this)});if('message-metadata'!==_0x82e60a['event']){if('action-metadata'!==_0x82e60a['event']){if(Ui(_0x82e60a['event'])&&this['setConversationTitle'](_0x82e60a['data']['conversationTitle'],!0x0),qi(_0x82e60a['event']))_0x19fe0e['push'](_0x82e60a['data']['source']);else{if(Di(_0x82e60a['event'])){if(_0x82e60a['event']!==_0xb7d193){if(_0xb7d193=_0x82e60a['event'],'web-search'===_0x82e60a['event']){this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));continue;}if('reasoning'===_0x82e60a['event']){this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));continue;}this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this)),this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this)),this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x82e60a['event'],'interactionId':this['id'],'id':_0x82e60a['data']?.['id']}),_0x19fe0e['length']>0x0&&'modification-delta'===_0x82e60a['event']&&(this['currentReply']['sources']=_0x19fe0e['splice'](0x0));}_0x82e60a['data']['textDelta']&&this['currentReply']['appendContent'](_0x82e60a['data']['textDelta']);}else Fi(_0x82e60a['event']);}}else this['actionCallId']=_0x82e60a['data']['callId'];}else this['messageId']=_0x82e60a['data']['messageId'];}}finally{this['isStopped']||(_0x19fe0e['length']>0x0&&(this['currentReply']['sources']=_0x19fe0e['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0xc59ce3){return this['replies']['find'](_0x472364=>_0x472364['id']===_0xc59ce3);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x56091f=>_0x56091f['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x13992e){const _0x173b9a=new Ge({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x13992e});return this['replies']['push'](_0x173b9a),_0x173b9a['delegate'](...Ce)['to'](this),this['fire']('replyCreated',_0x173b9a),_0x173b9a;}['setConversationTitle'](_0x16e93d,_0x5ea13d=!0x1){this['fire']('setConversationTitle',_0x16e93d,_0x5ea13d);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var je=function(_0x22c67e){return _0x22c67e['FILE']='file',_0x22c67e['DOCUMENT']='document',_0x22c67e['URL']='web-resource',_0x22c67e['TEXT']='text',_0x22c67e['SELECTION']='selection',_0x22c67e;}({}),be=function(_0x1470a9){return _0x1470a9['TEXT']='text',_0x1470a9['MARKDOWN']='markdown',_0x1470a9['HTML']='html',_0x1470a9;}({});const Oe=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),vi=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class wi extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x57a2a0,config:_0x42c605,ownerId:_0x3cc923}){super(),this['_connector']=_0x57a2a0,this['_config']=_0x42c605,this['_ownerId']=_0x3cc923;}['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'](_0x1bdcf5){const _0x2ff2a4=await this['_createContextItemFromContent'](_0x1bdcf5);return this['_addToConversationContextItem'](_0x2ff2a4),'current-document'===_0x2ff2a4['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x2ff2a4;}async['_createContextItemFromContent'](_0x47da72){if(_0x47da72['type']===je['DOCUMENT']){const _0x18fe43=await this['_connector']['fetchDocument'](this['_ownerId'],_0x47da72['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x47da72['type'],'content':_0x18fe43['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x18fe43['attributes']?.['version'],'sessionId':_0x18fe43['attributes']?.['sessionId']};}return{'id':_0x47da72['id'],'uiId':_0x47da72['id'],'label':_0x47da72['attributes']?.['label']||_0x47da72['name']||_0x47da72['url']||_0x47da72['id'],'type':_0x47da72['type'],..._0x47da72?.['attributes']?.['resourceId']?{'resourceId':_0x47da72['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x457526){const _0x3aac40=this['_pendingContextItems']['get'](_0x457526);_0x3aac40?.['isReadOnly']||this['_removeContextItem'](_0x457526);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x37e931 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x37e931['uiId']);const _0xacc6c5=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0xacc6c5&&this['_addContextItem']({..._0xacc6c5,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x441cca){for(const _0x44f31a of _0x441cca['values']())this['_addToConversationContextItem'](_0x44f31a);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'](_0xc752a6){return Array['from'](_0xc752a6['values']())['map'](_0x1909ac=>this['_mapContextItemToRequestData'](_0x1909ac))['filter'](_0x50e476=>null!==_0x50e476);}async['addFilesToContext'](_0x2a9c5b,_0x371034,_0x105c5d=je['FILE']){const _0x58a90b='files-'+_0x1cb0e0();this['_startUploadOperation'](_0x58a90b);try{await Promise['all'](_0x2a9c5b['map'](async _0x26d632=>{const _0x42540f='file-'+_0x1cb0e0(),_0x11e392=_0x257ef5(_0x26d632['name']);try{this['_addContextItem']({'type':_0x105c5d,'label':_0x371034?.['label']||_0x11e392,'uiId':_0x42540f,'resourceId':_0x371034?.['resourceId']},!0x0);const _0x4a5739=this['_connector']['uploadFile'](this['_ownerId'],_0x26d632,_0x371034);this['_ongoingUploads']['set'](_0x42540f,_0x4a5739['abortController']);const {id:_0x56bda4}=await _0x4a5739['getId']();this['_ongoingUploads']['delete'](_0x42540f),this['_finishContextItemLoading']({'type':_0x105c5d,'id':_0x56bda4,'label':_0x371034?.['label']||_0x11e392,'uiId':_0x42540f,'resourceId':_0x371034?.['resourceId']},!0x1);}catch(_0x318235){this['_ongoingUploads']['delete'](_0x42540f);if(!(_0x318235 instanceof _0x5cac2e&&_0x318235['message']['startsWith']('ai-request-aborted'))){const _0x2eef68=Oe['get'](_0x318235['code'])||'ai-chat-file-upload-failed',_0x371339=new _0x5cac2e(_0x2eef68,null,{'fileName':_0x11e392,..._0x318235});_0x371339['stack']=_0x318235['stack'],this['fire']('error',{'error':_0x371339});}this['_removeContextItem'](_0x42540f);}}));}finally{this['_finishUploadOperation'](_0x58a90b);}}['addCurrentDocumentToContext'](_0x57b564){if(this['isCurrentDocumentInContext']())return;const _0x4d8abb={'type':je['DOCUMENT'],'uiId':'current-document','label':_0x57b564,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x4d8abb);}async['updateCurrentDocument'](_0x1b23a7,_0x4452b9,_0x2fefae,_0x51487a){const _0x153bfe=this['_pendingContextItems']['get']('current-document');if(_0x153bfe&&_0x1b23a7){_0x153bfe['selection']=_0x51487a?_0x51487a['map'](_0x36866d=>({'start':_0x36866d['start'],'end':_0x36866d['end']})):[];try{if(_0x153bfe['version']===_0x4452b9)return;const {id:_0x52498d}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x1b23a7,{'version':_0x4452b9,'sessionId':_0x2fefae})['getId']();_0x153bfe['id']=_0x52498d,_0x153bfe['content']=_0x1b23a7,_0x153bfe['version']=_0x4452b9,_0x153bfe['sessionId']=_0x2fefae;}catch(_0x43eac7){const _0x24c8d6=new _0x5cac2e('ai-chat-document-upload-failed',null);_0x24c8d6['stack']=_0x43eac7['stack'],this['fire']('error',{'error':_0x24c8d6});}}}['addSelectionToContext'](_0x531d59){this['_addContextItem']({'type':je['SELECTION'],'label':_0x531d59,'uiId':'selection','content':_0x531d59});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x3db0cb,_0x2394ad){const _0x4fb06b='url-'+_0x1cb0e0();this['_startUploadOperation'](_0x4fb06b);const _0x58b2ac='url-'+_0x1cb0e0();try{this['_addContextItem']({'type':je['URL'],'label':_0x2394ad?.['label']||_0x3db0cb,'uiId':_0x58b2ac,'resourceId':_0x2394ad?.['resourceId']},!0x0);const _0x58579b=this['_connector']['uploadUrl'](this['_ownerId'],_0x3db0cb,_0x2394ad);this['_ongoingUploads']['set'](_0x58b2ac,_0x58579b['abortController']);const {id:_0x344bf8}=await _0x58579b['getId']();this['_ongoingUploads']['delete'](_0x58b2ac),this['_finishContextItemLoading']({'type':je['URL'],'id':_0x344bf8,'label':_0x2394ad?.['label']||_0x3db0cb,'uiId':_0x58b2ac,'resourceId':_0x2394ad?.['resourceId']},!0x1);}catch(_0x27ab85){this['_ongoingUploads']['delete'](_0x58b2ac),(_0x27ab85['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x5cac2e('ai-chat-url-upload-failed',this,{'url':_0x3db0cb,'originalError':_0x27ab85}),'url':_0x3db0cb}),this['_removeContextItem'](_0x58b2ac));}finally{this['_finishUploadOperation'](_0x4fb06b);}}async['loadSourceResources'](_0x363e31,_0x5b9a3f,_0x55df4b){const _0x22ad81=this['_addContextOptionsState']['sources']['find'](_0x3b016d=>_0x3b016d['id']===_0x363e31);if(!_0x22ad81)return this['fire']('error',{'error':new _0x5cac2e('ai-chat-source-not-found',this,{'sourceId':_0x363e31}),'sourceId':_0x363e31}),[];try{const _0x349ab5=(await _0x22ad81['getResources'](_0x5b9a3f))['map'](_0xd1042=>{const _0x3c5db0=this['_isResourceInContext'](_0xd1042['id']);return{..._0xd1042,'isInContext':_0x3c5db0};});return _0x22ad81['resources']=_0x349ab5,this['fire']('sourceResourcesLoaded',{'sourceId':_0x363e31,'source':_0x22ad81,'resources':_0x349ab5,'uid':_0x55df4b}),_0x349ab5;}catch(_0x58534f){return this['fire']('error',{'error':new _0x5cac2e('ai-chat-source-resources-load-failed',this,{'sourceId':_0x363e31,'originalError':_0x58534f}),'sourceId':_0x363e31,'sourceLabel':_0x22ad81['label']}),[];}}async['addResourceToContext'](_0x14ee10,_0x53e172){if(this['_isResourceInContext'](_0x53e172['id']))return;let _0xf862d3=_0x53e172['data'];if(!_0xf862d3&&_0x14ee10['getData'])try{_0xf862d3=await _0x14ee10['getData'](_0x53e172['id']);}catch(_0x40fc9f){return void this['fire']('error',{'error':new _0x5cac2e('ai-chat-resource-load-failed',this,{'resourceId':_0x53e172['id'],'sourceId':_0x14ee10['id'],'originalError':_0x40fc9f}),'resourceId':_0x53e172['id'],'sourceId':_0x14ee10['id']});}if(_0xf862d3)switch(_0x53e172['type']){case je['URL']:if('string'!=typeof _0xf862d3)return void this['fire']('error',{'error':new _0x5cac2e('ai-chat-context-invalid-data',this,{'resourceId':_0x53e172['id'],'sourceId':_0x14ee10['id'],'expectedType':'string','actualType':typeof _0xf862d3}),'resourceId':_0x53e172['id'],'sourceId':_0x14ee10['id']});await this['addUrlToContext'](_0xf862d3,{'label':_0x53e172['label'],'resourceId':_0x53e172['id']});break;case je['FILE']:if(!(_0xf862d3 instanceof File))return void this['fire']('error',{'error':new _0x5cac2e('ai-chat-context-invalid-data',this,{'resourceId':_0x53e172['id'],'sourceId':_0x14ee10['id'],'expectedType':'File','actualType':typeof _0xf862d3}),'resourceId':_0x53e172['id'],'sourceId':_0x14ee10['id']});await this['addFilesToContext']([_0xf862d3],{'label':_0x53e172['label'],'resourceId':_0x53e172['id']});break;case je['TEXT']:if('object'!=typeof _0xf862d3||!('content'in _0xf862d3)||!('type'in _0xf862d3))return void this['fire']('error',{'error':new _0x5cac2e('ai-chat-context-invalid-data',this,{'resourceId':_0x53e172['id'],'sourceId':_0x14ee10['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0xf862d3}),'resourceId':_0x53e172['id'],'sourceId':_0x14ee10['id']});_0xf862d3=wi['_convertTextResourceToFile'](_0xf862d3,_0x53e172['label']),await this['addFilesToContext']([_0xf862d3],{'label':_0x53e172['label'],'resourceId':_0x53e172['id']},je['TEXT']);break;default:this['fire']('error',{'error':new _0x5cac2e('ai-chat-context-unsupported-type',this,{'resourceId':_0x53e172['id'],'sourceId':_0x14ee10['id'],'resourceType':_0x53e172['type']}),'resourceId':_0x53e172['id'],'sourceId':_0x14ee10['id']});}else this['fire']('error',{'error':new _0x5cac2e('ai-chat-resource-no-data',this,{'resourceId':_0x53e172['id'],'sourceId':_0x14ee10['id']}),'resourceId':_0x53e172['id'],'sourceId':_0x14ee10['id']});}static['_convertTextResourceToFile'](_0x570f82,_0xc4b8ed){switch(_0x570f82['type']){case be['MARKDOWN']:return new File([_0x570f82['content']],_0xc4b8ed,{'type':'text/markdown'});case be['HTML']:return new File([_0x570f82['content']],_0xc4b8ed,{'type':'text/html'});default:return new File([_0x570f82['content']],_0xc4b8ed,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x45ad2d){switch(_0x45ad2d['type']){case je['FILE']:return{'type':je['FILE'],'id':_0x45ad2d['id']};case je['URL']:return{'type':je['URL'],'id':_0x45ad2d['id']};case je['DOCUMENT']:return{'type':je['DOCUMENT'],'id':_0x45ad2d['id'],..._0x45ad2d['selection']?.['length']&&{'selection':_0x45ad2d['selection']}};case je['TEXT']:return{'type':je['FILE'],'id':_0x45ad2d['id']};default:return null;}}['_addContextItem'](_0x4449ba,_0x143944=!0x1){if(this['_pendingContextItems']['set'](_0x4449ba['uiId'],_0x4449ba),_0x4449ba['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x4449ba,'isLoading':_0x143944}),'current-document'===_0x4449ba['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x4449ba['resourceId']){const _0x232220=this['_findSourceIdsByResourceId'](_0x4449ba['resourceId']);_0x232220&&_0x232220['forEach'](_0x5806b1=>{this['_updateResourceInContextState'](_0x5806b1,_0x4449ba['resourceId'],!0x0);});}}['_removeContextItem'](_0x162b2e){const _0x14adee=this['_pendingContextItems']['get'](_0x162b2e),_0x3f7e6c=this['_ongoingUploads']['get'](_0x162b2e);if(_0x3f7e6c&&(_0x3f7e6c['abort'](),this['_ongoingUploads']['delete'](_0x162b2e)),_0x14adee?.['resourceId']){const _0x4d479c=this['_findSourceIdsByResourceId'](_0x14adee['resourceId']);_0x4d479c&&_0x4d479c['forEach'](_0x3f0984=>{this['_updateResourceInContextState'](_0x3f0984,_0x14adee['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x162b2e),this['fire']('contextItemRemoved',{'uiId':_0x162b2e,'type':_0x14adee?.['type']}),'current-document'===_0x162b2e&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x304b47,_0x67255b){if(this['_pendingContextItems']['has'](_0x304b47['uiId'])&&(this['_pendingContextItems']['set'](_0x304b47['uiId'],_0x304b47),this['fire']('contextItemLoadingEnded',{'contextItem':_0x304b47,'isLoading':_0x67255b}),_0x304b47['resourceId'])){const _0x42afa9=this['_findSourceIdsByResourceId'](_0x304b47['resourceId']);_0x42afa9&&_0x42afa9['forEach'](_0x55aacb=>{this['_updateResourceInContextState'](_0x55aacb,_0x304b47['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x68f32c){this['_conversationContextItems']['set'](_0x68f32c['uiId'],_0x68f32c);}['_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']()},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x247142=>({..._0x247142,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x33469c=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x33469c,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x4c371a){for(const _0x45e0f2 of this['_pendingContextItems']['values']())if(_0x45e0f2['resourceId']===_0x4c371a)return!0x0;for(const _0x3003fe of this['_conversationContextItems']['values']())if(_0x3003fe['resourceId']===_0x4c371a)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x39c054){const _0x33657d=[];for(const _0x40a761 of this['_addContextOptionsState']['sources']){_0x40a761['resources']['find'](_0x2b1979=>_0x2b1979['id']===_0x39c054)&&_0x33657d['push'](_0x40a761['id']);}return 0x0===_0x33657d['length']?null:_0x33657d;}['_updateResourceInContextState'](_0x2cfaf6,_0x1aebb6,_0x185cc9){const _0x5b49a5=this['_addContextOptionsState']['sources']['find'](_0x23fe75=>_0x23fe75['id']===_0x2cfaf6);if(!_0x5b49a5)return;const _0x559c6c=_0x5b49a5['resources']['find'](_0x2bb1b8=>_0x2bb1b8['id']===_0x1aebb6);_0x559c6c&&(_0x559c6c['isInContext']=_0x185cc9,this['fire']('resourceStateChanged',{'sourceId':_0x2cfaf6,'resourceId':_0x1aebb6,'isInContext':_0x185cc9}));}['_startUploadOperation'](_0x3c7080){this['_ongoingUploadOperations']['set'](_0x3c7080,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x344b03){this['_ongoingUploadOperations']['delete'](_0x344b03),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const fi=['capabilitiesUpdated'];class Ii extends _0x5194ed(){['_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'](_0x27443f){const _0xf163a3={};return _0x27443f&&_0x27443f['isWebSearchEnabled']&&(_0xf163a3['webSearch']={}),_0x27443f&&_0x27443f['isReasoningEnabled']&&(_0xf163a3['reasoning']={}),_0xf163a3;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x14c255){_0x14c255!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x14c255,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x56aca0){_0x56aca0!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x56aca0,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ci extends xe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x191ecc){super(_0x191ecc),this['conversationId']=_0x191ecc['conversationId'],this['contextItems']=_0x191ecc['contextItems'],this['capabilities']=_0x191ecc['capabilities'],this['userMessage']=_0x191ecc['userMessage'],this['model']=_0x191ecc['model'],this['quickActionData']=_0x191ecc['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':wi['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ii['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class Ct extends _0x5194ed(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x12c2d6){super(),this['options']=_0x12c2d6,this['connector']=_0x12c2d6['connector'],this['chatModels']=_0x12c2d6['chatModels'],this['id']=_0x12c2d6['conversationId'];}async['init'](_0x19492f){try{this['chatContext']=new wi({'connector':this['connector'],'config':_0x19492f,'ownerId':this['id']}),this['chatContext']['delegate'](...vi)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ii(),this['chatCapabilities']['delegate'](...fi)['to'](this),this['chatCapabilities']['init']();const _0x3f079c=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x3f079c});const _0x6e2451=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x6e2451&&await this['setModel'](_0x6e2451);}catch(_0x206a98){const _0x4ec24e=new _0x5cac2e('ai-chat-conversation-init-failed',null,{'message':_0x206a98['message']||_0x206a98});_0x4ec24e['stack']=_0x206a98['stack'],this['fire']('error',{'error':_0x4ec24e});}}async['start'](){if(this['isStarted'])throw new _0x5cac2e('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x5cac2e('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x24a59e}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x24a59e,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x11f998){const _0xcbbbf8=new _0x5cac2e('ai-chat-conversation-start-failed',null,{'message':_0x11f998['message'],'conversationId':this['id']});throw _0xcbbbf8['stack']=_0x11f998['stack'],this['fire']('error',{'error':_0xcbbbf8}),_0xcbbbf8;}}async['load'](_0x1dff34,_0x470ebc){try{const _0x54b369=await this['connector']['fetchConversation'](_0x1dff34)['getConversation'](),_0x716d81=await this['connector']['fetchConversationMessages'](_0x1dff34)['getMessages'](),_0x2be0be=_0x716d81[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x54b369['id'],'title'in _0x54b369?this['fire']('setConversationTitle',_0x54b369['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x4ddd46=(await this['chatModels']['getAll']())['find'](_0x44f5ef=>_0x44f5ef['id']['toLowerCase']()===_0x2be0be['toLowerCase']());return this['selectedModel']=_0x4ddd46,this['fire']('modelSelected',{'selectedModel':_0x4ddd46,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x716d81,_0x470ebc,_0x2be0be),this['currentInteraction']=void 0x0,this;}catch(_0x19d966){const _0x26c80d=new _0x5cac2e('ai-chat-conversation-init-from-id-failed',null,{'message':_0x19d966['message'],'conversationId':_0x1dff34});throw _0x26c80d['stack']=_0x19d966['stack'],this['fire']('error',{'error':_0x26c80d}),_0x26c80d;}}async['_processMessagesToInteractions'](_0x11d0d3,_0x4eae23,_0x38b857){let _0xe41e1d;for(const _0xc7fb50 of _0x11d0d3)if('user'===_0xc7fb50['role']){const _0x82c009=await this['_extractContextItems'](_0xc7fb50),_0x435161={'isReasoningEnabled':Object['hasOwn'](_0xc7fb50['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0xc7fb50['capabilities'],'webSearch')};_0xe41e1d=this['createInteraction']({'userMessage':_0xc7fb50['prompt'],'contextItems':_0x82c009,'capabilities':_0x435161,'modelId':_0x38b857,'quickActionData':_0xc7fb50['attributes']?.['quickActionData']}),this['currentInteraction']=_0xe41e1d,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0xc7fb50['role']&&_0xe41e1d)for(const _0xb01822 of _0xc7fb50['content']){const _0xce24a8='text'===_0xb01822['type']?'text-delta':'modification-delta',_0x2ce78e=_0xe41e1d['getDocumentContext']()?.['sessionId']!==_0x4eae23;_0xe41e1d['currentReply']=_0xe41e1d['createReply']({'type':_0xce24a8,'isDone':!0x0,'interactionId':_0xe41e1d['id'],'areActionsDisabled':_0x2ce78e}),_0xe41e1d['currentReply']['appendContent'](_0xb01822['content']);}}}async['_extractContextItems'](_0x193e9b){const _0x4dfeb7=new Map();if(!_0x193e9b['content'])return _0x4dfeb7;for(const _0x3f4985 of _0x193e9b['content']){const _0x596ca5=await this['chatContext']['populateFromMessage'](_0x3f4985);_0x596ca5&&_0x4dfeb7['set'](_0x596ca5['id'],_0x596ca5);}return _0x4dfeb7;}async['handleUserInteraction']({userMessage:_0x5233a0,quickActionData:_0x2bbd0d}){if(!this['isStarted'])throw new _0x5cac2e('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x5cac2e('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x5112ae=this['chatContext']['getPendingContextItems'](),_0xcedcd6=this['chatCapabilities']['getCapabilitiesConfig'](),_0x58442b=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x5233a0,'contextItems':_0x5112ae,'capabilities':_0xcedcd6,'modelId':_0x58442b,'quickActionData':_0x2bbd0d}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x22d3ba){if(_0x22d3ba instanceof _0x5cac2e)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x22d3ba});else{const _0x59930b=Oe['get'](_0x22d3ba['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x5cac2e(_0x59930b,null,{'error':_0x22d3ba})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x56d7b3,contextItems:_0x255977,capabilities:_0x2e2382,modelId:_0x3ef35a,quickActionData:_0x68a688}){const _0x541958=new Ci({'userMessage':_0x56d7b3,'contextItems':_0x255977,'capabilities':_0x2e2382,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x3ef35a,'quickActionData':_0x68a688});return _0x541958['delegate'](...Ce)['to'](this),this['interactions']['push'](_0x541958),this['fire']('interactionCreated',_0x541958),_0x541958;}['getInteraction'](_0x6cd8e3){return this['interactions']['find'](_0x5abfdc=>_0x5abfdc['id']===_0x6cd8e3);}['removeInteraction'](_0x320d9b){const _0x44338f=this['getInteraction'](_0x320d9b);_0x44338f&&(_0x44338f['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x44338f),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x56acb3){this['chatContext']['addCurrentDocumentToContext'](_0x56acb3);}async['updateCurrentDocumentInContext']({content:_0x447d98,version:_0x342687,sessionId:_0x3d9275,selections:_0x251ebd}){await this['chatContext']['updateCurrentDocument'](_0x447d98,_0x342687,_0x3d9275,_0x251ebd);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x40bcee){this['chatContext']['addSelectionToContext'](_0x40bcee);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x337fd4){this['chatContext']['addFilesToContext'](_0x337fd4);}['addUrlToContext'](_0x466e4f){this['chatContext']['addUrlToContext'](_0x466e4f);}['addResourceToContext'](_0x9326c9,_0x4f90b6){this['chatContext']['addResourceToContext'](_0x9326c9,_0x4f90b6);}['loadSourceResources'](_0x49a3c1,_0x47cb71,_0x83d042){return this['chatContext']['loadSourceResources'](_0x49a3c1,_0x47cb71,_0x83d042);}['removeFromContext'](_0x4249f2){this['chatContext']['removeFromContext'](_0x4249f2);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x2ced0e){_0x2ced0e?!0x1===await this['chatModels']['isAvailable'](_0x2ced0e)&&(_0x200ccb('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x2ced0e}),_0x2ced0e=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x200ccb('ai-chat-conversation-set-model-null',{'conversation':this}),_0x2ced0e=(await this['chatModels']['getAvailableModels']())[0x0]),_0x2ced0e['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x2ced0e,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x2ced0e}));}}function q(_0x3a0d29){if(_0x3a0d29 instanceof pt)return _0x3a0d29;if(_0x3a0d29?.['editors']&&_0x3a0d29['editors']['get'](0x0))return _0x3a0d29['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.'),_0x3a0d29['editors']['get'](0x0);throw new _0x5cac2e('ai-get-editor-from-context-no-editor');}const Tt='ai-selection';class S extends _0x24ce56{['_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 _0x126cb5=q(this['context']),_0x1ee8e9=_0x126cb5['plugins']['has']('RealTimeCollaborationClient')&&_0x126cb5['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x1ee8e9||_0x1cb0e0();}return this['_sessionId'];}['getDocumentData'](){const _0x2a25c9=q(this['context']),_0x34a725=_0x2a25c9['model'],_0x13b6b8=_0x2a25c9['data']['toView'](_0x34a725['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x5ede32=new kt(_0x2a25c9['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x13b6b8,_0x5ede32);let _0x230ad3=_0x2a25c9['data']['processor']['toData'](_0x13b6b8);const _0x885412=this['_getMarkersInDocumentOrder'](),_0xe7a2d7=[];for(const _0x362045 of _0x885412){const _0x25c7c8='<'+_0x362045['name']+':start></'+_0x362045['name']+':start>',_0x56f03b=_0x230ad3['indexOf'](_0x25c7c8);_0x230ad3=_0x230ad3['substring'](0x0,_0x56f03b)+_0x230ad3['substring'](_0x56f03b+_0x25c7c8['length']);const _0x5ad55a='<'+_0x362045['name']+':end></'+_0x362045['name']+':end>',_0x35d275=_0x230ad3['indexOf'](_0x5ad55a);_0x230ad3=_0x230ad3['substring'](0x0,_0x35d275)+_0x230ad3['substring'](_0x35d275+_0x5ad55a['length']),_0xe7a2d7['push']({'markerName':_0x362045['name'],'start':_0x56f03b,'end':_0x35d275,'htmlFragment':_0x230ad3['substring'](_0x56f03b,_0x35d275)});}return{'content':_0x230ad3,'version':_0x2a25c9['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0xe7a2d7};}async['afterInit'](){this['context']instanceof pt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x39b8c2,_0x111cc9)=>{_0x111cc9['on']('ready',()=>{this['_integrateEditor'](_0x111cc9);});});}['_integrateEditor'](_0x245a83){_0x245a83['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Tt,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x245a83['conversion']['for']('dataDowncast')['markerToElement']({'model':Tt,'view':(_0x249a22,{writer:_0x110904,options:_0x312046})=>_0x312046['convertAiChatSelectionMarker']?_0x110904['createUIElement'](_0x249a22['markerName']+':'+(_0x249a22['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x53f004,_0x22f5ae,_0x37dce3=!0x1,_0x3983e8=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x3983e8)return!0x1;const _0x4fb3e2=q(this['context'])['model'];return _0x4fb3e2['change'](_0x4698c9=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x22f5ae,this['_displayedFakeSelectionLocked']=_0x37dce3;let _0x4e362e=0x0;for(let _0xa43ed7 of _0x53f004){const _0x171363=Tt+':'+_0x4e362e;if(_0xa43ed7['start']['isAtEnd']){const _0x25a2ed=_0xa43ed7['start']['getLastMatchingPosition'](({item:_0x5e6c9b})=>!_0x4fb3e2['schema']['isContent'](_0x5e6c9b),{'boundaries':_0xa43ed7});_0xa43ed7=_0x4698c9['createRange'](_0x25a2ed,_0xa43ed7['end']);}_0x4698c9['addMarker'](_0x171363,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xa43ed7}),_0x4e362e++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x483bf7){if(this['_displayedFakeSelectionId']!=_0x483bf7)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x3433e4=q(this['context']),_0x21a38f=_0x3433e4['model']['markers']['getMarkersGroup'](Tt);return _0x3433e4['model']['change'](_0x29afc1=>{for(const _0x3c40e2 of _0x21a38f)_0x29afc1['removeMarker'](_0x3c40e2);}),!0x0;}['modelToViewWithIds'](_0x229af0){const _0x4aac2e=q(this['context']),_0x1f9589=_0x4aac2e['data']['toView'](_0x229af0),_0x351a4c=new kt(_0x4aac2e['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x1f9589,_0x351a4c),_0x1f9589;}['_setDataIdsOnChildren'](_0x298f7f,_0x2c84c1){let _0xa686f2=!0x1;const _0x1cf2dd=new Set();for(const _0x5309cf of _0x298f7f['getChildren']()){const _0x1e4515=_0x5309cf['is']('emptyElement')||_0x5309cf['is']('containerElement');if(!_0x5309cf['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x5309cf,_0x2c84c1)||_0x1e4515)&&(_0x2c84c1['setAttribute']('data-id',this['_nextDataId'](_0x1cf2dd),_0x5309cf),_0xa686f2=!0x0);}return _0xa686f2;}['_nextDataId'](_0x343f00){let _0x309d84;do{_0x309d84='';for(let _0x3bd64b=0x0;_0x3bd64b<0x4;_0x3bd64b++)_0x309d84+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x343f00['has'](_0x309d84));return _0x343f00['add'](_0x309d84),_0x309d84;}['getSelectionText'](){const {model:_0x2bd72a}=q(this['context']),_0x49beed=_0x2bd72a['document']['selection'],_0x33c46b=_0x2bd72a['getSelectedContent'](_0x49beed),_0x5cd587=[],_0x3b6779=_0x2bd72a['createRangeIn'](_0x33c46b)['getWalker']();for(const {item:_0x67f77c}of _0x3b6779)_0x67f77c['is']('$textProxy')?_0x5cd587['push'](_0x67f77c['data']):_0x67f77c['is']('element')&&_0x5cd587['length']>0x0&&'\x20'!==_0x5cd587[_0x5cd587['length']-0x1]&&_0x5cd587['push']('\x20');return'\x22'+_0x5cd587['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x3a8e3d=q(this['context'])['model'];return Array['from'](_0x3a8e3d['markers']['getMarkersGroup'](Tt))['sort']((_0x553453,_0xf8bfb0)=>_0x553453['getStart']()['isBefore'](_0xf8bfb0['getStart']())?-0x1:_0x553453['getStart']()['isAfter'](_0xf8bfb0['getStart']())?0x1:0x0);}}const H=['applySuggestion','insertSuggestion','showChangeInText'];class ah extends _0x1f124f{['actionsButton'];['children'];['applySuggestionModel'];['showChangeInTextModel'];['insertSuggestionModel'];['_partsCount']=0x1;['_dropdownOriginalConfig'];['_dropdownCurrentConfig'];['_firstRender']=!0x0;constructor(_0x5dfd4d,_0x37b911){super(_0x5dfd4d),this['_dropdownOriginalConfig']=_0x37b911||[...H],this['_dropdownCurrentConfig']=[...this['_dropdownOriginalConfig']];const _0x29054b=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['applySuggestionModel']=new _0x2b6af7({'label':Ln('applySuggestion',_0x5dfd4d,this['_partsCount']),'icon':_0x33d7d6,'withText':!0x0,'type':'button','actionName':'applySuggestion'}),this['showChangeInTextModel']=new _0x2b6af7({'label':Ln('showChangeInText',_0x5dfd4d,this['_partsCount']),'icon':_0x558df1,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x2b6af7({'label':Ln('insertSuggestion',_0x5dfd4d,this['_partsCount']),'icon':_0x5aa8bc,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x5dfd4d),this['children']=this['createCollection'](),this['actionsButton']&&this['children']['add'](this['actionsButton']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x29054b['if']('isVisible','ck-hidden',_0xca691b=>!_0xca691b)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_dropdownCurrentConfig']=this['isTrackChangesOn']?this['_dropdownOriginalConfig']['filter'](_0x5ed7e1=>'applySuggestion'!==_0x5ed7e1):[...this['_dropdownOriginalConfig']],this['_updateDropdownActions'](_0x5dfd4d);});}['_updateDropdownActions'](_0x6e6bef){this['actionsButton']&&this['children']['has'](this['actionsButton'])&&(this['children']['remove'](this['actionsButton']),this['actionsButton']['destroy']()),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x6e6bef),this['actionsButton']&&this['children']['add'](this['actionsButton']);}['_createActionsDropdownOrButton'](_0x46c9b7){if(0x0==this['_dropdownCurrentConfig']['length'])return null;const _0x5ef0ce=0x1===this['_dropdownCurrentConfig']['length']?this['_createActionsButton'](_0x46c9b7):this['_createActionsDropdown'](_0x46c9b7),_0x277282=this['_firstRender']?'':'ck-ai-chat__feed__ai-suggestion__actions--no-animation';_0x5ef0ce['set']({'label':Ln(this['_dropdownCurrentConfig'][0x0],_0x46c9b7,this['_partsCount']),'tooltip':Un(this['_dropdownCurrentConfig'][0x0],_0x46c9b7,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions\x20'+_0x277282});for(const _0x484ccb of this['_dropdownCurrentConfig'])_0x5ef0ce['on'](_0x484ccb,()=>{this['fire'](_0x484ccb);});return this['_firstRender']=!0x1,_0x5ef0ce;}['_createActionsButton'](_0x2f648e){const _0x58a974=new _0x5be5f6(_0x2f648e);return _0x58a974['set']({'class':'ck-ai-button-primary','withText':!0x0}),_0x58a974['on']('execute',()=>{_0x58a974['fire'](this['_dropdownCurrentConfig'][0x0]);}),_0x58a974;}['_createActionsDropdown'](_0x9934d4){const _0x5c609c=new yn(_0x9934d4,{'listItemModels':this['_dropdownCurrentConfig']['map'](_0x1342bf=>{switch(_0x1342bf){case'applySuggestion':return this['applySuggestionModel'];case'showChangeInText':return this['showChangeInTextModel'];case'insertSuggestion':return this['insertSuggestionModel'];}})});return _0x5c609c['set']({'label':Ln(this['_dropdownCurrentConfig'][0x0],_0x9934d4,this['_partsCount']),'tooltip':Un(this['_dropdownCurrentConfig'][0x0],_0x9934d4,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),_0x5c609c['bind']('isEnabled')['to'](this),_0x5c609c;}['updateLabels'](_0x4bac7d){const _0x15363f=this['locale'];this['_partsCount']=_0x4bac7d||this['_partsCount'],this['actionsButton']['set']({'label':Ln(this['_dropdownCurrentConfig'][0x0],_0x15363f,this['_partsCount']),'tooltip':Un(this['_dropdownCurrentConfig'][0x0],_0x15363f,this['_partsCount'])}),this['applySuggestionModel']['label']=Ln('applySuggestion',_0x15363f,this['_partsCount']),this['showChangeInTextModel']['label']=Ln('showChangeInText',_0x15363f,this['_partsCount']),this['insertSuggestionModel']['label']=Ln('insertSuggestion',_0x15363f,this['_partsCount']);}}class yn extends _0x40793f{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x377c6d,_0x5c89d7){super(_0x377c6d),this['balloonPanelView']=new _0x134db1(this['locale']),this['bodyCollection']=new _0x1e472e(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x5c89d7['listItemModels']['slice'](0x1)),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',i(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{const _0x5815a2=_0x5c89d7['listItemModels'][0x0]['actionName'];this['fire'](_0x5815a2),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),this['on']('open',()=>{this['balloonPanelView']['isVisible']?(this['balloonPanelView']['hide'](),this['arrowView']['focus']()):(this['balloonPanelView']['pin']({'target':this['element'],'positions':['ltr'===this['locale']['uiLanguageDirection']?Pn:Hn]}),this['listView']['focus']());}),_0x5e494e({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x591b0f){const _0x3a3421=this['locale'],_0xbac1b6=new _0x5f8d0a(_0x3a3421);for(const _0xfc4063 of _0x591b0f){const _0x1f7e4b=new _0x19da3d(_0x3a3421),_0x10ecac=new _0xa5864f(_0x3a3421);_0x10ecac['bind'](...Object['keys'](_0xfc4063))['to'](_0xfc4063),_0x10ecac['delegate']('execute')['to'](_0xbac1b6),_0x1f7e4b['children']['add'](_0x10ecac),_0xbac1b6['items']['add'](_0x1f7e4b);}return _0xbac1b6['items']['delegate']('execute')['to'](this),_0xbac1b6['on']('execute',_0x29cefb=>{const _0x21c7df=_0x29cefb['source'];this['fire'](_0x21c7df['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0xbac1b6;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0x3678f9(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x3235c4,_0x5451e2)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x5451e2();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function Pn(_0x15ad78){return{'top':_0x15ad78['bottom'],'left':_0x15ad78['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function Hn(_0x13424e,_0x4ba31d){return{'top':_0x13424e['bottom'],'left':_0x13424e['left']-(_0x4ba31d['width']-_0x13424e['width']),'name':'arrowless','config':{'withArrow':!0x1}};}function Ln(_0x183238,_0x173922,_0x468870){switch(_0x183238){case'applySuggestion':return i(_0x173922,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x468870);case'showChangeInText':return i(_0x173922,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x468870);case'insertSuggestion':return i(_0x173922,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x468870);}}function Un(_0x1d8cd0,_0x441434,_0x37994e){switch(_0x1d8cd0){case'applySuggestion':return i(_0x441434,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x37994e);case'showChangeInText':return i(_0x441434,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP',_0x37994e);case'insertSuggestion':return i(_0x441434,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP',_0x37994e);}}class oe extends _0x5194ed(){['_connector'];['_availableModels'];['_defaultModelId'];['_modelList']=[];constructor({connector:_0x5ba623,availableModels:_0x225d62,defaultModelId:_0xf1d9a}){super(),this['_connector']=_0x5ba623,this['_availableModels']=_0x225d62,this['_defaultModelId']=_0xf1d9a;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x16e542=this['_connector']['getModels'](),_0x232f73=await _0x16e542['list']();this['_modelList']=_0x232f73['items'];}catch(_0x1eb270){throw _t('ai-models-unable-to-retrieve',{'error':_0x1eb270}),_0x1eb270;}return[...this['_modelList']];}async['getAvailableModels'](){const _0x25d1d6=await this['getAll']();return this['_filterModels'](_0x25d1d6,this['_availableModels']);}async['getModel'](_0x157638){const _0x53c8db=await this['getAll']();if(!_0x53c8db['length'])return null;if(_0x157638){const _0x1257a3=this['_getModelById'](_0x53c8db,_0x157638);if(_0x1257a3)return _0x1257a3;_0x200ccb('ai-chat-model-id-unrecognized',{'modelId':_0x157638,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x2de56f=await this['getAvailableModels']();if(!_0x2de56f['length'])return null;if(this['_defaultModelId']){const _0x1e7b3b=this['_getModelById'](_0x2de56f,this['_defaultModelId']);if(_0x1e7b3b)return _0x1e7b3b;_0x200ccb('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x2de56f[0x0]['id']});}return _0x2de56f[0x0];}async['isAvailable'](_0x1c9b15){return(await this['getAvailableModels']())['some'](_0x1e8a22=>_0x1e8a22['name']===_0x1c9b15['name']&&_0x1e8a22['provider']===_0x1c9b15['provider']);}['_filterModels'](_0x3eca51,_0x59fd2e){let _0x4f8e07;if(_0x59fd2e){_0x4f8e07=[];const _0xb90e92='string'==typeof _0x59fd2e?[_0x59fd2e['toLocaleLowerCase']()]:_0x59fd2e['map'](_0x35ddfa=>_0x35ddfa['toLocaleLowerCase']());for(const _0x50d5c7 of _0xb90e92)for(const _0x1ecacc of _0x3eca51)(_0x1ecacc['id']['toLocaleLowerCase']()===_0x50d5c7||_0x1ecacc['name']['toLocaleLowerCase']()===_0x50d5c7||Ne(_0x1ecacc)&&'auto'===_0x50d5c7||_0x1ecacc['provider']['toLocaleLowerCase']()===_0x50d5c7||_0x1ecacc['id']['toLocaleLowerCase']()['startsWith'](_0x50d5c7))&&_0x4f8e07['push'](_0x1ecacc);}else _0x4f8e07=_0x3eca51;return _0x4f8e07;}['_getModelById'](_0x1f4dc8,_0x5827b7){return _0x1f4dc8['find'](_0x3ec969=>Ne(_0x3ec969)&&'auto'===_0x5827b7?_0x3ec969:_0x3ec969['id']===_0x5827b7)||null;}static['getLocalized'](_0x19e319,_0x5c143b){return _0x5c143b['map'](_0xffe2e7=>{if(Ne(_0xffe2e7))_0xffe2e7['name']=i(_0x19e319,'AI_MODEL_NAME_AUTO'),_0xffe2e7['description']=i(_0x19e319,'AI_MODEL_DESCRIPTION_AUTO');else i(_0x19e319,'AI_MODEL_DESCRIPTION_'+_0xffe2e7['id']['toUpperCase']())['startsWith']('AI_MODEL_DESCRIPTION_')||(_0xffe2e7['description']=i(_0x19e319,'AI_MODEL_DESCRIPTION_'+_0xffe2e7['id']['toUpperCase']()));return _0xffe2e7;});}}function Ne(_0x33f493){return _0x33f493['id']['startsWith']('agent');}class It extends oe{async['getAll'](){return(await super['getAll']())['sort']((_0x5dacf7,_0x1ddce5)=>{const _0x36ed5a=Object['values'](_0x5dacf7['capabilities'])['filter'](_0x4eaa08=>_0x4eaa08['enabled'])['length'];return Object['values'](_0x1ddce5['capabilities'])['filter'](_0x3134ba=>_0x3134ba['enabled'])['length']-_0x36ed5a;});}}function rt({editor:_0x271d2c,interaction:_0x42a541,reply:_0x58c4ed,groups:_0x15a24b,transform:_0x52d439,documentCompare:_0x1a0f02,documentCompareOptions:_0x27f027}){const _0x244274=_0x42a541['getDocumentContext']();if(!_0x244274)return[];const _0x3c8701=_0x244274['content'],_0x4d3ebb=_0x244274['version'],_0x1f3823=_0x58c4ed['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0xa51067}of _0x15a24b){const _0x413566=_0xa51067['filter'](_0x1163cc=>'new'!=_0x1163cc['type'])['map'](_0x5e75bb=>Rt('data-id',_0x5e75bb['id'],_0x1f3823)),_0x459a66=_0xa51067['filter'](_0x20deae=>'removed'!=_0x20deae['type'])['map'](_0x3c22ad=>_0x3c22ad['node']['cloneNode'](!0x0));let _0xb36913=null;if(_0x413566['length']){_0xb36913=_0x413566[0x0]['previousSibling'];for(let _0x56dcb9=0x0;_0x56dcb9<_0x413566['length'];_0x56dcb9++)_0x5d80a9(_0x413566[_0x56dcb9]);}if(_0x459a66['length']){_0xb36913||(_0xa51067[0x0]['anchorId']?_0xb36913=Rt('data-id',_0xa51067[0x0]['anchorId'],_0x1f3823):(_0xb36913=_0x459a66['shift'](),_0x57cbd0(_0x1f3823,_0xb36913)));for(let _0x51a11e=0x0;_0x51a11e<_0x459a66['length'];_0x51a11e++)_0x186aa3(_0xb36913,_0x459a66[_0x51a11e]),_0xb36913=_0x459a66[_0x51a11e];}}const _0x373834=vt(_0x1f3823),_0x2f7a74=_0x1a0f02['getDiff'](_0x3c8701,_0x373834,_0x27f027)['getOperations']();if(_0x52d439){const _0x26ebc1=_0x271d2c['model']['document']['history']['getOperations'](_0x4d3ebb),_0x5e2ba6={'document':_0x271d2c['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return ut(_0x2f7a74,_0x26ebc1,_0x5e2ba6)['operationsA'];}return _0x2f7a74;}function ot(_0xb2206f,_0x217a13){if('marker'!=_0x217a13['type'])return;const _0x105246=_0xb2206f['model']['markers']['get'](_0x217a13['name']);_0x105246&&(_0x217a13['oldRange']=_0x105246['getRange']());}class Lr extends _0x384aff{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x30ce77,_0x2d9141={},_0x50e2ca){super(_0x30ce77),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x2d9141};const _0xe963b6=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0xe963b6?'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'](_0x50e2ca),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']);}['_setupRatingButtons'](){this['likeButton']=new _0x5be5f6(this['locale']),this['likeButton']['set']({'icon':_0x551c36,'label':i(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x512a8a=>!_0x512a8a),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x5be5f6(this['locale']),this['dislikeButton']['set']({'icon':_0x126149,'label':i(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x4b2b28=>!_0x4b2b28),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x5be5f6(this['locale']),this['copyButton']['set']({'icon':_0x621568,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x162994=>!_0x162994);const _0x2ecf88=new _0x26d10b();_0x2ecf88['set']({'content':_0x2e7acd}),_0x2ecf88['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'](_0x2ecf88);}['_setupShowChangesButton'](_0x173fd6){this['showChangesButton']=new _0x5be5f6(this['locale']),this['showChangesButton']['set']({'icon':tt,'label':i(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'isOn':_0x173fd6}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x5a0983=>!_0x5a0983),this['showChangesButton']['on']('execute',()=>{const _0x451373=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x451373,'icon':_0x451373?_0x48d429:tt}),this['fire']('toggleShowChanges',_0x451373);});}}class Dr extends _0x1f124f{['showChangesToggleView'];constructor(_0x30c19d,_0x404c8c){super(_0x30c19d),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Qr(_0x30c19d),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x30c19d,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x404c8c['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0xadf6b8=>_0xadf6b8?_0x4b2741:_0x4db50e),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x79eceb=new _0x26d10b();_0x79eceb['content']=_0x261f32,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x404c8c['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x79eceb,{'tag':'span','children':[i(_0x30c19d,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Qr extends _0x5be5f6{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x3bfe46){this['options']={'delay':_0x3bfe46['delay']??0x14,'textNodeStyle':_0x3bfe46['textNodeStyle'],'onStreamUpdate':_0x3bfe46['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x32e8ee,targetElement:_0x412442,abortSignal:_0x589867}){this['isStreaming']&&this['stop'](),_0x589867?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x3fdce8(_0x32e8ee,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0x200ccb('ai-html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x156a20=0x0;_0x156a20<this['currentIndex'];_0x156a20++)this['nodesList'][_0x156a20]['shouldBeStreamed']=!0x0;let _0x25e442=0x0;for(let _0x1a8635=this['currentIndex'];_0x1a8635<this['nodesList']['length'];_0x1a8635++){const _0x36c0d6=Date['now'](),_0x4ce7e9=this['nodesList'][_0x1a8635],_0x5b8f14=_0x36c0d6-_0x25e442;_0x4ce7e9['shouldBeStreamed']=!0x0;let _0x5230b0=_0x4ce7e9['parent'];for(;_0x5230b0;)_0x5230b0['shouldBeStreamed']=!0x0,_0x5230b0=_0x5230b0['parent'];if(_0x5b8f14<this['options']['delay'])try{const {promise:_0x32b0ca,abortController:_0x1b608d}=pr(this['options']['delay']-_0x5b8f14);this['timeoutAbortController']=_0x1b608d,await _0x32b0ca;}catch(_0x12945d){return;}_0x51bf13(_0x412442,'<'+_0x412442['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x412442['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x1a8635,_0x25e442=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x1aa64c}){Array['from'](_0x1aa64c['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x409330=>{_0x409330['replaceWith'](_0x409330['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x16a31e){let _0xc6e730='';if(function(_0x2b242b){return _0x1ae2c2(_0x2b242b);}(_0x16a31e)){for(const _0x5f471e of _0x16a31e['children'])_0xc6e730+=this['renderNode'](_0x5f471e);}else{if(dr(_0x16a31e)){if(!_0x16a31e['shouldBeStreamed'])return'';const _0x50ae9b=_0x16a31e,_0x139ee4=Object['entries'](_0x50ae9b['attribs'])['map'](([_0x1b4326,_0x34c7b3])=>_0x1b4326+'=\x22'+_0x34c7b3+'\x22')['join']('\x20');_0xc6e730+='<'+_0x50ae9b['tagName']+(_0x139ee4?'\x20'+_0x139ee4:'')+'>';for(const _0x25cd30 of _0x4bd440(_0x50ae9b))_0xc6e730+=this['renderNode'](_0x25cd30);_0xc6e730+='</'+_0x50ae9b['tagName']+'>';}else{if(!ar(_0x16a31e))return'';if(!_0x16a31e['shouldBeStreamed'])return'';!function(_0xa6c91e){if(!_0xa6c91e['parent']||!dr(_0xa6c91e['parent']))return!0x1;if(!cr['includes'](_0xa6c91e['parent']['tagName']))return!0x1;return!_0x273932(_0xa6c91e)['match'](/^\s*[<>]\s*$/);}(_0x16a31e)?_0xc6e730+=_0x1ff74f(_0x16a31e):_0xc6e730+=_0x1ff74f(new _0x5847fe('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x16a31e]));}}return _0xc6e730;}['getParsedDocumentNodeList'](){const _0x457787=[];return function(_0x2594ad,_0x38fdbd){const _0x1d20df=_0xabc7ef=>{if(_0x38fdbd(_0xabc7ef),_0xabc7ef instanceof _0x276e08)for(let _0x408e80=0x0;_0x408e80<_0xabc7ef['children']['length'];_0x408e80++){const _0x3aaedd=_0xabc7ef['children'][_0x408e80];_0x1d20df(_0x3aaedd);}};for(let _0x271d6c=0x0;_0x271d6c<_0x2594ad['children']['length'];_0x271d6c++)_0x1d20df(_0x2594ad['children'][_0x271d6c]);}(this['document'],_0x4f0c2c=>{if(ar(_0x4f0c2c)){const _0x20c98a=this['splitTextNodeIntoWordNodes'](_0x4f0c2c);_0x20c98a['length']&&_0x457787['push'](..._0x20c98a);}_0x4f0c2c['isWordSplitSource']||_0x4f0c2c['isWordSplitResult']||_0x457787['push'](_0x4f0c2c);}),_0x457787;}['splitTextNodeIntoWordNodes'](_0x3937d4){if(_0x3937d4['isWordSplitSource']||_0x3937d4['isWordSplitResult'])return[];const _0x4bf425=_0x273932(_0x3937d4)['match'](/(?:\s*\S+\s*)/g),_0x325c29=[];if(_0x4bf425&&_0x4bf425['length']>0x1){for(const _0x569425 of _0x4bf425){const _0x4a393c=new _0x38f6b5(_0x569425);_0x4a393c['isWordSplitResult']=!0x0,_0x5e539d(_0x3937d4,_0x4a393c),_0x325c29['push'](_0x4a393c);}_0x3937d4['isWordSplitSource']=!0x0,_0x5d80a9(_0x3937d4);}return _0x325c29;}}const cr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function ar(_0x4e2019){return _0x1c2d69(_0x4e2019);}function dr(_0x4f56c9){return _0x3cb149(_0x4f56c9);}function pr(_0x4add4d){const _0x191ec4=new AbortController();return{'promise':new Promise((_0x198144,_0xe9647d)=>{const _0x2ec95a=setTimeout(_0x198144,_0x4add4d);_0x191ec4['signal']['addEventListener']('abort',()=>{clearTimeout(_0x2ec95a),_0xe9647d();});}),'abortController':_0x191ec4};}const Ee=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class na extends _0x1f124f{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x445d3e,{part:_0x392ef9,uiIndex:_0x4aaa0c,areActionsDisabled:_0x21b1a8,availableActions:_0x3a21ca}){super(_0x445d3e),this['set']('partDefinition',_0x392ef9),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x15da6a=>'pending'==_0x15da6a&&!_0x21b1a8),this['children']=this['createCollection'](),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Vn(_0x445d3e,{'part':_0x392ef9,'uiIndex':_0x4aaa0c,'availableActions':_0x3a21ca}),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Ee)['to'](this);const _0x5293c8=this['bindTemplate'];this['contentView']=new _0x1f124f(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__content']}}),this['children']['addMany']([this['contentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x5293c8['to']('state',_0x3b5f30=>'ck-ai-suggestion__body__content-part_'+_0x3b5f30),_0x5293c8['to']('isEnabled',_0x4610db=>_0x4610db?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x5293c8['if']('isVisible','ck-hidden',_0x3123ad=>!_0x3123ad)]},'children':this['children'],'on':{'mouseenter':_0x5293c8['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x392ef9['index']});}),'mouseleave':_0x5293c8['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x392ef9['index']});})}});}async['updateContent']({part:_0x415019,renderingStrategy:_0x531140,showUnchangedParts:_0x1fdc08=!0x1,abortSignal:_0x4ae544}){this['partDefinition']=_0x415019,this['isVisible']=this['partDefinition']['hasChanges']||_0x1fdc08,this['isVisible']&&('streaming'===_0x531140?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x4ae544}):this['contentView']['element']['innerHTML']=vt(this['partDefinition']['content']));}['toggleHeader'](_0x27f04e){_0x27f04e?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Vn extends _0x1f124f{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];['_iconStateOutdated'];constructor(_0x210c23,{part:_0x211dd0,uiIndex:_0x146312,availableActions:_0x4ff41c}){super(_0x210c23),this['set']('partDefinition',_0x211dd0),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x30baa1=new _0x26d10b();_0x30baa1['content']=_0x30761e,_0x30baa1['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x411e2e=[];if(_0x4ff41c['includes']('showChangeInText')){const _0x2c442e=new _0x5be5f6(_0x210c23);_0x2c442e['set']({'label':i(_0x210c23,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x558df1}),_0x2c442e['bind']('isEnabled')['to'](this),_0x2c442e['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x211dd0['index']});}),_0x411e2e['push'](_0x2c442e);}if(_0x4ff41c['includes']('insertSuggestion')){const _0x43b4b5=new _0x5be5f6(_0x210c23);_0x43b4b5['set']({'label':i(_0x210c23,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x5aa8bc}),_0x43b4b5['bind']('isEnabled')['to'](this),_0x43b4b5['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x211dd0['index']});}),_0x411e2e['push'](_0x43b4b5);}const _0x1f2a28=new _0x5be5f6(_0x210c23);_0x1f2a28['set']({'label':i(_0x210c23,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x5c2b7a}),_0x1f2a28['bind']('isEnabled')['to'](this),_0x1f2a28['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x211dd0['index']});}),_0x411e2e['push'](_0x1f2a28),this['_toolbarView']=new _0x384aff(_0x210c23),this['_toolbarView']['items']['addMany'](_0x411e2e),this['_iconStateAccepted']=new _0x26d10b(),this['_iconStateAccepted']['content']=_0x42e278,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':i(_0x210c23,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x26d10b(),this['_iconStateRejected']['content']=_0x2cf6fc,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':i(_0x210c23,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}}),this['_iconStateOutdated']=new _0x26d10b(),this['_iconStateOutdated']['content']=_0x2cf6fc,this['_iconStateOutdated']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-outdated'],'data-cke-tooltip-text':i(_0x210c23,'AI_SUGGESTION_CONTENT_PART_OUTDATED'),'data-cke-tooltip-position':'n'}});const _0x34ce8f=new _0x1f124f(_0x210c23);_0x34ce8f['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x210c23,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x146312['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x30baa1,_0x34ce8f,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',(_0x1e7bd1,_0x1ac5aa,_0x587a80,_0x316c10)=>{switch(_0x316c10){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);break;case'outdated':this['children']['remove'](this['_iconStateOutdated']);}switch(_0x587a80){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);break;case'outdated':this['children']['add'](this['_iconStateOutdated']);}});}}class st extends _0x5194ed(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x14941f){const _0x27bbcd=this['createTask'](_0x14941f);return this['queue']['push'](_0x27bbcd),this['_processQueue'](),_0x27bbcd['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(_0x189f5d=>{this['once']('_queueEmpty',()=>{_0x189f5d();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x2b037d=this['queue']['shift']();try{await _0x2b037d['callback'](this['_abortController']['signal']),_0x2b037d['resolve']();}catch(_0x49fe96){_0x2b037d['reject'](_0x49fe96);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x2fe119){let _0x26a1ca,_0x2fa945;const _0x3b077e=new Promise((_0x4fe129,_0x40f0f3)=>{_0x26a1ca=_0x4fe129,_0x2fa945=_0x40f0f3;});return{'callback':_0x2fe119,'resolve':_0x26a1ca,'reject':_0x2fa945,'completePromise':_0x3b077e};}}class Fr extends _0x1f124f{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x38c3cc){super();const _0x1fe3e8=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']=_0x38c3cc,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x1fe3e8['if']('isDone','ck-ai-chat__feed__item_done'),_0x1fe3e8['if']('isVisible','ck-hidden',_0x40aded=>!_0x40aded),'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'](_0x3ab6c2=>{_0x3ab6c2['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x1f3ba2,_0x2c52e2,_0x38be10){await this['htmlStreamer']['stream']({'document':_0x1f3ba2,'targetElement':_0x2c52e2,'abortSignal':_0x38be10});}}class Pe extends Fr{constructor(_0x4c5ed8){super(_0x4c5ed8),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x4c5ed8['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x3ee111){this['element']['innerHTML']=_0x3ee111;}}class Tr extends _0x1f124f{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x261e55,_0x193a65){super(_0x261e55);const {areActionsDisabled:_0x27c2cc,showUnchangedParts:_0x35fdb4,availableActions:_0x6c174}=_0x193a65;this['_areActionsDisabled']=_0x27c2cc,this['_showUnchangedParts']=_0x35fdb4,this['_availableActions']=_0x6c174,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new st(),this['_emptyPartsWarningView']=new Pe({'id':'empty-parts-warning','initialContent':i(_0x261e55,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,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']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0xe9aedd,renderingStrategy:_0x33a162,abortSignal:_0x1e218d}){this['_children']['length']?_0xe9aedd['forEach'](_0x332f42=>{const _0x5c1e4a=this['_cachedContentParts']['findIndex'](_0x5785a1=>_0x5785a1['index']==_0x332f42['index']);-0x1===_0x5c1e4a?this['_cachedContentParts']['push'](_0x332f42):this['_cachedContentParts'][_0x5c1e4a]=_0x332f42;}):this['_cachedContentParts']=_0xe9aedd;for(const _0x2e56f0 of _0xe9aedd['filter'](_0x365c16=>_0x365c16['hasChanges']))this['_updateContentPartsPromiseQueue']['enqueue'](async _0x1cc5cb=>{let _0x502e1b=this['getPartView'](_0x2e56f0['index']);_0x502e1b||(_0x502e1b=new na(this['locale'],{'part':_0x2e56f0,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x502e1b['delegate'](...Ee)['to'](this),this['_children']['add'](_0x502e1b),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x502e1b['toggleHeader'](this['_children']['length']>0x1),await _0x502e1b['updateContent']({'part':_0x2e56f0,'renderingStrategy':_0x33a162,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x1cc5cb});});return _0x1e218d?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x48a24d,_0x75a719){const _0x4c088a=this['getPartView'](_0x48a24d);_0x4c088a&&(_0x4c088a['state']=_0x75a719),this['hasPendingParts']='pending'==_0x75a719||Array['from'](this['_children'])['some'](_0x50e079=>'pending'==_0x50e079['state']);}['getPartView'](_0xaac32a){return this['_children']['find'](_0x28d484=>_0x28d484['partDefinition']['index']==_0xaac32a)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x1e2c44=!this['_cachedContentParts']['find'](({hasChanges:_0x16c92a})=>_0x16c92a),_0x12c7bb=!!this['_cachedContentParts']['find'](({hasChanges:_0x6eb185})=>!_0x6eb185);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x12c7bb,_0x1e2c44?this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x2ff730=>_0x2ff730['partDefinition']['hasChanges']);}}class qe extends _0x2f6b47{constructor(_0x55eee6=void 0x0){super();const _0x316170=_0x55eee6?'ck-ai-spinner_'+_0x55eee6:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x316170]}});}}class F extends _0x1f124f{['bodyView'];['miniToolbarView'];['children'];['headerView'];['loaderView'];['errorView'];['sourcesView'];constructor(_0xcfe59e,_0xdf2ff){super(_0xcfe59e);const {showDiff:_0x3f0de2,areActionsDisabled:_0x34284e,miniToolbarConfig:_0x5943b5,hideHeader:_0x8cc864,showLoader:_0x21e41e,showUnchangedParts:_0x16f983,availableActions:_0x1dedd4}=_0xdf2ff;this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x21e41e),this['set']('isErrorVisible',!0x1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x8cc864||(this['headerView']=new Dr(_0xcfe59e,{'showDiff':_0x3f0de2}),this['headerView']['on']('toggleShowChanges',(_0x36795b,_0x519de4)=>{this['areChangesVisible']=_0x519de4['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x519de4['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new Tr(_0xcfe59e,{'areActionsDisabled':_0x34284e,'showUnchangedParts':!!_0x16f983,'availableActions':_0x1dedd4}),this['bodyView']['delegate'](...Ee)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden'),this['bindTemplate']['if']('isErrorVisible','ck-hidden')]}}),this['miniToolbarView']=new Lr(_0xcfe59e,_0x5943b5,_0x3f0de2),this['miniToolbarView']['delegate'](...Ee)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x20141d,_0x1b48ec)=>{this['areChangesVisible']=_0x1b48ec,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x1b48ec});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new Sr(this['locale']),this['children']['add'](this['sourcesView']),_0x21e41e&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['errorView']=this['_createErrorView'](),this['children']['add'](this['errorView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x4a90eb){await this['bodyView']['updateContentParts'](_0x4a90eb);}['updateSources'](_0x1f51da){this['sourcesView']['children']['addMany'](_0x1f51da['map'](_0x8efd7e=>new qr(this['locale'],_0x8efd7e))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['showError'](_0x3dcb4e){if(this['errorView']){const _0x20cf93=this['errorView']['element']?.['querySelector']('.ck-ai-suggestion__error-text');_0x20cf93&&(_0x20cf93['textContent']=_0x3dcb4e),this['isErrorVisible']=!0x0;}}['hideError'](){this['errorView']&&(this['isErrorVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x0),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x1);}['clearErrorState'](){this['miniToolbarView']&&(this['miniToolbarView']['isLoading']=!0x1),this['headerView']?.['showChangesToggleView']&&(this['headerView']['showChangesToggleView']['isEnabled']=!0x0);}['addNavigationItem'](_0x54e036){this['miniToolbarView']['items']['add'](_0x54e036);}['removeNavigationItem'](_0x1641fa){this['miniToolbarView']['items']['remove'](_0x1641fa);}['_createLoaderView'](){const _0x3e647f=new _0x1f124f(this['locale']),_0x509ae4=new qe('small');_0x509ae4['isVisible']=!0x0;const _0x128dde=new _0x1f124f(this['locale']);return _0x128dde['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[i(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x3e647f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x23fcce=>!_0x23fcce)]},'children':[_0x509ae4,_0x128dde]}),_0x3e647f;}['_createErrorView'](){const _0x53b71c=new _0x1f124f(this['locale']),_0x1c0f0a=new _0x1f124f(this['locale']);return _0x1c0f0a['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[i(this['locale'],'AI_CHAT_GENERIC_ERROR')]}),_0x53b71c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x16682c=>!_0x16682c)]},'children':[_0x1c0f0a]}),_0x53b71c;}}class Sr extends _0x1f124f{['children'];constructor(_0x5a550b){super(_0x5a550b),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',_0x11a469=>!_0x11a469)]},'children':this['children']});const _0x517225=new _0x1f124f(this['locale']),_0x33c611=new _0x26d10b();_0x33c611['content']=_0xcb7d20,_0x517225['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x33c611,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x517225);}}class qr extends _0x5be5f6{constructor(_0x5059f1,_0x49d284){super(_0x5059f1),this['set']({'label':_0x49d284['title'],'tooltip':_0x49d284['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x20a9c7=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x20a9c7['to'](()=>{window['open'](_0x49d284['url'],'_blank');})}}),_0x49d284['favicon']){const _0x272133=new _0x1f124f(_0x5059f1);_0x272133['setTemplate']({'tag':'img','attributes':{'src':_0x49d284['favicon']||_0xcb7d20,'alt':_0x49d284['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x272133);}else this['set']('icon',_0xcb7d20);}}class cs extends _0x384aff{constructor(_0x140842,_0x2755f0=!0x0,_0x28efe6=!0x0){super(_0x140842),this['set']('isLoading',!0x1),_0x2755f0&&(this['applyButton']=this['_createButton'](i(_0x140842,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x1e7be9=>!_0x1e7be9),this['items']['add'](this['applyButton'])),_0x28efe6&&(this['suggestButton']=this['_createButton'](i(_0x140842,'AI_BALLOON_SUGGEST_BUTTON'),_0x2755f0?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x287c46=>!_0x287c46),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x5e3ef0,_0x1b6c26){const _0x106566=new _0x5be5f6(this['locale']);return _0x106566['set']({'label':_0x5e3ef0,'class':_0x1b6c26||'','isVisible':!0x0,'withText':!0x0}),_0x106566;}}class ls extends _0x1f124f{constructor(_0x5ae74b){super(_0x5ae74b),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(_0x5ae74b,'AI_DISCLAIMER_TEXT')}]}]});}}const Fs=['wheel','touchstart','pointerdown','keydown'],Us=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class us{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x194782){this['element']=_0x194782,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x4a0ffc of Fs){const _0x56b91d='keydown'!==_0x4a0ffc;this['element']['addEventListener'](_0x4a0ffc,this['_onUserEvent']['bind'](this),{'passive':_0x56b91d,'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'](_0x4cf852){if(this['isRunning']){if('keydown'===_0x4cf852['type']){const _0x309071=_0x4cf852['key'];if(!Us['includes'](_0x309071))return;}_0x4cf852 instanceof WheelEvent?_0x4cf852['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x186463,scrollHeight:_0x101c91,clientHeight:_0x2115fb}=this['element'];return _0x101c91-_0x186463-_0x2115fb<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}const N=['applySuggestion','insertSuggestion','showNext','showPrevious'];class B extends _0x1f124f{['focusTracker'];['keystrokes'];['focusCycler'];['_availableActions'];['_focusables'];['_errorView'];['scrollManager'];constructor(_0xd1604e,_0x4a8ac0,_0x414b73,_0x4a6f87){super(_0xd1604e),this['_availableActions']=_0x414b73,this['set']('isLoading',!0x1),this['set']('isTrackChangesOn',_0x4a6f87),this['set']('isErrorVisible',!0x1),this['set']('errorMessage',''),this['focusTracker']=new _0x5e98a3(),this['keystrokes']=new _0x3678f9(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x12ca41({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x840caa(),this['_addContentView'](_0x4a8ac0['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x4a8ac0['showApplyButton'],_0x4a8ac0['showSuggestButton']),this['toolbar']['bind']('isLoading')['to'](this),this['_focusables']['clear'](),this['_focusables']['addMany']([this['toolbar']]),this['setTemplate']({'tag':'div','attributes':{'class':'ai-balloon-content'},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_dialogContent']['remove'](this['toolbar']),this['_addToolbar'](_0x4a8ac0['showApplyButton'],_0x4a8ac0['showSuggestButton']);});}['render'](){super['render']();for(const _0x2cd0bd of this['_focusables'])this['focusTracker']['add'](_0x2cd0bd['element']);this['keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['scrollManager']&&this['scrollManager']['destroy']();}['focus'](_0x98cbad){-0x1===_0x98cbad?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['showError'](_0xfb0730){this['_errorView']||(this['_errorView']=this['_createErrorView'](),this['_dialogContent']['addMany']([this['_errorView']],0x0)),this['errorMessage']=_0xfb0730,this['isErrorVisible']=!0x0;}['hideError'](){this['isErrorVisible']=!0x1;}['showRecoverableError'](_0x106c23){this['showError'](_0x106c23);}['showBlockingError'](_0x36628e){this['showError'](_0x36628e),this['toolbar']&&(this['toolbar']['applyButton']&&(this['toolbar']['applyButton']['isEnabled']=!0x1),this['toolbar']['suggestButton']&&(this['toolbar']['suggestButton']['isEnabled']=!0x1));}['setupRotator'](_0x210ea3){const _0x1baab5=this['_createNextButtonView'](),_0x26482c=this['_createPreviousButtonView']();_0x210ea3['view']['headerView']['children']['add'](_0x1baab5,0x2),_0x210ea3['view']['headerView']['children']['add'](_0x26482c,0x0),this['_focusables']['addMany']([_0x1baab5,_0x26482c]),this['focusTracker']['add'](_0x1baab5['element']),this['focusTracker']['add'](_0x26482c['element']);}['_addContentView'](_0x18f9d7){this['_mainView']=_0x18f9d7,this['_dialogContent']['add'](this['_mainView']);}['updateContent'](_0x5dd51f){const _0x5b1d6c=this['_dialogContent']['getIndex'](this['_mainView']);this['_dialogContent']['remove'](this['_mainView']),this['_mainView']=_0x5dd51f,this['_dialogContent']['add'](this['_mainView'],_0x5b1d6c),this['hideError'](),this['scrollManager']&&this['scrollManager']['destroy'](),this['_initializeScrollManager']();}['_addDisclaimerView'](){this['disclaimerView']=new ls(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x261661=!0x0,_0x590ff1=!0x0){_0x261661=_0x261661&&!this['isTrackChangesOn']&&this['_availableActions']['includes']('applySuggestion'),_0x590ff1=_0x590ff1&&this['_availableActions']['includes']('insertSuggestion'),this['toolbar']=new cs(this['locale'],_0x261661,_0x590ff1),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x3dec21=new _0x5be5f6(this['locale']);return _0x3dec21['set']({'icon':_0x5af157,'tooltip':i(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x3dec21['on']('execute',()=>{this['fire']('showNext');}),_0x3dec21;}['_createPreviousButtonView'](){const _0x5a0631=new _0x5be5f6(this['locale']);return _0x5a0631['set']({'icon':_0x31357f,'tooltip':i(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x5a0631['on']('execute',()=>{this['fire']('showPrevious');}),_0x5a0631;}['_createErrorView'](){const _0x4fb861=new _0x1f124f(this['locale']),_0x53c7db=new _0x1f124f(this['locale']);return _0x53c7db['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('errorMessage')}]}),_0x4fb861['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ai-balloon-error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x15e968=>!_0x15e968)]},'children':[_0x53c7db]}),_0x4fb861;}['startAutoScroll'](){this['_initializeScrollManager'](),this['scrollManager']&&this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']&&this['scrollManager']['stop']();}['_initializeScrollManager'](){const _0x31be64=this['_getScrollableElement']();_0x31be64&&!this['scrollManager']&&(this['scrollManager']=new us(_0x31be64));}['_getScrollableElement'](){return this['_mainView']instanceof F&&this['_mainView']['bodyView']['element']?this['_mainView']['bodyView']['element']:null;}}const z=0xa;class it extends _0x24ce56{static get['requires'](){return[R,S];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['_isUpdatingMarkers']=!0x1;['_pendingRenderCallback']=null;['open'](_0x225b9c){const _0x55aece=q(this['context']);if(this['_config']=_0x225b9c,this['isOpen'])return void this['_updateBalloon'](_0x225b9c);const _0x3586b7=this['context']['config']['get']('ai.availableReplyActions')||[...H],_0x2c6ab9=_0x55aece?.['commands']['get']('trackChanges'),_0x38922b=_0x2c6ab9?.['value'];this['balloonView']=new B(_0x55aece['locale'],_0x225b9c,_0x3586b7,!!_0x38922b),this['balloonView']['delegate'](...N)['to'](this),_0x2c6ab9&&this['balloonView']['bind']('isTrackChangesOn')['to'](_0x2c6ab9,'value'),this['_showDialog'](_0x225b9c);}['close'](){q(this['context'])['plugins']['get']('Dialog')['hide']();}['startAutoScroll'](){this['balloonView']&&this['balloonView']['startAutoScroll']();}['stopAutoScroll'](){this['balloonView']&&this['balloonView']['stopAutoScroll']();}['_updateBalloon'](_0x550949){const _0x11022c=q(this['context']),_0x92958=_0x11022c['plugins']['get']('Dialog');this['_pendingRenderCallback']&&(_0x11022c['editing']['view']['off']('render',this['_pendingRenderCallback']),this['_pendingRenderCallback']=null),this['_isUpdatingMarkers']=!0x0,_0x92958['view']?.['headerView']&&(_0x92958['view']['headerView']['label']=_0x550949['title'],_0x92958['view']['headerView']['iconView']&&_0x550949['icon']&&(_0x92958['view']['headerView']['iconView']['content']=_0x550949['icon'])),this['balloonView']['updateContent'](_0x550949['mainView']),this['_setupVisualSelection'](_0x550949['ranges'],_0x550949['index']),this['_pendingRenderCallback']=()=>{this['_isUpdatingMarkers']=!0x1,this['_pendingRenderCallback']=null,_0x92958['view']&&_0x92958['view']['updatePosition']();},_0x11022c['editing']['view']['once']('render',this['_pendingRenderCallback']);}['_setupVisualSelection'](_0x3d68fb,_0x4e4ab6){this['context']['plugins']['get'](S)['showFakeVisualSelection'](_0x3d68fb,'ai-balloon-'+_0x4e4ab6,!0x0,!0x0);}['_showDialog'](_0x3b14ef){const _0x3d92db=q(this['context']);this['_setupVisualSelection'](_0x3b14ef['ranges'],_0x3b14ef['index']);const _0x1da1a6=this['_getSelectionElements']();_0x1da1a6&&_0x1da1a6[0x0]&&_0x1a71b0({'target':_0x1da1a6[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),_0x3d92db['plugins']['get']('Dialog')['show']({'title':_0x3b14ef['title'],'icon':_0x3b14ef['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x3b14ef['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x58a902=>{_0x3b14ef['showRotator']&&this['balloonView']['setupRotator'](_0x58a902),this['_setupMarkerRemovalListener'](),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+this['_config']['index']),this['_cleanupMarkerRemovalListener'](),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x2e4bbb,_0x4d7714){if(!_0x4d7714)return null;const _0x3bc320=this['_getSelectionElements']();if(!_0x3bc320||0x0===_0x3bc320['length'])return{'left':Math['round'](_0x4d7714['left']+_0x4d7714['width']/0x2-_0x2e4bbb['width']/0x2),'top':Math['round'](_0x4d7714['top']+_0x4d7714['height']/0x2-_0x2e4bbb['height']/0x2)};const _0x289567=Math['round'](_0x4d7714['left']+_0x4d7714['width']/0x2-_0x2e4bbb['width']/0x2),_0x2cc69f=new _0x2063b2(_0x3bc320[0x0]),_0x3bc9bf=new _0x2063b2(_0x3bc320[_0x3bc320['length']-0x1]),_0x18bdbb=_0x2e4bbb['height'],_0x15074e=this['_config']['showRotator']?0x8:0x0;return{'left':_0x289567,'top':this['_calculateOptimalTopPosition'](_0x2cc69f,_0x3bc9bf,_0x18bdbb,_0x15074e,_0x4d7714)};}['_calculateOptimalTopPosition'](_0x423f37,_0x12427a,_0x555922,_0x1dab05=0x0,_0x4334fb){const _0xc37987=_0x555922+_0x1dab05,_0x22b4a0=new _0x2063b2(_0x38b85c['window']),_0x86027e=[_0x423f37['getVisible'](),_0x12427a['getVisible']()]['filter'](_0x3ff3e1=>_0x3ff3e1),_0x2e8028=_0x2063b2['getBoundingRect'](_0x86027e);if(!_0x2e8028)return Math['round'](_0x4334fb['top']+_0x4334fb['height']/0x2);const _0x41d189=_0x22b4a0['getIntersection'](_0x2e8028);if(!_0x41d189)return Math['round'](_0x4334fb['top']+_0x4334fb['height']/0x2);const _0x4db8a8=_0x4334fb['getVisible'](),_0x41c917=_0x4db8a8&&_0x2e8028['height']>_0x4db8a8['height'],_0x2557fa=_0x41d189['top'],_0x53aae2=_0x41d189['bottom'];if(_0x41c917){const _0x5c74e2=(_0x4db8a8||_0x22b4a0)['height']/0x2-_0xc37987/0x2,_0x8d875a=_0x2557fa-z-_0x4334fb['top'],_0x302551=_0x4334fb['bottom']-_0x53aae2-z;return _0x8d875a>=_0xc37987?Math['max'](z,_0x2557fa-_0xc37987-z):_0x302551>=_0xc37987?_0x53aae2+z:Math['max'](z,_0x5c74e2);}const _0x58bcc5=_0x2557fa-_0xc37987,_0x573ea3=_0x4334fb['bottom']-_0x53aae2-z,_0x293116=_0x2557fa-z-_0x4334fb['top'];let _0x48697b;if(_0x573ea3>=_0xc37987)_0x48697b=_0x53aae2+z;else{if(_0x293116>=_0xc37987)_0x48697b=_0x58bcc5-z;else _0x48697b=_0x2557fa+_0x2e8028['height']/0x2-_0xc37987/0x2;}return _0x48697b;}['_setupMarkerRemovalListener'](){const _0x41956d=q(this['context']);this['listenTo'](_0x41956d['model']['document'],'change',()=>{if(this['_isUpdatingMarkers'])return;for(const {name:_0x264331,data:{newRange:_0x15040f}}of _0x41956d['model']['document']['differ']['getChangedMarkers']())if(_0x264331['startsWith']('ai-selection:')&&(_0x15040f&&(_0x15040f['start']['isEqual'](_0x15040f['end'])||'$graveyard'==_0x15040f['root']['rootName'])||null==_0x15040f)){const _0x47eb46=i(this['context']['locale'],'AI_ACTIONS_SELECTION_REMOVED_ERROR');this['balloonView']['showBlockingError'](_0x47eb46),this['fire']('selectionRemoved');}});}['_cleanupMarkerRemovalListener'](){const _0x5c618b=q(this['context']);this['stopListening'](_0x5c618b['model']['document']);}['_getSelectionElements'](){const _0x2cdee4=q(this['context']);return _0xfe97ed(_0x2cdee4['editing'],[..._0x2cdee4['model']['markers']['getMarkersGroup']('ai-selection'),..._0x2cdee4['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class mt extends _0x24ce56{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[R,it,nt];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){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'],'availableModels':this['context']['config']['get']('ai.chat.models.displayedModels'),'defaultModelId':this['context']['config']['get']('ai.chat.models.defaultModelId')});const _0x28a887=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x5183c5,_0xd53235)=>{this['_handleUIUserMessage']({'userMessage':_0xd53235});}),this['listenTo'](_0x28a887,'resizedTabs',(_0x168251,_0x3520ca)=>{this['_setIsMaximized'](_0x3520ca);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x28a887['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0xa6149,_0x898426)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x898426));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x594091,_0x3b087e)=>{this['activeConversation']?.['addUrlToContext'](_0x3b087e);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x56b607,_0x5b8a4d)=>{this['activeConversation']?.['addResourceToContext'](_0x5b8a4d['source'],_0x5b8a4d['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x4df2f9,_0x78f8ff)=>{this['_removeFromContext'](_0x78f8ff);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x298688,_0x21c195)=>{this['activeConversation']?.['loadSourceResources'](_0x21c195['sourceId'],_0x21c195['query'],_0x21c195['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x457059,_0x56c051)=>{this['activeConversation']?.['setModel'](_0x56c051);}),this['listenTo'](this['_aiChatUi'],'like',(_0x21ba74,{replyId:_0x49c0fe})=>{console['log']('Liked\x20response',_0x49c0fe);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x5276a2,{replyId:_0x274074})=>{console['log']('Disliked\x20response',_0x274074);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x2817a7,_0x5ab253)=>{this['context']['plugins']['get'](it)['close'](),this['_insertSuggestion'](_0x5ab253);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x455dc3,{replyId:_0x704575,partIndex:_0x8e4d9e})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x704575,_0x8e4d9e);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x27e920,{replyId:_0x1d970b,partIndex:_0xcb87})=>{const _0x3a46da=this['_getDocumentRangeForReplyChanges'](_0x1d970b,_0xcb87);_0x3a46da&&'$graveyard'!=_0x3a46da['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x3a46da['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x112347,_0x3cb04b)=>{this['context']['plugins']['get'](it)['close'](),this['_applySuggestion'](_0x3cb04b);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x5e8116,{replyId:_0x2ed8f3,showDiff:_0x1d2b1a})=>{const {reply:_0x3003bb}=this['getInteractionAndReplyById'](_0x2ed8f3),_0x4751c8=_0x3003bb['getContentParts']({'showDiff':_0x1d2b1a});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3003bb['id'],'parts':_0x4751c8,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x3d9f14,{replyId:_0x21b561,partIndex:_0xdba3b6})=>{this['_previewedChangeGroup']?.['replyId']==_0x21b561&&this['_previewedChangeGroup']?.['partIndex']==_0xdba3b6&&this['context']['plugins']['get'](it)['close']();const {reply:_0x249ef0}=this['getInteractionAndReplyById'](_0x21b561);_0x249ef0['setChangeGroupState'](_0xdba3b6,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof pt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2d81bd,_0x258d05)=>{_0x258d05['on']('ready',()=>{this['_integrateEditor'](_0x258d05);});}),await this['_startConversationSafely']();}['_insertSuggestion'](_0x1338b7){const _0x785212=q(this['context']);if(!_0x785212['plugins']['has']('TrackChanges'))throw new _0x5cac2e('ai-no-track-changes',null);const _0x1cd64d=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x277528,interaction:_0xbfeb64}=this['getInteractionAndReplyById'](_0x1338b7['replyId']),_0x2053e7=this['_getDocumentRangeForReplyChanges'](_0x1338b7['replyId'],_0x1338b7['partIndex']),_0x45d9e5=void 0x0!==_0x1338b7['partIndex']?[_0x277528['changeGroups'][_0x1338b7['partIndex']]]:_0x277528['changeGroups']['filter'](_0x350a01=>'pending'==_0x350a01['state']),_0x497c09=_0x45d9e5['map'](_0x29e338=>_0x277528['changeGroups']['indexOf'](_0x29e338));if(!_0x2053e7||'$graveyard'==_0x2053e7['range']['root']['rootName'])return void _0x497c09['forEach'](_0xe737be=>_0x277528['setChangeGroupState'](_0xe737be,'outdated'));_0x497c09['forEach'](_0x288db8=>_0x277528['setChangeGroupState'](_0x288db8,'accepted'));const _0x5969a4=rt({'editor':_0x785212,'reply':_0x277528,'interaction':_0xbfeb64,'groups':_0x45d9e5,'transform':!0x0,'documentCompare':_0x1cd64d,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x83347a;_0x2053e7&&this['_scrollToSuggestionRange'](_0x2053e7['range']),_0x785212['model']['change'](_0x4a8373=>{_0x83347a=_0x4a8373['batch'],_0x785212['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x5969a4),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x83347a,{'interactionId':_0xbfeb64['id'],'replyId':_0x277528['id'],'indexes':_0x497c09['slice']()}),this['_updateRatings'](_0x277528);}['_applySuggestion'](_0x40fd04){const _0x1ef1f6=q(this['context']),_0x1f9124=this['context']['plugins']['get'](nt),{reply:_0xd895ae,interaction:_0x497a6d}=this['getInteractionAndReplyById'](_0x40fd04['replyId']),_0x1492d3=this['_getDocumentRangeForReplyChanges'](_0x40fd04['replyId'],_0x40fd04['partIndex']),_0x860b06=void 0x0!==_0x40fd04['partIndex']?[_0xd895ae['changeGroups'][_0x40fd04['partIndex']]]:_0xd895ae['changeGroups']['filter'](_0x3fbff5=>'pending'==_0x3fbff5['state']),_0x1c0835=_0x860b06['map'](_0x1686c4=>_0xd895ae['changeGroups']['indexOf'](_0x1686c4));if(!_0x1492d3||'$graveyard'==_0x1492d3['range']['root']['rootName'])return void _0x1c0835['forEach'](_0xa0910b=>_0xd895ae['setChangeGroupState'](_0xa0910b,'outdated'));_0x1c0835['forEach'](_0x568eda=>_0xd895ae['setChangeGroupState'](_0x568eda,'accepted'));const _0x48ed6d=rt({'editor':_0x1ef1f6,'reply':_0xd895ae,'interaction':_0x497a6d,'groups':_0x860b06,'transform':!0x0,'documentCompare':_0x1f9124,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x3eca13;_0x1492d3&&this['_scrollToSuggestionRange'](_0x1492d3['range']),_0x1ef1f6['model']['change'](_0x389dc4=>{_0x3eca13=_0x389dc4['batch'];for(const _0x2c8442 of _0x48ed6d)_0x2c8442['baseVersion']=_0x1ef1f6['model']['document']['version'],ot(_0x1ef1f6,_0x2c8442),_0x389dc4['batch']['addOperation'](_0x2c8442),_0x1ef1f6['model']['applyOperation'](_0x2c8442);}),this['_batchToChanges']['set'](_0x3eca13,{'interactionId':_0x497a6d['id'],'replyId':_0xd895ae['id'],'indexes':_0x1c0835['slice']()}),this['_updateRatings'](_0xd895ae);}['_openBalloonFor'](_0x180b68,_0x316606){const _0x1352a9=q(this['context']),_0x1df8bb=this['_getDocumentRangeForReplyChanges'](_0x180b68,_0x316606),_0x313871=this['context']['plugins']['get'](it);if(!_0x1df8bb)return void _0x313871['close']();const {range:_0xb21167,currentIndex:_0x22a4cf}=_0x1df8bb;if('$graveyard'==_0xb21167['root']['rootName']){const {reply:_0xc5a3ca}=this['getInteractionAndReplyById'](_0x180b68);return _0xc5a3ca['setChangeGroupState'](_0x22a4cf,'outdated'),void _0x313871['close']();}if(this['_previewedChangeGroup']?.['replyId']==_0x180b68&&this['_previewedChangeGroup']?.['partIndex']==_0x22a4cf)return;this['stopListening'](_0x313871),this['_previewedChangeGroup']={'replyId':_0x180b68,'partIndex':_0x22a4cf};let _0xaad111=_0x1352a9['config']['get']('ai.availableReplyActions')||[...H];_0x1352a9['plugins']['has']('TrackChanges')||(_0xaad111=_0xaad111['filter'](_0x22d6f6=>'insertSuggestion'!=_0x22d6f6));const _0x45fbf8=new F(_0x1352a9['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0,'availableActions':_0xaad111});this['stopListening'](_0x45fbf8);const {reply:_0xa2c4fb}=this['getInteractionAndReplyById'](_0x180b68),_0xcb1515=_0xa2c4fb['getContentParts']({'showDiff':this['_balloonShowDiff']})['filter'](_0x3f081c=>_0x3f081c['hasChanges']),_0x44af99=_0xcb1515['findIndex'](_0x5c658b=>_0x5c658b['index']==_0x22a4cf);if(-0x1==_0x44af99)return;const _0x2c89db=_0xcb1515[_0x44af99],_0x20782e=_0xcb1515['at']((_0x44af99-0x1)%_0xcb1515['length'])?.['index'],_0x59c407=_0xcb1515['at']((_0x44af99+0x1)%_0xcb1515['length'])?.['index'];_0x45fbf8['updateContent']({'parts':[_0x2c89db],'renderingStrategy':'static'});const _0x1b2855=_0x22a4cf!==_0x20782e;this['_scrollToSuggestionRange'](_0xb21167,!0x0),_0x313871['open']({'index':_0x22a4cf,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x44af99+0x1)['toString']()),'icon':Dt,'mainView':_0x45fbf8,'showRotator':_0x1b2855,'showApplyButton':!0x0,'showSuggestButton':_0x1352a9['plugins']['has']('TrackChanges'),'ranges':[_0xb21167]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x180b68,_0x22a4cf),this['listenTo'](_0x45fbf8,'toggleSuggestionDisplayMode',(_0x34a872,{showDiff:_0x3f632f})=>{this['_balloonShowDiff']=_0x3f632f;const {reply:_0x4afec3}=this['getInteractionAndReplyById'](_0x180b68),_0xd9e1f0=_0x4afec3['getContentParts']({'showDiff':_0x3f632f,'groupIndex':_0x22a4cf});_0x45fbf8['updateContent']({'parts':_0xd9e1f0,'renderingStrategy':'static'});}),this['listenTo'](_0x313871,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x180b68,'partIndex':_0x22a4cf}),_0x1b2855?this['_openBalloonFor'](_0x180b68,_0x59c407):_0x313871['close']();}),this['listenTo'](_0x313871,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x180b68,'partIndex':_0x22a4cf}),_0x1b2855?this['_openBalloonFor'](_0x180b68,_0x59c407):_0x313871['close']();}),_0x1b2855&&(this['listenTo'](_0x313871,'showNext',()=>{this['_openBalloonFor'](_0x180b68,_0x59c407);}),this['listenTo'](_0x313871,'showPrevious',()=>{this['_openBalloonFor'](_0x180b68,_0x20782e);})),this['listenTo'](_0x313871,'dialogClosed',()=>{this['stopListening'](_0x313871),this['stopListening'](_0x45fbf8),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x535d19,_0x5eb543){const _0x35e042=q(this['context']),{reply:_0x2b4312,interaction:_0x85561a}=this['getInteractionAndReplyById'](_0x535d19),_0x4beb03=_0x2b4312['changeGroups']['filter'](_0x27a982=>'pending'==_0x27a982['state']),_0x3fc994=_0x4beb03['map'](_0x5157e7=>_0x2b4312['changeGroups']['indexOf'](_0x5157e7));void 0x0===_0x5eb543&&(_0x5eb543=_0x3fc994[0x0]);const _0x1f3936=_0x3fc994['indexOf'](_0x5eb543);if(-0x1==_0x1f3936)return null;const _0x41051c=_0x4beb03[_0x1f3936],_0x4aa8be=new Ot([]),_0x1a1c57=new Ot([]);for(const _0x29aded of _0x41051c['changes'])if('removed'!=_0x29aded['type']&&_0x1a1c57['children']['push'](_0x29aded['node']['cloneNode'](!0x0)),'new'!=_0x29aded['type']){const _0xa85ba9=St(_0x2ec619=>wt(_0x2ec619,'data-id')==_0x29aded['id'],_0x2b4312['documentContextContent'],!0x0);_0x4aa8be['children']['push'](_0xa85ba9['cloneNode'](!0x0));}if(0x0==_0x4aa8be['children']['length']){if(_0x41051c['changes'][0x0]['anchorId']){const _0x1669b2=Rt('data-id',_0x41051c['changes'][0x0]['anchorId'],_0x2b4312['documentContextContent']);_0x4aa8be['children']['unshift'](_0x1669b2['cloneNode'](!0x0)),_0x1a1c57['children']['unshift'](_0x1669b2['cloneNode'](!0x0)),_0x1669b2['nextSibling']&&(_0x4aa8be['children']['push'](_0x1669b2['nextSibling']['cloneNode'](!0x0)),_0x1a1c57['children']['push'](_0x1669b2['nextSibling']['cloneNode'](!0x0)));}else{const _0x48a48a=_0x2b4312['documentContextContent']['children'][0x0];if(!_0x48a48a)return null;_0x4aa8be['children']['push'](_0x48a48a['cloneNode'](!0x0)),_0x1a1c57['children']['push'](_0x48a48a['cloneNode'](!0x0));}}const _0x23510d=_0x85561a['getDocumentContext'](),_0x316054=_0x35e042['data']['parse'](_0x23510d['content']),_0x2fc402=vt(_0x4aa8be),_0x38cdb3=_0x35e042['data']['parse'](_0x2fc402),_0xde7ae=_0x35e042['data']['parse'](_0x2fc402),_0x2b4e75=_0x35e042['model']['createPositionAt'](_0x38cdb3,0x0),_0x3034b8=vt(_0x1a1c57),_0x15a701={'anchor':_0x2b4e75,'markDeletions':!0x1},_0x507671=_0x35e042['plugins']['get'](nt)['getDiff'](_0x2fc402,_0x3034b8,_0x15a701)['getOperations']();if(!_0x507671['length'])return null;_0x35e042['model']['change'](_0x3908c7=>{for(const _0xd6b059 of _0x507671)if('remove'==_0xd6b059['type']){const _0x5358e7=_0xd6b059['sourcePosition'],_0x4894b3=_0xd6b059['howMany'],_0x49b32e=new lt(_0x5358e7,_0x4894b3);_0x3908c7['batch']['addOperation'](_0x49b32e),_0x35e042['model']['applyOperation'](_0x49b32e);}else'marker'!==_0xd6b059['type']&&(_0xd6b059['baseVersion']=null,_0xd6b059['isDocumentOperation']=!0x1,_0x3908c7['batch']['addOperation'](_0xd6b059),_0x35e042['model']['applyOperation'](_0xd6b059));});const _0x42c9c8=Et(_0x35e042,_0x507671,_0x38cdb3);yt(_0x35e042['model'],_0x42c9c8);const _0x453913=_0x42c9c8['getFirstRange']()['start']['path']['slice'](),_0x3fed9a=_0x42c9c8['getFirstRange']()['end']['path']['slice'](),_0x4ff096=[];let _0x3e417c=_0x38cdb3,_0x1846c0=_0xde7ae;for(let _0x358380=0x0;_0x358380<_0x3fed9a['length'];_0x358380++){const _0x2ab5eb=_0x3e417c['maxOffset']-_0x3fed9a[_0x358380];_0x4ff096[_0x358380]=_0x1846c0['maxOffset']-_0x2ab5eb,_0x3e417c=_0x3e417c['getChildAtOffset'](_0x3fed9a[_0x358380]),_0x1846c0=_0x1846c0['getChildAtOffset'](_0x4ff096[_0x358380]);}const _0x17c797=_0x35e042['model']['createRange'](_0x35e042['model']['createPositionFromPath'](_0xde7ae,_0x453913),_0x35e042['model']['createPositionFromPath'](_0xde7ae,_0x4ff096)),_0x134b36=_0xde7ae['getChild'](0x0)['getAttribute'](At),_0x187257=Array['from'](_0x316054['getChildren']())['find'](_0x2bee7f=>_0x2bee7f['getAttribute'](At)==_0x134b36)['getPath'](),_0x14e4bd=_0x17c797['start']['path']['slice'](),_0xcfecd9=_0x17c797['end']['path']['slice']();_0x14e4bd[0x0]=_0x187257[0x0]+_0x14e4bd[0x0],_0xcfecd9[0x0]=_0x187257[0x0]+_0xcfecd9[0x0];let _0x41c3a5=_0x35e042['model']['createRange'](_0x35e042['model']['createPositionFromPath'](_0x35e042['model']['document']['getRoot'](),_0x14e4bd),_0x35e042['model']['createPositionFromPath'](_0x35e042['model']['document']['getRoot'](),_0xcfecd9));const _0x13aafa=_0x35e042['model']['document']['history']['getOperations'](_0x23510d['version']);for(const _0x299601 of _0x13aafa)_0x41c3a5=ht['_createFromRanges'](_0x41c3a5['getTransformedByOperation'](_0x299601));return{'range':_0x41c3a5,'currentIndex':_0x5eb543};}['_integrateEditor'](_0x27c9b3){if(!_0x27c9b3['plugins']['has']('Undo'))return;const _0x12bba3=_0x27c9b3['commands']['get']('undo'),_0x1fbfb1=_0x27c9b3['commands']['get']('redo');this['listenTo'](_0x12bba3,'revert',(_0xbf73eb,_0x1649d4,_0x28e13d)=>{const _0x5314da=this['_batchToChanges']['get'](_0x1649d4);if(!_0x5314da)return;const _0x145d0b=this['activeConversation']['getInteraction'](_0x5314da['interactionId'])['getReply'](_0x5314da['replyId']);_0x5314da['indexes']['forEach'](_0x5e9406=>_0x145d0b['setChangeGroupState'](_0x5e9406,'pending')),this['_batchToChanges']['delete'](_0x1649d4),this['_batchToChanges']['set'](_0x28e13d,_0x5314da);}),this['listenTo'](_0x1fbfb1,'revert',(_0x33365,_0xbd486a,_0xda15d6)=>{const _0x421977=this['_batchToChanges']['get'](_0xbd486a);if(!_0x421977)return;const _0x135718=this['activeConversation']['getInteraction'](_0x421977['interactionId'])['getReply'](_0x421977['replyId']);_0x421977['indexes']['forEach'](_0x1d2eb5=>_0x135718['setChangeGroupState'](_0x1d2eb5,'accepted')),this['_batchToChanges']['delete'](_0xbd486a),this['_batchToChanges']['set'](_0xda15d6,_0x421977);});}async['loadConversation'](_0x43ef96){this['context']['plugins']['get'](it)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{await this['_aiConnector']['fetchConversation'](_0x43ef96)['getConversation'](),await this['_startConversationSafely'](_0x43ef96),this['updateConversationTitle']('\x20');const {sessionId:_0x1e8dba}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x43ef96,_0x1e8dba),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x17fb6c){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x43ef96}),this['_logError'](new _0x5cac2e('ai-chat-conversation-not-found',this,{'error':_0x17fb6c}));}finally{this['context']['plugins']['get'](ft)['view']['activateTab']('chat'),this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x378b37){this['activeConversation']['id']===_0x378b37&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0xa7a7fd=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0xa7a7fd),this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x3286c1,quickActionData:_0x541e99}){await this['_handleUIUserMessage']({'userMessage':_0x3286c1,'quickActionData':_0x541e99});}['getGroupId'](){const _0x91ee7c=this['context']['config']['get']('collaboration.channelId');if(!_0x91ee7c)throw new _0x5cac2e('ai-chat-missing-channel-id',this);return _0x91ee7c;}async['_startConversationSafely'](_0x1efd97){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x1efd97);}catch(_0x162ea6){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x1efd97||_0x1cb0e0()}),console['error'](_0x162ea6),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x3c6606){const _0x489a0b=this['context']['plugins']['get'](it);let _0x2f589f;_0x489a0b['isOpen']&&_0x489a0b['close'](),_0x3c6606||!this['activeConversation']?_0x2f589f=this['context']['config']['get']('ai.chat.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x2f589f=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x21b7e0=this['getGroupId'](),_0xc85ea2=_0x3c6606||_0x1cb0e0();this['activeConversation']=new Ct({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x2f589f,'conversationId':_0xc85ea2,'group':_0x21b7e0,'getEditor':()=>q(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x4f48f1,_0x552efd)=>{this['_aiChatUi']['createConversation'](_0x552efd),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x3c6606||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x2c85e0,_0x94d273)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x94d273['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x4d1c9f,_0x475182)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x475182);}),this['activeConversation']['on']('webSearchStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningStarted',()=>{this['_aiChatUi']['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('webSearchFinished',(_0x263ac0,_0xa295c)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0xa295c,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x20e6e7,_0x1ce036)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x1ce036,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x38abba,_0x435adc)=>{this['_aiChatUi']['removeFeedInteraction'](_0x435adc['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x2cc083,_0x4cb310,_0x357e15)=>{this['updateConversationTitle'](_0x4cb310,_0x357e15);}),this['activeConversation']['on']('replyCreated',(_0x3ea9b5,_0x913e0d)=>{'text-delta'===_0x913e0d['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x913e0d):this['_aiChatUi']['addFeedItemAISuggestion'](_0x913e0d);}),this['activeConversation']['on']('replyContentUpdated',async(_0x5f2522,_0x14c17d)=>{await this['_updateReplyContent']({'reply':_0x14c17d});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x4af490,{reply:_0x1b4d02,index:_0xec6540,state:_0xf55c37})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x1b4d02['id'],'index':_0xec6540,'state':_0xf55c37});}),this['activeConversation']['on']('contextItemAdded',(_0x22b1ac,_0x633a39)=>{if(this['_aiChatUi']['addContextItem'](_0x633a39['contextItem'],_0x633a39['isLoading']),'selection'===_0x633a39['contextItem']['type']){const _0x2bc5b4=[...q(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x2bc5b4,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x6337fe,_0x5cb31a)=>{this['_aiChatUi']['removeContextItem'](_0x5cb31a['uiId']),'current-document'==_0x5cb31a['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x5cb31a['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x1af88b,_0x877e27)=>{this['_aiChatUi']['setContextItemLoading'](_0x877e27['contextItem']['uiId'],_0x877e27['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x526d0d,_0xd963d9)=>{this['_aiChatUi']['setConversationContext'](_0xd963d9['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x207cae,_0x10c8b8)=>{this['_aiChatUi']['setAddContextOptions'](_0x10c8b8['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x7b1323,_0x447289)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x447289['sourceId'],_0x447289['source'],_0x447289['resources'],_0x447289['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x37c955,_0x988266)=>{this['_aiChatUi']['updateResourceState'](_0x988266['sourceId'],_0x988266['resourceId'],_0x988266['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x2c3f71,_0xee8c08)=>{this['_aiChatUi']['updateCapabilities'](_0xee8c08);}),this['activeConversation']['on']('modelSelected',(_0x597644,_0x2e449c)=>{this['_aiChatUi']['setSelectedModel'](_0x2e449c['selectedModel'],_0x2e449c['isDisabled']);}),this['activeConversation']['on']('error',(_0x12b05f,{error:_0x50442f,interactionId:_0x3ca1ff,fileName:_0x5c0865,url:_0x52c4e4,sourceId:_0x4ff57a,sourceLabel:_0x3c18ee})=>{const _0x476e5b=_0x3ca1ff?_0x3ca1ff+':'+_0x1cb0e0():_0x1cb0e0();_0x50442f['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x476e5b}):_0x50442f['message']['startsWith']('ai-chat-conversation-init-failed')||_0x50442f['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x476e5b}),this['_logError'](_0x50442f)):_0x50442f['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x5c0865),'id':_0x476e5b}):_0x50442f['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x52c4e4),'id':_0x476e5b}):_0x50442f['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x476e5b}):_0x50442f['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x476e5b}):_0x50442f['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x4ff57a&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x4ff57a),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x3c18ee||'source'),'id':_0x476e5b}),this['_logError'](_0x50442f)):_0x50442f['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x476e5b}),this['_logError'](_0x50442f)):_0x50442f['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x476e5b}),this['_logError'](_0x50442f)):_0x50442f['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x476e5b}),this['_logError'](_0x50442f)):_0x50442f['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x476e5b}),this['_logError'](_0x50442f)):_0x50442f['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':_0x476e5b}),this['_logError'](_0x50442f)):_0x50442f['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':_0x476e5b}),this['_logError'](_0x50442f)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x476e5b}),this['_logError'](_0x50442f));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x3c6606||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x331899,quickActionData:_0x504f1c}){if(!this['activeConversation'])throw new _0x5cac2e('ai-chat-controller-no-active-conversation');this['activeConversation']['isCurrentDocumentInContext']()&&await this['activeConversation']['updateCurrentDocumentInContext'](this['_aiEditing']['getDocumentData']()),this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x331899,'quickActionData':_0x504f1c}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x2cfc3c=q(this['context'])['model'],_0x2bfec6=Array['from'](_0x2cfc3c['markers']['getMarkersGroup'](Tt));_0x2cfc3c['change'](_0x58c4d5=>{_0x2bfec6['forEach'](_0x3f40b6=>_0x58c4d5['removeMarker'](_0x3f40b6));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0xa1592){this['_aiChatUi']['setIsMaximized'](_0xa1592);}['_logError'](_0x18ef21){_t(_0x18ef21['message']);}['_removeFromContext'](_0x235f89){this['activeConversation']?.['removeFromContext'](_0x235f89);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x5e30e0){const [_0x31da00,_0x300ef4]=_0x5e30e0['split'](':'),_0xf8d9a9=this['activeConversation']['getInteraction'](_0x31da00),_0x24fe16=_0xf8d9a9['getReply'](_0x300ef4);return{'interaction':_0xf8d9a9,'reply':_0x24fe16};}['_scrollToSuggestionRange'](_0x5a29b1,_0x2455c8=!0x1){const _0x2866fe=q(this['context']),_0x5173ee={'target':_0x2866fe['editing']['view']['domConverter']['viewRangeToDom'](_0x2866fe['editing']['mapper']['toViewRange'](_0x5a29b1)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x2455c8};_0x2455c8&&(_0x5173ee['alignToTop']=!0x0),_0x1a71b0(_0x5173ee);}['updateConversationTitle'](_0x46cfe7,_0x19eb28=!0x1){this['_aiChatUi']['setConversationTitle'](_0x46cfe7||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x19eb28);}async['_updateReplyContent']({reply:_0xe2cca0,renderingStrategy:_0x13210b}){const {id:_0x3a738a,isDone:_0x4e97e2,type:_0x2b9617,parsedContent:_0x534b37}=_0xe2cca0;if('modification-delta'===_0x2b9617){const _0x1dddcb=_0xe2cca0['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3a738a,'parts':_0x1dddcb,'renderingStrategy':_0x13210b,'isDone':_0x4e97e2});}else'text-delta'===_0x2b9617&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x3a738a,'parsedContent':_0x534b37,'renderingStrategy':_0x13210b,'isDone':_0x4e97e2});_0x4e97e2&&_0xe2cca0['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x3a738a,_0xe2cca0['sources']);}async['_stopLastInteraction'](){const _0xee619=this['activeConversation']?.['lastInteraction'];_0xee619&&(_0xee619['stop'](),this['_aiChatUi']['stopInteraction'](_0xee619));}async['_flushLastInteractionUI'](){const _0x5d9dd0=this['activeConversation']?.['lastInteraction'];if(_0x5d9dd0){for await(const _0x2e37eb of _0x5d9dd0['replies'])await this['_updateReplyContent']({'reply':_0x2e37eb,'renderingStrategy':'static'});}}['_updateRatings'](_0xa955dc){const _0x1ef8b7={'positiveCount':_0xa955dc['changeGroups']['filter'](_0x43b683=>'accepted'===_0x43b683['state'])['length'],'totalCount':_0xa955dc['changeGroups']['length'],'modificationId':_0xa955dc['id']},_0xbfb201=this['activeConversation']['getInteraction'](_0xa955dc['interactionId'])['messageId'];this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0xbfb201,_0x1ef8b7);}}const Mt=[...Ee,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class Le extends Fr{['containerView'];['actionsView'];constructor(_0x40ec9d,_0x180e52){super(_0x180e52),this['set']('isTrackChangesOn',!0x1),this['containerView']=new F(_0x40ec9d,{'showDiff':_0x180e52['showDiff'],'areActionsDisabled':_0x180e52['areActionsDisabled'],'availableActions':_0x180e52['availableActions']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x3e8399,_0x560f50)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x560f50['showDiff']});}),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',(_0x35d9ef,{index:_0x6be2c8})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x6be2c8});}),this['containerView']['on']('insertSuggestion',(_0x41bddc,{index:_0x28db9e})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x28db9e});}),this['containerView']['on']('rejectSuggestion',(_0x17ac45,{index:_0x203738})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x203738});}),this['containerView']['on']('mouseOverSuggestion',(_0x239a7c,{index:_0x4d4f69})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4d4f69});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x34b12c,{index:_0xc2291})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0xc2291});}),this['actionsView']=new ah(_0x40ec9d,this['options']['availableActions']),this['actionsView']['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn'),this['actionsView']['on']('showChangeInText',()=>{this['fire']('showChangeInText',{'replyId':this['options']['id']});}),this['actionsView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'replyId':this['options']['id']});}),this['actionsView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'replyId':this['options']['id']});}),_0x180e52['areActionsDisabled']?this['actionsView']['isEnabled']=!0x1:this['actionsView']['bind']('isEnabled')['to'](this['containerView']['bodyView'],'hasPendingParts'),this['children']['addMany']([this['containerView'],this['actionsView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x25d40d){await this['containerView']['updateContent'](_0x25d40d),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x32f76c,_0x1eac64){this['containerView']['bodyView']['updatePartState'](_0x32f76c,_0x1eac64);}['updateSources'](_0x32de69){this['containerView']['updateSources'](_0x32de69);}['getPartView'](_0x340d34){return this['containerView']['bodyView']['getPartView'](_0x340d34);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class Ve extends Fr{['replyContainer'];constructor(_0x21fb74,_0x586140){super(_0x586140),this['locale']=_0x21fb74,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x1f124f(),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':Je(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x3c8c57,renderingStrategy:_0x34793a,abortSignal:_0x4d696d}){'streaming'===_0x34793a?await this['streamIntoElement'](_0x3c8c57,this['replyContainer']['element'],_0x4d696d):this['replyContainer']['element']['innerHTML']=_0x1ff74f(_0x3c8c57);}['updateSources'](_0x2413e7){const _0x515d75=new Sr(this['locale']);_0x515d75['children']['addMany'](_0x2413e7['map'](_0x19d18b=>new qr(this['locale'],_0x19d18b))),_0x515d75['isVisible']=!0x0,this['children']['add'](_0x515d75);}}const bn={'file':_0x2286ef,'document':_0x327358,'web-resource':_0x3c7071,'text':_0x2286ef,'selection':_0x533588},Zr='ck-ai-chat-context-chip',ra='ck-ai-chat-context-chip_wide',oa='ck-ai-chat-context-chip_document',ca='ck-ai-chat-context-chip__label',la='ck-ai-chat-context-chip__type-icon',da='ck-ai-chat-context-controls__chip-tooltip',On='n';class Bo extends _0x5be5f6{constructor(_0x275212,_0x66e32,_0x40779e,_0x4c0bbd,_0xeadeab=!0x1){super(_0x275212),this['_isAnimationOnEnterEnabled']=_0x4c0bbd,this['_initializeProperties'](_0x66e32,_0x40779e,_0xeadeab),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'](_0x58378c,_0x2a2515,_0x54e612){this['set']('label',_0x58378c['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x58378c['type']),this['set']('id',_0x58378c['uiId']),this['set']('readonly',_0x2a2515),this['set']('isLoading',_0x54e612);}['_setupTemplate'](){const _0x3edaba=this['_createIconView'](),_0x1d899d=this['_createRemoveButton'](),_0x281ac1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x281ac1),'children':this['_createTemplateChildren'](_0x3edaba,_0x1d899d,_0x281ac1)});}['_createTemplateAttributes'](_0x3b05f1){return{'class':[Zr,_0x3b05f1['if']('itemType',oa,_0x4eeea3=>'document'==_0x4eeea3),_0x3b05f1['if']('itemType',ra,_0x1fcade=>'selection'==_0x1fcade)],'data-cke-tooltip-text':_0x3b05f1['to']('label',gn),'data-cke-tooltip-position':On,'data-cke-tooltip-class':da};}['_createTemplateChildren'](_0x82ccbc,_0x4c9bba,_0x151f03){const _0x12b1a7=this['_createLabelElement'](_0x151f03),_0x94787f=this['_createLoaderIcon']();return this['readonly']?[_0x82ccbc,_0x12b1a7]:[_0x82ccbc,_0x94787f,_0x12b1a7,_0x4c9bba];}['_createLabelElement'](_0x17c113){return{'tag':'span','attributes':{'class':ca},'children':[{'text':_0x17c113['to']('label')}]};}['_createRemoveButton'](){const _0x558038=new _0x5be5f6(this['locale']);return _0x558038['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0xeed3e4}),this['_setupRemoveButtonEvent'](_0x558038),_0x558038;}['_setupRemoveButtonEvent'](_0x18f353){_0x18f353['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x135fa5=this['bindTemplate'],_0x4c7a81=new _0x26d10b();return _0x4c7a81['content']=bn[this['itemType']],_0x4c7a81['extendTemplate']({'attributes':{'class':[la,_0x135fa5['if']('isLoading','ck-hidden',_0x52363c=>_0x52363c)]}}),_0x4c7a81;}['_handleAnimationEndOnce'](_0x78dbd6,_0x2d2837){if(!_0x78dbd6)return;const _0x57edce=()=>{_0x2d2837(),_0x78dbd6['removeEventListener']('animationend',_0x57edce),_0x78dbd6['removeEventListener']('webkitAnimationEnd',_0x57edce);};_0x78dbd6['addEventListener']('animationend',_0x57edce),_0x78dbd6['addEventListener']('webkitAnimationEnd',_0x57edce);}['_createLoaderIcon'](){const _0x36caeb=new qe('small');return _0x36caeb['bind']('isVisible')['to'](this,'isLoading',_0x4cab52=>_0x4cab52),_0x36caeb;}}function gn(_0x28ec0b){if(!_0x28ec0b)return _0x28ec0b;if(_0x28ec0b['length']<=0x78)return _0x28ec0b;const _0x485568=_0x28ec0b['slice'](0x0,0x78),_0x1ac19d=_0x485568['lastIndexOf']('\x20');return(_0x1ac19d>0x0?_0x485568['slice'](0x0,_0x1ac19d):_0x485568)+'…';}const wn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},dn='300px';class Ao{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x44bb26,_0x52c40d,_0x1ab30d,_0x1c5bfc,_0x1912ad){this['_locale']=_0x44bb26,this['_visibleChips']=_0x52c40d,this['_config']={...wn,..._0x1ab30d,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x1ab30d['cssClasses']}},this['_overflowChips']=new _0x128d2a(),this['_bodyCollection']=_0x1c5bfc,this['_parentView']=_0x1912ad||null;}['setContainerElement'](_0x24d998){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x24d998,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 _0xbef1d5=[...this['_visibleChips'],...this['_overflowChips']],_0x279e18=this['_createCalculationContainer'](),_0x13a4a2=this['_calculateOverflowInContainer'](_0x279e18,_0xbef1d5),_0x1348f5=_0x279e18['_ancestorsToRestore'];_0x1348f5&&this['_restoreAncestorVisibility'](_0x1348f5),_0x279e18['remove'](),this['_applyOverflowResults'](_0xbef1d5,_0x13a4a2);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x5e494e({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x3fc9dd=new _0x5be5f6(this['_locale']);_0x3fc9dd['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x440133=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x440133['push'](this['_config']['cssClasses']['controlsButton']),_0x3fc9dd['extendTemplate']({'attributes':{'class':_0x440133}}),_0x3fc9dd;}['_createShowMoreBalloonPanelView'](){const _0x56ebe5=new _0x134db1(this['_locale']);return _0x56ebe5['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x56ebe5),_0x56ebe5;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x20721c=>{_0x20721c['disableAnimationOnEnter']();});const _0x3b010b=new _0x1f124f(this['_locale']);_0x3b010b['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x3b010b);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x24b949=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x24b949?'':'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'](_0x60189f){const _0x3b7a4d=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0xccd290=this['_containerElement']?.['classList'];if(_0xccd290){const _0x3f4082=_0xccd290[0x0]||'',_0x131b91=_0x60189f['querySelector']('.'+_0x3f4082),_0xec776f=_0x60189f['querySelector'](_0x3b7a4d);return _0x131b91||_0xec776f||_0x60189f;}return _0x60189f['querySelector'](_0x3b7a4d)||_0x60189f;}['_calculateContainerWidth'](){const _0x538713=this['_parentView']?.['element']||this['_containerElement'];if(!_0x538713)return dn;const _0x15d65a=window['getComputedStyle'](_0x538713)['width'];if('auto'===_0x15d65a||'0px'===_0x15d65a||!_0x15d65a){const _0x5512fb=_0x538713['parentElement'];if(_0x5512fb){const _0x1b7f78=window['getComputedStyle'](_0x5512fb);return'auto'!==_0x1b7f78['width']?_0x1b7f78['width']:dn;}return dn;}return _0x15d65a;}['_applyCalculationStyles'](_0x49e3b3,_0x2172bd){this['_config']['cssClasses']['calculationContainer']&&_0x49e3b3['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x49e3b3['style']['width']=_0x2172bd,_0x49e3b3['style']['position']='absolute',_0x49e3b3['style']['top']='-9999px',_0x49e3b3['style']['left']='-9999px',_0x49e3b3['style']['opacity']='0',_0x49e3b3['style']['pointerEvents']='none',_0x49e3b3['style']['zIndex']='-1',_0x49e3b3['style']['visibility']='visible\x20!important',_0x49e3b3['style']['display']='block\x20!important',_0x49e3b3['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x2658e0){_0x2658e0['forEach'](({element:_0x5a0ea7,originalDisplay:_0x5751b4,originalVisibility:_0x167bf5})=>{_0x5a0ea7['style']['display']=_0x5751b4,_0x5a0ea7['style']['visibility']=_0x167bf5;});}['_makeAncestorsVisible'](_0x5e3782){const _0x2dc8e9=[];let _0x59252e=_0x5e3782;for(;_0x59252e&&_0x59252e!==document['body'];){const _0x14b5b8=window['getComputedStyle'](_0x59252e);'none'!==_0x14b5b8['display']&&'hidden'!==_0x14b5b8['visibility']||(_0x2dc8e9['push']({'element':_0x59252e,'originalDisplay':_0x59252e['style']['display'],'originalVisibility':_0x59252e['style']['visibility']}),_0x59252e['style']['display']='block',_0x59252e['style']['visibility']='visible'),_0x59252e=_0x59252e['parentElement'];}return _0x2dc8e9;}['_createContainerElements'](){let _0x15cb1c,_0xe6a02b;return this['_parentView']?.['element']?(_0x15cb1c=this['_parentView']['element']['cloneNode'](!0x0),_0xe6a02b=this['_findTargetContainer'](_0x15cb1c)):(_0x15cb1c=document['createElement']('div'),_0xe6a02b=_0x15cb1c),{'calculationContainer':_0x15cb1c,'targetContainer':_0xe6a02b};}['_createCalculationContainer'](){const {calculationContainer:_0x1833b0,targetContainer:_0x4df530}=this['_createContainerElements'](),_0x523d85=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x1833b0,_0x523d85);const _0x8068af=this['_parentView']?.['element']||this['_containerElement'],_0x5ef503=_0x8068af?.['parentElement'];_0x5ef503?_0x5ef503['appendChild'](_0x1833b0):document['body']['appendChild'](_0x1833b0),_0x1833b0['_targetContainer']=_0x4df530;const _0x358462=this['_makeAncestorsVisible'](_0x5ef503||null);return _0x1833b0['offsetWidth'],_0x1833b0['_ancestorsToRestore']=_0x358462,_0x1833b0;}['_calculateOverflowInContainer'](_0x309e61,_0x1e8be1){const _0x71af9e=_0x309e61['_targetContainer']||_0x309e61,_0x5079f6=[],{rowCount:_0x5a1d40}=this['_renderChipsAndCountRows'](_0x71af9e,_0x1e8be1);if(_0x5a1d40<=this['_config']['maxVisibleRows'])return _0x5079f6;const _0x52a18c=_0x1e8be1['slice']();for(;_0x52a18c['length']>0x0;){if(this['_testButtonFit'](_0x309e61,_0x71af9e,_0x52a18c)){const _0x3f0e96=_0x1e8be1['filter'](_0x49a6db=>!_0x52a18c['includes'](_0x49a6db));_0x5079f6['push'](..._0x3f0e96);break;}if(!_0x52a18c['pop']())break;}return _0x5079f6;}['_renderChipsAndCountRows'](_0x46c527,_0x472ba3){_0x46c527['innerHTML']='',_0x472ba3['forEach'](_0x511c9f=>{if(_0x511c9f['element']){const _0x24f62c=_0x511c9f['element']['cloneNode'](!0x0);_0x46c527['appendChild'](_0x24f62c);}}),_0x46c527['offsetWidth'];const _0x5e3d88=_0x46c527['children'],_0x4c3963=[];return Array['from'](_0x5e3d88)['forEach'](_0x3bc611=>{const _0x488dfe=_0x3bc611['getBoundingClientRect']()['top'];_0x4c3963['some'](_0x5d7f42=>Math['abs'](_0x5d7f42-_0x488dfe)<this['_config']['rowDetectionTolerance'])||_0x4c3963['push'](_0x488dfe);}),{'rowCount':_0x4c3963['length']};}['_createMockButton'](){const _0xfe9ae7=document['createElement']('button');return _0xfe9ae7['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0xfe9ae7['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0xfe9ae7['textContent']='+\x201',_0xfe9ae7;}['_testButtonFit'](_0x1ad01a,_0x573084,_0xbece91){this['_renderChipsAndCountRows'](_0x573084,_0xbece91);const _0x4f3369=this['_createMockButton']();_0x1ad01a['appendChild'](_0x4f3369),_0x1ad01a['offsetWidth'];const _0x36557c=[..._0x573084['children'],_0x4f3369],_0x5ad241=[];_0x36557c['forEach'](_0x5f7af7=>{const _0x57478c=_0x5f7af7['getBoundingClientRect']()['top'];_0x5ad241['some'](_0x4ed8e5=>Math['abs'](_0x4ed8e5-_0x57478c)<this['_config']['rowDetectionTolerance'])||_0x5ad241['push'](_0x57478c);});const _0x2062f7=_0x5ad241['length'];return _0x4f3369['remove'](),_0x2062f7<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x27a9aa,_0x496180){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x27a9aa['forEach'](_0x3990fe=>{_0x496180['includes'](_0x3990fe)?this['_overflowChips']['add'](_0x3990fe):this['_visibleChips']['add'](_0x3990fe);});}['_updateOverflowUI'](_0x4b02cd){if(_0x4b02cd>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x4b02cd>0x0&&this['_showMoreButtonView']){const _0x1dcccd=''+this['_config']['showMoreLabelPrefix']+(_0x4b02cd<0x63?_0x4b02cd:'99');this['_showMoreButtonView']['label']=_0x1dcccd;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x3c4901,_0xdc0b9e){this['_distributeChips'](_0x3c4901,_0xdc0b9e),this['_updateOverflowUI'](_0xdc0b9e['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x1a1098=>{_0x1a1098[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 _0x5f34c4=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x5f34c4['width']||0x0===_0x5f34c4['height'])return!0x1;const _0x2e84db=window['innerHeight']||document['documentElement']['clientHeight'],_0x9b19cc=window['innerWidth']||document['documentElement']['clientWidth'],_0x46a679=0xc8;return _0x5f34c4['bottom']>=-0xc8&&_0x5f34c4['top']<=_0x2e84db+_0x46a679&&_0x5f34c4['right']>=-0xc8&&_0x5f34c4['left']<=_0x9b19cc+_0x46a679;}}const ua='ck-ai-chat__feed__context-chips',_a='ck-ai-chat-context-chips-wrapper',Ia='ck-ai-chat-context-chips-wrapper-balloon',Aa='ck-ai-chat-controls-button',ga='ck-ai-chat-controls_context_show-more-button',Ea='ck-ai-chat-context-controls__show-more-balloon-panel';class _h extends _0x1f124f{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x3ad43a,_0x18c9ab,_0xe18109){super(_0x3ad43a),this['_bodyCollection']=_0xe18109,this['_createContextChips'](_0x18c9ab);const _0x10024d={'cssClasses':{'showMoreButton':ga,'showMoreBalloon':Ea,'overflowContainer':Ia,'controlsButton':Aa}};this['_overflowManager']=new Ao(_0x3ad43a,this['_contextChips'],_0x10024d,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[ua,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':_a},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x47634b=this['element']['querySelector']('.'+_a);_0x47634b&&(this['_overflowManager']['setContainerElement'](_0x47634b),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x2f029b){for(const _0x5e15b8 of _0x2f029b){const _0x131bc8=new Bo(this['locale'],_0x5e15b8,!0x0,!0x1);this['_contextChips']['add'](_0x131bc8);}}}class Me extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x1d4605,_0x110281,_0x2fb760){super(_0x110281),this['_locale']=_0x1d4605,this['_bodyCollection']=_0x2fb760,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'](_0x2bda84=>!_0x2bda84['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x1f124f(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 Lt extends Fr{['capabilities'];constructor(_0x2b163f,_0x159a30){super(_0x159a30);const {isWebSearchEnabled:_0x34bfeb,isReasoningEnabled:_0x1c9211}=_0x159a30['capabilities'],_0x45db25=[];let _0x1fc98c='';_0x34bfeb&&_0x1c9211?(_0x1fc98c=i(_0x2b163f,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x45db25['push'](aa(_0xcb7d20)),_0x45db25['push'](aa(_0x33af03))):_0x34bfeb?(_0x1fc98c=i(_0x2b163f,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x45db25['push'](aa(_0xcb7d20))):_0x1c9211&&(_0x1fc98c=i(_0x2b163f,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x45db25['push'](aa(_0x33af03))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x1fc98c?'':'ck-hidden']}});const _0x1234ac=new _0x1f124f();_0x1234ac['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x45db25,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x1fc98c]}]}),this['children']['add'](_0x1234ac),this['capabilities']=_0x159a30['capabilities'];}}function aa(_0x10f160){const _0x460991=new _0x26d10b();return _0x460991['content']=_0x10f160,_0x460991;}class Be extends _0x1f124f{constructor(_0x16792e,_0x12ac85){super(_0x16792e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x12ac85)});}['_createSkeletonItems'](_0x1a5272){const _0x29ac74=['ck','ck-ai-skeleton__item'];return _0x1a5272['map'](_0x46c03b=>{let _0x1c96bb='';switch(_0x46c03b['attributes']['align']){case'right':_0x1c96bb='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x1c96bb='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x1c96bb='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x46c03b['tag'],'attributes':{'class':[..._0x29ac74,_0x46c03b['attributes']['class']?_0x46c03b['attributes']['class']:''],'style':'width:\x20'+_0x46c03b['attributes']['width']+';\x20height:\x20'+_0x46c03b['attributes']['height']+';'+_0x1c96bb}};});}}const We={'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(_0x1426b1,_0x495b14,_0x36a4ef,_0x2fb367){return new Array(_0x1426b1)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x495b14,'height':_0x36a4ef,'align':_0x2fb367}}));}class pi extends _0x1f124f{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x43a17b,_0x28a3d3){super(_0x43a17b),this['_bodyCollection']=_0x28a3d3,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Mt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new us(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x3d92d0,_0x2c2b26){let _0x2e43c1;'ai-reply'===_0x3d92d0?_0x2e43c1=new Ve(this['locale'],_0x2c2b26):'ai-suggestion-reply'===_0x3d92d0?(_0x2e43c1=new Le(this['locale'],_0x2c2b26),_0x2e43c1['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn')):_0x2e43c1='user-message'===_0x3d92d0?new Me(this['locale'],_0x2c2b26,this['_bodyCollection']):'interaction-header'===_0x3d92d0?new Lt(this['locale'],_0x2c2b26):new Pe(_0x2c2b26),this['children']['add'](_0x2e43c1);}async['updateReplyItem']({id:_0x79b07d,parsedContent:_0x414cbe,renderingStrategy:_0x3afd94,abortSignal:_0x253ed0}){const _0x253763=this['getItemById'](_0x79b07d);if(!(_0x253763 instanceof Ve))throw new _0x5cac2e('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x253763,'id':_0x79b07d,'parsedContent':_0x414cbe});await _0x253763['updateContent']({'parsedContent':_0x414cbe,'renderingStrategy':_0x3afd94,'abortSignal':_0x253ed0});}async['updateWebSources'](_0x42096d,_0x57d456){const _0x2df64f=this['getItemById'](_0x42096d);if(_0x2df64f instanceof Le)_0x2df64f['updateSources'](_0x57d456);else{if(!(_0x2df64f instanceof Ve))throw new _0x5cac2e('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x2df64f,'id':_0x42096d,'sources':_0x57d456});_0x2df64f['updateSources'](_0x57d456);}}async['updateSuggestionItem']({id:_0x1c0cad,parts:_0xefc6e3,renderingStrategy:_0x5491fe,abortSignal:_0x59e3fb}){const _0x56af6e=this['getItemById'](_0x1c0cad);if(!(_0x56af6e instanceof Le))throw new _0x5cac2e('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x56af6e,'id':_0x1c0cad,'parts':_0xefc6e3});await _0x56af6e['updateContent']({'parts':_0xefc6e3,'renderingStrategy':_0x5491fe,'abortSignal':_0x59e3fb});}['updateSuggestionPartState']({id:_0x134db9,index:_0x1c0595,state:_0x1e04cd}){const _0x8dc4b6=this['getItemById'](_0x134db9);if(!(_0x8dc4b6 instanceof Le))throw new _0x5cac2e('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x134db9});_0x8dc4b6['updatePartState'](_0x1c0595,_0x1e04cd);}['markItemAsDone'](_0x4f3456){this['getItemById'](_0x4f3456)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x371318=>_0x371318['options']['id']);}['removeItem'](_0x4da6f8){this['children']['remove'](this['getItemById'](_0x4da6f8));}['scrollToSuggestion'](_0x36ef11,_0x462fc4){const _0x592901=this['getItemById'](_0x36ef11);if(!(_0x592901 instanceof Le))return void _0x200ccb('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x36ef11,'partIndex':_0x462fc4});const _0x19b59e=_0x592901['getPartView'](_0x462fc4);_0x19b59e?_0x1a71b0({'target':_0x19b59e['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x200ccb('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x36ef11,'partIndex':_0x462fc4});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x10d7c6=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x10d7c6,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x17f8f5=new Be(this['locale'],We['aiFeed']);return _0x17f8f5['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x7887b0=>!_0x7887b0)]}}),_0x17f8f5;}['_createFeedItems'](){const _0x54d221=new _0x1f124f(this['locale']);return _0x54d221['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x54d221;}['_createFeedLoader'](){const _0x40e925=new _0x1f124f(this['locale']);return _0x40e925['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x47f53f=>!_0x47f53f)]},'children':this['_createLoaderChildren']()}),_0x40e925;}['_createLoaderChildren'](){const _0x5a00dc=new qe();return _0x5a00dc['isVisible']=!0x0,[_0x5a00dc,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x5d8cef){const _0x9037f6=this['children']['find'](_0x1780ad=>_0x1780ad['options']['id']['includes'](_0x5d8cef));if(!_0x9037f6)throw new _0x5cac2e('ai-chat-feed-view-item-not-found',this,{'id':_0x5d8cef});return _0x9037f6;}['setLoadingMessage'](_0x14e9eb){this['set']('loadingMessage',_0x14e9eb);}['toggleLoadingSkeleton'](_0x304d85){this['set']('isLoadingSkeletonVisible',_0x304d85);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Vr extends _0x5f8d0a{['filter'](){let _0x5e7e71=0x0;for(const _0x12beb6 of this['items'])_0x5e7e71+=_0x12beb6['items']['length'];return{'resultsCount':_0x5e7e71,'totalItemsCount':_0x5e7e71};}}class ps extends _0x1018e6{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x517a64,_0x2923e8){super(_0x517a64,{'queryView':{'label':'','creator':_0x4f979b,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Vr(_0x517a64),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x2923e8,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ps['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ps['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',(_0x3b0339,_0x307dac)=>!_0x3b0339&&!_0x307dac),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0xbdc076,_0x3f4e78)=>{this['isUploadInProgress']||this['isEmpty']||_0xbdc076['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3f4e78());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x226afd=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x226afd)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x2fbc01=_0x257ef5(_0x226afd);this['fire']('sendUserMessage',_0x2fbc01),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x393edc){this['queryView']['fieldView']['set']('placeholder',_0x393edc);}['_createSubmitButton'](){const _0x594207=new _0x5be5f6(this['locale']);return _0x594207['set']({'icon':_0x265ec2,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x594207['on']('execute',()=>{this['submit']();}),_0x594207;}['setIsUploadInProgress'](_0x512613){this['isUploadInProgress']=_0x512613;}['_setUpAddContextButtonPositioning'](){const _0x503c39=this['locale'],_0x4bb8ce=()=>{_0x38b85c['window']['requestAnimationFrame'](()=>{if(_0x36678f(this['element'])){const _0x716f5e=new _0x2063b2(this['queryView']['fieldView']['element']),_0x5230d7=new _0x2063b2(this['_addContextButtonView']['element']),_0xf60876=_0x716f5e['width'],_0x53a591='rtl'===_0x503c39['uiLanguageDirection']?'right':'left';_0x716f5e['excludeScrollbarsAndBorders']();const _0x4b79d3=_0xf60876-_0x716f5e['width']+0x1;this['_addContextButtonView']['element']['style'][_0x53a591]='calc('+(_0xf60876-_0x5230d7['width']-_0x4b79d3)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x4bb8ce),this['on']('render',()=>{_0x4bb8ce(),this['_queryViewResizeObserver']=new _0x5e59a0(this['queryView']['fieldView']['element'],()=>{_0x4bb8ce();});});}}const ma='ck-ai-chat__prompt-capabilities',pa='ck-ai-chat-controls-button',Ta='ck-ai-chat-controls-button--commands',Ca='ck-ai-chat-controls__model-selection',wa='ck-ai-chat-controls__model-selection__item-name',fa='ck-ai-chat-controls__model-selection__item-description',Sa='ck-ai-chat-controls__model-selection__item-capabilities',Oa='n';class ms extends _0x1f124f{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x5401f5){super(_0x5401f5),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorVisible',!0x0),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,'modelSelectorVisible',_0x5c1ea7=>_0x5c1ea7),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x5f4e1a=>_0x5f4e1a?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x40b0a4=>_0x40b0a4),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x1f68a1=>_0x1f68a1),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x1fa87b=>!_0x1fa87b),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x5dcf26=>i(this['locale'],_0x5dcf26?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x45b995=>_0x45b995),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x3e0fe7=>!_0x3e0fe7),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x431d25=>i(this['locale'],_0x431d25?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ma]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x128d2a(),_0x8575d7(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x8c509c,_0x254488){if(this['set']('modelSelectorVisible',!(_0x254488&&_0x8c509c['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x8c509c?.['length']){const _0x448dc3=oe['getLocalized'](this['locale'],_0x8c509c);for(const _0x14507b of _0x448dc3){const _0xfdcaf6=new _0x2b6af7({'label':_0x14507b['name'],'withText':!0x0,'role':'menuitemradio','id':_0x14507b['id'],'model':_0x14507b});_0xfdcaf6['bind']('isOn')['to'](this,'activeModelId',_0x4c60b7=>_0x4c60b7===_0x14507b['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xfdcaf6,'labelView':new ba(this['locale'],_0x14507b)});}}}['setWebSearch'](_0x18a01f){this['set']('webSearchActive',_0x18a01f);}['setReasoning'](_0x59be11){this['set']('reasoningActive',_0x59be11);}['setModel'](_0x41dd11){if(!_0x41dd11)return;this['activeModelId']=_0x41dd11['id'],this['activeModelName']=_0x41dd11['name']||_0x41dd11['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x41dd11['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x41dd11['name']);const _0x5085cd=_0x41dd11['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x5085cd),this['_webSearchButton']['set']('isVisible',_0x5085cd);const _0x4c71e7=_0x41dd11['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x4c71e7),this['_reasoningButton']['set']('isVisible',_0x4c71e7);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x14fea8){this['set']('modelSelectorEnabled',!0x1),_0x14fea8&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x107c8d=new _0x5be5f6();return _0x107c8d['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0xcb7d20,'class':pa,'isToggleable':!0x0,'tooltipPosition':Oa}),_0x107c8d['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x107c8d;}['_createReasoningButton'](){const _0x21be72=new _0x5be5f6();return _0x21be72['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x33af03,'class':pa,'isToggleable':!0x0,'tooltipPosition':Oa}),_0x21be72['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x21be72;}['_createCommandsButton'](){const _0x5523b9=new _0x5be5f6();return _0x5523b9['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':Dt,'withText':!0x0,'class':pa,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Oa}),_0x5523b9['extendTemplate']({'attributes':{'class':[Ta]}}),_0x5523b9['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x5523b9;}['_createModelSelectionDropdown'](){const _0x5cc01a=_0x12dfeb(this['locale']);return _0x5cc01a['set']({'panelPosition':'ne','class':[Ca]}),_0x5cc01a['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Oa}),this['listenTo'](_0x5cc01a,'execute',_0xdc360b=>{this['fire']('selectModel',_0xdc360b['source']['model']);}),_0x5cc01a;}['_createModelNameView'](){const _0x48bc9f=new Ko(this['locale']);return _0x48bc9f['bind']('text')['to'](this,'activeModelName',_0x47dae7=>_0x47dae7??''),_0x48bc9f['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x3c7714,_0x507946)=>!_0x3c7714&&!_0x507946?.['toLowerCase']()['startsWith']('agent')),_0x48bc9f;}}let ba=class extends _0x3a2a12{constructor(_0xf551ee,_0x591d7e){super();const _0xb9eee2=this['bindTemplate'],_0x3bd5d3=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0xb9eee2['to']('style'),'id':_0xb9eee2['to']('id')},'children':[{'tag':'div','attributes':{'class':[wa]},'children':[{'text':_0xb9eee2['to']('text')}]},{'tag':'div','attributes':{'class':[fa]},'children':[{'tag':'span','children':[{'text':_0x591d7e['description']}]}]},{'tag':'div','attributes':{'class':[Sa]},'children':_0x3bd5d3}]}),_0x3bd5d3['addMany'](this['_getCapabilityParts'](_0xf551ee,_0xcb7d20,'AI_CHAT_SEARCH_WEB',_0x591d7e['capabilities']['webSearch']?.['enabled']??!0x1)),_0x3bd5d3['addMany'](this['_getCapabilityParts'](_0xf551ee,_0x33af03,'AI_CHAT_REASONING',_0x591d7e['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x3069c3,_0x1dab00,_0x1afa21,_0x295fe){const _0x342037=new _0x26d10b();_0x342037['content']=_0x1dab00;const _0x363dd3=new _0x1f124f(_0x3069c3);_0x363dd3['setTemplate']({'tag':'span','children':[{'text':i(_0x3069c3,_0x1afa21)+':\x20'}]});const _0x10ad06=new _0x1f124f(_0x3069c3);return _0x10ad06['setTemplate']({'tag':'span','children':[{'text':i(_0x3069c3,_0x295fe?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x342037,_0x363dd3,_0x10ad06];}};class Ko extends _0x1f124f{constructor(_0x4e9f31){super(_0x4e9f31),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x3c36ca=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x3c36ca['if']('isVisible','ck-hidden',_0x40196c=>!_0x40196c)]},'children':[{'text':_0x3c36ca['to']('text')}]});}}const Ra='ck-ai-chat-context-controls__url-form',Na='ck-ai-chat-context-controls__url-input-section';class To extends _0x1f124f{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x47e2a3){super(_0x47e2a3),this['focusTracker']=new _0x5e98a3(),this['keystrokes']=new _0x3678f9(),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 _0x12ca41({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x34038f=>{this['focusTracker']['add'](_0x34038f['element']),this['keystrokes']['listenTo'](_0x34038f['element']);}),_0x4ef42a({'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'](_0x2cd8af){this['urlInputField']['errorText']=_0x2cd8af,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x4b7136=new _0x5be5f6(this['locale']);return _0x4b7136['set']({'icon':_0x31357f,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x4b7136;}['_createUrlInputField'](){const _0xb9832a=new _0x448875(this['locale'],_0x156742);return _0xb9832a['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0xb9832a['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0xb9832a;}['_createConfirmButton'](){const _0x4e9448=new _0x5be5f6(this['locale']);return _0x4e9448['set']({'icon':_0x2e7acd,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x4e9448;}['_setupTemplate'](){const _0x38d106=new _0xb4a1f4(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'});_0x38d106['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Ra,'tabindex':'-1'},'children':[_0x38d106,{'tag':'div','attributes':{'class':Na},'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',_0x2a5ebb=>{_0x2a5ebb['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x2ce22e,_0x393bc7)=>{this['clear'](),this['fire']('cancel'),_0x393bc7();});}['_handleSubmit'](){const _0x3558a6=this['getValue']()['trim']();_0x3558a6?this['_isValidUrl'](_0x3558a6)?(this['clearError'](),this['fire']('submitUrl',_0x3558a6)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x8a4818=this['getValue']()['trim'](),_0x1f9fb8=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x8a4818['length']>0x0&&!_0x1f9fb8;}['_isValidUrl'](_0x3337ad){try{return!!new URL(_0x3337ad);}catch{return!0x1;}}}const ka='ck-ai-chat-resources__item',ya='ck-ai-chat-resources__item--in-context',va='ck-ai-chat-resources__item-title',xa='ck-ai-chat-resources__item__icon';class tc extends _0x19da3d{['resource'];['_titleView'];['_iconView'];constructor(_0x44f11f,_0xeed97e){super(_0x44f11f),this['resource']=_0xeed97e,this['set']('isInContext',!!_0xeed97e['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x56e5ad){if(_0x56e5ad['isInContext'])return _0x2e7acd;switch(_0x56e5ad['type']){case je['DOCUMENT']:return _0x327358;case je['URL']:return _0x3c7071;case je['FILE']:case je['TEXT']:return _0x2286ef;default:return _0x3c36c7;}}['highlightText'](_0x538899){if(!_0x538899||''===_0x538899['trim']())return void this['_titleView']['highlightText'](null);const _0x1f7754=new RegExp(_0x38bbb1(_0x538899),'gi');this['_titleView']['highlightText'](_0x1f7754);}['updateResourceState'](_0x339b84){this['resource']['isInContext']=_0x339b84,this['isInContext']=_0x339b84,this['_updateIcon']();}['_createTitleView'](){const _0x5d39d0=new _0x1df954();return _0x5d39d0['text']=this['resource']['label'],_0x5d39d0['extendTemplate']({'tag':'span','attributes':{'class':[va]}}),_0x5d39d0;}['_createIconView'](){const _0xd8f7e6=new _0x26d10b();return _0xd8f7e6['content']=this['getResourceIcon'](this['resource']),_0xd8f7e6;}['_setupTemplate'](){const _0x3e0bc4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[ka,_0x3e0bc4['if']('isVisible','ck-hidden',_0x1d5df0=>!_0x1d5df0),_0x3e0bc4['if']('isInContext',ya)]},'children':[{'tag':'div','attributes':{'class':[xa]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x3e0bc4['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const La='ck-ai-chat-resources__list';class Ur extends _0x5f8d0a{['_source'];constructor(_0x54b826,_0x1edadb){super(_0x54b826),this['_source']=_0x1edadb,this['extendTemplate']({'attributes':{'class':[La]}});}['setResources'](_0x2d2770,_0x52fa46){this['items']['clear']();let _0x1bc555=_0x2d2770;if(this['_source']['useDefaultFiltering']&&_0x52fa46&&''!==_0x52fa46['trim']()){const _0xdade8a=new RegExp(_0x52fa46['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x1bc555=_0x2d2770['filter'](_0x385147=>_0xdade8a['test'](_0x385147['label']));}for(const _0x4e502a of _0x1bc555){const _0x67043a=new tc(this['locale'],_0x4e502a);_0x67043a['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x4e502a);}),this['items']['add'](_0x67043a);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x52fa46);}['highlightText'](_0x5246f9){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x100b0f=>{_0x100b0f['highlightText'](_0x5246f9);});}['updateResourceState'](_0x1ef1df,_0x3b7fa1){for(const _0x3ec547 of this['items']){const _0x232ab5=_0x3ec547;_0x232ab5['resource']['id']===_0x1ef1df&&_0x232ab5['updateResourceState'](_0x3b7fa1);}}['_handleResourceSelection'](_0x5e51f0,_0x234378){this['fire']('addResourceToContext',{'source':_0x5e51f0,'resource':_0x234378});}}class zr extends _0x448875{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x1a9a7e){const t=_0x1a9a7e['t'],_0x4da2f9={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x156742,'label':i(_0x1a9a7e,'AI_CHAT_SEARCH_RESOURCES')};super(_0x1a9a7e,_0x4da2f9['creator']),this['label']=_0x4da2f9['label'],this['_viewConfig']=_0x4da2f9,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x1a9a7e,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x8856ae){this['fire']('search',_0x8856ae);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x26d10b(),this['iconView']['content']=_0x115b67,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0xe1f5a8,t){this['resetButtonView']=new _0x5be5f6(_0xe1f5a8),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x15e321,'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',_0x92ee58=>!_0x92ee58),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 Or extends _0x1f124f{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x323617,_0x5f1f25){super(_0x323617),this['_source']=_0x5f1f25['source'],this['_searchInputVisibleFrom']=_0x5f1f25['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 _0x840caa([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new zr(this['locale']);}['_createSearchSection'](){const _0x1b1706=new _0x1f124f(this['locale']);return _0x1b1706['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x206127,_0x14acd0)=>{this['loadResources'](_0x14acd0),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x14acd0);}),_0x1b1706;}['_createResourcesListView'](){const _0x57041b=new Ur(this['locale'],this['_source']);return _0x57041b['delegate']('addResourceToContext')['to'](this),_0x57041b['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x57041b;}['_createSkeletonView'](){const _0x5ae3ee=new Be(this['locale'],We['aiChatResources']);return _0x5ae3ee['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x5536d0=>!_0x5536d0)]}}),_0x5ae3ee;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x393ba3){const _0x44b577=_0x1cb0e0();this['_latestLoadResourcesUid']=_0x44b577,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x393ba3,'uid':_0x44b577}),this['isLoading']=!0x0;}['setResources'](_0x2a6ffa,_0x951607){if(_0x951607&&_0x951607!==this['_latestLoadResourcesUid'])return;const _0xc7c245=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x2a6ffa,_0xc7c245),_0x2a6ffa['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x3cf7a2,_0x40501c){this['_resourcesListView']['updateResourceState'](_0x3cf7a2,_0x40501c);}}const Da='ck-ai-chat-context-controls__source-balloon-panel',Pa='ck-button-icon\x20ck-button-back',Ha='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class ko{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0xf6426b,_0x16a818,_0x35921d){this['_locale']=_0xf6426b,this['_bodyCollection']=_0x16a818,this['_config']=_0x35921d;}['showSourceResourcesBalloon'](_0x35b549){let _0x57dbd6=this['_sourceResourceBalloons']['get'](_0x35b549['id']);_0x57dbd6||(_0x57dbd6=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x35b549['id'],_0x57dbd6),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x57dbd6)),this['_addSourceResourceContent'](_0x57dbd6,_0x35b549),_0x57dbd6['show']();const _0x4c4612=this['_config']['getTargetElement']();_0x4c4612&&_0x57dbd6['pin']({'target':_0x4c4612,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x2de1d0,_0xdac77c,_0x297ca5){const _0xbe3ed7=this['_sourceResourceBalloons']['get'](_0x2de1d0);if(!_0xbe3ed7)return;const _0x251a8c=this['_getResourcesViewFromBalloon'](_0xbe3ed7);_0x251a8c&&(_0x251a8c['setResources'](_0xdac77c,_0x297ca5),_0x251a8c['once']('change:isLoading',()=>{_0xbe3ed7['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x5618ec){const _0x1fa2dc=this['_sourceResourceBalloons']['get'](_0x5618ec);_0x1fa2dc&&requestAnimationFrame(()=>{_0x1fa2dc['hide'](),this['_sourceResourceBalloons']['delete'](_0x5618ec),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x5d1a86 of this['_sourceResourceBalloons']['values']())if(_0x5d1a86['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x582468,_0x4d691c,_0x46b7e2){const _0x3057a4=this['_sourceResourceBalloons']['get'](_0x582468);if(!_0x3057a4||!_0x3057a4['isVisible'])return;const _0x428d5f=this['_config']['getTargetElement']();if(!_0x428d5f)return;_0x3057a4['pin']({'target':_0x428d5f,'limiter':this['_config']['getLimiterElement']()});const _0x2d1d4d=this['_getResourcesViewFromBalloon'](_0x3057a4);_0x2d1d4d&&_0x2d1d4d['updateResourceState'](_0x4d691c,_0x46b7e2);}['destroy'](){for(const _0x5b7e4a of this['_sourceResourceBalloons']['values']())_0x5b7e4a['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x25b5f8=new _0x134db1(this['_locale']);return _0x25b5f8['extendTemplate']({'attributes':{'class':Da}}),this['_bodyCollection']['add'](_0x25b5f8),_0x25b5f8;}['_addSourceResourceContent'](_0x3d047,_0x363f51){_0x3d047['content']['clear']();const _0x2ee83f=this['_createBalloonHeader'](_0x3d047,_0x363f51);_0x3d047['content']['add'](_0x2ee83f);const _0x98df36=this['_createBalloonResourcesView'](_0x363f51);_0x3d047['content']['add'](_0x98df36);}['_createBalloonHeader'](_0x127a9a,_0x439080){const _0x1ef23d=this['_createBackButton'](_0x127a9a),_0x138468=new _0xb4a1f4(this['_locale'],{'label':_0x439080['label'],'class':Ha});return _0x138468['children']['add'](_0x1ef23d,0x0),_0x138468;}['_createBackButton'](_0x400833){const _0x405b23=new _0x5be5f6(this['_locale']);return _0x405b23['set']({'icon':_0x31357f,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Pa}),_0x405b23['on']('execute',()=>{_0x400833['hide'](),this['_config']['onBackToContext']();}),_0x405b23;}['_createBalloonResourcesView'](_0x29f62d){const _0x5ae67f=new Or(this['_locale'],{'source':_0x29f62d,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x5ae67f['on']('loadSourceResources',(_0x1de5ae,_0x1a9983)=>{this['_config']['onLoadSourceResources'](_0x1a9983);}),_0x5ae67f['on']('addResourceToContext',(_0x544d92,_0x3cb841)=>{this['_config']['onResourceSelected'](_0x3cb841['source'],_0x3cb841['resource']),this['closeSourceResourceBalloon'](_0x29f62d['id']);}),_0x5ae67f;}['_getResourcesViewFromBalloon'](_0x465ff6){const _0x36049e=_0x465ff6['content']['get'](0x1);return _0x36049e instanceof Or?_0x36049e:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x20cc61){_0x5e494e({'emitter':_0x20cc61,'contextElements':[_0x20cc61['element']],'callback':()=>{_0x20cc61['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x20cc61['isVisible']});}}const gs=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],Eo='ck-ai-chat-context-controls',vo='ck-ai-chat-context-controls__pending-contexts',Vo='ck-ai-chat-context-controls__add-context-balloon-panel',Io='ck-ai-chat-context-controls__add-context-button',Po='ck-ai-chat-context-controls__url-balloon-panel',Ro='ck-ai-chat-context-controls__balloon-button',Uo='ck-ai-chat-context-controls__balloon-button-source',Lo='ck-ai-chat-controls-button',No='ck-ai-chat-context-chips-wrapper-balloon',Oo='ck-ai-chat-controls_context_show-more-button',Mo='ck-ai-chat-context-controls__show-more-balloon-panel',Ho='ck-ai-chat',jo=[_0x134db1['defaultPositions']['northArrowSouthWest'],_0x134db1['defaultPositions']['northArrowSouth'],_0x134db1['defaultPositions']['northArrowSouthEast'],_0x134db1['defaultPositions']['southArrowNorthWest'],_0x134db1['defaultPositions']['southArrowNorth'],_0x134db1['defaultPositions']['southArrowNorthEast']];class bs extends _0x1f124f{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x29c65f,_0x3fcc46){super(_0x29c65f),this['bodyCollection']=_0x3fcc46['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x29c65f),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x29c65f),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x29c65f),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x29c65f,_0x3fcc46);const _0x346a7a={'cssClasses':{'showMoreButton':Oo,'showMoreBalloon':Mo,'overflowContainer':No,'controlsButton':Lo}};this['_overflowManager']=new Ao(_0x29c65f,this['_currentContextsChips'],_0x346a7a,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'](_0x5442f3,_0x21f11e){const _0x4a4e=this['_createContextButton'](_0x5442f3,'current',!0x0,_0x21f11e);this['_addContextToCollection'](_0x4a4e,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0xe26eb0){this['_removeContextFromCollection'](_0xe26eb0,this['_currentContextsChips']),this['_removeContextFromCollection'](_0xe26eb0,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x47ae19,_0x3d89cc){let _0xa83286=this['_currentContextsChips']['find'](_0x47e401=>_0x47e401['id']===_0x47ae19);_0xa83286||(_0xa83286=this['_overflowManager']['overflowChips']['find'](_0x1a4c86=>_0x1a4c86['id']===_0x47ae19)),_0xa83286&&(_0xa83286['isLoading']=_0x3d89cc);}['setConversationContext'](_0x5334bf){this['_conversationContextsChips']['clear']();for(const _0x3af0c3 of _0x5334bf){const _0x5286f2=this['_createContextButton'](_0x3af0c3,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x5286f2,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0xd618d3,_0x4fa7e2,_0x1c2265){this['_resourcesBalloonView']['updateResourceState'](_0xd618d3,_0x4fa7e2,_0x1c2265);}['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'](_0x97b38f){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x97b38f),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x566c6a,_0x5b545d,_0x467e9a,_0x1c71d2){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x566c6a,_0x467e9a,_0x1c71d2);}['closeSourceResourceBalloon'](_0x143dd2){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x143dd2),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x4d42ff){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x4d42ff),this['_setAddContextButtonEnabled'](_0x4d42ff);}['_setAddContextButtonEnabled'](_0x9c2e8d){const _0x1b5747=!_0x9c2e8d['document']['isHidden']&&_0x9c2e8d['document']['enabled'],_0x541a1b=_0x9c2e8d['urls']['enabled'],_0x1f9fc0=_0x9c2e8d['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x1b5747||_0x541a1b||_0x1f9fc0;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Eo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':vo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x212d58){const _0x189ea3=new _0x5be5f6(_0x212d58);return _0x189ea3['set']({'label':i(_0x212d58,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Lo+'\x20'+Io,'icon':_0x28b660,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x189ea3;}['_createAddContextBalloonPanelView'](_0x278261){return this['_createBaseBalloonPanel'](_0x278261,Vo);}['_createUrlBalloonPanelView'](_0x489bb5){const _0x52a2be=this['_createBaseBalloonPanel'](_0x489bb5,Po);return this['_addUrlContent'](_0x52a2be,_0x489bb5),_0x52a2be;}['_createResourcesBalloonView'](_0x6c1d21,_0x52777a){const _0x294ace={'searchInputVisibleFrom':_0x52777a['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});},'onResourceSelected':(_0xf8b12e,_0x261055)=>{this['fire']('addResourceToContext',{'source':_0xf8b12e,'resource':_0x261055});},'onLoadSourceResources':_0x7dde46=>{this['fire']('loadSourceResources',_0x7dde46);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new ko(_0x6c1d21,_0x52777a['bodyCollection'],_0x294ace);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Ho)||document['body'];}['_createBaseBalloonPanel'](_0x2b86d9,_0x2c7ddb){const _0x5ed46d=new _0x134db1(_0x2b86d9);return _0x5ed46d['extendTemplate']({'attributes':{'class':_0x2c7ddb}}),this['bodyCollection']['add'](_0x5ed46d),_0x5ed46d;}['_setBalloonPanelContent'](_0x390af7,_0x38a20a,_0x365bbf){if(_0x390af7['content']['clear'](),!_0x365bbf['document']['isHidden']&&_0x365bbf['document']['enabled']){const _0x1b0cad=this['_createBalloonButton'](_0x38a20a,{'label':i(_0x38a20a,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x327358});_0x1b0cad['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x390af7['content']['add'](_0x1b0cad);}if(_0x365bbf['urls']['enabled']){const _0x2094c2=this['_createBalloonButton'](_0x38a20a,{'label':i(_0x38a20a,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x3c7071});_0x2094c2['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo}),this['_urlInputView']['focus']();}),_0x390af7['content']['add'](_0x2094c2);}if(_0x365bbf['files']['enabled']){const _0x70a044=new _0x5337e2(_0x38a20a);_0x70a044['set']({'label':i(_0x38a20a,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x38bdbd,'withText':!0x0,'tooltip':!0x0,'class':Ro,'allowMultipleFiles':!0x0}),_0x70a044['on']('done',(_0x1db55d,_0x5f27da)=>{this['fire']('addFileToContext',_0x5f27da),this['hideAddContextBalloonPanel']();}),_0x70a044['tooltip']=!0x0,_0x390af7['content']['add'](_0x70a044);}for(const _0x2fdd29 of _0x365bbf['sources']){const _0x52bbb6=this['_createBalloonButton'](_0x38a20a,{'label':_0x2fdd29['label'],'icon':_0x2fdd29['icon']||_0x3c36c7,'type':'source'});_0x390af7['content']['add'](_0x52bbb6),_0x52bbb6['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x2fdd29);});}}['_addUrlContent'](_0x47b1b7,_0x29b20d){this['_urlInputView']=new To(_0x29b20d),this['_urlInputView']['on']('submitUrl',(_0x5ec93d,_0xd7d536)=>{this['_handleUrlSubmit'](_0xd7d536);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});}),_0x47b1b7['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x56de36,_0x1a27b3){const _0x1eca5c='source'===_0x1a27b3['type']?new Ma(_0x56de36):new _0x5be5f6(_0x56de36);return _0x1eca5c['set']({'label':_0x1a27b3['label'],'icon':_0x1a27b3['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Ro}),_0x1eca5c;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x5e494e({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x1aade8){const _0x337c27=this['_addContextBalloonConfig'];_0x337c27['buttonView']['isOn']=_0x1aade8,_0x1aade8?_0x337c27['balloonView']['show']():_0x337c27['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x259e46,buttonView:_0x4e45ed,hideMethod:_0x58fdaa}=this['_addContextBalloonConfig'];_0x5e494e({'emitter':_0x259e46,'contextElements':[_0x259e46['element'],_0x4e45ed['element']],'callback':()=>{_0x58fdaa();},'activator':()=>_0x4e45ed['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x3856ea,_0x4cc372,_0xdd5df=!0x1,_0x123a54=!0x1){const _0x1403e0='conversation'===_0x4cc372||!0x0===_0x3856ea['isReadOnly'],_0x52b900=new Bo(this['locale'],_0x3856ea,_0x1403e0,_0xdd5df,_0x123a54);return _0x1403e0||_0x52b900['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x52b900['id']);}),_0x52b900;}['_addContextToCollection'](_0x1e930c,_0x534881){_0x534881['add'](_0x1e930c,0x0);}['_removeContextFromCollection'](_0x3e0533,_0x429e15){const _0x171d24=_0x429e15['find'](_0x45cb23=>_0x45cb23['id']===_0x3e0533);_0x171d24&&_0x429e15['remove'](_0x171d24);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo}));}['_handleUrlSubmit'](_0x4196fd){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x4196fd);}}class Ma extends _0x5be5f6{['arrowView'];constructor(_0x4353ea){super(_0x4353ea),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Uo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x263d4f=new _0x26d10b();return _0x263d4f['content']=_0x4deb05,_0x263d4f['extendTemplate']({'attributes':{'class':Uo+'__arrow'}}),_0x263d4f;}}class _s extends _0x1f124f{['_cancelButtonView'];['_loaderView'];constructor(_0x490593){super(_0x490593),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 _0xd31131=new _0x5be5f6(this['locale']);return _0xd31131['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x4a18d1}),_0xd31131['on']('execute',()=>{this['fire']('abortPromptStream');}),_0xd31131;}['_createLoaderView'](){const _0x59bcb0=new _0x1f124f(this['locale']);return _0x59bcb0['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')}]}),_0x59bcb0;}}class ji extends _0x1f124f{['_displayedModels']=[];['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x39e3c3,_0x4fd0a9){super(_0x39e3c3),this['_contextPanelView']=this['_createContextPanelView'](_0x39e3c3,{'bodyCollection':_0x4fd0a9['bodyCollection'],'searchInputVisibleFrom':_0x4fd0a9['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x39e3c3),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x39e3c3),this['_loaderView']=this['_createLoaderView'](_0x39e3c3),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x39e3c3),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...gs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x4dadfa=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x4dadfa['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x4dadfa['if']('isLoading','ck-hidden',_0x399b4f=>_0x399b4f||!this['isModelAvailable']),_0x4dadfa['if']('isModelAvailable','ck-hidden',_0x46986b=>!_0x46986b||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x4dadfa['if']('isLoading','ck-hidden',_0x334d24=>!_0x334d24)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x4dadfa['if']('isModelAvailable','ck-hidden',_0x3af14f=>_0x3af14f)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x5e494e({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0xee3d6,_0x54a00a){return new bs(_0xee3d6,_0x54a00a);}['_createPromptInputView'](_0x47ae07){return new ps(_0x47ae07,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x2a8fff){return new ms(_0x2a8fff);}['_createLoaderView'](_0x22b46f){return new _s(_0x22b46f);}['_createModelUnavailableMessageView'](_0x28e4df){const _0x107004=new ws(_0x28e4df);return _0x107004['delegate']('startConversation')['to'](this),_0x107004;}['_handlePromptInputFocus'](_0x4ef5e0,_0x59828e,_0x5439f4){_0x5439f4?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x4e2197,_0x4bb122){this['_contextPanelView']['addContextItem'](_0x4e2197,_0x4bb122);}['removeContextItem'](_0x4d7ff9){this['_contextPanelView']['removeContextItem'](_0x4d7ff9);}['setContextItemLoading'](_0x1eee5c,_0x37577e){this['_contextPanelView']['setContextItemLoading'](_0x1eee5c,_0x37577e);}['setIsUploadInProgress'](_0x1589a3){this['_promptInputView']['setIsUploadInProgress'](_0x1589a3);}['setConversationContext'](_0x216cda){this['_contextPanelView']['setConversationContext'](_0x216cda);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x2930de,_0x2fc8ad,_0x531b88){this['_contextPanelView']['updateResourceState'](_0x2930de,_0x2fc8ad,_0x531b88);}['setWebSearch'](_0x5b6433){this['_promptCapabilitiesView']['setWebSearch'](_0x5b6433);}['setReasoning'](_0x5a1cfa){this['_promptCapabilitiesView']['setReasoning'](_0x5a1cfa);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x4f8f24){this['_contextPanelView']['setAddContextOptions'](_0x4f8f24);}['setInputPlaceholder'](_0x16f1d3){this['_promptInputView']['setPlaceholderText'](_0x16f1d3);}['setModelList'](_0x10a660,_0x19a7b9){this['_displayedModels']=_0x10a660,this['_promptCapabilitiesView']['setModelList'](_0x10a660,_0x19a7b9);}['setModel'](_0x3e3d3a){(_0x3e3d3a?this['_displayedModels']['find'](_0x17023e=>_0x17023e['id']===_0x3e3d3a['id']):null)?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x3e3d3a)):_0x3e3d3a?.['id']['startsWith']('agent')?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](this['_displayedModels'][0x0])):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x42b80){this['_promptCapabilitiesView']['disableModelSelector'](_0x42b80);}['populateSourceResourceBalloon'](_0x2961a5,_0x370ec9,_0x30739b,_0x5265ff){this['_contextPanelView']['populateSourceResourceBalloon'](_0x2961a5,_0x370ec9,_0x30739b,_0x5265ff);}['closeSourceResourceBalloon'](_0x5c3348){this['_contextPanelView']['closeSourceResourceBalloon'](_0x5c3348);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class ws extends _0x1f124f{constructor(_0x5f02cc){super(_0x5f02cc);const _0x3774db=new _0x5be5f6(_0x5f02cc);_0x3774db['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x3774db['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'},_0x3774db]}]});}}class ki extends _0xb4a1f4{['conversationStartButton'];['resizeButton'];constructor(_0x602832,_0x432fdf){super(_0x602832,{'label':i(_0x602832,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Ht}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x602832),this['children']['add'](this['conversationStartButton']),_0x432fdf&&(this['resizeButton']=ks(_0x602832,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x4d5ca8){const _0xa3fd77=new _0x5be5f6(_0x4d5ca8);return _0xa3fd77['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x51df24,'class':'ck-ai-chat__start-conversation'}),_0xa3fd77['on']('execute',()=>{this['fire']('startConversation');}),_0xa3fd77;}}class bi extends _0x1f124f{constructor(_0x5387f4){super(_0x5387f4),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x5387f4,'AI_DISCLAIMER_TEXT')}]}]});}}class bt extends _0x1f124f{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x57535a,_0x4ebdef){super(_0x57535a),this['_bodyCollection']=new _0x1e472e(_0x57535a),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new ki(_0x57535a,_0x4ebdef['showResizeButton']),this['chatHeader']['delegate'](...Mt)['to'](this),this['chatFeed']=new pi(_0x57535a,this['_bodyCollection']),this['chatFeed']['delegate'](...Mt)['to'](this),this['chatControls']=new ji(_0x57535a,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x4ebdef['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Mt)['to'](this),this['chatDisclaimer']=new bi(_0x57535a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x57535a['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0xb5d82c,_0x24d429,_0x54f82a,_0x2aae36){this['chatControls']['populateSourceResourceBalloon'](_0xb5d82c,_0x24d429,_0x54f82a,_0x2aae36);}['closeSourceResourceBalloon'](_0x4626c8){this['chatControls']['closeSourceResourceBalloon'](_0x4626c8);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class dt extends _0x24ce56{static get['requires'](){return[ft];}['_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(_0x258d57){super(_0x258d57);const _0x2aacb2=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new st(),this['_view']=new bt(this['context']['locale'],{'showResizeButton':_0x2aacb2['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Mt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0xb29937,{showDiff:_0x1e0d0a})=>{this['showDiff']=_0x1e0d0a;}),_0x2aacb2['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x8e9728=>_0x8e9728),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x1bd300=>_0x1bd300),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x5db0e8){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x5db0e8['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':i(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x4ac876,staticMessage:_0x11ca7b}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x4ac876,'initialContent':'<p>'+_0x11ca7b+'</p>'});}['addFeedItemUserMessage'](_0x47e1c0){const _0x105681=_0x47e1c0['quickActionData']?.['displayedPrompt']||_0x47e1c0['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x47e1c0['contextItems']['values']()),'initialContent':'<p>'+_0x105681+'</p>','id':_0x47e1c0['id']});}['addFeedItemError']({errorMessage:_0x459af9,id:_0x209833}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x459af9+'</p>','id':_0x209833});}['addFeedItemAIReply'](_0x9849e8){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x9849e8['interactionId']+':'+_0x9849e8['id']}),this['setLoadingMessage'](null);});}async['addFeedItemAISuggestion'](_0x1d9fe5){const _0x4efcb8=q(this['context']);let _0x2e4e51=_0x4efcb8['config']['get']('ai.availableReplyActions')||[...H];if(_0x4efcb8['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x43362e=_0x4efcb8['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x43362e,'value');}}else _0x2e4e51=_0x2e4e51['filter'](_0x5838a8=>'insertSuggestion'!=_0x5838a8);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x1d9fe5['interactionId']+':'+_0x1d9fe5['id'],'areActionsDisabled':_0x1d9fe5['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x2e4e51}),this['setLoadingMessage'](null);});}['addFeedInteractionHeader'](_0x1f7fe4,_0x18722f){const _0x1fd818=this['_view']['chatFeed']['children']['last'];if(_0x1fd818 instanceof Lt)return this['_view']['chatFeed']['children']['remove'](_0x1fd818),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x1f7fe4['id'],'capabilities':{'isWebSearchEnabled':_0x1fd818['capabilities']['isWebSearchEnabled']||_0x18722f['isWebSearchEnabled'],'isReasoningEnabled':_0x1fd818['capabilities']['isReasoningEnabled']||_0x18722f['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x1f7fe4['id'],'capabilities':_0x18722f});}['updateFeedInteractionHeader'](_0x2199ce){const _0x17018d=this['_view']['chatFeed']['children']['find'](_0x1fb2b8=>_0x1fb2b8['options']['id']==_0x2199ce['id']&&_0x1fb2b8 instanceof Lt);_0x17018d&&_0x17018d['set']('isVisible',_0x2199ce['isVisible']);}async['updateFeedItemAIReplyContent'](_0x26ee66){const _0x3d384a=_0x26ee66['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x3ead51=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x26ee66,'abortSignal':_0x3ead51,'renderingStrategy':_0x3d384a}),_0x26ee66['isDone']&&this['markFeedItemAsDone'](_0x26ee66['id']);});}['updateFeedItemAIReplySources'](_0x10dac2,_0x2d1767){this['_view']['chatFeed']['updateWebSources'](_0x10dac2,_0x2d1767);}async['updateFeedItemAIReplySuggestionContent'](_0x4df8c6){const _0x4847ba=_0x4df8c6['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x3b6909=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x4df8c6,'abortSignal':_0x3b6909,'renderingStrategy':_0x4847ba}),_0x4df8c6['isDone']&&this['markFeedItemAsDone'](_0x4df8c6['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x224c94){this['_view']['chatFeed']['updateSuggestionPartState'](_0x224c94);}['markFeedItemAsDone'](_0x1b0ddf){this['_view']['chatFeed']['markItemAsDone'](_0x1b0ddf);}['removeFeedInteraction'](_0x3c906b){this['_view']['chatFeed']['getItemIds']()['filter'](_0x1edf3b=>_0x1edf3b['startsWith'](_0x3c906b))['forEach'](_0x2580cc=>this['_view']['chatFeed']['removeItem'](_0x2580cc));}['startInteraction'](){this['setLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1}),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0xa8cf49){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x27f559=>_0x27f559['startsWith'](_0xa8cf49['id']))['forEach'](_0x3507d6=>this['markFeedItemAsDone'](_0x3507d6)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x1f809c,_0x4cc7ab){this['_view']['chatControls']['addContextItem'](_0x1f809c,_0x4cc7ab);}['removeContextItem'](_0x1bcf9a){this['_view']['chatControls']['removeContextItem'](_0x1bcf9a);}['setContextItemLoading'](_0xfe0e91,_0x4ed3c7){this['_view']['chatControls']['setContextItemLoading'](_0xfe0e91,_0x4ed3c7);}['setIsUploadInProgress'](_0x17edf7){this['_view']['chatControls']['setIsUploadInProgress'](_0x17edf7);}['setConversationContext'](_0x5a438a){this['_view']['chatControls']['setConversationContext'](_0x5a438a);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x339275,_0x3ea04e,_0x49748c){this['_view']['chatControls']['updateResourceState'](_0x339275,_0x3ea04e,_0x49748c);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x17bfa5){this['_view']['chatControls']['setAddContextOptions'](_0x17bfa5);}['updateCapabilities'](_0x2b6de2){this['_view']['chatControls']['setWebSearch'](_0x2b6de2['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x2b6de2['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x2b6de2));}['setSelectedModel'](_0x461252,_0x5a5b37){this['_view']['chatControls']['setModel'](_0x461252),_0x5a5b37&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x3307e0){this['feedItemRenderingStrategy']=_0x3307e0;}['toggleLoadingSkeleton'](_0x3118e4){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x3118e4);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x2ca663,_0xed30a2=!0x1){if(_0xed30a2&&!Pt()&&_0x2ca663['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x2ca663);this['_view']['chatHeader']['label']=_0x2ca663;}['setLoadingMessage'](_0x5865e2){const _0x3becb5=this['_getLoadingMessage'](_0x5865e2);this['_view']['chatFeed']['setLoadingMessage'](_0x3becb5);}['_animateConversationTitle'](_0x78e8b1){let _0x1df489=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x78e8b1[_0x1df489],_0x1df489++,_0x1df489===_0x78e8b1['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0xac98ab){this['_view']['chatHeader']['isMaximized']=_0xac98ab;}['_getLoadingMessage'](_0x2ab7e7){return _0x2ab7e7?_0x2ab7e7['isWebSearchEnabled']&&_0x2ab7e7['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x2ab7e7['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x2ab7e7['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR'):'';}['_getInputPlaceholder'](_0x1d956d){return _0x1d956d?_0x1d956d['isWebSearchEnabled']&&_0x1d956d['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x1d956d['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x1d956d['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'](_0x1dbacf,_0x40553f,_0x452864,_0x3e8a58){this['_view']['populateSourceResourceBalloon'](_0x1dbacf,_0x40553f,_0x452864,_0x3e8a58);}['closeSourceResourceBalloon'](_0x3afe24){this['_view']['closeSourceResourceBalloon'](_0x3afe24);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x2e0c92,_0x55cfb3){this['_view']['chatFeed']['scrollToSuggestion'](_0x2e0c92,_0x55cfb3);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Mi extends _0x5f8d0a{['sections'];constructor(_0xd0dc36,_0x3d6a61){super(_0xd0dc36),this['sections']=_0x3d6a61,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x34add8){let _0xee8d25=0x0,_0x1f60e9=0x0;for(const _0x2a0e0b of this['sections']){const {resultsCount:_0x2515b7,totalItemsCount:_0x5c25b5}=_0x2a0e0b['filter'](_0x34add8);_0xee8d25+=_0x2515b7,_0x1f60e9+=_0x5c25b5;}return{'resultsCount':_0xee8d25,'totalItemsCount':_0x1f60e9};}}class xi extends _0x19da3d{['title'];['itemsViews'];['_itemsListView'];constructor(_0x6bddef,{title:_0x26fea5,items:_0x5cc851}){super(_0x6bddef);const _0x57ad46=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x26fea5,this['itemsViews']=_0x5cc851;const _0x44561e=new _0x1f124f(_0x6bddef);_0x44561e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x5f8d0a(_0x6bddef),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x57ad46['if']('isVisible','ck-hidden',_0x21d202=>!_0x21d202)]},'children':[_0x44561e,this['_itemsListView']]});}['filter'](_0x350085){const _0x4decd6=this['itemsViews']['length'];let _0x455065=0x0;for(const _0x3afd20 of this['itemsViews']){if(_0x350085){const _0x6ddbee=_0x3afd20['isMatching'](_0x350085);_0x3afd20['isVisible']=!!_0x6ddbee,_0x3afd20['highlightText'](_0x350085);}else _0x3afd20['isVisible']=!0x0,_0x3afd20['highlightText'](null);_0x3afd20['isVisible']&&_0x455065++;}return this['isVisible']=_0x455065>0x0,{'resultsCount':_0x455065,'totalItemsCount':_0x4decd6};}['getItem'](_0x5ee323){return this['itemsViews']['find'](_0x3abd2a=>_0x3abd2a['id']===_0x5ee323);}['removeItem'](_0x4bcc59){const _0x25796c=this['itemsViews']['indexOf'](_0x4bcc59);-0x1!==_0x25796c&&(this['itemsViews']['splice'](_0x25796c,0x1),this['_itemsListView']['items']['remove'](_0x4bcc59));}}class Li extends/* #__PURE__ -- @preserve */
27
+ _0x1cf7a0(_0x19da3d){['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(_0x443f4c,_0x165446){super(_0x443f4c);const _0x4c2dab=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x165446['pinned']),this['set']('loadingState',null),this['id']=_0x165446['id'];const {title:_0x2de224,createdAt:_0x49bec5,active:_0x191939=!0x1}=_0x165446;this['_titleView']=new _0x1df954(),this['_titleView']['text']=_0x2de224,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x489de9=this['_createCheckView'](),_0x3606d9=this['_createPinButtonView'](_0x443f4c),_0x1df4bc=this['_createMenuDropdownView'](),_0x2cc03f=this['_createEditInputView'](_0x443f4c,_0x2de224),_0x2f309c=this['_createAcceptEditButtonView'](_0x443f4c,_0x2cc03f),_0x3b50cc=this['_createCancelEditButtonView'](_0x443f4c,_0x2cc03f);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x3606d9),this['actions']['add'](_0x1df4bc),this['on']('change:isEdit',(_0x22cca,_0x5e1ef9,_0xf8c062)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0xf8c062?(this['actions']['add'](_0x2f309c),this['actions']['add'](_0x3b50cc),this['mainContent']['add'](_0x2cc03f),_0x2cc03f['element']['focus']()):(this['actions']['add'](_0x3606d9),this['actions']['add'](_0x1df4bc),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x191939?'ck-ai-chat-history__item--active':'',_0x4c2dab['if']('isVisible','ck-hidden',_0x4bd1da=>!_0x4bd1da),_0x4c2dab['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',_0x4c2dab['if']('loadingState','ck-hidden',_0x313030=>!!_0x313030)]},'children':_0x191939?[_0x489de9]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x4c2dab['if']('loadingState','ck-hidden',_0x47da98=>!_0x47da98)]},'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',_0x4c2dab['if']('loadingState','ck-hidden',_0x322b4e=>!!_0x322b4e)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x4c2dab['if']('loadingState','ck-hidden',_0x2e0d29=>!_0x2e0d29)]},'children':[{'text':_0x4c2dab['to']('loadingState',_0x4d0cc9=>_0x4d0cc9?i(this['locale'],Li['LOADING_LABELS'][_0x4d0cc9]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x49bec5]}]},{'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'](_0x4cfaf3){this['_titleView']['text']=_0x257ef5(_0x4cfaf3);}['updateLoadingState'](_0x1bd1c6,_0x3ce3e7){this['set']('loadingState',_0x3ce3e7?_0x1bd1c6:null);}['_createCheckView'](){const _0x1a9e68=new _0x26d10b();return _0x1a9e68['set']({'content':_0x33d7d6}),_0x1a9e68;}['_createPinButtonView'](_0x573450){const _0x5f04b5=new _0x5be5f6(_0x573450);return _0x5f04b5['set']({'label':i(_0x573450,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x1a2605,'withText':!0x1,'tooltip':!0x0}),_0x5f04b5['bind']('isOn')['to'](this,'pinned'),_0x5f04b5['on']('execute',()=>{const _0x39405c=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x39405c});}),_0x5f04b5;}['_createMenuDropdownView'](){const _0x2c1351=_0x12dfeb(this['locale'],_0x491d60),_0x1b6b64=_0x2c1351['panelView']['children'];_0x2c1351['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x33c4b0}),_0x2c1351['panelPosition']='sw';const _0x5cd595=new _0x5be5f6(this['locale']);_0x5cd595['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x5cd595['withText']=!0x0,_0x5cd595['on']('execute',()=>{this['isEdit']=!0x0;});const _0x485cbf=new _0x5be5f6(this['locale']);_0x485cbf['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x485cbf['withText']=!0x0,_0x485cbf['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x12990f=new _0x5f8d0a(this['locale']),_0x35f89f=new _0x19da3d(this['locale']);_0x35f89f['children']['add'](_0x5cd595);const _0x1fc28c=new _0x19da3d(this['locale']);return _0x1fc28c['children']['add'](_0x485cbf),_0x12990f['items']['addMany']([_0x35f89f,_0x1fc28c]),_0x1b6b64['add'](_0x12990f),_0x2c1351;}['_createEditInputView'](_0x5cf3ba,_0x493934){const _0x2dbdc4=new _0x5d2b74(_0x5cf3ba),_0x13d5db=_0x2dbdc4['bindTemplate'];return _0x2dbdc4['value']=_0x493934,_0x2dbdc4['extendTemplate']({'on':{'keydown':_0x13d5db['to'](_0x2292f1=>{'Enter'==_0x2292f1['key']&&this['_commitEditInputValue'](_0x2dbdc4);})}}),_0x2dbdc4;}['_createAcceptEditButtonView'](_0x5a5547,_0x986ee){const _0x4ed569=new _0x5be5f6(_0x5a5547);return _0x4ed569['set']({'icon':_0x33d7d6,'withText':!0x1,'tooltip':i(_0x5a5547,'AI_CHAT_HISTORY_ACCEPT')}),_0x4ed569['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x4ed569['on']('execute',()=>{this['_commitEditInputValue'](_0x986ee);}),_0x4ed569;}['_commitEditInputValue'](_0x11eb61){const _0x4a1453=_0x11eb61['element']['value']||'';this['_titleView']['text']=_0x4a1453,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x4a1453});}['_createCancelEditButtonView'](_0x44f465,_0x5ec06a){const _0x2ce46a=new _0x5be5f6(_0x44f465);return _0x2ce46a['set']({'icon':_0x15e321,'withText':!0x1,'tooltip':i(_0x44f465,'AI_CHAT_HISTORY_CANCEL')}),_0x2ce46a['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x2ce46a['on']('execute',()=>{this['isEdit']=!0x1,_0x5ec06a['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x2ce46a;}['_createSpinnerView'](){const _0x303ec1=new qe('tiny');return _0x303ec1['isVisible']=!0x0,_0x303ec1;}['isMatching'](_0x4e4a67){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x4e4a67)?{'title':!0x0}:null;}['highlightText'](_0x6efdc5){this['_titleView']['highlightText'](_0x6efdc5);}}class Ut extends _0x1f124f{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x5a50e7,_0x3a11f3){super(_0x5a50e7),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 _0x2891dc=new _0xb4a1f4(_0x5a50e7,{'label':i(_0x5a50e7,'AI_CHAT_HISTORY_HEADING'),'icon':Nt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x3a11f3&&(this['resizeButton']=ks(_0x5a50e7,this),_0x2891dc['children']['add'](this['resizeButton'])),this['sectionsView']=new Mi(_0x5a50e7,[]),this['sectionsView']['delegate'](...Yi)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0x501299=>!_0x501299)]}}),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':[_0x2891dc,{'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 _0x300ac2=new _0x2c0dee(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x40d466=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x40d466),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x2ff194=this['_createErrorView']();return _0x2ff194['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x25a407=>!_0x25a407)]}}),_0x300ac2['on']('render',()=>{_0x300ac2['children']['add'](_0x2ff194,0x1);}),_0x300ac2['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x1b8546=>!_0x1b8546)]}}),_0x300ac2;}['_createSkeletonView'](){const _0x3be1ea=new Be(this['locale'],We['aiHistory']);return _0x3be1ea['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x30ae8f=>!_0x30ae8f)]}}),_0x3be1ea;}['_createErrorView'](){const _0x26c46c=new _0x1f124f(this['locale']),_0x50e941=new _0x5be5f6(this['locale']);_0x50e941['set']({'withText':!0x1,'icon':_0x15e321,'class':'ck-ai-notification_error__dismiss-button'}),_0x50e941['bind']('isVisible')['to'](this,'hasItems',_0x2ee4dc=>!!_0x2ee4dc),_0x50e941['on']('execute',()=>{this['errorMessage']='';});const _0x23e528=this['bindTemplate'];return _0x26c46c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x23e528['to']('errorMessage')}]},_0x50e941]}),_0x26c46c;}['_createEmptyStateView'](){const _0x3f34c1=new _0x5be5f6(this['locale']);_0x3f34c1['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x51df24,'class':'ck-ai-chat__start-conversation'}),_0x3f34c1['on']('execute',()=>{this['fire']('openChat');});const _0x46b7db=new _0x1f124f(this['locale']);return _0x46b7db['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x39e23f=>!_0x39e23f)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x3f34c1]}),_0x46b7db;}['_createListItemViews'](_0x184e76,_0x5227ff){const _0x56a626=[];for(const _0x1b54fe of _0x184e76){const _0x372453=new Li(_0x5227ff,_0x1b54fe);_0x372453['delegate'](...Yi)['to'](this),_0x56a626['push'](_0x372453);}return _0x56a626;}['updateHistoryItemsWithCategories'](_0x40a40e){const _0xdbd351=this['locale']||'en',_0x3cf84d=[];for(const _0x32f5a1 of _0x40a40e){const _0x12f052=this['_createListItemViews'](_0x32f5a1['items'],_0xdbd351);_0x3cf84d['push'](new xi(_0xdbd351,{'title':_0x32f5a1['title'],'items':_0x12f052}));}this['sectionsView']['sections']=_0x3cf84d,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x3cf84d),this['hasItems']=_0x40a40e['some'](_0x12bf4d=>_0x12bf4d['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x361308){for(const _0x2c072e of this['sectionsView']['sections']){const _0x4c17ba=_0x2c072e['getItem'](_0x361308);if(_0x4c17ba){if(_0x2c072e['removeItem'](_0x4c17ba),0x0===_0x2c072e['itemsViews']['length']){const _0x2eccf9=this['sectionsView']['sections']['indexOf'](_0x2c072e);-0x1!==_0x2eccf9&&(this['sectionsView']['sections']['splice'](_0x2eccf9,0x1),this['sectionsView']['items']['remove'](_0x2c072e));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x5e1970,_0x2bfda7){for(const _0x38f7ea of this['sectionsView']['sections']){const _0x2583f6=_0x38f7ea['getItem'](_0x5e1970);if(_0x2583f6){_0x2583f6['updateTitle'](_0x2bfda7);break;}}}['updateItemLoadingState'](_0x3e4a4e,_0x46984f,_0x3ab616){for(const _0x391c60 of this['sectionsView']['sections']){const _0x353543=_0x391c60['getItem'](_0x3e4a4e);if(_0x353543){_0x353543['updateLoadingState'](_0x46984f,_0x3ab616);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x39d4df=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x39d4df);}}}const Yi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends _0x24ce56{static get['requires'](){return[ft];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xf0327d){super(_0xf0327d);const _0x163d59=this['context']['plugins']['get']('AITabs');this['_historyView']=new Ut(this['context']['locale'],_0x163d59['showResizeButton']),this['_historyView']['delegate'](...Yi)['to'](this),_0x163d59['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Nt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x3e007a){this['_historyView']['removeHistoryItem'](_0x3e007a);}['updateItems'](_0x56c5d1){this['_historyView']['updateHistoryItemsWithCategories'](_0x56c5d1);}['updateItemTitle'](_0xb6ec9e,_0x459e2a){this['_historyView']['updateItemTitle'](_0xb6ec9e,_0x459e2a);}['updateItemLoadingState'](_0x3556b4,_0x189f13,_0x1c1430){this['_historyView']['updateItemLoadingState'](_0x3556b4,_0x189f13,_0x1c1430);}['setLoadingSkeleton'](_0x207884){this['_historyView']['isLoading']=_0x207884;}['showError'](_0x29fca3){this['_historyView']['errorMessage']=_0x29fca3;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0xea8767){this['_historyView']['isMaximized']=_0xea8767;}}class Ue extends ts(){['id'];['createdAt'];constructor({id:_0x4102f6,title:_0x2fdc0d,createdAt:_0x3240ed,updatedAt:_0x4f00b9,pinned:_0x2149e2}){super(),this['id']=_0x4102f6,this['createdAt']=new Date(_0x3240ed),this['set']('title',_0x2fdc0d),this['set']('updatedAt',_0x4f00b9?new Date(_0x4f00b9):null),this['set']('pinned',_0x2149e2||!0x1);}['updateTitle'](_0xd2e091){this['set']('title',_0x257ef5(_0xd2e091)),this['updatedAt']=new Date();}['updatePinned'](_0x41c839){this['set']('pinned',_0x41c839),this['updatedAt']=new Date();}}class Yt extends _0x5194ed(){['items']=[];['connector'];['group'];constructor({connector:_0x1e665b,group:_0x3dc699}){super(),this['connector']=_0x1e665b,this['group']=_0x3dc699;}async['init'](){try{const _0x5bc04a=this['connector']['fetchConversations'](this['group']),_0x335a75=await _0x5bc04a['getConversations']();this['loadItems'](_0x335a75);}catch(_0x22bcbb){this['fire']('error',{'error':_0x22bcbb,'operation':'init'});}}['addItem'](_0x269a7b){this['items']['push'](_0x269a7b);}async['removeItem'](_0x1016ba){const _0x3fc40c=this['items']['findIndex'](_0x338c03=>_0x338c03['id']===_0x1016ba);if(-0x1===_0x3fc40c)return!0x1;try{return await this['connector']['deleteConversation'](_0x1016ba)['execute'](),this['items']['splice'](_0x3fc40c,0x1),this['fire']('itemRemoved',{'itemId':_0x1016ba}),!0x0;}catch(_0x2ed338){return this['fire']('error',{'error':_0x2ed338,'operation':'removeItem','itemId':_0x1016ba}),!0x1;}}['getItem'](_0x445fc3){return this['items']['find'](_0xf54c74=>_0xf54c74['id']===_0x445fc3);}async['updateItemTitle'](_0x4fa7cf,_0x3a5abe){const _0x301fd7=this['getItem'](_0x4fa7cf);if(!_0x301fd7)return!0x1;try{return await this['connector']['updateConversation'](_0x4fa7cf,{'title':_0x3a5abe})['getResult'](),_0x301fd7['updateTitle'](_0x3a5abe),this['fire']('itemUpdated',{'itemId':_0x4fa7cf,'updates':{'title':_0x3a5abe}}),!0x0;}catch(_0x11bd8a){return this['fire']('error',{'error':_0x11bd8a,'operation':'updateItemTitle','itemId':_0x4fa7cf}),!0x1;}}async['updateItemPinned'](_0x1ee455,_0x2bfb37){const _0x24e7a9=this['getItem'](_0x1ee455);if(!_0x24e7a9)return!0x1;try{return await this['connector']['updateConversation'](_0x1ee455,{'pinned':_0x2bfb37})['getResult'](),_0x24e7a9['updatePinned'](_0x2bfb37),this['fire']('itemUpdated',{'itemId':_0x1ee455,'updates':{'pinned':_0x2bfb37}}),!0x0;}catch(_0x55cb27){return this['fire']('error',{'error':_0x55cb27,'operation':'updateItemPinned','itemId':_0x1ee455}),!0x1;}}['loadItems'](_0x2553f9){try{this['items']=[],_0x2553f9['map'](_0x315de9=>{this['addItem'](new Ue(_0x315de9));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0xa1dfc3){this['fire']('error',{'error':_0xa1dfc3,'operation':'loadItems'});}}['getItems'](_0x5db9b8={}){const _0x6fb2db=void 0x0!==_0x5db9b8['pinned']&&_0x5db9b8['pinned'],_0x6158b4=_0x5db9b8['from']?new Date(_0x5db9b8['from']['getFullYear'](),_0x5db9b8['from']['getMonth'](),_0x5db9b8['from']['getDate']()):null,_0x309411=_0x5db9b8['to']?new Date(_0x5db9b8['to']['getFullYear'](),_0x5db9b8['to']['getMonth'](),_0x5db9b8['to']['getDate']()):null;return this['items']['filter'](_0x494ed4=>{if(_0x494ed4['pinned']!==_0x6fb2db)return!0x1;if(_0x309411){const _0xfbdef=new Date(_0x494ed4['createdAt']['getFullYear'](),_0x494ed4['createdAt']['getMonth'](),_0x494ed4['createdAt']['getDate']());return _0x6158b4?_0x6158b4['getTime']()===_0x309411['getTime']()?_0xfbdef['getTime']()===_0x6158b4['getTime']():_0xfbdef<_0x309411&&_0xfbdef>=_0x6158b4:_0xfbdef<_0x309411;}return!0x0;});}}class jt extends _0x24ce56{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[R,mt,xt,ft];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](R),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](mt);const _0x27aca3=this['context']['plugins']['get'](ft);try{const _0x28d960=this['_aiChatController']['getGroupId']();this['history']=new Yt({'connector':this['_aiConnector'],'group':_0x28d960}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x17af55,_0xd187db)=>{this['_setItemLoading'](_0xd187db['id'],'remove'),this['_handleRemove'](_0xd187db['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x3ce468,_0x2ff4ee)=>{this['_setItemLoading'](_0x2ff4ee['id'],'rename'),this['_handleEditTitle'](_0x2ff4ee['id'],_0x2ff4ee['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x10980f,_0x4a9306)=>{void 0x0!==_0x4a9306['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x4a9306['itemId'],_0x4a9306['updates']['title']),void 0x0!==_0x4a9306['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x4a9306['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x132b40,_0x301bf5)=>{this['_aiChatController']['handleRemovedConversation'](_0x301bf5['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x301bf5['itemId']),this['_clearItemLoading'](_0x301bf5['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x22700e,_0x548857)=>{this['_handleHistoryErrorUI'](_0x548857['error'],_0x548857['operation'],_0x548857['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x40fd28,_0x6205ae)=>{this['_handleSelectConversation'](_0x6205ae['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x54f11c,_0x4a30be)=>{const _0x43ca32=_0x4a30be['pinned']?'pin':'unpin';this['_setItemLoading'](_0x4a30be['id'],_0x43ca32),this['_handleTogglePin'](_0x4a30be['id'],_0x4a30be['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x27aca3['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x27aca3['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x27aca3,'resizedTabs',(_0x91392f,_0x1875c5)=>{this['_setIsMaximized'](_0x1875c5);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x27aca3['resize']();});}catch(_0x217655){this['_handleHistoryErrorUI'](_0x217655,'init');}}async['_handleEditTitle'](_0x561f7d,_0x3784b4){await this['history']['updateItemTitle'](_0x561f7d,_0x3784b4);}async['_handleTogglePin'](_0x5ad3e7,_0x4b57f9){await this['history']['updateItemPinned'](_0x5ad3e7,_0x4b57f9);}async['_handleRemove'](_0x40b64c){await this['history']['removeItem'](_0x40b64c);}async['_handleSelectConversation'](_0x1e93a4){await this['_aiChatController']['loadConversation'](_0x1e93a4);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x24e0a7=this['_aiChatController']['activeConversation']?.['id'],_0x8dda18=this['_getCategorizedItems']()['map'](_0x569d39=>({'title':_0x569d39['title'],'items':_0x569d39['items']['map'](_0x26c97b=>({'id':_0x26c97b['id'],'title':_0x26c97b['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x26c97b['createdAt'])['toLocaleDateString'](),'active':_0x26c97b['id']===_0x24e0a7,'pinned':_0x26c97b['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x8dda18);}['_setItemLoading'](_0x4df9b,_0x87be6d){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x4df9b,_0x87be6d,!0x0);}['_clearItemLoading'](_0x40277e){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x40277e,null,!0x1);}['_handleHistoryErrorUI'](_0x1b9520,_0x52b73c,_0x2580f4){const _0xfdcf2e=this['_generateErrorMessage'](_0x52b73c,_0x2580f4);this['_aiChatHistoryUi']['showError'](_0xfdcf2e),_0x2580f4&&this['_clearItemLoading'](_0x2580f4),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x1e18b2,_0x3f8586){const _0x590cf6=_0x3f8586?this['history']['getItem'](_0x3f8586):null,_0x4afe3a=_0x590cf6?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x1e18b2){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x4afe3a);case'updateItemPinned':{const _0x36134c=i(this['context']['locale'],_0x590cf6?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x36134c,_0x4afe3a]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x4afe3a);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 _0x45627c=new Date(),_0x3350b7=new Date(_0x45627c['getFullYear'](),_0x45627c['getMonth'](),_0x45627c['getDate']()),_0x1dbd32=new Date(_0x3350b7);_0x1dbd32['setDate'](_0x1dbd32['getDate']()-0x1);const _0x27f416=new Date(_0x3350b7);_0x27f416['setDate'](_0x27f416['getDate']()-0xe);const _0x5bec93=this['history']['getItems']({'pinned':!0x0}),_0xe8c159=this['history']['getItems']({'from':_0x3350b7,'to':_0x3350b7}),_0xa529ad=this['history']['getItems']({'from':_0x1dbd32,'to':_0x1dbd32}),_0x392ef8=this['history']['getItems']({'from':_0x27f416,'to':_0x1dbd32}),_0x30db07=this['history']['getItems']({'to':_0x27f416}),_0xa8ed58=[];return _0x5bec93['length']>0x0&&_0xa8ed58['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x5bec93}),_0xe8c159['length']>0x0&&_0xa8ed58['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0xe8c159}),_0xa529ad['length']>0x0&&_0xa8ed58['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0xa529ad}),_0x392ef8['length']>0x0&&_0xa8ed58['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x392ef8}),_0x30db07['length']>0x0&&_0xa8ed58['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x30db07}),_0xa8ed58;}['_setIsMaximized'](_0x3b7f13){this['_aiChatHistoryUi']['setIsMaximized'](_0x3b7f13);}}class gt extends _0x24ce56{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ua extends _0x24ce56{static get['requires'](){return[mt,S,dt,gt];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4def83){super(_0x4def83),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](mt)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](mt)['startConversation']();}async['sendMessage']({message:_0x519cc9,quickActionData:_0xe6f776}){await this['context']['plugins']['get'](mt)['sendMessage']({'message':_0x519cc9,'quickActionData':_0xe6f776});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](mt)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](mt)['focusPromptInput']();}}class co extends Qt{constructor(_0x1910a6){super(_0x1910a6);const _0x3e627f=_0x1910a6['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x3e627f,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x467394=this['editor']['plugins']['get']('AITabs')['view'];_0x467394['isVisible']=!_0x467394['isVisible'];}}class qt extends _0x2a032b{static get['requires'](){return[ft];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4eb890=this['editor'];_0x4eb890['commands']['add']('toggleAi',new co(_0x4eb890)),_0x4eb890['ui']['componentFactory']['add']('toggleAi',()=>{const _0x31eb6c=this['_createAIUIButton'](_0x5be5f6);return _0x31eb6c['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x31eb6c;}),_0x4eb890['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x3591b0=this['_createAIUIButton'](_0x33defb);return _0x3591b0['set']({'role':'menuitemcheckbox'}),_0x3591b0;});}['_createAIUIButton'](_0x3c3635){const _0x49d63e=this['editor'],_0x1ec39c=_0x49d63e['commands']['get']('toggleAi'),_0x241ea4=new _0x3c3635(_0x49d63e['locale']);return _0x241ea4['set']({'label':i(_0x49d63e['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x5166a7,'isToggleable':!0x0}),_0x241ea4['bind']('isEnabled')['to'](_0x1ec39c),_0x241ea4['bind']('isOn')['to'](_0x1ec39c,'value',_0xd75a50=>!!_0xd75a50),this['listenTo'](_0x241ea4,'execute',()=>{_0x1ec39c['execute']();}),_0x241ea4;}}class Va extends _0x2a032b{static get['requires'](){return[qt,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function ee(_0x20af0c){const {editor:_0x550314,action:_0x11e4b7,withText:_0x321033=!0x1,withIcon:_0x2c88f0=!0x0,isInDropdown:_0x6ca1a=!0x0,shouldPreventFocus:_0x391f4c=!0x1}=_0x20af0c;return()=>{const _0x11ae59=_0x550314['locale'],_0xc900bc=new _0x5be5f6(_0x11ae59),_0x1f2523=_0xc900bc['bindTemplate'];_0x6ca1a&&_0xc900bc['extendTemplate']({'on':{'mouseenter':_0x1f2523['to'](()=>{_0x391f4c&&_0x391f4c()||_0xc900bc['focus']();})}});const _0x7fa7d5=_0x11e4b7['icon']??_0x11e4b7['parent']?.['icon'];return _0xc900bc['set']({'label':_0x11e4b7['displayedPrompt'],'withText':_0x321033,'role':'menuitem','icon':_0x2c88f0?_0x7fa7d5??_0x1201c9:void 0x0,'tooltip':!_0x321033,'class':'ck-ai-quick-actions-button','isEnabled':_0x11e4b7['isEnabled']}),_0xc900bc['on']('execute',()=>{_0x550314['editing']['view']['focus'](),_0x550314['commands']['execute']('aiQuickAction',_0x11e4b7);}),_0xc900bc;};}class vs extends _0xa5864f{['arrowView'];constructor(_0x479249,_0x850cc5){super(_0x479249,_0x850cc5);const _0x2e8358=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',_0x3aca4a=>String(_0x3aca4a)),'data-cke-tooltip-disabled':_0x2e8358['to']('isOn')},'on':{'mouseenter':_0x2e8358['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x4f6583=new _0x26d10b();return _0x4f6583['content']=_0x4deb05,_0x4f6583['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x4f6583;}}class Ss extends _0x5f8d0a{['_allListItems'];['_allSearchableItems'];constructor(_0x4987be,_0x253113,_0x19d21d){super(_0x4987be),this['_allListItems']=_0x253113,this['_allSearchableItems']=_0x19d21d;}['filter'](_0x263df2){if(!_0x263df2)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x7a5a51=_0x263df2['source']['toLowerCase']()['trim'](),_0x426640=this['_allSearchableItems']['filter'](_0x2f8148=>(_0x2f8148['groupLabel']?_0x2f8148['label']+'\x20('+_0x2f8148['groupLabel']+')':_0x2f8148['label'])['toLowerCase']()['includes'](_0x7a5a51));return this['items']['clear'](),this['items']['addMany'](_0x426640['sort']((_0x107db2,_0xc1681)=>{const _0x5080f2=_0x107db2['groupLabel'],_0x384590=_0xc1681['groupLabel'];return _0x5080f2||_0x384590?_0x5080f2?0x1:-0x1:0x0;})['map'](_0x40b7fc=>_0x40b7fc['item'])),this['_highlightQuery'](_0x7a5a51,_0x426640),{'resultsCount':_0x426640['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x19aedc,_0x53e278){if(!_0x19aedc)return;const _0x58d114=new RegExp(_0x38bbb1(_0x19aedc),'gi');_0x53e278['forEach'](_0x48452e=>{_0x48452e['highlightViews']&&_0x48452e['highlightViews']['forEach'](_0x3a2168=>{'function'==typeof _0x3a2168['highlightText']&&_0x3a2168['highlightText'](_0x58d114);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x263119=>{_0x263119['highlightViews']&&_0x263119['highlightViews']['forEach'](_0x57f6f9=>{'function'==typeof _0x57f6f9['highlightText']&&_0x57f6f9['highlightText'](null);});});}}const ys='menu',Ts='menuitem';class ao extends _0x1f124f{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x3d7c0a,_0x1c3f05,_0x22cd21,_0x3ad02e,_0x4c6405=!0x1){const _0x56c63=_0x3d7c0a['locale'];super(_0x56c63),this['_bodyCollection']=_0x3ad02e,this['_hasSearch']=_0x4c6405;const _0x46b2e3=this['_createListItems'](_0x3d7c0a,_0x1c3f05,_0x22cd21);this['optionsListView']=new Ss(_0x56c63,_0x46b2e3,this['_allSearchableItems']),this['optionsListView']['role']=ys,this['optionsListView']['items']['addMany'](_0x46b2e3),this['focusTracker']=new _0x5e98a3(),this['keystrokes']=new _0x3678f9(),_0x4c6405&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x46b2e3,this['focusCycler']=new _0x12ca41({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x4c6405&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x925f46=_0x4c6405&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x840caa(_0x925f46),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x56c63['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x2c0dee(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 _0x4a20b5=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x4a20b5);}['_createListItems'](_0x56f749,_0x1095fe,_0x26b62d){const _0x480d14=new _0x840caa();return _0x1095fe['forEach'](_0x1b55c8=>{if('actions'in _0x1b55c8){const {listItem:_0x283799}=this['_createActionGroupButton'](_0x56f749,_0x1b55c8,_0x26b62d);_0x480d14['add'](_0x283799),_0x1b55c8['actions']['forEach'](_0x6b3067=>{this['_createActionButton'](_0x56f749,_0x6b3067,_0x1b55c8['label'],_0x1b55c8['icon']);const {listItem:_0x24c1a0,highlightViews:_0x3e116a}=this['_createSearchResultActionButton'](_0x56f749,_0x6b3067,_0x1b55c8['label'],_0x1b55c8['icon']);this['_allSearchableItems']['push']({'item':_0x24c1a0,'label':_0x6b3067['displayedPrompt'],'groupLabel':_0x1b55c8['label'],'highlightViews':_0x3e116a});});}else{const {listItem:_0x47cef2}=this['_createActionButton'](_0x56f749,_0x1b55c8);_0x480d14['add'](_0x47cef2);const _0x4f8a15=_0x47cef2['children']['first'];if(_0x4f8a15){const {listItem:_0x412446,highlightViews:_0x4d88b1}=this['_createSearchResultActionButton'](_0x56f749,_0x1b55c8);this['_allSearchableItems']['push']({'item':_0x412446,'label':_0x4f8a15['label']||'','highlightViews':_0x4d88b1});}}}),_0x480d14;}['_createActionButton'](_0x414072,_0x3b48d7,_0x3ac38c,_0x38c6ef){const _0x5257c7=new _0x19da3d(this['locale']);if(_0x3ac38c&&_0x38c6ef){const _0xb61afe=new _0x5be5f6(this['locale']),_0x5cc4d5=_0xb61afe['bindTemplate'],_0x29e657=new _0x1df954();_0x29e657['text']=_0x3b48d7['displayedPrompt'];const _0x1ee7a0=new _0x1df954();_0x1ee7a0['text']=_0x3ac38c;const _0x1f36c9=new _0x26d10b();_0x1f36c9['content']=_0x38c6ef,_0x1f36c9['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x12219c=new _0x1f124f(this['locale']);_0x12219c['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x225a8c=new _0x1f124f(this['locale']);return _0x225a8c['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0xb61afe['set']({'label':_0x3b48d7['displayedPrompt']+'\x20('+_0x3ac38c+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0xb61afe['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':[_0x29e657,_0x12219c,_0x1f36c9,_0x1ee7a0,_0x225a8c],'on':{'mouseenter':_0x5cc4d5['to'](()=>{this['_isSearchFocused']()||_0xb61afe['focus']();}),'click':_0x5cc4d5['to'](()=>{_0xb61afe['fire']('execute');})}}),_0xb61afe['on']('execute',()=>{_0x414072['editing']['view']['focus'](),_0x414072['commands']['execute']('aiQuickAction',_0x3b48d7);}),_0x5257c7['children']['add'](_0xb61afe),{'listItem':_0x5257c7,'highlightViews':[_0x29e657,_0x1ee7a0]};}{const _0x42e04d=new _0x5f2692(),_0x266aec=new _0x5be5f6(this['locale'],_0x42e04d),_0x278d69=_0x266aec['bindTemplate'],_0x36ca92=_0x3b48d7['icon']??_0x3b48d7['parent']?.['icon'],_0x5ee40b=void 0x0!==_0x3b48d7['icon'];return _0x266aec['set']({'label':_0x3b48d7['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x5ee40b?_0x36ca92??_0x1201c9:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x266aec['extendTemplate']({'on':{'mouseenter':_0x278d69['to'](()=>{this['_isSearchFocused']()||_0x266aec['focus']();})}}),_0x266aec['on']('execute',()=>{_0x414072['editing']['view']['focus'](),_0x414072['commands']['execute']('aiQuickAction',_0x3b48d7);}),_0x5257c7['children']['add'](_0x266aec),{'listItem':_0x5257c7,'highlightViews':[_0x42e04d]};}}['_createSearchResultActionButton'](_0x20bc86,_0x49e834,_0x3823a0,_0x294fed){return _0x3823a0&&_0x294fed?this['_createSearchResultGroupedActionButton'](_0x20bc86,_0x49e834,_0x3823a0,_0x294fed):this['_createSearchResultIndividualActionButton'](_0x20bc86,_0x49e834);}['_createSearchResultGroupedActionButton'](_0x28b2c8,_0x57444c,_0x1793d6,_0x5b04af){const _0x43e78e=new _0x19da3d(this['locale']),_0x15bef2=new _0x5be5f6(this['locale']),_0x16787c=_0x15bef2['bindTemplate'],{view:_0xca4c94,highlightView:_0x81bce2}=this['_createSearchResultGroupRow'](_0x1793d6,_0x5b04af),{view:_0x422890,highlightView:_0x4283cb}=this['_createSearchResultActionRow'](_0x57444c['displayedPrompt']),_0x47ec14=this['_createSearchResultContentView'](_0xca4c94,_0x422890);return _0x15bef2['set']({'label':_0x57444c['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}),_0x15bef2['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':[_0x47ec14],'on':{'mouseenter':_0x16787c['to'](()=>{this['_isSearchFocused']()||_0x15bef2['focus']();}),'click':_0x16787c['to'](()=>{this['_handleSearchResultButtonClick'](_0x15bef2);})}}),this['_setupActionButtonExecution'](_0x15bef2,_0x28b2c8,_0x57444c),_0x43e78e['children']['add'](_0x15bef2),{'listItem':_0x43e78e,'highlightViews':[_0x81bce2,_0x4283cb]};}['_createSearchResultIndividualActionButton'](_0x23ec48,_0x3f63e0){const _0x3cf0d8=new _0x19da3d(this['locale']),_0x25bd89=new _0x5f2692(),_0x38c5c5=new _0x5be5f6(this['locale'],_0x25bd89),_0x3275c9=_0x38c5c5['bindTemplate'];return _0x38c5c5['set']({'label':_0x3f63e0['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x38c5c5['extendTemplate']({'on':{'mouseenter':_0x3275c9['to'](()=>{this['_isSearchFocused']()||_0x38c5c5['focus']();})}}),this['_setupActionButtonExecution'](_0x38c5c5,_0x23ec48,_0x3f63e0),_0x3cf0d8['children']['add'](_0x38c5c5),{'listItem':_0x3cf0d8,'highlightViews':[_0x25bd89]};}['_createSearchResultGroupRow'](_0x674383,_0x3d812d){const _0x20096b=new _0x1f124f(this['locale']),_0x33b704=new _0x26d10b();_0x33b704['content']=_0x3d812d,_0x33b704['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x569e3d=new _0x1df954();return _0x569e3d['text']=_0x674383,_0x20096b['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x33b704,_0x569e3d]}),{'view':_0x20096b,'highlightView':_0x569e3d};}['_createSearchResultActionRow'](_0x230d53){const _0x2a2c88=new _0x1f124f(this['locale']),_0x7ec8cf=new _0x1df954();return _0x7ec8cf['text']=_0x230d53,_0x2a2c88['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x7ec8cf]}),{'view':_0x2a2c88,'highlightView':_0x7ec8cf};}['_createSearchResultContentView'](_0x2c68c5,_0x56d676){const _0xcdc7c4=new _0x1f124f(this['locale']);return _0xcdc7c4['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x2c68c5,_0x56d676]}),_0xcdc7c4;}['_setupActionButtonExecution'](_0x4132df,_0x2223e3,_0x21b12b){_0x4132df['on']('execute',()=>{_0x2223e3['editing']['view']['focus'](),_0x2223e3['commands']['execute']('aiQuickAction',_0x21b12b);});}['_createActionGroupButton'](_0x2f753b,_0x5e6f82,_0x5bdef2){const _0x5e803d=new _0x19da3d(this['locale']),_0x58ae1e=new _0x5f2692(),_0x782bf8=new vs(this['locale'],_0x58ae1e),_0xf230a2=_0x782bf8['bindTemplate'],_0x291e9f=this['_getPanelKeystroke'](_0x5bdef2),_0x55fe09=this['_createGroupActionsList'](_0x2f753b,_0x5e6f82['actions'],_0x5bdef2);_0x782bf8['set']({'label':_0x5e6f82['label'],'withText':!0x0,'role':Ts,'icon':_0x5e6f82['icon']??_0x1201c9,'isEnabled':_0x5e6f82['actions']['some'](_0x2de25f=>_0x2de25f['isEnabled'])}),_0x782bf8['extendTemplate']({'on':{'mouseenter':_0xf230a2['to'](()=>{this['_isSearchFocused']()||_0x782bf8['focus']();})}});const _0x229b8e=new _0x134db1(this['locale']);return _0x229b8e['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0xf230a2['to'](_0x1e6eea=>{this['_handlePanelKeydown'](_0x1e6eea,_0x291e9f,_0x782bf8,_0x229b8e);})}}),_0x782bf8['bind']('isOn')['to'](_0x229b8e,'isVisible'),this['_bodyCollection']['add'](_0x229b8e),_0x229b8e['content']['add'](_0x55fe09),this['_setupGroupMenuBehavior'](_0x782bf8,_0x229b8e),_0x5e803d['children']['add'](_0x782bf8),{'listItem':_0x5e803d,'highlightView':_0x58ae1e};}['_createGroupActionsList'](_0x52315b,_0x4fd4b3,_0x274790){const _0x4ac4a8=new _0x5f8d0a(this['locale']);return _0x4ac4a8['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x4fd4b3['forEach'](_0x1e1a27=>{const _0x519102=new _0x19da3d(this['locale']),_0x5e2646=ee({'editor':_0x52315b,'action':_0x1e1a27,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x519102['children']['add'](_0x5e2646),_0x274790['focusTracker']['add'](_0x5e2646),_0x4ac4a8['items']['add'](_0x519102);}),_0x4ac4a8;}['_setupGroupMenuBehavior'](_0x4dc128,_0x5d232c){const _0x12c467=_0x4dc128['bindTemplate'],_0x41e2d1=this['_getButtonKeystroke'](_0x4dc128);_0x4dc128['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x12c467['to'](()=>{this['_showNestedPanel'](_0x5d232c,_0x4dc128);}),'mouseleave':_0x12c467['to'](_0x17a31a=>{const _0x4eaa85=_0x17a31a['relatedTarget'];this['_isMovingToNestedMenu'](_0x4eaa85,_0x5d232c)||this['_hideNestedPanel'](_0x5d232c);}),'keydown':_0x12c467['to'](_0x52bfa2=>{_0x52bfa2['key']==_0x41e2d1&&(this['_showNestedPanel'](_0x5d232c,_0x4dc128),_0x5d232c['content']['get'](0x0)['focus']());})}}),_0x5d232c['on']('render',()=>{_0x5d232c['element']?.['addEventListener']('mouseleave',_0x36ca60=>{const _0x42629f=_0x36ca60['relatedTarget'];_0x4dc128['element']?.['contains'](_0x42629f)||this['_isMovingToNestedMenu'](_0x42629f,_0x5d232c)||this['_hideNestedPanel'](_0x5d232c);});});}['_showNestedPanel'](_0x94df52,_0x6c7c79){this['_openNestedPanels']['forEach'](_0x5a41fe=>{_0x5a41fe!==_0x94df52&&_0x5a41fe['isVisible']&&_0x5a41fe['hide']();}),_0x94df52['show'](),_0x94df52['pin']({'positions':[_0x8c845f['eastSouth']],'target':_0x6c7c79['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x94df52);}['_hideNestedPanel'](_0x850fc6){_0x850fc6['hide'](),this['_openNestedPanels']['delete'](_0x850fc6);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0xc16fd0=>_0xc16fd0['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x2c4070,_0x12dcaf){if(!_0x2c4070)return!0x1;if(_0x12dcaf['element']?.['contains'](_0x2c4070))return!0x0;const _0x192a8b=_0x2c4070;return _0x192a8b['closest']&&(null!==_0x192a8b['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x192a8b['closest']('.ck-ai-quick-actions-group-list')||null!==_0x192a8b['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'](_0x198ab7){return'rtl'===_0x198ab7['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x12205c){return'rtl'===_0x12205c['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x3fbb66,_0x3510ec,_0x1089b5,_0x5e789b){_0x3fbb66['key']==_0x3510ec&&(_0x1089b5['focus'](),this['_hideNestedPanel'](_0x5e789b));}['_handleSearchResultButtonClick'](_0x55d660){_0x55d660['fire']('execute');}}function te(_0x274395){const {editor:_0x1a2e9d,content:_0x1416c8,buttonDefinition:_0x39418c,bodyCollection:_0x5f19dc,hasSearch:_0x3147ee=!0x1}=_0x274395;return()=>{const _0xfcae6c=_0x1a2e9d['locale'],_0x53a0da=_0x12dfeb(_0xfcae6c);_0x53a0da['buttonView']['set']({'icon':_0x39418c['icon']??_0x1201c9,'label':_0x39418c['label'],'tooltip':!0x0}),_0x53a0da['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x3ada22=new ao(_0x1a2e9d,_0x1416c8,_0x53a0da,_0x5f19dc,_0x3147ee);if(_0x53a0da['panelView']['children']['add'](_0x3ada22),_0x3147ee){const _0x493f4e='ai-quick-actions-dropdown-selection';_0x53a0da['on']('change:isOpen',(_0x26fd67,_0x4e3219,_0x5c4ac9)=>{if(_0x5c4ac9){if(_0x1a2e9d['plugins']['has']('AIEditing')){const _0x9710f=_0x1a2e9d['plugins']['get'](S),_0x279628=_0x1a2e9d['model']['document']['selection'],_0x2f80da=Array['from'](_0x279628['getRanges']());_0x2f80da['length']>0x0&&_0x9710f['showFakeVisualSelection'](_0x2f80da,_0x493f4e,!0x1,!0x0);}}else _0x1a2e9d['plugins']['has']('AIEditing')&&_0x1a2e9d['plugins']['get'](S)['hideFakeVisualSelection'](_0x493f4e),_0x3ada22['resetSearch']();});}return _0x53a0da;};}const ae='<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>',se='<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>',re='<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 Ft=function(_0x7aaedc){return _0x7aaedc['CHAT']='CHAT',_0x7aaedc['ACTION']='ACTION',_0x7aaedc['REVIEW']='REVIEW',_0x7aaedc;}({}),Ga=function(_0x4b9515){return _0x4b9515['CHAT']='AIChat',_0x4b9515['ACTION']='AIActions',_0x4b9515['REVIEW']='AIReviewMode',_0x4b9515;}({});class ii extends _0x2a032b{static get['requires'](){return[_0x563d6a];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x96c24a=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x96c24a),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x1290ce){return function(_0x206579){const _0x5952bd=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x206579['uiLanguage']),_0x3ed1db=_0x5952bd||'English',_0x47adb0=[{'id':'ask-ai','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Wt},{'id':'chat-commands','label':i(_0x206579,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Wt,'actions':[{'id':'explain','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ae['replace']('%0',_0x3ed1db),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':se['replace']('%0',_0x3ed1db),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':re['replace']('%0',_0x3ed1db),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Vt},{'id':'continue','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Bt},{'id':'fix-grammar','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Jt},{'id':'adjust-length','label':i(_0x206579,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Kt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x206579,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Gt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x206579,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Zt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x206579,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x206579,'AI_QUICK_ACTIONS_OTHER'),'icon':Xt,'actions':[]}];return _0x47adb0;}(_0x1290ce);}async['_getDefaultAndCustomActions'](){const _0x429a40=ii['getDefaultQuickActions'](this['editor']['locale']),_0x2e3781=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0xa7d135=[];try{_0xa7d135=await new oe({'connector':this['editor']['plugins']['get']('AIConnector'),'availableModels':this['editor']['config']['get']('ai.chat.models.displayedModels')})['getAvailableModels']();}catch(_0x268cd7){const _0x42f3c9=new _0x5cac2e('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x268cd7});_t(_0x42f3c9['message']);}finally{const _0x42e06c=_0x2e3781['map'](_0x4f7dd6=>({..._0x4f7dd6,'icon':void 0x0}));_0x429a40['find'](_0x1503b1=>'other'===_0x1503b1['id'])['actions']['push'](..._0x42e06c),_0x429a40['forEach'](_0x1bdb1c=>{if('actions'in _0x1bdb1c)_0x1bdb1c['actions']['forEach'](_0x22d317=>{if(_0x22d317['isEnabled']=!!_0xa7d135['find'](_0x3c9068=>_0x3c9068['id']===_0x22d317['model'])||void 0x0===_0x22d317['model'],!_0x22d317['isEnabled']){const _0x17d83e=new _0x5cac2e('ai-quick-actions-unavailable-model',this,{'actionId':_0x22d317['id'],'modelId':_0x22d317['model']});_t(_0x17d83e['message']);}});else{if(_0x1bdb1c['isEnabled']=!!_0xa7d135['find'](_0xc13dad=>_0xc13dad['id']===_0x1bdb1c['model'])||void 0x0===_0x1bdb1c['model'],!_0x1bdb1c['isEnabled']){const _0x3818f3=new _0x5cac2e('ai-quick-actions-unavailable-model',this,{'actionId':_0x1bdb1c['id'],'modelId':_0x1bdb1c['model']});_t(_0x3818f3['message']);}}});}return _0x429a40;}['_initializeQuickActionsComponentsAndCommands'](){const _0x4923c7=new _0x1e472e(this['editor']['locale']);_0x4923c7['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x4923c7),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x4923c7);}['_initializeQuickActionsDropdown'](_0x1996ad){const _0x3bacfc=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',te({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x1201c9,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x1996ad,'hasSearch':_0x3bacfc}));}['_prepareQuickActionsDefinition'](_0x35b89b){this['_quickActionsDefinition']=_0x35b89b['map'](_0x4886cb=>{if('actions'in _0x4886cb){const _0x2a4524=_0x4886cb;return{..._0x2a4524,'actions':_0x2a4524['actions']['map'](_0x49fb16=>{const {actions:_0x374610,..._0x52664e}=_0x2a4524;return{..._0x49fb16,'parent':_0x52664e};})['filter'](_0x17c1f4=>this['_shouldIncludeAction'](_0x17c1f4))};}return _0x4886cb;})['filter'](_0x3747a8=>'actions'in _0x3747a8?_0x3747a8['actions']['length']>0x0:this['_shouldIncludeAction'](_0x3747a8));}['_shouldIncludeAction'](_0xcf2de2){const _0xd5f9ed=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ga[_0xcf2de2['type']])&&!_0xd5f9ed['includes'](_0xcf2de2['id']);}['_initializeQuickActionsComponents'](_0x5402b6){this['_quickActionsDefinition']['forEach'](_0x2234e0=>{if('actions'in _0x2234e0){const _0x318559=te({'editor':this['editor'],'content':_0x2234e0['actions'],'buttonDefinition':_0x2234e0,'bodyCollection':_0x5402b6});this['editor']['ui']['componentFactory']['add'](_0x2234e0['id'],_0x318559),_0x2234e0['actions']['forEach'](_0x296efd=>{const _0xbb1fde=ee({'editor':this['editor'],'action':_0x296efd});this['editor']['ui']['componentFactory']['add'](_0x296efd['id'],_0xbb1fde);});}else{const _0x39351a=ee({'editor':this['editor'],'action':_0x2234e0,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x2234e0['id'],_0x39351a);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x353dbe=>{const _0x1d0f75=new _0x104620(_0x353dbe),_0x4fa9c8=i(_0x353dbe,'AI_QUICK_ACTIONS_HEADING');_0x1d0f75['buttonView']['set']({'label':_0x4fa9c8,'icon':_0x1201c9});const _0x6d66ed=new _0x4a8496(_0x353dbe);_0x6d66ed['set']({'ariaLabel':_0x4fa9c8,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x486df7=>{if('actions'in _0x486df7){const _0x4bf84e=_0x486df7,_0x3c1580=new _0x200fb1(_0x353dbe,_0x1d0f75),_0x15667f=new _0x104620(_0x353dbe),_0x192a25=new _0x4a8496(_0x353dbe);_0x15667f['buttonView']['set']({'label':_0x4bf84e['label'],'icon':_0x4bf84e['icon']}),_0x4bf84e['actions']['forEach'](_0x3cb4f7=>{const _0x1a358f=new _0x200fb1(_0x353dbe,_0x15667f),_0x4d14a1=new _0x33defb(_0x353dbe);_0x4d14a1['set']({'label':_0x3cb4f7['displayedPrompt'],'icon':_0x3cb4f7['icon'],'role':'menuitem','isEnabled':_0x3cb4f7['isEnabled']}),_0x4d14a1['on']('execute',()=>{this['_executeQuickAction'](_0x3cb4f7);}),_0x4d14a1['delegate']('execute')['to'](_0x15667f),_0x1a358f['children']['add'](_0x4d14a1),_0x192a25['items']['add'](_0x1a358f);}),_0x15667f['panelView']['children']['add'](_0x192a25),_0x3c1580['children']['add'](_0x15667f),_0x6d66ed['items']['add'](_0x3c1580);}else{const _0x1dd41e=_0x486df7,_0x2751ad=new _0x200fb1(_0x353dbe,_0x1d0f75),_0x1f8258=new _0x33defb(_0x353dbe);_0x1f8258['set']({'label':_0x1dd41e['displayedPrompt'],'icon':_0x1dd41e['icon'],'role':'menuitem','isEnabled':_0x1dd41e['isEnabled']}),_0x1f8258['on']('execute',()=>{this['_executeQuickAction'](_0x1dd41e);}),_0x1f8258['delegate']('execute')['to'](_0x1d0f75),_0x2751ad['children']['add'](_0x1f8258),_0x6d66ed['items']['add'](_0x2751ad);}});const _0x2d670a=Object['values'](Ga)['some'](_0x31cb0a=>this['editor']['plugins']['has'](_0x31cb0a));return _0x1d0f75['set']({'isEnabled':_0x2d670a}),_0x1d0f75['panelView']['children']['add'](_0x6d66ed),_0x1d0f75;});}['_executeQuickAction'](_0x33015a){const _0x58eda4=this['editor'];_0x58eda4['editing']['view']['focus'](),_0x58eda4['commands']['execute']('aiQuickAction',_0x33015a);const _0x135c54=_0x58eda4['ui']['view']['menuBarView'];_0x135c54&&_0x135c54['close']&&_0x135c54['close']();}}class ci extends Qt{['execute'](_0x568019){switch(this['_expandSelectionIfCollapsed'](),_0x568019['type']){case Ft['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x507a60=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x5cac2e('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x507a60});}this['_handleAIChatAction'](_0x568019);break;case Ft['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x2788be=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x5cac2e('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x2788be});}this['_handleAIActionsAction'](_0x568019);break;case Ft['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x4d81ef=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x5cac2e('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x4d81ef});}this['_handleAIReviewAction'](_0x568019);}}async['_handleAIChatAction'](_0x1b5212){const _0x5cb40b=this['editor']['plugins']['get']('AIChat'),_0x3eebf4=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x1b5212['id'])_0x3eebf4['removeSelectionFromChatContext'](),await _0x5cb40b['addSelectionToChatContext'](),_0x5cb40b['focusPromptInput']();else await _0x5cb40b['startConversation'](),_0x3eebf4['removeSelectionFromChatContext'](),await _0x5cb40b['addSelectionToChatContext'](),_0x5cb40b['focusPromptInput'](),await _0x5cb40b['sendMessage']({'message':_0x1b5212['prompt']||_0x1b5212['displayedPrompt'],'quickActionData':{'id':_0x1b5212['id'],'displayedPrompt':_0x1b5212['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x38cc0a=this['editor'],_0x3716eb=_0x38cc0a['model']['document']['selection'];if(!_0x3716eb['isCollapsed'])return;const _0x3119b9=_0x5f540c(_0x3716eb['getSelectedBlocks']())||_0x38cc0a['model']['schema']['getLimitElement'](_0x3716eb);_0x38cc0a['model']['change'](_0x5b3e2e=>{_0x5b3e2e['setSelection'](_0x3119b9,'in');});}['_handleAIActionsActionLabel'](_0x373ae0){return _0x373ae0['parent']?.['label']&&'other'!==_0x373ae0['parent']?.['id']?_0x373ae0['parent']['label']+':\x20'+_0x373ae0['displayedPrompt']:_0x373ae0['displayedPrompt'];}async['_handleAIActionsAction'](_0x3143e2){const _0xcd0399=this['editor']['plugins']['get']('AIActions'),_0xd8f5ed=_0x3143e2['prompt']?{'userMessage':_0x3143e2['prompt'],'model':_0x3143e2['model']}:{'actionName':_0x3143e2['actionName']||_0x3143e2['id'],'args':_0x3143e2['args']},_0x4dc631=this['_handleAIActionsActionLabel'](_0x3143e2);await _0xcd0399['executeAction'](_0xd8f5ed,_0x4dc631,_0x3143e2['icon']);}async['_handleAIReviewAction'](_0x3e6d4f){console['log']('handleAIReviewAction',_0x3e6d4f);}}class ti extends _0x2a032b{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x27f6e0=this['editor'],_0x49f20a=new ci(this['editor']);if(_0x27f6e0['commands']['add']('aiQuickAction',_0x49f20a),_0x27f6e0['plugins']['has']('AIChat')){const _0x1a765b=this['editor']['plugins']['get']('AIChat');_0x27f6e0['model']['document']['selection']['on']('change:range',(_0x542c80,_0x2ed99d)=>{_0x2ed99d['directChange']&&_0x1a765b['removeSelectionFromChatContext']();});}}}class Ae extends Ge{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x4bc529=this['documentContextContent']['children']['map'](_0xe39b9b=>({'node':_0xe39b9b,'id':wt(_0xe39b9b,'data-id')})),_0x189010=this['parsedMergedContent']['children']['map'](_0x43efea=>({'node':_0x43efea,'id':wt(_0x43efea,'data-id')||_0x1cb0e0()})),_0x44691f=_0x582dcc(_0x4bc529,_0x189010,{'comparator':(_0x435a15,_0x2e8fb2)=>_0x435a15['id']==_0x2e8fb2['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x44691f['length']&&_0x44691f[_0x44691f['length']-0x1]['removed'];)_0x44691f['pop']();}const _0x113393=_0x44691f['map'](_0x12df60=>{const _0x2c5b23=_0x12df60['added']?'new':_0x12df60['removed']?'removed':'modified';return{'node':_0x12df60['value'][0x0]['node'],'type':_0x2c5b23,'id':_0x12df60['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x113393,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x2b4ff1,_0x2d91c1){return _0x2d91c1;}}class Q extends xe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x5ad122){super(_0x5ad122),this['content']=_0x5ad122['content'],this['version']=_0x5ad122['version'],this['actionName']=_0x5ad122['actionName'],this['args']=_0x5ad122['args'],this['userMessage']=_0x5ad122['userMessage'],this['model']=_0x5ad122['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':je['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x366fe5){const _0xe7912d=new Ae({'editor':this['editor'],'documentContextContent':this['content'],..._0x366fe5});return this['replies']['push'](_0xe7912d),_0xe7912d['delegate'](...Ce)['to'](this),this['fire']('replyCreated',_0xe7912d),_0xe7912d;}}class ri extends _0x2a032b{static get['requires'](){return[R,_0xc33e8e,S,it,nt];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x840caa();['_navigationPreviousButton'];['_navigationCounter'];['_isNavigationCounterInView']=!0x1;['_navigationNextButton'];['_isNavigationPreviousButtonInView']=!0x1;['_isNavigationNextButtonInView']=!0x1;['_promiseQueue'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}constructor(_0x323ccd){super(_0x323ccd),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new st(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x381146,_0x556bf4,_0x354e5c){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x378037,anchorData:_0x512a5c}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x381146,_0x378037,_0x512a5c,_0x556bf4,_0x354e5c);}}const {modelFragment:_0x734075,anchorData:_0x580775}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x381146,_0x734075,_0x580775,_0x556bf4,_0x354e5c);}['_getExecuteDataRegular'](){const _0xbab613=this['editor']['model']['document']['selection'];if(_0xbab613['isCollapsed']){const _0x1d4233=_0x5f540c(_0xbab613['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0xbab613);this['editor']['model']['change'](_0x361cf1=>{_0x361cf1['setSelection'](_0x1d4233,'in');});}const _0x3b60ad=_0xbab613['getFirstRange'](),_0x4226d3=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0xbab613),_0x3b60ad['start'],_0x3b60ad['end']),_0x3a41e9=_0xbab613['getFirstRange']()['start'],_0x1538f0=new Map();let _0x518def=_0x4226d3;for(let _0x1ebf41=0x0;_0x1ebf41<_0x3a41e9['path']['length'];_0x1ebf41++)_0x1538f0['set'](_0x518def,_0x3a41e9['path'][_0x1ebf41]),_0x518def=_0x518def['getChild'](0x0);return{'modelFragment':_0x4226d3,'anchorData':_0x1538f0};}['_getExecuteDataInTable'](){const _0x52e130=this['editor']['model']['document']['selection'],_0x4d5a1d=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x498a77=_0x52e130['getFirstRange']()['start']['parent']['parent'],_0xce02fd=this['_wrapWithCommonAncestors'](_0x4d5a1d,this['editor']['model']['createPositionBefore'](_0x498a77),this['editor']['model']['createPositionAfter'](_0x498a77)),_0x3a4b11=_0x52e130['getFirstRange']()['start'],_0x1c4e44=new Map();let _0x403a4c=_0xce02fd;for(let _0x285d8a=0x0;_0x285d8a<_0x3a4b11['path']['length'];_0x285d8a++)if(_0x1c4e44['set'](_0x403a4c,_0x3a4b11['path'][_0x285d8a]),_0x285d8a<_0x3a4b11['path']['length']-0x1)_0x403a4c=_0x403a4c['getChild'](0x0);else{let _0x2ff9db=_0x403a4c['nextSibling'];for(;_0x2ff9db;)_0x1c4e44['set'](_0x2ff9db,_0x3a4b11['path'][_0x285d8a]),_0x2ff9db=_0x2ff9db['nextSibling'];}return{'modelFragment':_0xce02fd,'anchorData':_0x1c4e44};}['_executeAction'](_0x4ad9c9,_0x4bf1ae,_0x149746,_0x4cc1fe,_0x223939){const _0xe68757=this['editor']['plugins']['get'](S),_0x4403f8=this['editor']['plugins']['get'](it),_0x3b3f6c=this['editor']['model']['document']['selection'],_0x2c7091=_0xe68757['modelToViewWithIds'](_0x4bf1ae),_0x3f88f9=this['editor']['data']['processor']['toData'](_0x2c7091),_0x1d2410=this['editor']['model']['document']['version'],_0x1f533e=[..._0x3b3f6c['getRanges']()];let _0x3102f1=this['editor']['config']['get']('ai.availableReplyActions')||[...H];this['editor']['plugins']['has']('TrackChanges')||(_0x3102f1=_0x3102f1['filter'](_0x2d35eb=>'insertSuggestion'!=_0x2d35eb));const _0x262d93=new F(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0,'availableActions':_0x3102f1});return _0x4403f8['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x4cc1fe,'icon':_0x223939||_0x1201c9,'mainView':_0x262d93,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':this['editor']['plugins']['has']('TrackChanges'),'ranges':_0x1f533e}),this['_setLoadingState'](_0x262d93,_0x4403f8),this['listenTo'](_0x4403f8,'applySuggestion',()=>{this['_applyChanges'](_0x4bf1ae,_0x149746,!0x1);}),this['listenTo'](_0x4403f8,'insertSuggestion',()=>{this['_applyChanges'](_0x4bf1ae,_0x149746,!0x0);}),this['listenTo'](_0x4403f8,'selectionRemoved',()=>{this['_stopInteraction'](),this['_disableCustomViews']();}),this['listenTo'](_0x4403f8,'dialogClosed',()=>{if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x1a222e=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x267d7f=_0x1a222e['changeGroups'][0x0];_0x267d7f&&'pending'===_0x267d7f['state']&&_0x1a222e['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x4403f8);}),this['_createInteraction'](_0x3f88f9,_0x1d2410,_0x262d93,_0x4403f8,_0x4ad9c9);}['_wrapWithCommonAncestors'](_0x2cbcfe,_0x1ec521,_0x3119d1){const _0x355fda=this['editor']['model']['createRange'](_0x1ec521,_0x3119d1)['getCommonAncestor'](),_0x260757=_0x355fda['is']('documentFragment')?[]:_0x355fda['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x260757['length']){const _0x3d0920=_0x260757['map'](_0x583256=>_0x583256['_clone'](!0x1));for(let _0x1651d2=0x1;_0x1651d2<_0x3d0920['length'];_0x1651d2++)_0x3d0920[_0x1651d2-0x1]['_appendChild'](_0x3d0920[_0x1651d2]);return _0x3d0920[_0x3d0920['length']-0x1]['_appendChild'](_0x2cbcfe),new at(_0x3d0920[0x0]);}return _0x2cbcfe;}async['_createInteraction'](_0x45c276,_0x613451,_0x2c544a,_0x5afcb5,_0x44d445){const _0x29ddf2=this['editor'];this['_interactionParams']={'action':_0x44d445,'content':_0x45c276,'version':_0x613451,'mainView':_0x2c544a,'aiBalloon':_0x5afcb5};const _0x2e182f=new Q({'connector':this['_aiConnector'],'editor':_0x29ddf2,'content':_0x45c276,'version':_0x613451,..._0x44d445});this['_interactions']['push'](_0x2e182f),_0x2c544a['hideError']();const _0x577f84=(_0x809c28,_0xc510b2,_0x4f1527=!0x1,_0x376087='streaming')=>this['_promiseQueue']['enqueue'](async _0x3fdffb=>{try{const _0x5904bc=et({'editor':_0x29ddf2,'changeGroups':_0x809c28['changeGroups'],'documentContextContent':_0x809c28['documentContextContent'],'showDiff':_0x4f1527,'trimUnchanged':!0x1});await _0xc510b2['updateContent']({'parts':_0x5904bc,'renderingStrategy':_0x376087,'abortSignal':_0x3fdffb});}catch(_0x3d9989){if(this['_isAbortError'](_0x3d9989))return;throw _0x3d9989;}});this['_interaction']['on']('replyCreated',(_0x345e9f,_0x4aba69)=>{_0x2c544a['hideLoader'](),_0x5afcb5['startAutoScroll'](),_0x577f84(_0x4aba69,_0x2c544a)['catch'](_0x14df7c=>{this['_isAbortError'](_0x14df7c)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x14df7c),this['_setErrorState'](_0x2e182f,_0x2c544a));});}),this['_interaction']['on']('replyContentUpdated',(_0x2cf203,_0x3ba629)=>{_0x577f84(_0x3ba629,_0x2c544a)['catch'](_0x26cca4=>{this['_isAbortError'](_0x26cca4)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x26cca4),this['_setErrorState'](_0x2e182f,_0x2c544a));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x2c544a,_0x5afcb5),this['_updateNavigationUI'](),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0xadd4b5){this['_isAbortError'](_0xadd4b5)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0xadd4b5),this['_setErrorState'](_0x2e182f,_0x2c544a));}finally{_0x5afcb5['stopAutoScroll']();}}),this['listenTo'](_0x2c544a,'toggleSuggestionDisplayMode',async(_0x3b6d7f,{showDiff:_0x1d3c22})=>{try{this['_balloonShowDiff']=_0x1d3c22;const _0x319969=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x319969&&await _0x577f84(_0x319969,_0x2c544a,_0x1d3c22,'static');}catch(_0x1b07f2){this['_isAbortError'](_0x1b07f2)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x1b07f2),this['_setErrorState'](_0x2e182f,_0x2c544a));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x3f2c83,{reply:_0x207d77})=>{const _0x2a9a11={'positiveCount':_0x207d77['changeGroups']['filter'](_0x1d4224=>'accepted'===_0x1d4224['state'])['length'],'totalCount':_0x207d77['changeGroups']['length']},_0x2ba17f=this['_interaction']['actionCallId'],_0x1cd4ca=this['_interaction']['actionName'];_0x1cd4ca?this['_aiConnector']['upsertAIActionRating'](_0x1cd4ca,_0x2ba17f,_0x2a9a11):this['_aiConnector']['upsertCustomAIActionRating'](_0x2ba17f,_0x2a9a11);}),this['_setLoadingState'](_0x2c544a,_0x5afcb5);try{const _0x444f45=await this['_interaction']['start']();return this['_updateNavigationUI'](),_0x444f45;}catch(_0x47694e){if(this['_isAbortError'](_0x47694e))return;_0x2c544a['hideLoader'](),this['_setErrorState'](_0x2e182f,_0x2c544a);}}['_applyChanges'](_0x3d52e4,_0x438eae,_0x55d7e5){const _0x39a694=this['editor'];if(_0x55d7e5&&!_0x39a694['plugins']['has']('TrackChanges'))throw new _0x5cac2e('ai-no-track-changes',null);const _0x33cb5f=this['editor']['plugins']['get'](nt),_0x2327e7=this['_interaction'],_0x447b4e=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x1157b2=_0x447b4e['changeGroups'];_0x447b4e['setChangeGroupState'](0x0,'accepted');let _0x1e0b22=rt({'editor':_0x39a694,'reply':_0x447b4e,'interaction':_0x2327e7,'groups':_0x1157b2,'transform':!0x1,'documentCompare':_0x33cb5f,'documentCompareOptions':{'anchor':_0x39a694['model']['createPositionAt'](_0x3d52e4,0x0),'markDeletions':_0x55d7e5}});_0x1e0b22=this['_filterOperationsOutsideRange'](_0x1e0b22,_0x438eae);for(const _0x31ba6d of _0x1e0b22)this['_anchorOperation'](_0x438eae,_0x31ba6d,_0x39a694['model']['document']['getRoot']());const _0x9cbf81=_0x2327e7['getDocumentContext']()['version'],_0x4a6a73=_0x39a694['model']['document']['history']['getOperations'](_0x9cbf81),_0x25d544={'document':_0x39a694['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x356151=ut(_0x1e0b22,_0x4a6a73,_0x25d544)['operationsA'];_0x39a694['model']['change'](_0xfce00=>{if(_0xfce00['setSelection'](_0x39a694['model']['document']['selection']['focus']),_0x55d7e5)_0x39a694['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x356151);else{for(const _0x570833 of _0x356151)_0x570833['baseVersion']=_0x39a694['model']['document']['version'],ot(_0x39a694,_0x570833),_0xfce00['batch']['addOperation'](_0x570833),_0x39a694['model']['applyOperation'](_0x570833);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x23bff3,_0x5b8f6e){return _0x23bff3['filter'](_0x4102da=>{if('rename'==_0x4102da['type']){const _0x1eb322=_0x4102da['position']['nodeAfter'];return!_0x5b8f6e['has'](_0x1eb322);}if(_0x4102da['type']['indexOf']('Attribute')>-0x1){const _0xe224d0=_0x4102da['range']['start']['nodeAfter'];return!_0x5b8f6e['has'](_0xe224d0);}return!0x0;});}['_anchorOperation'](_0x31634e,_0x342a38,_0x10bf40){const _0x4d1dc4=_0x342a38['clone']();for(const _0xf89276 in _0x342a38){const _0xe83266=_0x342a38[_0xf89276];_0xe83266 instanceof ht?_0x342a38[_0xf89276]=new ht(_0x5eff73(_0xe83266['start']),_0x5eff73(_0xe83266['end'])):_0xe83266 instanceof ct&&(_0x342a38[_0xf89276]=_0x5eff73(_0xe83266));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x4d1dc4['type'])){if(_0x4d1dc4['isDocumentOperation']=!0x1,_0x4d1dc4['baseVersion']=null,'remove'==_0x4d1dc4['type']){const _0x2b45bd=_0x4d1dc4['sourcePosition'],_0x573bdd=_0x4d1dc4['howMany'];new lt(_0x2b45bd,_0x573bdd)['_execute']();}else _0x4d1dc4['_execute']();}function _0x5eff73(_0x5ecf8){if('$graveyard'==_0x5ecf8['root']['rootName'])return _0x5ecf8;const _0x3eb751=[];let _0x179232=_0x5ecf8['root'];for(let _0x4380e2=0x0;_0x4380e2<_0x5ecf8['path']['length'];_0x4380e2++){const _0x256f2e=_0x31634e['get'](_0x179232)||0x0;_0x3eb751[_0x4380e2]=_0x5ecf8['path'][_0x4380e2]+_0x256f2e,_0x179232=_0x179232['getChildAtOffset'](_0x5ecf8['path'][_0x4380e2]);}return new ct(_0x10bf40,_0x3eb751,_0x5ecf8['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x2154cf,content:_0x693d0d,version:_0x16730e,mainView:_0x1f77d7,aiBalloon:_0x123a63}=this['_interactionParams'];_0x1f77d7['areChangesVisible']=!0x1,_0x1f77d7['hideError'](),this['_clearErrorState'](_0x1f77d7,_0x123a63);const _0x569f3d=_0x1f77d7;_0x569f3d['miniToolbarView']&&_0x569f3d['miniToolbarView']['showChangesButton']&&_0x569f3d['miniToolbarView']['showChangesButton']['set']({'isOn':!0x1,'icon':tt}),this['_clearSuggestionContent'](_0x1f77d7),_0x1f77d7['showLoader'](),this['_updateNavigationUI'](),this['stopListening'](_0x1f77d7),this['_createInteraction'](_0x693d0d,_0x16730e,_0x1f77d7,_0x123a63,_0x2154cf)['catch'](_0x22f2d2=>{this['_isAbortError'](_0x22f2d2)||console['error']('Error\x20refreshing\x20interaction:',_0x22f2d2);});}['_clearSuggestionContent'](_0x305194){const _0x545b62=_0x305194['bodyView']['_children'];for(;_0x545b62['length']>0x0;)_0x545b62['remove'](_0x545b62['first']);_0x305194['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x4b3374){return!!_0x4b3374['message']&&_0x4b3374['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_updateNavigationUI']();}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_interactionParams']['aiBalloon']['stopAutoScroll']();}['_setupCustomViews'](){const _0x2c15bd=new _0x5be5f6(this['editor']['locale']),_0x475bee=new _0x5be5f6(this['editor']['locale']),_0x2eaeb1=new _0x1f124f(this['editor']['locale']),_0x1f2369=new _0x5be5f6(this['editor']['locale']);_0x2c15bd['set']({'icon':_0x4fb256,'label':i(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x475bee['set']({'icon':_0x31357f,'tooltip':i(this['editor']['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x2eaeb1['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':['1/1']}),_0x1f2369['set']({'icon':_0x5af157,'tooltip':i(this['editor']['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x2c15bd['bind']('isEnabled')['to'](this,'isBusy',_0x5939b8=>!_0x5939b8),_0x2c15bd['on']('execute',()=>{this['_refreshInteraction']();}),_0x475bee['bind']('isEnabled')['to'](this,'isBusy',_0x1d58ca=>!_0x1d58ca),_0x475bee['on']('execute',()=>{this['_navigateToPrevious']();}),_0x1f2369['bind']('isEnabled')['to'](this,'isBusy',_0x5bb030=>!_0x5bb030),_0x1f2369['on']('execute',()=>{this['_navigateToNext']();}),this['_navigationPreviousButton']=_0x475bee,this['_navigationCounter']=_0x2eaeb1,this['_navigationNextButton']=_0x1f2369,this['_customViews']['add'](_0x2c15bd);}['_navigateToPrevious'](){const _0x4eb043=this['_interactions']['length'];this['_currentInteractionIndex']<_0x4eb043-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0xf2b342){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0xf2b342;const {mainView:_0x4fddaf}=this['_interactionParams'],_0x3e7ba2=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x3e7ba2)return;if(_0x3e7ba2['hasError'])return this['_setErrorState'](_0x3e7ba2,_0x4fddaf),void this['_updateNavigationUI']();if(!_0x3e7ba2['replies']['length'])return;_0x4fddaf['hideError'](),this['_interactionParams']&&this['_clearErrorState'](_0x4fddaf,this['_interactionParams']['aiBalloon']);const _0x2cd3b8=_0x3e7ba2['replies'][_0x3e7ba2['replies']['length']-0x1];if(_0x2cd3b8){const _0x30fcbf=this['editor'];this['_clearSuggestionContent'](_0x4fddaf);try{const _0x2cf306=et({'editor':_0x30fcbf,'changeGroups':_0x2cd3b8['changeGroups'],'documentContextContent':_0x2cd3b8['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});this['_clearSuggestionContent'](_0x4fddaf),await new Promise(_0xa0fbd0=>setTimeout(_0xa0fbd0,0x32)),await _0x4fddaf['updateContent']({'parts':_0x2cf306,'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x70f7f4){this['_isAbortError'](_0x70f7f4)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x70f7f4);}}this['_updateNavigationUI']();}['_updateNavigationUI'](){if(!this['_navigationPreviousButton']||!this['_navigationCounter']||!this['_navigationNextButton'])return;const _0x4ea2ef=this['_interactions']['length'],_0x492444=_0x4ea2ef>0x1,_0x126015=this['_interactionParams']?.['mainView'];if(_0x492444){this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView']||(this['_customViews']['add'](this['_navigationPreviousButton']),_0x126015?.['addNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x0,this['_customViews']['add'](this['_navigationCounter']),_0x126015?.['addNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x0,this['_customViews']['add'](this['_navigationNextButton']),_0x126015?.['addNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x0);const _0x491617=_0x4ea2ef-this['_currentInteractionIndex'];this['_navigationCounter']['element']&&(this['_navigationCounter']['element']['textContent']=_0x491617+'/'+_0x4ea2ef),this['_navigationPreviousButton']['isEnabled']=this['_currentInteractionIndex']<_0x4ea2ef-0x1,this['_navigationNextButton']['isEnabled']=this['_currentInteractionIndex']>0x0;}else(this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView'])&&(this['_customViews']['remove'](this['_navigationPreviousButton']),_0x126015?.['removeNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x1,this['_customViews']['remove'](this['_navigationCounter']),_0x126015?.['removeNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x1,this['_customViews']['remove'](this['_navigationNextButton']),_0x126015?.['removeNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x1);}['_setLoadingState'](_0x167008,_0x2d9a36){_0x167008['setLoading'](),_0x2d9a36['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_setErrorState'](_0x4d20e8,_0x253980){const _0x42118c=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');_0x253980['showError'](_0x42118c),_0x4d20e8['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],_0x253980['setErrorState'](),this['_interactionParams']?.['aiBalloon']['balloonView']['toolbar']&&(this['_interactionParams']['aiBalloon']['balloonView']['toolbar']['isLoading']=!0x0);}['_clearErrorState'](_0x1471b1,_0x1a0222){_0x1471b1['clearErrorState'](),_0x1a0222['balloonView']['toolbar']&&(_0x1a0222['balloonView']['toolbar']['isLoading']=!0x1);}async['_clearLoadingState'](_0x506f93,_0x2a00dc){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x506f93['clearLoading'](),_0x2a00dc['balloonView']['clearLoading']();}['_disableCustomViews'](){this['_customViews']['forEach'](_0x43773d=>{'isEnabled'in _0x43773d&&(_0x43773d['isEnabled']=!0x1);});}}class Ba extends _0x2a032b{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2b8d69){super(_0x2b8d69),_0x2b8d69['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class mo{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x4b7e21,title:_0x5db8fe,description:_0x58c996,isParameterized:_0x496ffd,useArgs:_0x25986a,options:_0x2f97ad}){this['id']=_0x4b7e21,this['title']=_0x5db8fe,this['description']=_0x58c996,this['isParameterized']=_0x496ffd,this['useArgs']=_0x25986a,this['options']=_0x2f97ad;}}class kr extends mo{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x3d6267){this['_models']=_0x3d6267;}}class si extends ts(){['_checks'];constructor(_0x48af06){super(),this['_checks']=this['_mapCheckDefinitions'](_0x48af06);}get['checks'](){return this['_checks'];}['getCheckById'](_0x42cd3e){return this['checks']['find'](_0x41c3e1=>_0x41c3e1['id']===_0x42cd3e);}['removeCheckById'](_0x385ec0){this['_checks']=this['_checks']['filter'](_0x4ff9b6=>_0x4ff9b6['id']!==_0x385ec0);}['_mapCheckDefinitions'](_0x3400a3){return _0x3400a3['map'](_0x1e5979=>'custom'===_0x1e5979['id']?new kr(_0x1e5979):new mo(_0x1e5979));}}class hn extends _0x5194ed(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x4b5e26,contentNew:_0x3d29ee,contentInitial:_0x5adade,documentVersion:_0x351603}){super(),this['id']=_0x4b5e26,this['contentNew']=_0x3d29ee,this['contentInitial']=_0x5adade,this['documentVersion']=_0x351603;}}class an extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x2ae809,_0x541380,_0x207179){super(),this['id']=_0x2ae809,this['parent']=_0x207179,this['_data']=_0x541380,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 Rr extends ts(){['id']=_0x1cb0e0();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x596530,_0x11118c,_0x53c764,_0x5e9e78,_0x1e0c86){super(),this['_sourceCheck']=_0x11118c,this['_documentData']=_0x596530,this['_aiConnector']=_0x53c764,this['_reviewParams']=_0x5e9e78,this['_reviewArgs']=_0x1e0c86,this['on']('change:status',(_0x4dbc34,_0x409af4,_0x5809fa)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x5809fa,'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'](_0x86c0c0=>'pending'===_0x86c0c0['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x3ec18e){this['_documentData']=_0x3ec18e;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x167fda=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x3c98ce of _0x167fda)'unmodified'!==_0x3c98ce['data']['operation']&&('error'!==_0x3c98ce['data']['operation']?'review-metadata'!==_0x3c98ce['event']?this['_addReviewCheckResult'](_0x3c98ce['data']['dataId'],_0x3c98ce['data']['textDelta']):this['callId']=_0x3c98ce['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']?this['status']='unmodified':this['status']='ready');}catch(_0x4d9ed8){this['_currentError']=_0x4d9ed8,_0x4d9ed8 instanceof Error&&_0x4d9ed8['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'](_0x3da2e1,_0x1acdfd){const _0x59610e=this['_results']['get'](_0x3da2e1);if(!_0x59610e)return;const _0x3f5893=[];_0x1acdfd['forEach']((_0xc62cd0,_0xe936b6)=>{const _0x5f3ac8=new an(_0x59610e['id']+'-'+_0xe936b6,_0xc62cd0,_0x59610e);_0x5f3ac8['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x5f3ac8,'status':_0x5f3ac8['status']});}),_0x5f3ac8['on']('change:isActivated',()=>{_0x5f3ac8['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x5f3ac8}):this['fire']('reviewCheckResultDeactivated',{'change':_0x5f3ac8});}),this['_changes']['push'](_0x5f3ac8),_0x3f5893['push'](_0x5f3ac8);}),this['fire']('reviewCheckResultReady',{'changes':_0x3f5893,'result':_0x59610e,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x57971e){const _0x502b5a=this['_changes']['find'](_0x53aaef=>_0x53aaef['id']===_0x57971e);return!(!_0x502b5a||'pending'!==_0x502b5a['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x3c3af9=>!0x0===_0x3c3af9['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x100b65=>'pending'===_0x100b65['status']);}['getChangeById'](_0x2d9800){return this['_changes']['find'](_0x515298=>_0x515298['id']===_0x2d9800);}['markAllChangesAsAccepted'](){for(const _0xaa1c93 of this['_changes'])'pending'===_0xaa1c93['status']&&(_0xaa1c93['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x29f489){const _0x4d30e3=this['_changes']['find'](_0x55c03b=>_0x55c03b['id']===_0x29f489);_0x4d30e3&&'pending'===_0x4d30e3['status']&&(_0x4d30e3['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x5bff62){const _0x301f99=this['_changes']['find'](_0x3a88f9=>_0x3a88f9['id']===_0x5bff62);_0x301f99&&'pending'===_0x301f99['status']&&(_0x301f99['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x4ac1bf){const _0x17e1ea=this['_changes']['find'](_0x236be3=>_0x236be3['id']===_0x4ac1bf);_0x17e1ea&&'pending'===_0x17e1ea['status']&&(_0x17e1ea['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x26a7ee){const _0x4d8732=this['_changes']['find'](_0x1e871f=>_0x1e871f['id']===_0x26a7ee);_0x4d8732&&'outdated'===_0x4d8732['status']&&(_0x4d8732['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x1428c8){this['_changes']['filter'](_0x4340fc=>_0x4340fc['isActivated']&&_0x4340fc['id']!==_0x1428c8)['forEach'](_0x31a4b6=>{_0x31a4b6['isActivated']=!0x1;});const _0x1fcfac=this['_changes']['find'](_0x474cc6=>_0x474cc6['id']===_0x1428c8);_0x1fcfac&&'pending'===_0x1fcfac['status']&&(_0x1fcfac['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x4b9b42=>_0x4b9b42['isActivated'])['forEach'](_0xe7ddf8=>{_0xe7ddf8['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x56c315){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x3c9d7c;if(_0x56c315){const _0x246be2=this['_changes']['find'](_0x15dc56=>_0x15dc56['id']===_0x56c315);if(_0x246be2&&_0x246be2['isRated'])return;_0x246be2&&(_0x3c9d7c=_0x246be2['parent']['id'],_0x246be2['isRated']=!0x0);}const _0x13c989={'positiveCount':this['_changes']['filter'](_0x178b89=>'accepted'===_0x178b89['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x13c989,this['callId'],_0x3c9d7c);}['_addReviewCheckResult'](_0x4933d3,_0x42b7e8){const _0x101c2f=this['_documentData']['elements']['get'](_0x4933d3);if(!_0x101c2f)return;const _0x263e44=_0x101c2f['getContent']();if(_0x263e44===_0x42b7e8)return;const _0x2ab43a=new hn({'id':_0x4933d3,'contentInitial':_0x263e44,'contentNew':_0x42b7e8,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x2ab43a['id'],_0x2ab43a),this['fire']('reviewCheckResultAdded',{'result':_0x2ab43a,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x4e7833=>'pending'===_0x4e7833['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x1c1b76=>'pending'===_0x1c1b76['status'])['length']&&(this['status']='finished'));}}class hi extends Rr{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x2cd942=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0xb9a6af=0x0;_0xb9a6af<this['_reviewParams']['length'];_0xb9a6af++){if(!this['_reviewParams'][_0xb9a6af]||!this['_sourceCheck']['options'][_0xb9a6af])continue;const _0x103e95=this['_sourceCheck']['options'][_0xb9a6af],_0x48cbe4=_0x103e95['data']?.['find'](_0x44702f=>_0x44702f['id']===this['_reviewParams'][_0xb9a6af]);_0x48cbe4&&_0x2cd942['push'](_0x48cbe4['label']);}return _0x2cd942['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x3e83ec,_0x2fbd3a,_0x548a82){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x2fbd3a,_0x3e83ec,_0x548a82);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class oi extends Rr{['_prompt'];['_model'];constructor(_0x4cd0c5,_0x36182a,_0x5b5ab8,_0x112ed3,_0x1d7b69){super(_0x5b5ab8,_0x112ed3,_0x1d7b69),this['_prompt']=_0x4cd0c5,this['_model']=_0x36182a;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x586588,_0xcebafb,_0x52108a){return this['_aiConnector']['upsertCustomAIReviewRating'](_0xcebafb,_0x586588,_0x52108a);}}const ni=[{'id':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'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':'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'}]}]},{'id':'translate','title':'Translate','description':'Translate\x20the\x20text\x20into\x20another\x20language.','isParameterized':!0x0,'useArgs':!0x0,'options':[{'formType':'dropdown','label':'Select\x20language','argsKey':'language','data':[{'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'}]}]}];class me extends _0x24ce56{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[R];}static get['pluginName'](){return'AIReviewModeController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiReviewModeUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewModeEditing']=this['context']['plugins']['get']('AIReviewModeEditing');const _0x204160=this['context']['config']['get']('ai.reviewMode.translations');if(_0x204160){for(const _0x524404 of ni)'translate'===_0x524404['id']&&(_0x524404['options'][0x0]['data']=_0x204160);}const _0x123597=this['_translateReviewChecks'](ni);this['_aiReviewCheckList']=new si(_0x123597);const _0x53e33b=this['_aiReviewCheckList']['checks']['find'](_0x2a4bef=>'custom'===_0x2a4bef['id']);if(_0x53e33b)try{const _0x1f854b=await new oe({'connector':this['_aiConnector']})['getAll']();_0x53e33b['models']=_0x1f854b['map'](_0x5d17e2=>({..._0x5d17e2,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0x5d17e2['id']['toUpperCase'](),_0x5d17e2['description'])}));}catch(_0x25307b){this['_aiReviewCheckList']['removeCheckById']('custom'),this['_logError'](new _0x5cac2e('ai-review-mode-models-unable-to-retrieve',this,{'error':_0x25307b}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0xeace2,_0x57d047)=>{const _0x353da4=this['_aiReviewCheckList']['getCheckById'](_0x57d047['id']);if(_0x353da4){this['_onDiffChange'](this['_isDiffOn']),_0x57d047['isCustom']?this['_currentReviewCheckRun']=new oi(_0x57d047['args']['prompt'],_0x57d047['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x353da4,this['_aiConnector']):this['_currentReviewCheckRun']=new hi(this['_aiReviewModeEditing']['getDocumentData'](),_0x353da4,this['_aiConnector'],_0x57d047['params'],_0x57d047['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x2e3226,_0x3775c4)=>{'data'===_0x3775c4['status']||'loading'===_0x3775c4['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x3775c4)):'finished'===_0x3775c4['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x3775c4['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'unmodified'===_0x3775c4['status']?this['_aiReviewModeUi']['showNoChangesView']():'error-general'===_0x3775c4['status']?(this['_aiReviewModeUi']['showGeneralResultsErrorView'](),this['_logError'](new _0x5cac2e('ai-review-mode-check-run-general-error',this,this['_currentReviewCheckRun']?.['currentError']))):'error-chunk'===_0x3775c4['status']?(this['_aiReviewModeUi']['showChunkErrorView'](),this['_logError'](new _0x5cac2e('ai-review-mode-check-run-chunk-error',this,this['_currentReviewCheckRun']?.['currentError']))):'aborted'===_0x3775c4['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0)),'ready'!==_0x3775c4['status']&&'error-chunk'!==_0x3775c4['status']&&'error-general'!==_0x3775c4['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x1bf0b7,_0x249f8f)=>{if(!this['_currentReviewCheckRun'])throw new _0x5cac2e('ai-review-mode-no-current-check-run',this);const _0x59d71b=this['_aiReviewModeEditing']['diffContent'](_0x249f8f['result']['contentInitial'],_0x249f8f['result']['contentNew']);_0x249f8f['source']['addResultChanges'](_0x249f8f['result']['id'],_0x59d71b);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x147e4b,_0x2cd741)=>{for(const _0x5f3e3d of _0x2cd741['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x5f3e3d);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x2cd741['changes'],_0x2cd741['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x231bd7,_0x2af964)=>{this['_aiReviewModeUi']['updateChangeState'](_0x2af964['change']['id'],_0x2af964['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x23e82e,_0x48054a)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x48054a['change']['id']);const _0x2072f3=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x48054a['change']['id']);if(!_0x2072f3)return;if('content'===this['_changeActivationSource']){const _0x251299=this['_aiReviewModeUi']['getChangeElement'](_0x48054a['change']['id']);_0x251299&&_0x444aef(_0x251299['closest']('.ck-ai-review-mode__check-run-result')||_0x251299);}else{if('panel'===this['_changeActivationSource']){const _0x57b2f5={'target':_0x2072f3['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};_0x1a71b0(_0x57b2f5);}}const _0xc240a7=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x48054a['change'],_0x2072f3['domElement'],void 0x0,'click',_0xc240a7?.['editing']?.['view']?.['getDomRoot'](),_0xc240a7?.['ui']?.['viewportOffset']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults'](),this['_aiReviewModeUi']['hideChangeBalloon']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x496845){_0x496845 instanceof Error&&_0x496845['message']['includes']('ai-request-aborted')||(_0x496845 instanceof _0x5cac2e?this['_logError'](_0x496845):this['_logError'](new _0x5cac2e('ai-review-mode-check-run-failed',this,{'error':_0x496845})));}}else this['_logError'](new _0x5cac2e('ai-review-mode-source-check-not-found',this,{'checkId':_0x57d047['id']}));}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewMode',()=>{this['_onReviewModeRunLeave']();}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewModeResultList',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewModeUi'],'finishReview',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x1902a1=this['_currentReviewCheckRun']['getActiveChanges']();_0x1902a1['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x1902a1['map'](_0x5b5b9b=>_0x5b5b9b['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted'](),this['_currentReviewCheckRun']['sendRating']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x45159c,_0x42402c)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x42402c['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x42402c['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x42402c['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x42402c['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0xc82416,_0x53bd8e)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x53bd8e['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x53bd8e['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x53bd8e['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x53bd8e['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x13b4fb,_0x1eaf23)=>{this['_isDiffOn']=_0x1eaf23['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewModeEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewModeEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x45d930,_0x41863c)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x41863c['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x102a93,_0x57aaa2)=>{if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x57aaa2['changeId']);const _0x4d26b1=this['_currentReviewCheckRun']['getChangeById'](_0x57aaa2['changeId']);if(!_0x4d26b1)return;const _0x3051ad=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x4d26b1,_0x57aaa2['markerElement'],_0x57aaa2['domEvent'],'click',_0x3051ad?.['editing']?.['view']?.['getDomRoot'](),_0x3051ad?.['ui']?.['viewportOffset']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerHovered',(_0x4e83fc,_0x39f842)=>{if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x4da8f7=this['_currentReviewCheckRun']['getChangeById'](_0x39f842['changeId']);if(!_0x4da8f7)return;const _0x2afc34=this['_aiReviewModeEditing']['getEditor']();this['_aiReviewModeUi']['showChangeBalloon'](_0x4da8f7,_0x39f842['markerElement'],_0x39f842['domEvent'],'hover',_0x2afc34?.['editing']?.['view']?.['getDomRoot'](),_0x2afc34?.['ui']?.['viewportOffset']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerBlurred',()=>{if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewModeUi']['hideChangeBalloon']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRemoved',(_0x178890,_0x50d76a)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x50d76a['changeId']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRestored',(_0x4a0cfb,_0x464e70)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x464e70['changeId']);});}['_onReviewModeRunLeave'](_0x27a4db=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x27a4db&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x4dd38f=this['_aiReviewModeEditing']['getEditor']();_0x4dd38f&&_0x4dd38f['editing']['view']['change'](_0x9e5e66=>{const _0x563c2b=_0x4dd38f['editing']['view']['document']['getRoot']();_0x9e5e66['removeClass']('ck-ai-review-mode-diff',_0x563c2b),_0x9e5e66['removeClass']('ck-ai-review-mode-highlights',_0x563c2b);});}['_onDiffChange'](_0x45eed9){const _0x315916=this['_aiReviewModeEditing']['getEditor']();_0x45eed9?this['_aiReviewModeUi']['hideDiffInBalloon']():this['_aiReviewModeUi']['showDiffInBalloon'](),_0x315916&&_0x315916['editing']['view']['change'](_0x135575=>{const _0x2fdce4=_0x315916['editing']['view']['document']['getRoot']();_0x135575['removeClass']('ck-ai-review-mode-diff',_0x2fdce4),_0x135575['removeClass']('ck-ai-review-mode-highlights',_0x2fdce4),_0x135575['addClass'](_0x45eed9?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights',_0x2fdce4);});}['_translateReviewChecks'](_0x49af3f){return _0x49af3f['map'](_0xcafeab=>{const _0x36137b='AI_REVIEW_CHECK_'+_0xcafeab['id']['toUpperCase']()['replaceAll']('-','_'),_0x666e8d={..._0xcafeab,'title':this['_getTranslationWithDefault'](_0x36137b+'_TITLE',_0xcafeab['title']),'description':this['_getTranslationWithDefault'](_0x36137b+'_DESCRIPTION',_0xcafeab['description'])};return _0xcafeab['options']&&(_0x666e8d['options']=_0xcafeab['options']['map'](_0x26f4b9=>({..._0x26f4b9,'label':this['_getTranslationWithDefault'](_0x36137b+'_OPTIONS_LABEL',_0x26f4b9['label']||''),'data':_0x26f4b9['data']?_0x26f4b9['data']['map'](_0x41b2fc=>({..._0x41b2fc,'label':this['_getTranslationWithDefault'](_0x36137b+'_OPTIONS_DATA_'+_0x41b2fc['id']['toUpperCase'](),_0x41b2fc['label'])})):void 0x0}))),_0x666e8d;});}['_getTranslationWithDefault'](_0x24e1e0,_0x4edf17){const _0x58cc89=i(this['context']['locale'],_0x24e1e0);return _0x58cc89===_0x24e1e0?_0x4edf17:_0x58cc89;}['_logError'](_0x322c8a){_t(_0x322c8a['message']),_0x322c8a['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewModeUi']['showGeneralReviewModeErrorView']():this['_aiReviewModeUi']['showGeneralResultsErrorView']();}}class Mr extends _0x1f124f{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x3dace4,_0x4dd51b){super(_0x3dace4),this['_defaultValue']=_0x4dd51b['default']||(_0x4dd51b['data']['length']>0x0?_0x4dd51b['data'][0x0]['id']:''),this['_defaultLabel']=_0x4dd51b['data']['find'](_0x52278f=>_0x52278f['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x12dfeb(this['locale']);const _0x2e1124=this['_prepareListOptions'](_0x4dd51b['data']);_0x8575d7(this['_dropdownView'],_0x2e1124,{'role':'menu','ariaLabel':_0x4dd51b['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x13bea0=>{_0x13bea0['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x2fb124=>{this['formValue']=_0x2fb124['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x2fb124['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode__check-list-item-parameterized-form-element','ck-ai-review-mode__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x2a2beb=[]){const _0x34a6a3=new _0x128d2a();this['resetToDefault']();for(const _0x412827 of _0x2a2beb){const _0x21fedb=new _0x2b6af7({'label':_0x412827['label'],'withText':!0x0,'role':'menuitemradio','id':_0x412827['id'],'model':_0x412827});_0x21fedb['bind']('isOn')['to'](this,'formValue',_0x2e2c4a=>_0x2e2c4a===_0x21fedb['id']);const _0x2cfcd0={'type':'button','model':_0x21fedb};_0x34a6a3['add'](_0x2cfcd0);}return _0x34a6a3;}}class $s extends _0x19da3d{['_formItem']=null;constructor(_0x3a4386,_0x58ac75,_0xdef7a8){super(_0x3a4386),this['argsKey']=_0x58ac75?.['argsKey'];if('dropdown'===_0x58ac75['formType'])this['_formItem']=new Mr(this['locale'],_0x58ac75);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x453225=new _0x1dd36b(this['locale'],{'children':[this['_formItem']],'class':[_0xdef7a8?'ck-form__row_with-submit':'']});_0xdef7a8&&_0x453225['children']['add'](_0xdef7a8),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x453225]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Ws extends _0x31868f{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x25da9e){super(_0x25da9e),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x3678f9(),this['minRows']=Ws['MIN_ROWS'],this['maxRows']=Ws['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-mode-prompt-input','class':['ck','ck-review-mode__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class ec extends _0x1f124f{['focusTracker']=new _0x5e98a3();['keystrokes']=new _0x3678f9();['focusCycler'];['_focusables']=new _0x840caa();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x5ee164,_0x5849ce){super(_0x5ee164),this['_check']=_0x5849ce,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x5849ce['models']&&_0x5849ce['models']['length']>0x0?_0x5849ce['models'][0x0]['id']:'',this['_defaultLabel']=_0x5849ce['models']&&_0x5849ce['models']['length']>0x0?_0x5849ce['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x448875(this['locale'],()=>new Ws(_0x5ee164)),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 _0x128d2a(),this['_setModelList'](),_0x8575d7(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions']},'children':[new _0x1dd36b(this['locale'],{'children':[this['promptInputView']]}),new _0x1dd36b(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x5c690f,_0x58115b)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x58115b()):_0x58115b();}),this['focusCycler']=new _0x12ca41({'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'](_0x5bd01b=>{this['_focusables']['add'](_0x5bd01b),this['focusTracker']['add'](_0x5bd01b['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 _0x1bee40 of this['_getFormValidators']()){const _0x3385e6=_0x1bee40();if(_0x3385e6)return this['promptInputView']['errorText']=_0x3385e6,!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 _0x4c5374=new _0x5be5f6(this['locale']),t=this['locale']['t'];return _0x4c5374['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x4c5374['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x4c5374;}['_createCancelButtonView'](){const _0x1575ee=new _0x5be5f6(this['locale']),t=this['locale']['t'];return _0x1575ee['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x1575ee['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x451ac7=>{_0x451ac7['stopPropagation']();})}}),_0x1575ee['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x1575ee;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x2aba8a=this['_check']['models'];if(this['resetToDefault'](),_0x2aba8a?.['length']){const _0x40978a=oe['getLocalized'](this['locale'],_0x2aba8a);for(const _0x3e7515 of _0x40978a){const _0xa6ee7e=new _0x2b6af7({'label':_0x3e7515['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3e7515['id'],'model':_0x3e7515});_0xa6ee7e['bind']('isOn')['to'](this,'modelId',_0x1f420a=>_0x1f420a===_0x3e7515['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xa6ee7e,'labelView':new Ys(this['locale'],_0x3e7515)});}}}['_createModelSelectionDropdown'](){const _0x2eb688=_0x12dfeb(this['locale']);return _0x2eb688['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x2eb688['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x2eb688,'execute',_0x3686ef=>{this['modelId']=_0x3686ef['source']['model']['id'],_0x2eb688['buttonView']['label']=_0x3686ef['source']['label'];}),_0x2eb688;}['_createActionsFooterView'](){const _0x5da0da=new _0x1f124f(this['locale']);return _0x5da0da['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x5da0da;}}class Ys extends _0x3a2a12{constructor(_0x5c2c8b,_0x15b163){super();const _0x1d4266=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1d4266['to']('style'),'id':_0x1d4266['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x1d4266['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x15b163['description']||'']}]}]});}}class Gs extends _0x19da3d{['_formItemsCollection']=new _0x840caa();['_customCheckView']=null;constructor(_0x5c8ce2,_0x582985,_0x50fab1){super(_0x5c8ce2),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x582985['isParameterized']);const _0x1ec217=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai-review-mode__check-list-item_selected',_0x562e9e=>_0x562e9e),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x3a6b26=>_0x3a6b26)],'style':{'--ck-ai-review-check-list-item-index':_0x50fab1}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-list-item-title-text']},'children':[{'text':_0x582985['title']}]},_0x1ec217]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x582985['description']}]}]}]},..._0x582985['isParameterized']?[this['_createParameterizedView'](_0x582985)]:[],...'custom'===_0x582985['id']?[this['_createCustomView'](_0x582985)]:[]]}),this['on']('click',()=>{_0x582985['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x582985['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x5e494e({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x57f417=>{_0x57f417['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x53e913=new _0x26d10b();return _0x53e913['content']=_0x2c5965,_0x53e913['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x53e913;}['_createParameterizedView'](_0x5171e4){const _0x505504=new _0x1f124f(),_0x1219a8=this['_createFormView'](_0x5171e4);return _0x505504['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x230e62=>!_0x230e62)]},'children':[_0x1219a8]}),_0x505504;}['_createFormView'](_0x4ccab9){const _0x245c4a=new _0x1f124f(),_0x273b20=Array['isArray'](_0x4ccab9['options'])?_0x4ccab9['options']:[],_0x231cd5=new _0x5be5f6(this['locale']),t=this['locale']['t'];_0x231cd5['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x231cd5['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5c442=>{_0x5c442['stopPropagation']();})}}),_0x231cd5['on']('execute',()=>{const _0x478742=[],_0x5ae3d0={};this['_formItemsCollection']['forEach'](_0x221d60=>{_0x478742['push'](_0x221d60['value']),_0x4ccab9['useArgs']&&_0x4ccab9['options']&&(_0x5ae3d0[_0x221d60['argsKey']]=_0x221d60['value']);}),this['fire']('runReviewCheck',{'id':_0x4ccab9['id'],'params':_0x478742['length']?_0x478742:void 0x0,'args':Object['keys'](_0x5ae3d0)['length']?_0x5ae3d0:void 0x0});});const _0x2bb719=_0x273b20['length'];return _0x273b20['forEach']((_0x475b0f,_0x461e67)=>{const _0x59a996=_0x461e67===_0x2bb719-0x1;this['_formItemsCollection']['add'](new $s(this['locale'],_0x475b0f,_0x59a996?_0x231cd5:null));}),_0x245c4a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x245c4a;}['_createCustomView'](_0x5bf943){return this['_customCheckView']=new ec(this['locale'],_0x5bf943),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized','ck-ai-review-mode__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x46b948=>!_0x46b948)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x1bf6be,_0xd72eea,_0x39d236)=>{_0x39d236||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class ih extends _0x19da3d{['_checkViews'];constructor(_0x211bfc){super(_0x211bfc),this['_checkViews']=new _0x840caa();const _0x5b5479=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x5b5479['if']('isVisible','ck-hidden',_0x7b9be0=>!_0x7b9be0)]},'children':this['_checkViews']});}['setChecks'](_0x397d67){this['_checkViews']['clear']();for(const [_0x49f54d,_0x40b084]of _0x397d67['entries']()){const _0x302dad=new Gs(this['locale'],_0x40b084,_0x49f54d);_0x302dad['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x302dad);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x1a814f of this['_checkViews'])_0x1a814f instanceof Gs&&_0x1a814f['resetToDefault']();}}class Rs extends _0x1f124f{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['statusButtonView'];constructor(_0xdf2f9,_0xa35338){super(_0xdf2f9),this['id']=_0xa35338,this['set']('status','pending'),this['set']('changeId',_0xa35338),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['statusButtonView']=this['_createStatusButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result',this['bindTemplate']['if']('isActive','ck-ai-review-mode__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['statusButtonView']]},this['infoButtonView']]}]}),this['on']('click',()=>{this['fire']('activateChange',{'id':_0xa35338,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0xb81f9a=new _0x1f124f(this['locale']);return _0xb81f9a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-content-direct-excluded','ck-ai-review-mode__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x17bc3a=>!_0x17bc3a)]}}),_0xb81f9a;}['_createAcceptButtonView'](){const _0x28f2e7=new _0x5be5f6(this['locale']);return _0x28f2e7['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x28f2e7['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xa22045=>{this['fire']('acceptChange',{'id':this['changeId']}),_0xa22045['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x4b1c9d=>'pending'!==_0x4b1c9d)]}}),_0x28f2e7;}['_createDismissButtonView'](){const _0x439974=new _0x5be5f6(this['locale']);return _0x439974['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x439974['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x181252=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x181252['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-result-dismiss-button',this['bindTemplate']['if']('status','ck-hidden',_0x1acbd1=>'pending'!==_0x1acbd1)]}}),_0x439974;}['_createInfoButtonView'](){const _0x43ae3c=new _0x5be5f6(this['locale']);return _0x43ae3c['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x10c8fd,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x43ae3c['bind']('isOn')['to'](this,'isInfoToggleOn',_0x3cce5b=>_0x3cce5b),_0x43ae3c['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x43ae3c;}['_createStatusButtonView'](){const _0x460c77=new _0x5be5f6(this['locale']);return _0x460c77['set']({'withText':!0x0,'isEnabled':!0x1}),_0x460c77['bind']('label')['to'](this,'status',_0x255208=>i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_'+_0x255208['toUpperCase']())),_0x460c77['bind']('icon')['to'](this,'status',_0x19790a=>'ACCEPTED'===_0x19790a['toUpperCase']()?_0x33d7d6:'REJECTED'===_0x19790a['toUpperCase']()?_0x15e321:_0x30c3f5),_0x460c77['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x4b450f=>'pending'===_0x4b450f)],'disabled':'disabled'}}),_0x460c77;}}class Qs extends _0x5be5f6{constructor(_0x2962eb){super(_0x2962eb),this['set']({'label':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class eh extends _0x19da3d{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];constructor(_0x59c823){super(_0x59c823),this['_resultViews']=new _0x840caa(),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(_0x59c823),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 _0x70c1e7=this['_createCombinedSkeletonLoader'](),_0x3547d3=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x3547d3['if']('isVisible','ck-hidden',_0x2dfcb0=>!_0x2dfcb0)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x2a95e4=>_0x2a95e4)]},'children':this['_resultViews']},_0x70c1e7]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x20a73b){const _0x285db0=new Rs(this['locale'],_0x20a73b['id']);_0x285db0['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x285db0),_0x285db0['resultResponseView']['element']['innerHTML']=_0x20a73b['contentDiffed'];}['hideResult'](_0x557a05,_0xd62bf8){if('pending'===_0xd62bf8)return;const _0x2140ae=this['_resultViews']['find'](_0x5859c1=>_0x5859c1['id']===_0x557a05);_0x2140ae&&(_0x2140ae['status']=_0xd62bf8,_0x2140ae['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_grayout'));}['showResult'](_0x4927b2,_0x32a0a5){if('pending'!==_0x32a0a5)return;const _0x1530ef=this['_resultViews']['find'](_0x37454f=>_0x37454f['id']===_0x4927b2);_0x1530ef&&(_0x1530ef['status']=_0x32a0a5,_0x1530ef['element']?.['classList']['remove']('ck-ai-review-mode__check-run-result_grayout'));}['setTitle'](_0x4a3102,_0x212b79){this['headerTitle']=_0x4a3102,this['headerSubtitle']=_0x212b79||'';}['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 Be(this['locale'],We['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x505e75=new _0x1f124f(this['locale']),_0x1a0662=[];for(let _0x3018f7=0x0;_0x3018f7<0x10;_0x3018f7++){const _0x102e1e=this['_createSkeletonLoader']();_0x102e1e['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x1a0662['push'](_0x102e1e);}return _0x505e75['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x3053b3=>!_0x3053b3)]},'children':_0x1a0662}),_0x505e75;}['_createErrorView'](){const _0x1bc08e=new _0x1f124f(this['locale']),_0x5a3a6b=new _0x5be5f6(this['locale']),t=this['locale']['t'];return _0x1bc08e['delegate']('retryReview')['to'](this),_0x5a3a6b['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x5a3a6b['on']('execute',()=>{this['fire']('retryReview');}),_0x1bc08e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x3c2c14=>!_0x3c2c14),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x125ceb=>'chunk'===_0x125ceb)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x4083a3=>'chunk'===_0x4083a3)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0xb979c2=>'general'!==_0xb979c2)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x3f52a3=>'chunk'!==_0x3f52a3)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x5a3a6b]}),_0x1bc08e;}['_createCancelButtonView'](){const _0x128326=new _0x5be5f6(this['locale']);return _0x128326['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x4a18d1}),_0x128326['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x15cd18=>_0x15cd18),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4ee9fc=>_0x4ee9fc)]}}),_0x128326['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x128326;}['_createToggleDiffButtonView'](){const _0x2ad983=new _0x5be5f6(this['locale']);_0x2ad983['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x2ad983['bind']('isEnabled')['to'](this,'isError',_0x435eb6=>!_0x435eb6),_0x2ad983['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3e7485=>!_0x3e7485),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x58600e=>_0x58600e)]}});const _0x61bce7=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x55b50b=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x2ad983['bind']('isOn')['to'](this,'isToggleDiffOn',_0x38551c=>_0x38551c),_0x2ad983['bind']('icon')['to'](this,'isToggleDiffOn',_0x540fe7=>_0x540fe7?_0x3fcade:_0x66bceb),_0x2ad983['bind']('label')['to'](this,'isToggleDiffOn',_0x35e029=>_0x35e029?_0x61bce7:_0x55b50b),_0x2ad983['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x2ad983;}['_createAcceptAllButtonView'](){const _0x3469db=new _0x5be5f6(this['locale']);return _0x3469db['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x3469db['bind']('isEnabled')['to'](this,'isError',_0x153dc9=>!_0x153dc9),_0x3469db['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x56d750=>!_0x56d750),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x534fa2=>_0x534fa2)]}}),_0x3469db['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x3469db;}['_createExitReviewButtonView'](){const _0x3d938c=new _0x5be5f6(this['locale']);return _0x3d938c['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x3d938c['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x55e59c=>!_0x55e59c),this['bindTemplate']['if']('isCompleted','ck-hidden',_0xb06db2=>_0xb06db2)]}}),_0x3d938c['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x3d938c;}['_createResultHeaderView'](){const _0xfe20d9=new _0x1f124f(this['locale']),_0x20aec0=this['_createTitleView']();return _0xfe20d9['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai-review-mode__review-completed-header',_0x126b28=>_0x126b28)]},'children':[_0x20aec0,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0xfe20d9;}['_createTitleView'](){const _0x3a1efe=new _0x1f124f(this['locale']),_0x180d95=new qe();return _0x180d95['bind']('isVisible')['to'](this,'isResultReady',_0x1c7b21=>!_0x1c7b21),_0x3a1efe['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-wrapper']},'children':[_0x180d95,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x222419=>_0x222419)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x10965c=>!_0x10965c)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x3a1efe;}['_createFinishReviewButtonView'](){const _0x15c942=new Qs(this['locale']);return _0x15c942['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2a2ad4=>!_0x2a2ad4)]}}),_0x15c942['delegate']('finishReview')['to'](this),_0x15c942;}}class th extends _0x19da3d{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x2280a2){super(_0x2280a2),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x86078a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x86078a['if']('isVisible','ck-hidden',_0xc5fa46=>!_0xc5fa46)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai-review-mode__review-completed-content-text']},'children':[{'text':i(_0x2280a2,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x108104=new Qs(this['locale']);return _0x108104['delegate']('finishReview')['to'](this),_0x108104;}['_createResultHeaderView'](){const _0x166d0e=new _0x1f124f(this['locale']);return _0x166d0e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title']},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x166d0e;}}class hh extends _0x1f124f{constructor(_0x5c223b){super(_0x5c223b),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x17be2d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__general-error-container',_0x17be2d['if']('isVisible','ck-hidden',_0x33fd25=>!_0x33fd25)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x17be2d['to']('errorMessage')}]}]});}}class ve extends _0x1f124f{['reviewModeHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x1a5f0d){super(_0x1a5f0d),this['reviewModeHeader']=new _0xb4a1f4(_0x1a5f0d,{'label':i(_0x1a5f0d,'AI_REVIEW_MODE'),'icon':_0x18e785,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['generalErrorView']=new hh(_0x1a5f0d),this['reviewCheckListView']=new ih(_0x1a5f0d),this['reviewCheckListView']['delegate'](...sh)['to'](this),this['reviewCheckResultsView']=new eh(_0x1a5f0d),this['reviewCheckResultsView']['delegate'](...sh)['to'](this),this['reviewCompletedView']=new th(_0x1a5f0d),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-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],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'](_0x511fcf){this['reviewCheckResultsView']['addResult'](_0x511fcf),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;}['showGeneralReviewModeErrorView'](_0xb2dc74){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0xb2dc74;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class Ie extends _0x134db1{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x152f39,_0x2d976c){super(_0x152f39),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']()),_0x2d976c['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x2f27ab){this['resultItemView']['changeId']=_0x2f27ab['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x2f27ab['contentDiffed'];}['showBalloon'](_0x8b245,_0x404420,_0x6c9a00,_0x232508,_0x22b503,_0x30031a){this['_removeActiveClassFromMarkers'](),this['updateContent'](_0x8b245),this['show']();const _0x96e3aa=Array['from'](_0x404420['getClientRects']())['reverse'](),_0x26fb43=this['_getPointedRectIndexFromEvent'](_0x6c9a00,_0x96e3aa);'click'===_0x232508?(this['isDiffActive']=!0x0,this['_setActiveClassOnMarker'](_0x8b245['id']),this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x404420,_0x26fb43,_0x8b245['id'],_0x22b503,_0x30031a)})):'hover'===_0x232508&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x404420,_0x26fb43,_0x8b245['id'])}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_removeActiveClassFromMarkers'](),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');}['_removeActiveClassFromMarkers'](){_0x38b85c['document']['querySelectorAll']('.ck-ai-review-mode__change_active')['forEach'](_0x2c5079=>{_0x2c5079['classList']['remove']('ck-ai-review-mode__change_active');});}['_setActiveClassOnMarker'](_0x5bf678){_0x38b85c['document']['querySelectorAll']('span[data-marker-id*=\x22'+_0x5bf678+'\x22]')['forEach'](_0x551258=>{_0x551258['classList']['add']('ck-ai-review-mode__change_active');});}['_setupClickOutsideHandler'](){_0x5e494e({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x271d30=[this['element']];return this['_pinnedTargetElement']&&_0x271d30['push'](this['_pinnedTargetElement']),_0x271d30;},'callback':()=>{this['hide'](),this['unpin'](),this['_removeActiveClassFromMarkers'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x3a9c8c=new _0x1f124f();return this['resultItemView']=new Rs(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x3a9c8c['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai-review-mode-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0x3a9c8c;}['_getBestRectPositionOnClick'](_0x226ae9,_0x529309,_0x2ca30f,_0x2b5731,_0x3e9c29){const _0x36f4dc=this['position']['replace']('arrow_',''),_0x2f1c95=Array['from'](_0x226ae9['getClientRects']());let _0x53e6bf,_0x551c5f=_0x2f1c95['reverse']();return void 0x0!==_0x529309&&this['_isPinnedRectVisible'](_0x551c5f[_0x529309],_0x2b5731,_0x3e9c29)?(_0x53e6bf=_0x551c5f[_0x529309],this['_pinnedRectIndex']=_0x529309):this['_isPinnedRectVisible'](_0x551c5f[0x0],_0x2b5731,_0x3e9c29)&&void 0x0===_0x529309?_0x53e6bf=_0x551c5f[0x0]:(_0x551c5f='s'==_0x36f4dc[0x0]?[..._0x2f1c95]['reverse']():_0x2f1c95,_0x551c5f['forEach'](_0x4c508f=>{this['_isPinnedRectVisible'](_0x4c508f,_0x2b5731,_0x3e9c29)&&(_0x53e6bf=_0x4c508f);})),this['_pinnedTargetChangeId']=_0x2ca30f,this['_pinnedTargetElement']=_0x226ae9,_0x53e6bf||_0x226ae9['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x33e206,_0x3b7620,_0x46fa5d){const _0x2eae6b=Array['from'](_0x33e206['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x3b7620&&this['_pinnedTargetChangeId']!==_0x46fa5d)return this['_pinnedRectIndex']=_0x3b7620,this['_pinnedTargetElement']=_0x33e206,this['_pinnedTargetChangeId']=_0x46fa5d,_0x2eae6b[_0x3b7620];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x46fa5d){if(_0x33e206!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x2eae6b[this['_pinnedRectIndex']];}return void 0x0!==_0x3b7620&&this['_pinnedTargetChangeId']!==_0x46fa5d?(this['_pinnedRectIndex']=_0x3b7620,this['_pinnedTargetElement']=_0x33e206,this['_pinnedTargetChangeId']=_0x46fa5d,_0x2eae6b[_0x3b7620]):_0x33e206['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x26f5aa,_0x59f8c3){if(_0x26f5aa)for(let _0x3ff689=0x0;_0x3ff689<_0x59f8c3['length'];_0x3ff689++){const _0x174974=_0x59f8c3[_0x3ff689];if(_0x26f5aa['clientX']>=_0x174974['left']-0x3&&_0x26f5aa['clientX']<=_0x174974['right']+0x3&&_0x26f5aa['clientY']>=_0x174974['top']-0x3&&_0x26f5aa['clientY']<=_0x174974['bottom']+0x3)return _0x3ff689;}}['_isPinnedRectVisible'](_0x50de5c,_0x6dae3d,_0x22352d){const _0x18526a=new _0x2063b2(_0x50de5c),_0x305a8b=_0x6dae3d||document['documentElement'],_0xcca228=_0x18526a['getIntersection'](_0x2c67a3(_0x22352d)),_0x54ef7a=new _0x2063b2(_0x305a8b)['getIntersection'](_0x18526a);return!!(_0xcca228&&_0x54ef7a&&_0x18526a['width']>0x0);}}const sh=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ce extends _0x24ce56{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[ft];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x39100c){super(_0x39100c),this['_bodyCollection']=new _0x1e472e(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new ve(this['context']['locale']),this['_reviewModeView']['delegate'](...sh)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new Ie(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0xfc65dc=this['context']['plugins']['get']('AITabs');_0xfc65dc['view']['on']('activateTab',(_0x4a2133,_0x3aeea7)=>{'reviewMode'===_0x3aeea7?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0xfc65dc['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x18e785,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x21ab81){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x21ab81),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x5f42f7){_0x5f42f7&&('error-general'!==_0x5f42f7['status']?'error-chunk'!==_0x5f42f7['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x3b56a8){this['_reviewModeView']['addCheckRunResult'](_0x3b56a8);}['showGeneralResultsErrorView'](){this['_reviewModeView']['showGeneralResultsErrorView']();}['showGeneralReviewModeErrorView'](_0x5527ee){this['_reviewModeView']['showGeneralReviewModeErrorView'](_0x5527ee??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0xf97388,_0x4d04cd){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0xf97388,_0x4d04cd);}['setActiveStateInResults'](_0x12c4fd){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x2d04a0=>{_0x2d04a0['id']===_0x12c4fd&&_0x2d04a0['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x1e1652=>_0x1e1652['setItemAsInactive']());}['updateChangeState'](_0x2830f7,_0x3a2206){'accepted'===_0x3a2206||'rejected'===_0x3a2206||'outdated'===_0x3a2206?this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x2830f7,_0x3a2206):this['_reviewModeView']['reviewCheckResultsView']['showResult'](_0x2830f7,_0x3a2206);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x48ad02,_0x3b8689,_0x40897d,_0x48d275,_0x1882d7,_0x20c61e){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x48ad02,_0x3b8689,_0x40897d,_0x48d275,_0x1882d7,_0x20c61e);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['hideDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['showDiffInBalloon']();}['getChangeElement'](_0x362098){const _0x25961c=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x4d8c89=>_0x4d8c89['id']===_0x362098);return _0x25961c?_0x25961c['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const pe='reviewmode-';class ue extends _0x24ce56{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[nt,S];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x25dfa2){super(_0x25dfa2),this['_domEmitter']=new(_0x27b81b())(),this['_eventEmitter']=new(_0x5194ed())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x5d41d3=q(this['context']);_0x5d41d3['conversion']['for']('editingDowncast')['markerToElement']({'model':pe+'insert','view':(_0x3d062b,{writer:_0x1ebcb3})=>{const _0x572de7=this['_markers']['get'](_0x3d062b['markerName']),_0xf00a24={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x3d062b['markerName']};return _0x1ebcb3['createUIElement']('span',_0xf00a24,function(_0x15b114){const _0x2d31a4=this['toDomElement'](_0x15b114);return _0x2d31a4['innerHTML']=_0x572de7?.['text']||'',_0x2d31a4;});}}),_0x5d41d3['conversion']['for']('editingDowncast')['markerToHighlight']({'model':pe+'remove-only','view':_0x19fdb4=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x19fdb4['markerName']}})}),_0x5d41d3['conversion']['for']('editingDowncast')['markerToHighlight']({'model':pe+'remove-context','view':_0x5c45d4=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x5c45d4['markerName']}})}),_0x5d41d3['conversion']['for']('editingDowncast')['markerToHighlight']({'model':pe+'remove-text','view':_0x5c3ee4=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x5c3ee4['markerName']}})}),_0x5d41d3['conversion']['for']('dataDowncast')['markerToElement']({'model':pe+'suggestion-context','view':(_0x3f206c,{writer:_0x2f90ef})=>_0x2f90ef['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x3f206c['isOpening']?'start':'end')})}),_0x5d41d3['conversion']['for']('downcast')['attributeToAttribute']({'model':At,'view':_0x3ee98d}),this['_domEmitter']['listenTo'](document,'click',(_0x1b9713,_0x4c5b42)=>{const _0x56e0d7=_0x4c5b42['target'],_0x24386a=this['_findMarkerElement'](_0x56e0d7);if(!_0x24386a)return;const _0x338367=_0x24386a['getAttribute']('data-marker-id'),_0x577edd=_0x338367['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x338367,'changeId':_0x577edd,'markerElement':_0x24386a,'domEvent':_0x4c5b42});}),this['_domEmitter']['listenTo'](document,'mouseover',(_0x132f3b,_0xa839d6)=>{const _0x5bb3ea=_0xa839d6['target'],_0x384eb2=_0xa839d6['relatedTarget'];let _0xdfafaa=this['_findMarkerElement'](_0x5bb3ea);if(!_0xdfafaa&&_0x384eb2&&(_0xdfafaa=this['_findMarkerElement'](_0x384eb2)),!_0xdfafaa)return;const _0x3bdf50=_0xdfafaa['getAttribute']('data-marker-id'),_0x11d1d2=_0x3bdf50['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x11d1d2,'markerElement':_0xdfafaa,'domEvent':_0xa839d6});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x2f0749((_0x535b61,_0x12965d)=>{const _0x4bc746=_0x12965d['target'];if(this['_findMarkerElement'](_0x4bc746))return;_0x4bc746['closest']('.ck-reset.ck-ai-review-mode-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x5d41d3['model']['document']['registerPostFixer'](_0x127aaa=>this['_validateMarkers'](_0x5d41d3,_0x127aaa)),_0x5d41d3['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x5d41d3));}['getDocumentData'](){const _0x5858a5=this['context']['plugins']['get']('AIEditing'),_0x2d7c13=q(this['context']),_0x479065=_0x2d7c13['model'],_0x578c4a=new at();for(const _0x2cb606 of _0x479065['document']['getRoot']()['getChildren']()){const _0x17ddbe=_0x2cb606['_clone'](!0x0);_0x578c4a['_appendChild'](_0x17ddbe);}for(const _0x4c39e9 of _0x479065['markers'])_0x578c4a['markers']['set'](_0x4c39e9['name'],this['_changeRangeOwnerDocument'](_0x4c39e9['getRange']()['clone'](),_0x578c4a));const _0x2d1e8a=new _0x1ada95({'ignoreElementEnd':!0x0,'startPosition':_0x479065['createPositionAt'](_0x578c4a,0x0)}),_0x2b06fc=new Set(),_0x117e42=new Map();for(const {item:_0x51e337}of _0x2d1e8a){if(!_0x51e337['is']('$textProxy'))continue;const _0xd8d7fd=_0x51e337['parent'];if(_0xd8d7fd&&_0xd8d7fd['is']('element')){const _0x56b8ba=this['_upsertDataId'](_0xd8d7fd,()=>_0x5858a5['_nextDataId'](_0x2b06fc));_0x2b06fc['add'](_0x56b8ba);for(const _0x36b742 of _0xd8d7fd['getChildren']())_0x36b742['is']('element')&&_0x2b06fc['add'](this['_upsertDataId'](_0x36b742,()=>_0x5858a5['_nextDataId'](_0x2b06fc)));let _0x67141e=_0xd8d7fd;for(;_0x67141e['parent']&&!_0x67141e['parent']['is']('documentFragment');)_0x67141e=_0x67141e['parent'],_0x67141e['hasAttribute'](At)&&_0x67141e['_removeAttribute'](At);_0x117e42['set'](_0x56b8ba,{'path':_0xd8d7fd['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x67141e['_clone'](!0x0),_0x56b8ba,_0x2d7c13['data'])}),_0x2d1e8a['jumpTo'](_0x479065['createPositionAfter'](_0xd8d7fd));}}return{'content':_0x2d7c13['data']['processor']['toData'](_0x2d7c13['data']['toView'](_0x578c4a)),'version':_0x2d7c13['model']['document']['version'],'elements':_0x117e42};}['diffContent'](_0x9cc40e,_0xcfdbff){const _0x8ad1bf=[],_0x368b15=q(this['context']),_0x2df88b=_0x368b15['data']['parse'](_0xcfdbff,'$documentFragment'),_0x3fe33f=_0x368b15['data']['parse'](_0x9cc40e,'$documentFragment'),_0x430448=_0x368b15['model']['createPositionAt'](_0x3fe33f,0x0);if(this['_haveSingleTopLevelElement'](_0x2df88b)){if(!this['_hasSameTopLevelElement'](_0x3fe33f,_0x2df88b))return _0x8ad1bf;}else{const _0x16f23d=_0x368b15['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x3fe33f,_0x16f23d)||!this['_haveOnlyInlineContent'](_0x2df88b,_0x16f23d))return _0x8ad1bf;}const _0x202238=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x9cc40e,_0xcfdbff,{'anchor':_0x430448,'markDeletions':!0x0})['getOperations']()['filter'](_0x5c22e0=>'insert'===_0x5c22e0['type']||'marker'===_0x5c22e0['type']&&_0x5c22e0['name']['startsWith']('$markedRemove')),_0x58fb46=this['_groupAdjacentOperations'](_0x202238);let _0x181450=0x0;return _0x368b15['model']['change'](_0x262637=>{for(let _0x301735=0x0;_0x301735<_0x58fb46['length'];_0x301735++){const _0x431928=_0x58fb46[_0x301735],_0x2ec0fb=_0x262637['createDocumentFragment']();for(const _0x330adf of _0x3fe33f['getChildren']())_0x262637['append'](_0x330adf['_clone'](!0x0),_0x2ec0fb);for(const _0x105a0e of _0x431928['operationsIsolated'])if('insert'===_0x105a0e['type']){const _0x45c912=_0x105a0e;_0x45c912['baseVersion']=null,_0x45c912['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x45c912,_0x2ec0fb),_0x262637['batch']['addOperation'](_0x105a0e),_0x368b15['model']['applyOperation'](_0x105a0e);const _0x38a09f='suggestion:insertion:id:authorId:'+_0x181450++,_0xfa0431=_0x368b15['model']['createRange'](_0x45c912['position'],_0x45c912['position']['getShiftedBy'](_0x45c912['howMany']));_0x2ec0fb['markers']['set'](_0x38a09f,_0xfa0431);}else{if('marker'===_0x105a0e['type']&&_0x105a0e['name']['startsWith']('$markedRemove')){const _0x3be3aa=_0x105a0e,_0x39b019='suggestion:deletion:id:authorId:'+_0x181450++;this['_changeOperationOwnerDocument'](_0x3be3aa,_0x2ec0fb),_0x2ec0fb['markers']['set'](_0x39b019,_0x3be3aa['newRange']);}}const _0x329719=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x431928['operationsIsolated'][0x0]),_0x2ec0fb),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x431928['operationsIsolated'][_0x431928['operationsIsolated']['length']-0x1]),_0x2ec0fb));_0x2ec0fb['markers']['set'](pe+'suggestion-context',new ht(_0x329719['start'],_0x329719['end'])),_0x8ad1bf['push']({..._0x431928,'context':this['_createGetContextFn'](_0x2ec0fb,_0x368b15['data'],{'ellipsisBefore':_0x329719['hasContentBefore'],'ellipsisAfter':_0x329719['hasContentAfter']}),'content':this['_createGetContentFn'](_0x2ec0fb,_0x368b15['data'])});}}),_0x8ad1bf;}['markChangePositionInEditorContent'](_0xaace99,_0x57a5aa){if(!_0xaace99['length'])return;const _0x271659=_0xaace99[0x0]['parent']['id'],_0x35c14c=_0x57a5aa['elements']['get'](_0x271659);if(!_0x35c14c)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x271659);const _0x51f407=_0x35c14c['path'],_0x1c8916=q(this['context']),_0x298009=_0x1c8916['model']['document']['history']['getOperations'](_0x57a5aa['version']),_0x535cb7=[];for(const _0x1dde17 of _0xaace99){const _0x131aa9=_0x1dde17['operationsIsolated']['map'](_0x4e362a=>this['_translateOperationToEditorContent'](_0x4e362a,_0x51f407,_0x1c8916['model']['document']['getRoots']()[0x0]));if(!_0x131aa9||!_0x131aa9['length'])continue;const _0x228569=_0x131aa9['every'](_0x16336e=>'marker'===_0x16336e['type']&&_0x16336e['name']['startsWith']('$markedRemove')),_0x11d5fa={'document':_0x1c8916['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x568d24=ut(_0x131aa9,_0x298009,_0x11d5fa)['operationsA'];for(const _0x782403 of _0x568d24)if('insert'===_0x782403['type']){const _0x5e715d=_0x782403,_0x6f6778=_0x5e715d['nodes'];let _0x1cdbef='';for(const _0x22f977 of _0x6f6778)_0x22f977&&_0x22f977['is']('model:$text')&&(_0x1cdbef+=_0x22f977['data']);_0x535cb7['push']({'start':_0x5e715d['position'],'end':_0x5e715d['position'],'type':'insert','groupId':_0x1dde17['id'],'text':_0x1cdbef});}else{if('marker'===_0x782403['type']&&_0x782403['name']['startsWith']('$markedRemove')){const _0x5f0c48=_0x782403;let _0xce76e7='remove-text';if(_0x228569){const _0x1c16d5=this['_findAdjacentContextDistance'](_0x5f0c48['newRange']['start'],'backward',_0x1c8916['model']['schema']),_0x2e7135=this['_findAdjacentContextDistance'](_0x5f0c48['newRange']['end'],'forward',_0x1c8916['model']['schema']);if(_0x1c16d5||_0x2e7135){const _0x39dda0=_0x5f0c48['newRange']['start']['getShiftedBy'](-_0x1c16d5),_0x19c3c8=_0x5f0c48['newRange']['end']['getShiftedBy'](_0x2e7135);_0x535cb7['push']({'start':_0x39dda0,'end':_0x19c3c8,'groupId':_0x1dde17['id'],'type':'remove-context'});}else _0xce76e7='remove-only';}_0x535cb7['push']({'start':_0x5f0c48['newRange']['start'],'end':_0x5f0c48['newRange']['end'],'groupId':_0x1dde17['id'],'type':_0xce76e7});}}}this['_insertMarkers'](_0x535cb7);}['clearAllMarkers'](){const _0x183677=q(this['context']);_0x183677['model']['change'](_0x26a875=>{for(const _0x11be24 of this['_markers']['keys']())_0x183677['model']['markers']['get'](_0x11be24)&&_0x26a875['removeMarker'](_0x11be24);}),this['_markers']['clear']();}['switchToReadOnly'](){q(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){q(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x21c620){const _0x2de4b7=q(this['context']),_0x5a0704=_0x2de4b7['model'],_0x1d465a=_0x21c620['map'](_0x557df3=>this['_getMarkersDataForGroup'](_0x557df3))['flat']();_0x5a0704['change'](_0x4496c0=>{for(const _0x2fcb58 of _0x1d465a){const _0x5020d2=_0x2de4b7['model']['markers']['get'](_0x2fcb58['id']);_0x5020d2&&('insert'===_0x2fcb58['type']?_0x5a0704['insertContent'](_0x4496c0['createText'](_0x2fcb58['text']||''),_0x5020d2['getRange']()['start']):'remove-text'!==_0x2fcb58['type']&&'remove-only'!==_0x2fcb58['type']||_0x5a0704['deleteContent'](_0x5a0704['createSelection'](_0x5020d2['getRange']())),_0x4496c0['removeMarker'](_0x2fcb58['id']),this['_markers']['delete'](_0x2fcb58['id']));}});}['rejectChange'](_0x5a5ceb){const _0x1aa290=q(this['context']),_0x3fbebd=this['_getMarkersDataForGroup'](_0x5a5ceb);_0x1aa290['model']['change'](_0x554f8=>{for(const _0x3dea70 of _0x3fbebd)_0x554f8['removeMarker'](_0x3dea70['id']),this['_markers']['delete'](_0x3dea70['id']);});}['getEditor'](){return q(this['context']);}['getMarkerElementForChange'](_0x13c650){const _0x1f544b=Array['from'](this['_markers']['values']())['filter'](_0x1eaa76=>_0x1eaa76['groupId']===_0x13c650);if(!_0x1f544b['length'])return null;const _0x166f81=0x1===_0x1f544b['length']?_0x1f544b[0x0]:this['_sortMarkers'](_0x1f544b)[0x0],_0x4fab6c=q(this['context']),_0x2ee38e=_0x4fab6c['model']['markers']['get'](_0x166f81['id']);if(!_0x2ee38e)return null;const _0x4cafdd=_0x2ee38e['getRange'](),_0xc0b440=_0x4fab6c['editing']['view']['getDomRoot']();if(!_0xc0b440||!_0x4cafdd)return null;const _0x47c426=_0xc0b440['querySelector']('[data-marker-id=\x22'+_0x166f81['id']+'\x22]');return _0x47c426?{'modelRange':_0x4cafdd,'domElement':_0x47c426}:null;}['_validateMarkers'](_0xb834d7,_0x1ec5cb){const _0x469747=Array['from'](this['_markers']['keys']()),_0x44bf4b=new Map();for(const _0x47d20a of _0x469747){const _0x1f1d12=_0xb834d7['model']['markers']['get'](_0x47d20a);if(!_0x1f1d12)continue;const _0x18a27b=_0x1f1d12['getStart']()['path'][0x0];_0x44bf4b['has'](_0x18a27b)||_0x44bf4b['set'](_0x18a27b,[]),_0x44bf4b['get'](_0x18a27b)['push'](_0x1f1d12);}const _0x8ef072=new Set();for(const _0x10f485 of _0xb834d7['model']['document']['differ']['getChanges']()){let _0xcd0725=-0x1,_0x4a87d4=null;if('insert'===_0x10f485['type'])_0x4a87d4=new ht(_0x10f485['position'],_0x10f485['position']['getShiftedBy'](_0x10f485['length'])),_0xcd0725=_0x10f485['position']['path'][0x0];else{if('remove'!==_0x10f485['type'])continue;_0x4a87d4=new ht(_0x10f485['position']),_0xcd0725=_0x10f485['position']['path'][0x0];}const _0x47d742=_0x44bf4b['get'](_0xcd0725)||[];if(_0x47d742['length']){for(const _0x5bb2ea of _0x47d742)if(_0x4a87d4['root']['rootName']===_0x5bb2ea['getRange']()['root']['rootName']&&('insert'!==_0x10f485['type']||!_0x4a87d4['containsRange'](_0x5bb2ea['getRange']()))&&(_0x4a87d4['isIntersecting'](_0x5bb2ea['getRange']())||_0x4a87d4['start']['isTouching'](_0x5bb2ea['getRange']()['end'])||_0x4a87d4['end']['isTouching'](_0x5bb2ea['getRange']()['start']))){const _0x49064f=this['_parseMarkerName'](_0x5bb2ea['name']);Array['from'](this['_markers']['values']())['filter'](_0x589bb3=>_0x589bb3['groupId']===_0x49064f['groupId'])['forEach'](_0xe1bdb3=>_0x8ef072['add'](_0xe1bdb3['id']));}}}if(_0x8ef072['size']){for(const _0x2638f1 of _0x8ef072)_0x1ec5cb['removeMarker'](_0x2638f1);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x497871){for(const {name:_0x2334d8,data:_0x334b9a}of _0x497871['model']['document']['differ']['getChangedMarkers']()){if(!_0x2334d8['startsWith'](pe))continue;const _0x24c2e8=_0x334b9a['oldRange'],_0x4cb543=_0x334b9a['newRange'],_0x5ee2c4=_0x24c2e8&&'$graveyard'===_0x24c2e8['root']['rootName'],_0x523334=_0x4cb543&&'$graveyard'===_0x4cb543['root']['rootName'];if(_0x5ee2c4&&_0x523334)continue;const _0x2abbdb=this['_parseMarkerName'](_0x2334d8);this['_markers']['get'](_0x2334d8)&&(_0x523334||!_0x4cb543?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x2334d8,'changeId':_0x2abbdb['groupId']}):_0x5ee2c4&&_0x4cb543&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x2334d8,'changeId':_0x2abbdb['groupId']}));}}['_parseMarkerName'](_0x587e69){const _0x289bf1=_0x587e69['split'](':'),_0xc6f9cb=(_0x289bf1[0x1]||'')['split']('_');return{'prefix':_0x289bf1[0x0],'groupId':_0xc6f9cb[0x0],'suffix':_0xc6f9cb[0x1]};}['_translateOperationToEditorContent'](_0x5598df,_0x5e58b8,_0x43ed50){if('insert'===_0x5598df['type']){const _0x3030b7=_0x5598df;return new _0x5477f4(this['_changePosition'](_0x5e58b8['concat'](_0x3030b7['position']['offset']),_0x43ed50),_0x3030b7['nodes'],_0x3030b7['baseVersion']);}if('marker'===_0x5598df['type']&&_0x5598df['name']['startsWith']('$markedRemove')){const _0x404f12=_0x5598df;return new _0x34ebe2(_0x404f12['name'],_0x404f12['oldRange'],this['_changeRange'](_0x404f12['newRange'],_0x5e58b8['concat'](_0x404f12['newRange']['start']['offset']),_0x5e58b8['concat'](_0x404f12['newRange']['end']['offset']),_0x43ed50),_0x404f12['_markers'],_0x404f12['affectsData'],_0x404f12['baseVersion']);}return _0x5598df;}['_groupAdjacentOperations'](_0x233808){if(!_0x233808['length'])return[];const _0x3c3370=[];let _0x19a26f=0x0,_0x575861=0x0,_0x338937=[];for(let _0x18b119=0x0;_0x18b119<=_0x233808['length'];_0x18b119++){const _0x3e20cf=_0x233808[_0x18b119],_0x3ecb1f=_0x233808[_0x18b119-0x1];!_0x3e20cf||_0x3ecb1f&&!this['_getOperationEnd'](_0x3ecb1f)['isTouching'](this['_getOperationStart'](_0x3e20cf))?(_0x3c3370['push']({'operations':_0x338937,'operationsIsolated':_0x338937['map'](_0x2c7d9e=>this['_shiftOperation'](_0x2c7d9e['clone'](),-_0x575861)),'groupOffset':_0x19a26f}),_0x338937=_0x3e20cf?[_0x3e20cf]:[],_0x575861+=_0x19a26f,_0x19a26f=0x0):_0x338937['push'](_0x3e20cf),_0x3e20cf&&'insert'===_0x3e20cf['type']&&(_0x19a26f+=_0x3e20cf['howMany']);}return _0x3c3370;}['_findAdjacentContextDistance'](_0x511081,_0x2baf1,_0x271d69,_0x391bf0=0x1){const _0x245776=new _0x1ada95({'startPosition':_0x511081,'direction':_0x2baf1});let _0x3e199f=0x0;for(let _0x37bdd9=0x0;_0x37bdd9<_0x391bf0;_0x37bdd9++){let _0x2af6ed=0x0,_0x189fd2=!0x1,_0xf54d9d='forward'===_0x2baf1?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x5f0cc3}of _0x245776)if(_0x5f0cc3['is']('$textProxy')){const _0x2a16d2=_0xf54d9d['exec'](_0x5f0cc3['data']);if(_0x2a16d2&&_0x2a16d2['length']){if(_0x2af6ed+='forward'===_0x2baf1?_0x2a16d2['index']+_0x2a16d2[0x0]['length']:_0x5f0cc3['data']['length']-_0x2a16d2['index'],_0x2a16d2[0x0]['length']!==_0x5f0cc3['data']['length'])break;_0x189fd2=!0x0,_0xf54d9d='forward'===_0x2baf1?/^\w+/:/\w+$/;}else{if(_0x189fd2)break;_0x2af6ed+=_0x5f0cc3['offsetSize'];}}else{if(_0x5f0cc3['is']('element')){_0x271d69['isInline'](_0x5f0cc3)&&!_0x189fd2&&(_0x2af6ed+=0x1);break;}}_0x3e199f+=_0x2af6ed,_0x245776['jumpTo'](_0x511081['getShiftedBy']('forward'===_0x2baf1?_0x3e199f:-_0x3e199f));}return _0x3e199f;}['_getChangeContext'](_0x181134,_0x47075b){const _0x30c07c=q(this['context'])['model']['schema'],_0x429822=this['_findAdjacentContextDistance'](_0x181134,'backward',_0x30c07c,0x6),_0x444467=this['_findAdjacentContextDistance'](_0x47075b,'forward',_0x30c07c,0x6),_0x218d3c=_0x181134['getShiftedBy'](-_0x429822),_0x140998=_0x47075b['getShiftedBy'](_0x444467);return{'start':_0x218d3c,'end':_0x140998,'hasContentBefore':!_0x218d3c['isAtStart'],'hasContentAfter':!_0x140998['isAtEnd']};}['_insertMarkers'](_0x362ae3){const _0x40931f=this['context']['plugins']['get']('AIEditing'),_0x355eb8=new Set();q(this['context'])['model']['change'](_0x30fc25=>{for(const _0x30c1a6 of _0x362ae3){const _0x289bc4=''+pe+_0x30c1a6['type']+':'+_0x30c1a6['groupId']+'_'+_0x40931f['_nextDataId'](_0x355eb8);this['_markers']['set'](_0x289bc4,{'id':_0x289bc4,'groupId':_0x30c1a6['groupId'],'type':_0x30c1a6['type'],'text':_0x30c1a6['text']}),_0x30fc25['addMarker'](_0x289bc4,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x30fc25['createRange'](_0x30c1a6['start'],_0x30c1a6['end'])});}});}['_createGetContextFn'](_0x2dce24,_0x2151ac,_0x3c8f71){let _0x117a98='';return()=>{if(!_0x117a98){const _0x39d1f0=_0x2151ac['toView'](_0x2dce24,{'showSuggestionHighlights':!0x0});let _0x247ca6=_0x39d1f0['getChild'](0x0);if(_0x247ca6['is']('containerElement')||(_0x247ca6=_0x39d1f0),!_0x247ca6)return'';let _0xdebad3=!0x1;const _0x2f2ff1=[];for(const _0x47a8cb of _0x247ca6['getChildren']())_0x47a8cb['is']('element','span')&&_0x47a8cb['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0xdebad3=!0x1),_0xdebad3&&_0x2f2ff1['push'](_0x47a8cb),_0x47a8cb['is']('element','span')&&_0x47a8cb['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0xdebad3=!0x0);_0x247ca6['_removeChildren'](0x0,_0x247ca6['childCount']),_0x3c8f71?.['ellipsisBefore']&&_0x247ca6['_appendChild']('…'),_0x247ca6['_appendChild'](_0x2f2ff1),_0x3c8f71?.['ellipsisAfter']&&_0x247ca6['_appendChild']('…');const _0x325965=_0x2151ac['htmlProcessor']['domConverter']['viewToDom'](_0x39d1f0),_0x2d687b=_0x2151ac['htmlProcessor']['htmlWriter']['getHtml'](_0x325965);_0x117a98=_0x2d687b;}return _0x117a98;};}['_createGetContentFn'](_0x3b32b3,_0x3cf3d5){let _0x444b21='';return()=>(_0x444b21||(_0x444b21=_0x3cf3d5['stringify'](_0x3b32b3,{'showSuggestionHighlights':!0x0})),_0x444b21);}['_createGetContentUsingDataIdFn'](_0x1cbef5,_0x25a9e8,_0xb37d2c){let _0x1265ac='';return()=>{if(!_0x1265ac){const _0xd40375=_0xb37d2c['toView'](new at(_0x1cbef5)),_0x31c9d5=_0xb37d2c['htmlProcessor']['domConverter']['viewToDom'](_0xd40375)['querySelector']('[data-id=\x22'+_0x25a9e8+'\x22]');_0x1265ac=_0x31c9d5?.['outerHTML']||'';}return _0x1265ac;};}['_findMarkerElement'](_0x59ef11,_0x21af7c=0x5){let _0x29048e=_0x59ef11,_0x5e5c08=null;for(let _0x5579f3=0x0;_0x5579f3<_0x21af7c&&_0x29048e;_0x5579f3++){if(!_0x29048e['className']){_0x29048e=_0x29048e['parentElement'];continue;}if(!(''+_0x29048e['className'])['includes']('ck-ai_review-mode-marker_')){_0x29048e=_0x29048e['parentElement'];continue;}if(!_0x29048e['getAttribute']('data-marker-id'))break;_0x5e5c08=_0x29048e;break;}return _0x5e5c08;}['_getMarkersDataForGroup'](_0x6efa22){return Array['from'](this['_markers']['values']())['filter'](_0x2b9d96=>_0x2b9d96['groupId']===_0x6efa22);}['_getOperationStart'](_0x221eb5){return'insert'===_0x221eb5['type']?_0x221eb5['position']:_0x221eb5['newRange']['start'];}['_getOperationEnd'](_0x400889,_0x546316=!0x1){return'insert'===_0x400889['type']?_0x546316?_0x400889['position']:_0x400889['position']['getShiftedBy'](_0x400889['howMany']):_0x400889['newRange']['end'];}['_shiftOperation'](_0x8e8997,_0x53efe8){return'insert'===_0x8e8997['type']?_0x8e8997['position']=_0x8e8997['position']['getShiftedBy'](_0x53efe8):'marker'===_0x8e8997['type']&&_0x8e8997['newRange']&&(_0x8e8997['newRange']=new ht(_0x8e8997['newRange']['start']['getShiftedBy'](_0x53efe8),_0x8e8997['newRange']['end']['getShiftedBy'](_0x53efe8))),_0x8e8997;}['_changeOperationOwnerDocument'](_0x4729f9,_0xb7e09){'insert'===_0x4729f9['type']?_0x4729f9['position']=this['_changePositionOwnerDocument'](_0x4729f9['position'],_0xb7e09):'marker'===_0x4729f9['type']&&_0x4729f9['newRange']&&(_0x4729f9['newRange']=this['_changeRangeOwnerDocument'](_0x4729f9['newRange'],_0xb7e09));}['_changePositionOwnerDocument'](_0x2a8205,_0x3d2401){return new ct(_0x3d2401,_0x2a8205['path']);}['_changeRangeOwnerDocument'](_0x72b808,_0x3cb92e){return new ht(this['_changePositionOwnerDocument'](_0x72b808['start'],_0x3cb92e),this['_changePositionOwnerDocument'](_0x72b808['end'],_0x3cb92e));}['_changePosition'](_0x2fe985,_0x5c1332){return new ct(_0x5c1332,[..._0x2fe985]);}['_changeRange'](_0x41e737,_0x89177f,_0x45f95c,_0x3eafeb){return new ht(this['_changePosition'](_0x89177f,_0x3eafeb),this['_changePosition'](_0x45f95c,_0x3eafeb));}['_sortMarkers'](_0x455e23){const _0x267dd2=_0x57ffe6=>{switch(_0x57ffe6){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x455e23['sort']((_0x55aea2,_0x6b0e6c)=>_0x267dd2(_0x55aea2['type'])-_0x267dd2(_0x6b0e6c['type']));}['_hasSameTopLevelElement'](_0x199a93,_0x2ba1ea){const _0x3dcef8=_0x199a93['getChild'](0x0),_0x2ec513=_0x2ba1ea['getChild'](0x0);return!(!_0x3dcef8||!_0x2ec513)&&((!_0x3dcef8['is']('element')||!_0x2ec513['is']('element')||_0x3dcef8['name']===_0x2ec513['name'])&&!(_0x3dcef8['is']('element')&&!_0x2ec513['is']('element')||!_0x3dcef8['is']('element')&&_0x2ec513['is']('element')));}['_haveSingleTopLevelElement'](_0x14860e){return 0x1===_0x14860e['childCount'];}['_haveOnlyInlineContent'](_0x4c9667,_0x238fe2){for(const _0x3b49fc of _0x4c9667['getChildren']())if(_0x3b49fc['is']('element')&&!_0x238fe2['isInline'](_0x3b49fc))return!0x1;return!0x0;}['_upsertDataId'](_0x36bb7a,_0x431e6b){let _0x4608c9=_0x36bb7a['getAttribute'](At);return _0x4608c9||(_0x4608c9=_0x431e6b(),_0x36bb7a['_setAttribute'](At,_0x4608c9)),_0x4608c9;}}class Ka extends _0x24ce56{static get['requires'](){return[me,ce,ue];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ri as AIActions,x as AIAdapter,Qn as AIAssistant,n as AIAssistantUI,it as AIBalloon,Ua as AIChat,mt as AIChatController,gt as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,dt as AIChatUI,R as AIConnector,S as AIEditing,Va as AIEditorIntegration,Ft as AIQuickActionType,Ba as AIQuickActions,ii as AIQuickActionsUI,tr as AIRequestError,mo as AIReviewCheck,hn as AIReviewCheckResult,Rr as AIReviewCheckRun,Ka as AIReviewMode,me as AIReviewModeController,ue as AIReviewModeEditing,ce as AIReviewModeUI,ft as AITabs,ye as AITextAdapter,qt as AIToggleButtonUI,Jn as AWSTextAdapter,zn as OpenAITextAdapter,E as ShowAIAssistantCommand,co as ToggleAICommand,ks as createResizeButton,Xn as getDefaultAICommands};