@ckeditor/ckeditor5-ai 47.2.0-alpha.6 → 47.2.0-alpha.7

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 (290) hide show
  1. package/build/ai.js +1 -1
  2. package/dist/index.js +5 -5
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +15 -15
  150. package/src/aiactions/aiactions.js +1 -1
  151. package/src/aiactions/model/aiactionsinteraction.js +1 -1
  152. package/src/aiactions/model/aiactionsreply.js +1 -1
  153. package/src/aiassistant/adapters/aiadapter.js +1 -1
  154. package/src/aiassistant/adapters/aitextadapter.js +1 -1
  155. package/src/aiassistant/adapters/awstextadapter.js +1 -1
  156. package/src/aiassistant/adapters/openaitextadapter.js +1 -1
  157. package/src/aiassistant/aiassistant.js +1 -1
  158. package/src/aiassistant/aiassistantediting.js +1 -1
  159. package/src/aiassistant/aiassistantui.js +1 -1
  160. package/src/aiassistant/legacyerrors.js +1 -1
  161. package/src/aiassistant/ui/aiassistantcontroller.js +2 -2
  162. package/src/aiassistant/ui/form/aiformcontentarea.js +1 -1
  163. package/src/aiassistant/ui/form/aiformerrorview.js +1 -1
  164. package/src/aiassistant/ui/form/aiformpromptview.js +1 -1
  165. package/src/aiassistant/ui/form/aiformtoolbarview.js +1 -1
  166. package/src/aiassistant/ui/form/aiformview.js +1 -1
  167. package/src/aiassistant/ui/form/aihistorylistitemview.js +1 -1
  168. package/src/aiassistant/ui/form/aihistorylistview.js +1 -1
  169. package/src/aiassistant/ui/form/prompthistory.js +1 -1
  170. package/src/aiassistant/ui/showaiassistantcommand.js +1 -1
  171. package/src/aiassistant/utils/common-translations.js +1 -1
  172. package/src/aiassistant/utils/normalizecommandsconfig.js +1 -1
  173. package/src/aiballoon/aiballoon.js +1 -1
  174. package/src/aiballoon/ui/aiballoondisclaimerview.js +1 -1
  175. package/src/aiballoon/ui/aiballoontoolbarview.js +1 -1
  176. package/src/aiballoon/ui/aiballoonview.js +1 -1
  177. package/src/aichat/aichat.js +1 -1
  178. package/src/aichat/aichatcontroller.js +1 -1
  179. package/src/aichat/aichatui.js +1 -1
  180. package/src/aichat/model/aichatcontext.d.ts +10 -2
  181. package/src/aichat/model/aichatcontext.js +1 -1
  182. package/src/aichat/model/aichatconversation.js +1 -1
  183. package/src/aichat/model/aichatinteraction.js +1 -1
  184. package/src/aichat/model/aichatmodels.js +1 -1
  185. package/src/aichat/ui/aichatcontrolsview.js +1 -1
  186. package/src/aichat/ui/aichatfeedview.js +1 -1
  187. package/src/aichat/ui/aichatheaderview.js +1 -1
  188. package/src/aichat/ui/aichatview.js +1 -1
  189. package/src/aichat/ui/controls/aichatchipsoverflowmanager.js +1 -1
  190. package/src/aichat/ui/controls/aichatcontextitembuttonview.js +1 -1
  191. package/src/aichat/ui/controls/aichatcontextpanelurlinputview.js +1 -1
  192. package/src/aichat/ui/controls/aichatcontextpanelview.js +1 -1
  193. package/src/aichat/ui/controls/aichatcontrolsloaderview.js +1 -1
  194. package/src/aichat/ui/controls/aichatpromptcapabilitiesview.js +1 -1
  195. package/src/aichat/ui/controls/aichatpromptinputview.js +1 -1
  196. package/src/aichat/ui/controls/aichatpromptsuggestionslistview.js +1 -1
  197. package/src/aichat/ui/controls/resources/aichatcontextresourceslistview.js +1 -1
  198. package/src/aichat/ui/controls/resources/aichatcontextresourcesview.js +1 -1
  199. package/src/aichat/ui/controls/resources/aichatresourcelistitemview.js +1 -1
  200. package/src/aichat/ui/controls/resources/aichatresourcesballoonview.js +1 -1
  201. package/src/aichat/ui/controls/resources/aichatresourcessearchinputview.js +1 -1
  202. package/src/aichat/ui/feed/aichatfeedcontextchipsview.js +1 -1
  203. package/src/aichat/ui/feed/aichatfeederroritemview.js +1 -1
  204. package/src/aichat/ui/feed/aichatfeedinteractionheaderview.js +1 -1
  205. package/src/aichat/ui/feed/aichatfeeditemview.js +1 -1
  206. package/src/aichat/ui/feed/aichatfeedreplyitemview.js +1 -1
  207. package/src/aichat/ui/feed/aichatfeedsuggestionitemactionsview.js +1 -1
  208. package/src/aichat/ui/feed/aichatfeedsuggestionitemview.js +1 -1
  209. package/src/aichat/ui/feed/aichatfeedusermessageitem.js +1 -1
  210. package/src/aichat/utils/eventnames.js +1 -1
  211. package/src/aichat/utils/promisequeue.js +1 -1
  212. package/src/aichat/utils/scrollmanager.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.js +1 -1
  222. package/src/aicore/aiconnector.js +1 -1
  223. package/src/aicore/aiediting.js +1 -1
  224. package/src/aicore/model/aicapabilities.js +1 -1
  225. package/src/aicore/model/aicontext.js +1 -1
  226. package/src/aicore/model/aiinteraction.js +1 -1
  227. package/src/aicore/model/aimodels.js +1 -1
  228. package/src/aicore/model/aireply.js +1 -1
  229. package/src/aicore/pipeline/airesponseapplier.js +2 -2
  230. package/src/aicore/pipeline/airesponseparser.js +2 -2
  231. package/src/aicore/ui/aidisclaimerview.js +1 -1
  232. package/src/aicore/ui/aiskeleton.js +1 -1
  233. package/src/aicore/ui/aispinner.js +1 -1
  234. package/src/aicore/ui/suggestioncontainer/aiminitoolbarview.js +1 -1
  235. package/src/aicore/ui/suggestioncontainer/aisuggestionbodyview.js +1 -1
  236. package/src/aicore/ui/suggestioncontainer/aisuggestioncontainerview.js +1 -1
  237. package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.js +1 -1
  238. package/src/aicore/ui/suggestioncontainer/aisuggestionheaderview.js +1 -1
  239. package/src/aicore/utils/common-translations.js +1 -1
  240. package/src/aicore/utils/createresizebutton.js +1 -1
  241. package/src/aicore/utils/documentposition.js +1 -1
  242. package/src/aicore/utils/documentrange.js +1 -1
  243. package/src/aicore/utils/eventnames.js +1 -1
  244. package/src/aicore/utils/geteditorfromcontext.js +1 -1
  245. package/src/aicore/utils/getoperationsfromreply.js +1 -1
  246. package/src/aicore/utils/getsuggestionpartsfromreply.js +1 -1
  247. package/src/aicore/utils/htmlparser.js +1 -1
  248. package/src/aicore/utils/htmlstreamer.js +1 -1
  249. package/src/aieditorintegration/aieditorintegration.js +1 -1
  250. package/src/aieditorintegration/aitogglebutton/aitogglebuttonui.js +1 -1
  251. package/src/aieditorintegration/aitogglebutton/toggleaicommand.js +1 -1
  252. package/src/aiquickactions/aiquickactions.js +1 -1
  253. package/src/aiquickactions/aiquickactionscommand.js +1 -1
  254. package/src/aiquickactions/aiquickactionsediting.js +1 -1
  255. package/src/aiquickactions/aiquickactionsui.js +1 -1
  256. package/src/aiquickactions/ui/aiquickactionsbuttoncreator.js +1 -1
  257. package/src/aiquickactions/ui/aiquickactionsdropdowncontentview.js +1 -1
  258. package/src/aiquickactions/ui/aiquickactionsdropdowncreator.js +1 -1
  259. package/src/aireviewmode/aireviewcheckdefinitions.js +1 -1
  260. package/src/aireviewmode/aireviewmode.js +1 -1
  261. package/src/aireviewmode/aireviewmodecontroller.js +1 -1
  262. package/src/aireviewmode/aireviewmodeediting.js +1 -1
  263. package/src/aireviewmode/aireviewmodeui.js +1 -1
  264. package/src/aireviewmode/model/aireviewcheck.js +1 -1
  265. package/src/aireviewmode/model/aireviewcheckcustom.js +1 -1
  266. package/src/aireviewmode/model/aireviewchecklist.js +1 -1
  267. package/src/aireviewmode/model/aireviewcheckresult.js +1 -1
  268. package/src/aireviewmode/model/aireviewcheckresultchange.js +1 -1
  269. package/src/aireviewmode/model/aireviewcheckrun.js +1 -1
  270. package/src/aireviewmode/model/aireviewcustomcheckrun.js +1 -1
  271. package/src/aireviewmode/model/aireviewsystemcheckrun.js +1 -1
  272. package/src/aireviewmode/ui/aireviemodepromptinputview.js +1 -1
  273. package/src/aireviewmode/ui/aireviewmodeballoonsuggestionview.js +1 -1
  274. package/src/aireviewmode/ui/aireviewmodechecklistitemresultview.js +1 -1
  275. package/src/aireviewmode/ui/aireviewmodecustomcheckview.js +1 -1
  276. package/src/aireviewmode/ui/aireviewmodefinishreviewbuttonview.js +1 -1
  277. package/src/aireviewmode/ui/aireviewmodereviewchecklistview.js +1 -1
  278. package/src/aireviewmode/ui/aireviewmodereviewcheckresultsview.js +1 -1
  279. package/src/aireviewmode/ui/aireviewmodereviewcommandlistitemview.js +1 -1
  280. package/src/aireviewmode/ui/aireviewmodereviewcompletedview.js +1 -1
  281. package/src/aireviewmode/ui/aireviewmodeview.js +1 -1
  282. package/src/aireviewmode/ui/form/aireviewmodeformdropdown.js +1 -1
  283. package/src/aireviewmode/ui/form/aireviewmodeformmanager.js +1 -1
  284. package/src/aitabs/aitabs.js +1 -1
  285. package/src/aitabs/aitabsmainview.js +1 -1
  286. package/src/aitabs/tabs/aitabsview.js +1 -1
  287. package/src/aitabs/tabs/tabbuttonview.js +1 -1
  288. package/src/aitabs/tabs/tabpanelview.js +1 -1
  289. package/src/errors.js +1 -1
  290. package/src/index.js +1 -1
package/dist/index.js CHANGED
@@ -20,8 +20,8 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x4075a7,Command as Qt,ContextPlugin as _0x5ac5c7,Editor as Ct}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x242b0e,IconCheck as _0x44639d,IconError as _0x131586,IconSubmit as _0x1f7b2c,IconAIHistory as dt,IconMagicWand as _0x4741cd,IconRobotPencil as _0x4c55ed,IconMaximize as _0x187bdc,IconMinimize as to,IconDocumentWithLoupe as _0x61e054,IconAddComment as _0x163e8a,IconShowChangesOn as _0x44b5c0,IconShowChangesOff as _0x573537,IconDocument as _0x5d66c2,IconThreeStars as _0x1db00b,IconRemove as _0x52a4f2,IconDocumentWithCheckmark as _0x94b735,IconDocumentWithCross as _0x3e809b,IconLoupe as _0x3213b0,IconCancel as _0xead019,IconStop as _0x1575c2,IconAIChat as Lt,IconPlus as _0x55a7fb,IconPin as _0x137ba3,IconThreeHorizontalDots as _0x533464,IconChevronRight as _0x3b954a,IconInfo as _0x12c769,IconOutdated as _0x287a66,IconEye as _0x4017e2,IconEyeCrossedOut as _0x3bb4b0,IconAIReview as _0x3fc907}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x5fe9bf,CKEditorError as _0x5b2487,ObservableMixin as ts,global as _0x221a5,isVisible as _0x4a2145,Rect as _0x1f7ba8,Collection as _0x3925ff,FocusTracker as _0x2cffef,KeystrokeHandler as _0x46a36b,first as _0x41a078,toArray as _0x25b36d,EmitterMixin as _0x49ef7b,logWarning as _0x5ace8a,scrollViewportToShowTarget as _0x43244e,logError as At,ResizeObserver as _0x25fce8,_isMotionReduced as Pt,scrollAncestorsToShowTarget as _0x3d185f,DomEmitterMixin as _0xb2d536}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x5aa8e0,ButtonView as _0x23f64b,View as _0x1fbe2f,SpinnerView as _0x33e627,IconView as _0x285b99,AutocompleteView as _0x250640,ListView as _0x5253cf,ListItemGroupView as _0x139840,ListItemView as _0x57e588,ButtonLabelView as _0x1eeb89,FocusCycler as _0x14e425,createLabeledTextarea as _0x59eec3,Dialog as _0x52d042,createDropdown as _0x43e2d9,addMenuToDropdown as _0x3ded9c,MenuBarMenuView as _0x890a74,MenuBarMenuListItemButtonView as _0x6490d1,DialogViewPosition as _0x51762f,MenuBarMenuListView as _0x4f9a9e,MenuBarMenuListItemView as _0x2db487,UIModel as _0x355792,SplitButtonView as _0x5c1602,BalloonPanelView as _0x506f25,BodyCollection as _0x203f54,clickOutsideHandler as _0x39650b,ListItemButtonView as _0x37a4cc,ViewCollection as _0xa90262,addListToDropdown as _0x11fa7b,submitHandler as _0x33fe91,LabeledFieldView as _0x3ce94b,createLabeledInputText as th,FormHeaderView as _0x5e15d9,HighlightedTextView as _0x4bd456,FileDialogButtonView as _0xf15140,InputTextView as _0x1f4d7f,SearchTextView as _0xc74ce3,DropdownMenuButtonView as _0x1650b4,DropdownMenuPanelPositioningFunctions as _0x5738b9,BalloonToolbar as _0x51c989,FormRowView as _0x51e522,TextareaView as _0x31b097}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x4d1f5d,ClipboardMarkersUtils as _0x450c57}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x42a9c7,ViewDataTransfer as _0x2f9531,ViewUpcastWriter as _0x4bdcac,Matcher as _0x1be03a,_DetachOperation as lt,_insertIntoModelNodeList as _0xc8d065,_removeFromModelNodeList as _0x180cb5,ModelRange as ht,ViewDowncastWriter as kt,transformOperationSets as ut,ModelDocumentFragment as at,ModelPosition as ct,ModelTreeWalker as _0x409913,InsertOperation as _0x33f64c,MarkerOperation as _0x51c46c}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x57909f,escape as _0x49969b,escapeRegExp as _0x22ea74}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x11fa39,InvokeModelWithResponseStreamCommand as _0x4808b4,InvokeModelCommand as _0x50c2d9}from'@aws-sdk/client-bedrock-runtime';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x409f9f}from'htmlparser2';import{isTag as _0x184c31,findOne as Ot,getParent as _0x129d47,findAll as _0x57b4b6,removeElement as _0x2efcb7,replaceElement as _0x30ee20,prepend as _0x15b0b3,prependChild as _0x5799cf,appendChild as _0x1b6d1c,append as _0x326e1b,find as _0x40e565,isComment as _0x31699d,getChildren as _0x304494,textContent as _0x233945}from'domutils';import _0x6c271b from'dom-serializer';import{Document as Mt,Element as _0x3bfaba,Text as _0xb8da44,cloneNode as _0x586262,isDocument as _0x10a30b,isText as _0x590eb2,NodeWithChildren as _0x41a8e}from'domhandler';import{MarkdownGfmMdToHtml as _0x5a34ab}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x4d872a,getAllMarkersDomElementsSorted as _0x7efeec,DocumentCompare as nt,DATA_ID_MODEL_ATTRIBUTE as St,ConfirmMixin as _0xf55989,LateFocusDropdownButtonView as _0x33205d,DATA_ID_VIEW_ATTRIBUTE as _0x542bb5}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x221916}from'es-toolkit';import{IconThumbUp as _0x17e08c,IconThumbDown as _0x1f016c,IconCopy as _0x35a582,IconCheck as _0x1fb727,IconShowChangesOff as tt,IconShowChangesOn as _0x3c5bb2,IconWeb as _0x3aa839,IconNextArrow as _0x4742cd,IconPreviousArrow as _0x2875b9,IconAI as Ut,IconClose as _0x254221,IconSelection as _0x52cd3c,IconFileUpload as _0x151b3b,IconLink as _0x4138cd,IconDocument as _0xc22ba7,IconBulb as _0x4ef1cb,IconDocumentOutline as _0x4a05c2,IconPaperClip as _0x116d7d,IconBrowseFiles as _0x118169,IconDropdownArrow as _0x1a8e14,IconAIAskAI as _0x53ad3f,IconAIQuickActions as _0x5880d7,IconAIChatCommands as Wt,IconAIImproveWriting as Vt,IconAIContinueWriting as Bt,IconAIGrammarCheck as Jt,IconAIAdjustLength as Yt,IconAIChangeTone as zt,IconAITranslate as Zt,IconAIOther as Xt,IconRefresh as _0x387b6c}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0xb5422d from'morphdom';import{SuggestionsConversion as qt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{diffArrays as _0x53e905}from'diff';const K='_ungrouppedCommands';function o(_0x57c797,_0x283873){const _0x5a74ab=(0x0,_0x283873['t'])('Other');return _0x57c797['length']?'groupId'in _0x57c797[0x0]?_0x57c797:[{'groupId':K,'groupLabel':_0x5a74ab,'order':0x1/0x0,'commands':_0x57c797}]:[{'groupId':K,'groupLabel':_0x5a74ab,'order':0x1/0x0,'commands':[]}];}const $n=globalThis['DataTransfer'],f='ai-ui';class a extends _0x4075a7{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x32d655}=this,_0x548714=['ck-fake-ai-selection'];_0x32d655['config']['get']('ai.assistant.useTheme')&&_0x548714['push']('ck-ai-assistant-ui_theme'),_0x32d655['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x548714,'priority':0xc}}),_0x32d655['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x3c597e,{writer:_0x4445bb})=>{if(!_0x3c597e['markerRange']['isCollapsed'])return null;const _0x22f1e0=_0x4445bb['createUIElement']('span');return _0x4445bb['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x22f1e0),_0x22f1e0;}});}['afterInit'](){!async function(_0x3b0197){const _0x2e102a=_0x3d72e7([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]),_0x26032c=0x3dffc4e1,_0x17d791=0x3df8bcc1^_0x26032c,_0x3da778=window[_0x3d72e7([0x44,0x61,0x74,0x65])][_0x3d72e7([0x6e,0x6f,0x77])](),_0x3e8f49=_0x3b0197[_0x3d72e7([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x36d7a6=new window[(_0x3d72e7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x13a6df=>{_0x3e8f49[_0x3d72e7([0x6f,0x6e,0x63,0x65])](_0x3d72e7([0x72,0x65,0x61,0x64,0x79]),_0x13a6df);}),_0x5346d2={[_0x3d72e7([0x6b,0x74,0x79])]:_0x3d72e7([0x45,0x43]),[_0x3d72e7([0x75,0x73,0x65])]:_0x3d72e7([0x73,0x69,0x67]),[_0x3d72e7([0x63,0x72,0x76])]:_0x3d72e7([0x50,0x2d,0x32,0x35,0x36]),[_0x3d72e7([0x78])]:_0x3d72e7([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]),[_0x3d72e7([0x79])]:_0x3d72e7([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]),[_0x3d72e7([0x61,0x6c,0x67])]:_0x3d72e7([0x45,0x53,0x32,0x35,0x36])},_0x41241f=_0x3e8f49[_0x3d72e7([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x3d72e7([0x67,0x65,0x74])](_0x3d72e7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x1c37ba(){let _0x3339cd,_0x652c64=null,_0xd859dc=null;try{if(_0x41241f==_0x3d72e7([0x47,0x50,0x4c]))return _0x3d72e7([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x3339cd=_0x322c6e(),!_0x3339cd)return _0x3d72e7([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x3339cd[_0x3d72e7([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0xd859dc=_0x5ec4e4(_0x3339cd[_0x3d72e7([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x3339cd[_0x3d72e7([0x6a,0x74,0x69])])),await _0x266f15()?_0x159ffe()?_0x3a7e9d()?_0x3d72e7([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3cdc4()?(_0x3339cd[_0x3d72e7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3d72e7([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x652c64=_0x20b9c6(_0x3d72e7([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x3339cd[_0x3d72e7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3d72e7([0x74,0x72,0x69,0x61,0x6c])&&(_0x652c64=_0x20b9c6(_0x3d72e7([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x38ae6c()):_0x3d72e7([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x3d72e7([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x3d72e7([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x3d72e7([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x3a7e9d(){const _0x513ceb=[_0x3d72e7([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x3d72e7([0x74,0x72,0x69,0x61,0x6c])][_0x3d72e7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3339cd[_0x3d72e7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x3da778/0x3e8:0xe10*_0x17d791;return _0x3339cd[_0x3d72e7([0x65,0x78,0x70])]<_0x513ceb;}function _0x159ffe(){const _0x21c272=_0x3339cd[_0x3d72e7([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x21c272&&(!!_0x21c272[_0x3d72e7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3d72e7([0x2a]))||!!_0x21c272[_0x3d72e7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3d72e7([0x41,0x49])));}function _0x3cdc4(){const _0x3b9660=_0x3339cd[_0x3d72e7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3b9660||0x0==_0x3b9660[_0x3d72e7([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x3ec43c}=new URL(window[_0x3d72e7([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3b9660[_0x3d72e7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3ec43c))return!0x0;const _0x141a03=_0x3ec43c[_0x3d72e7([0x73,0x70,0x6c,0x69,0x74])](_0x3d72e7([0x2e]));return _0x3b9660[_0x3d72e7([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x52a7c0=>_0x52a7c0[_0x3d72e7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3d72e7([0x2a])))[_0x3d72e7([0x6d,0x61,0x70])](_0x373945=>_0x373945[_0x3d72e7([0x73,0x70,0x6c,0x69,0x74])](_0x3d72e7([0x2e])))[_0x3d72e7([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xcccb8e=>_0xcccb8e[_0x3d72e7([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x141a03[_0x3d72e7([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3d72e7([0x6d,0x61,0x70])](_0x4e524b=>Array(_0x141a03[_0x3d72e7([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x4e524b[_0x3d72e7([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3d72e7([0x66,0x69,0x6c,0x6c])](_0x4e524b[0x0]===_0x3d72e7([0x2a])?_0x3d72e7([0x2a]):'')[_0x3d72e7([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x4e524b))[_0x3d72e7([0x73,0x6f,0x6d,0x65])](_0x5222d1=>_0x141a03[_0x3d72e7([0x65,0x76,0x65,0x72,0x79])]((_0x4013ce,_0x3ff064)=>_0x5222d1[_0x3ff064]===_0x4013ce||_0x5222d1[_0x3ff064]===_0x3d72e7([0x2a])));}function _0x38ae6c(){return _0x652c64&&_0xd859dc?new window[(_0x3d72e7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x45e095,_0x2cdac2)=>{_0x652c64[_0x3d72e7([0x74,0x68,0x65,0x6e])](_0x45e095,_0x2cdac2),_0xd859dc[_0x3d72e7([0x74,0x68,0x65,0x6e])](_0x5ab267=>{_0x5ab267!=_0x3d72e7([0x56,0x61,0x6c,0x69,0x64])&&_0x45e095(_0x5ab267);},_0x2cdac2);}):_0x652c64||_0xd859dc||_0x3d72e7([0x56,0x61,0x6c,0x69,0x64]);}}function _0x5ec4e4(_0x253681,_0x267ea5){return new window[(_0x3d72e7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3ac84d=>{if(_0x51a36f())return _0x3ac84d(_0x3d72e7([0x56,0x61,0x6c,0x69,0x64]));_0x58107d(),_0x3e8f49[_0x3d72e7([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x3d72e7([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x4f7562=!0x1;const _0x536546=_0x5fe9bf();function _0x3b967c(_0x192f3b){return!!_0x192f3b&&(typeof _0x192f3b===_0x3d72e7([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x192f3b===_0x3d72e7([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x192f3b[_0x3d72e7([0x74,0x68,0x65,0x6e])]===_0x3d72e7([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x192f3b[_0x3d72e7([0x63,0x61,0x74,0x63,0x68])]===_0x3d72e7([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x3b428e(_0x56323e){_0x5eb2d6(_0x56323e)[_0x3d72e7([0x74,0x68,0x65,0x6e])](_0x2eb3b0=>{if(!_0x2eb3b0||_0x2eb3b0[_0x3d72e7([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x3d72e7([0x6f,0x6b]))return _0x3d72e7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x220e6c(_0x226d75(_0x536546+_0x267ea5))!=_0x2eb3b0[_0x3d72e7([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x3d72e7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x3d72e7([0x56,0x61,0x6c,0x69,0x64]);})[_0x3d72e7([0x74,0x68,0x65,0x6e])](_0x5bd823=>(_0xfbc4f7(),_0x5bd823),()=>{const _0x49ef50=_0x276fb8();return null==_0x49ef50?(_0xfbc4f7(),_0x3d72e7([0x56,0x61,0x6c,0x69,0x64])):_0x3d72e7(_0x3da778-_0x49ef50>(0x19f340e1^_0x26032c)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x3d72e7([0x74,0x68,0x65,0x6e])](_0x3ac84d)[_0x3d72e7([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3ac84d(_0x3d72e7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x56e9b7=0x3dc92a61^_0x26032c;function _0xfbc4f7(){const _0x587677=_0x3d72e7([0x6c,0x6c,0x63,0x74,0x2d])+_0x220e6c(_0x226d75(_0x253681)),_0x17866b=_0x452745(_0x220e6c(window[_0x3d72e7([0x4d,0x61,0x74,0x68])][_0x3d72e7([0x63,0x65,0x69,0x6c])](_0x3da778/_0x56e9b7)));window[_0x3d72e7([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3d72e7([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x587677,_0x17866b);}function _0x276fb8(){const _0x6e09f8=_0x3d72e7([0x6c,0x6c,0x63,0x74,0x2d])+_0x220e6c(_0x226d75(_0x253681)),_0x41a5e2=window[_0x3d72e7([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3d72e7([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x6e09f8);return _0x41a5e2?window[_0x3d72e7([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x452745(_0x41a5e2),0x10)*_0x56e9b7:null;}function _0x5eb2d6(_0x5f46d9){return new window[(_0x3d72e7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x45edd,_0x1f76f9)=>{_0x5f46d9[_0x3d72e7([0x74,0x68,0x65,0x6e])](_0x45edd,_0x1f76f9),window[_0x3d72e7([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x1f76f9,0x3dfe1021^_0x26032c);});}}_0x3e8f49[_0x3d72e7([0x6f,0x6e])](_0x3d72e7([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x5a16a4,_0x370870)=>{if(_0x370870[0x0]!=_0x253681)return _0x3ac84d(_0x3d72e7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x370870[0x1]={..._0x370870[0x1],[_0x3d72e7([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x536546};},{[_0x3d72e7([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3d72e7([0x68,0x69,0x67,0x68])}),_0x3e8f49[_0x3d72e7([0x6f,0x6e])](_0x3d72e7([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x17c0f8=>{_0x3b967c(_0x17c0f8[_0x3d72e7([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x4f7562=!0x0,_0x3b428e(_0x17c0f8[_0x3d72e7([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x3d72e7([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3d72e7([0x6c,0x6f,0x77])}),_0x36d7a6[_0x3d72e7([0x74,0x68,0x65,0x6e])](()=>{_0x4f7562||_0x3ac84d(_0x3d72e7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x51a36f(){return _0x3e8f49[_0x3d72e7([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3d72e7([0x76,0x69,0x65,0x77])][_0x3d72e7([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x3d72e7([0x61,0x75,0x74,0x6f]);}function _0x58107d(){_0x3e8f49[_0x3d72e7([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3d72e7([0x76,0x69,0x65,0x77])][_0x3d72e7([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3d72e7([0x61,0x75,0x74,0x6f]);}}function _0x20b9c6(_0x265ebf){const _0x52af51=[new window[(_0x3d72e7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3da361=>setTimeout(_0x3da361,0x3df6fa2d^_0x26032c)),_0x36d7a6[_0x3d72e7([0x74,0x68,0x65,0x6e])](()=>new window[(_0x3d72e7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xe8890e=>{let _0x5407a9=0x0;_0x3e8f49[_0x3d72e7([0x6d,0x6f,0x64,0x65,0x6c])][_0x3d72e7([0x6f,0x6e])](_0x3d72e7([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x4e1870,_0x502e26)=>{_0x502e26[0x0][_0x3d72e7([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x5407a9++,_0x5407a9==(0x3dffc519^_0x26032c)&&(_0xe8890e(),_0x4e1870[_0x3d72e7([0x6f,0x66,0x66])]());});}))];return window[_0x3d72e7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3d72e7([0x72,0x61,0x63,0x65])](_0x52af51)[_0x3d72e7([0x74,0x68,0x65,0x6e])](()=>_0x265ebf);}async function _0x42e879(){await _0x36d7a6,_0x3e8f49[_0x3d72e7([0x6d,0x6f,0x64,0x65,0x6c])][_0x3d72e7([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x5a71b0,_0x3e8f49[_0x3d72e7([0x6d,0x6f,0x64,0x65,0x6c])][_0x3d72e7([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x5a71b0,_0x3e8f49[_0x3d72e7([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x3d72e7([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x37fbec(_0x4f5209){const _0x1ce276=_0x33c4fe();_0x3e8f49[_0x1ce276]=_0x3d72e7([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x4f5209,_0x4f5209!=_0x3d72e7([0x56,0x61,0x6c,0x69,0x64])&&_0x42e879();}function _0x33c4fe(){const _0x567cbf=window[_0x3d72e7([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x3d72e7([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x3d72e7([0x6e,0x6f,0x77])]())[_0x3d72e7([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x3d72e7([0x2e]),'');let _0x4b89be=_0x3d72e7([0x6e]);for(let _0x5e44b8=0x0;_0x5e44b8<_0x567cbf[_0x3d72e7([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5e44b8+=0x2){let _0x4aa742=window[_0x3d72e7([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x567cbf[_0x3d72e7([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5e44b8,_0x5e44b8+0x2));_0x4aa742>=_0x2e102a[_0x3d72e7([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x4aa742-=_0x2e102a[_0x3d72e7([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x4b89be+=_0x2e102a[_0x4aa742];}return _0x4b89be;}function _0x322c6e(){const _0x1f2bee=_0x41241f[_0x3d72e7([0x73,0x70,0x6c,0x69,0x74])](_0x3d72e7([0x2e]));if(0x3!=_0x1f2bee[_0x3d72e7([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x21b3df(_0x1f2bee[0x1]);function _0x21b3df(_0x143659){const _0x50ba84=_0x55ced5(_0x143659);return _0x50ba84&&_0x90b8ff()?_0x50ba84:null;function _0x90b8ff(){const _0x599eea=_0x50ba84[_0x3d72e7([0x6a,0x74,0x69])],_0x38d2b5=window[_0x3d72e7([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x599eea[_0x3d72e7([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x599eea[_0x3d72e7([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x424d55={..._0x50ba84,[_0x3d72e7([0x6a,0x74,0x69])]:_0x599eea[_0x3d72e7([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x599eea[_0x3d72e7([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x424d55[_0x3d72e7([0x76,0x63])],_0x226d75(_0x424d55)==_0x38d2b5;}}}async function _0x266f15(){let _0x4499c4=!0x0;try{const _0x2ee7df=_0x41241f[_0x3d72e7([0x73,0x70,0x6c,0x69,0x74])](_0x3d72e7([0x2e])),[_0x513bcf,_0x3376db,_0xfa88c8]=_0x2ee7df;return _0x12471d(_0x513bcf),await _0x1d8407(_0x513bcf,_0x3376db,_0xfa88c8),_0x4499c4;}catch{return!0x1;}function _0x12471d(_0x39275a){const _0x4d619d=_0x55ced5(_0x39275a);_0x4d619d&&_0x4d619d[_0x3d72e7([0x61,0x6c,0x67])]==_0x3d72e7([0x45,0x53,0x32,0x35,0x36])||(_0x4499c4=!0x1);}async function _0x1d8407(_0x2eb7c6,_0x109344,_0x35b568){const _0x5416ec=window[_0x3d72e7([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x3d72e7([0x66,0x72,0x6f,0x6d])](_0x406448(_0x35b568),_0x2127fe=>_0x2127fe[_0x3d72e7([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x8f2500=new window[(_0x3d72e7([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x3d72e7([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x2eb7c6+_0x3d72e7([0x2e])+_0x109344),_0x1cb993=window[_0x3d72e7([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x3d72e7([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1cb993)return;const _0x32892c=await _0x1cb993[_0x3d72e7([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x3d72e7([0x6a,0x77,0x6b]),_0x5346d2,{[_0x3d72e7([0x6e,0x61,0x6d,0x65])]:_0x3d72e7([0x45,0x43,0x44,0x53,0x41]),[_0x3d72e7([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x3d72e7([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x3d72e7([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1cb993[_0x3d72e7([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x3d72e7([0x6e,0x61,0x6d,0x65])]:_0x3d72e7([0x45,0x43,0x44,0x53,0x41]),[_0x3d72e7([0x68,0x61,0x73,0x68])]:{[_0x3d72e7([0x6e,0x61,0x6d,0x65])]:_0x3d72e7([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x32892c,_0x5416ec,_0x8f2500)||(_0x4499c4=!0x1);}}function _0x55ced5(_0x5313d1){return _0x5313d1[_0x3d72e7([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x3d72e7([0x65,0x79]))?JSON[_0x3d72e7([0x70,0x61,0x72,0x73,0x65])](_0x406448(_0x5313d1)):null;}function _0x406448(_0x4d6aad){return window[_0x3d72e7([0x61,0x74,0x6f,0x62])](_0x4d6aad[_0x3d72e7([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x3d72e7([0x2b]))[_0x3d72e7([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x3d72e7([0x2f])));}function _0x226d75(_0x266455){let _0x4bd01a=0x1505;function _0x73d09e(_0x4cc983){for(let _0x45ba39=0x0;_0x45ba39<_0x4cc983[_0x3d72e7([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x45ba39++){const _0x539311=_0x4cc983[_0x3d72e7([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x45ba39);_0x4bd01a=(_0x4bd01a<<0x5)+_0x4bd01a+_0x539311,_0x4bd01a&=_0x4bd01a;}}function _0x314e34(_0x252cbc){Array[_0x3d72e7([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x252cbc)?_0x252cbc[_0x3d72e7([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x314e34):_0x252cbc&&typeof _0x252cbc==_0x3d72e7([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x3d72e7([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x252cbc)[_0x3d72e7([0x73,0x6f,0x72,0x74])]()[_0x3d72e7([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x140ec0,_0x23c66f])=>{_0x73d09e(_0x140ec0),_0x314e34(_0x23c66f);}):_0x73d09e(window[_0x3d72e7([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x252cbc));}return _0x314e34(_0x266455),_0x4bd01a>>>0x0;}function _0x220e6c(_0x5d0176){return _0x5d0176[_0x3d72e7([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x3d72e7([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x3d72e7([0x30]));}function _0x452745(_0x4ac29d){return _0x4ac29d[_0x3d72e7([0x73,0x70,0x6c,0x69,0x74])]('')[_0x3d72e7([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x3d72e7([0x6a,0x6f,0x69,0x6e])]('');}function _0x5a71b0(){}function _0x3d72e7(_0x36334a){return _0x36334a['map'](_0x78a569=>String['fromCharCode'](_0x78a569))['join']('');}_0x37fbec(await _0x1c37ba());}(this);}['showFakeVisualSelection'](){const _0x9008e4=this['editor']['model'];_0x9008e4['change'](_0xd03fab=>{const _0x4f74de=_0x9008e4['document']['selection']['getRanges']();let _0x21837e=0x0;for(const _0x5466e1 of _0x4f74de){const _0x62c912=f+':'+_0x21837e;if(_0x9008e4['markers']['has'](_0x62c912))_0xd03fab['updateMarker'](_0x62c912,{'range':_0x5466e1});else{if(_0x5466e1['start']['isAtEnd']){const _0x2d2a2f=_0x5466e1['start']['getLastMatchingPosition'](({item:_0x4df09a})=>!_0x9008e4['schema']['isContent'](_0x4df09a),{'boundaries':_0x5466e1});_0xd03fab['addMarker'](_0x62c912,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xd03fab['createRange'](_0x2d2a2f,_0x5466e1['end'])});}else _0xd03fab['addMarker'](_0x62c912,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5466e1});}_0x21837e++;}});}['hideFakeVisualSelection'](){const _0x38cccf=this['editor']['model'],_0xf8de51=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0xf8de51['length']&&_0x38cccf['change'](_0x4f6d5e=>{_0xf8de51['forEach'](_0x4cc64d=>{_0x4f6d5e['removeMarker'](_0x4cc64d);});});}['insertContent'](_0xe00769,_0x227b0b){const _0x30340c=this['_getAISelection'](),_0x4e0ddd=_0x227b0b||_0x30340c['getFirstRange']();this['editor']['model']['canEditAt'](_0x4e0ddd)&&this['editor']['model']['change'](_0xb2b54e=>{this['hideFakeVisualSelection'](),_0x227b0b||this['_resetContentOfSelectedTableCells'](_0xb2b54e,_0x30340c),this['_pasteHTMLUsingClipboard']({'insertAt':_0x4e0ddd,'writer':_0xb2b54e,'html':_0xe00769});});}['insertContentBelow'](_0x11b6b3){const {model:_0x126a5d}=this['editor'],_0x78f7d1=this['_getAISelection']();_0x126a5d['change'](()=>{const _0x4e1bec=this['_prepareTableInsertBelowPosition'](_0x11b6b3,_0x78f7d1)||this['_getDefaultInsertBelowPosition'](_0x78f7d1);this['insertContent'](_0x11b6b3,_0x4e1bec);});}['_getAISelection'](){const _0x3a937f=this['editor']['model'],_0x4573ac=Array['from'](_0x3a937f['markers']['getMarkersGroup'](f))['map'](_0x4431c2=>_0x4431c2['getRange']());return _0x3a937f['createSelection'](_0x4573ac);}['_pasteHTMLUsingClipboard']({writer:_0x3d22c4,html:_0x5f342f,insertAt:_0x527d55}){const {view:_0x52f8b5}=this['editor']['editing'],_0x1c3e1e=this['editor']['plugins']['get'](_0x4d1f5d),_0x92116=new $n();_0x92116['setData']('text/html',_0x5f342f);const _0x2a4025=new ClipboardEvent('paste',{'clipboardData':_0x92116}),_0x24dedd=new _0x42a9c7(_0x52f8b5,_0x2a4025,{'dataTransfer':new _0x2f9531(_0x92116)});_0x3d22c4['setSelection'](_0x527d55);const _0x7f1d7c=(_0x869589,_0xb20304)=>{_0xb20304['resultRange']&&_0x3d22c4['setSelection'](_0xb20304['resultRange']);};_0x1c3e1e['once']('contentInsertion',_0x7f1d7c,{'priority':'lowest'}),_0x52f8b5['document']['fire']('paste',_0x24dedd),_0x1c3e1e['off']('contentInsertion',_0x7f1d7c);}['_getDefaultInsertBelowPosition'](_0x4d0aca){const {model:_0x2beae9}=this['editor'],_0x5775a2=Array['from'](_0x4d0aca['getSelectedBlocks']());return _0x5775a2['length']?_0x2beae9['createPositionAfter'](_0x5775a2['pop']()):_0x4d0aca['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x5ec397,_0x5d8b32){const {model:_0x1a6eaf,plugins:_0x46c8a8}=this['editor'];if(_0x46c8a8['has']('TableUtils')){const _0x41848e=_0x46c8a8['get']('TableUtils')['getSelectedTableCells'](_0x5d8b32);if(_0x41848e['length']){const _0x29a3a7=this['_getTableRowCountFromContent'](_0x5ec397),_0x2a3a3e=this['_createEmptyTableRows'](_0x41848e,_0x29a3a7);return _0x1a6eaf['createPositionAt'](_0x2a3a3e,0x0);}}return null;}['_getTableRowCountFromContent'](_0x49fff7){const _0x1e8d82=this['editor']['plugins']['get']('TableUtils'),_0x2a78a9=this['editor']['data']['parse'](_0x49fff7),_0x439f7e=Array['from'](_0x2a78a9['getChildren']())['filter'](_0x26c661=>_0x26c661['is']('element','table'));let _0x429872=0x0;return _0x439f7e['forEach'](_0x48c3b3=>{_0x429872+=_0x1e8d82['getRows'](_0x48c3b3);}),_0x429872;}['_createEmptyTableRows'](_0x4ab45e,_0x448209){const _0x70601e=this['editor']['plugins']['get']('TableUtils'),_0x206613=_0x70601e['getRowIndexes'](_0x4ab45e),_0x567686=_0x70601e['getColumnIndexes'](_0x4ab45e),_0x378270=_0x206613['last']+0x1,_0x1f8c4a=_0x567686['first'],_0x37e9bf=_0x4ab45e[0x0]['findAncestor']('table');for(let _0x541ffe=0x0;_0x541ffe<_0x448209;_0x541ffe++)_0x70601e['insertRows'](_0x37e9bf,{'at':_0x378270});return _0x37e9bf['getChild'](_0x378270)['getChild'](_0x1f8c4a);}['_resetContentOfSelectedTableCells'](_0x395b10,_0x3e4c04){const {plugins:_0x1719fe}=this['editor'],{model:_0x1da60}=_0x395b10;if(!_0x1719fe['has']('TableUtils'))return;_0x1719fe['get']('TableUtils')['getSelectedTableCells'](_0x3e4c04)['length']&&_0x1da60['deleteContent'](_0x3e4c04);}}class x extends _0x4075a7{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x5b2487('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x1206a8){super(_0x1206a8),this['name']='AIRequestError';}}function qn(_0x568a6f,_0x1126a1,_0x29bb66){const t=_0x568a6f['t'];switch(_0x1126a1){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',_0x29bb66);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x29bb66);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'},_0x29bb66);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 _0x1126a1;}}class E extends Qt{['_commandDefinitions'];constructor(_0x543e9f,_0x45c17b){super(_0x543e9f),this['_commandDefinitions']=_0x45c17b,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x44077e,_0x26aeb8,_0x2891b9)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x2891b9));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x301b56,_0x2dfc91,_0x4b2506)=>{this['enabledCommandsIds']=_0x4b2506?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x26afb8=this['editor']['model'];this['_hasContext']=function(_0xefa1f5){const _0x7e4c21=_0xefa1f5['document']['selection'];return _0x7e4c21['isCollapsed']?0x0!==[..._0x7e4c21['getSelectedBlocks']()]['length']&&![..._0x7e4c21['getSelectedBlocks']()][0x0]['isEmpty']:!!_0xefa1f5['hasContent'](_0x7e4c21['getFirstRange']());}(_0x26afb8);const _0x33073e=_0x26afb8['document']['selection'],_0x549cbb=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x2fe5f0 of _0x33073e['getRanges']())for(const _0x41e088 of _0x2fe5f0['getItems']())if(_0x41e088['is']('element')&&_0x549cbb['includes'](_0x41e088['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x478bea='',_0x1779b3='',_0x2da2f7='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x478bea,_0x1779b3,_0x2da2f7);}}function ns(_0x5c2b77,_0x4eb645){const _0xd96850=new Set();for(const _0x10f6e6 of _0x5c2b77['values']())(_0x4eb645||!0x1===_0x10f6e6['requiresContent'])&&_0xd96850['add'](_0x10f6e6['id']);return Array['from'](_0xd96850);}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(_0x3648f8,_0x729615,_0x7227e7){super(),this['editor']=_0x3648f8,this['textAdapter']=_0x729615,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x7227e7,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x305809,_0x2bd449,_0x3364db)=>{this['view']['value']=this['_sanitizeHTML'](_0x3364db);}),this['listenTo'](this['view'],'submitPrompt',(_0x4b241b,_0x111857)=>{const _0x52a9ae=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x111857,_0x52a9ae,'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:_0x2e4c19,query:_0x252d35,htmlContent:_0x22d904,label:_0x58022e,mainActionLabel:_0x27698f}){this['view']['prompt']=_0x58022e,this['view']['mainAction']=_0x27698f,this['initialContext']=_0x22d904,_0x252d35&&(this['view']['isRendered']?this['_handleQuery'](_0x252d35,_0x22d904,_0x2e4c19,_0x58022e):this['view']['once']('render',()=>{this['_handleQuery'](_0x252d35,_0x22d904,_0x2e4c19,_0x58022e);}));}['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'](_0x23cb25,_0x5dd736,_0x4a5cf6,_0x35114e){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x5dd736,this['previousQuery']=_0x23cb25,this['previousLabel']=_0x35114e||_0x23cb25,this['previousActionId']=_0x4a5cf6,new Promise(_0x1a83b0=>{this['textAdapter']['makeRequest']({'query':_0x23cb25,'context':_0x5dd736,'onData':_0x27df10=>{this['currentResponse']=_0x27df10,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x4a5cf6})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x5ed7ea=>{_0x5ed7ea instanceof tr?this['view']['handleError'](_0x5ed7ea['message']):this['view']['handleError'](),_0x1a83b0();})['finally'](()=>{this['stopProcessing'](),_0x1a83b0();});});}['_parseAndNormalizeContent'](_0xb8199f,_0x3fcac=!0x1){const _0x422ebf=hs['exec'](_0xb8199f);_0xb8199f=_0x422ebf?_0xb8199f['substring'](_0x422ebf[0x1]['length']):_0xb8199f['length']<0x64&&!_0x3fcac?'':this['_stripMarkdownSyntax'](_0xb8199f);const _0x45f72e=this['_domParser']['parseFromString'](_0xb8199f,'text/html');if(_0x422ebf){const _0x5609de=Array['from'](_0x45f72e['body']['childNodes']);_0x5609de['reverse']();for(const _0x472145 of _0x5609de){if(_0x472145['nodeType']==Node['ELEMENT_NODE'])break;_0x472145['remove']();}}const _0x47b18f=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x45f72e['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x47b18f);const _0x34244e=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x222787=this['editor']['data']['toModel'](_0x47b18f);return _0x34244e||_0x222787['markers']['clear'](),this['editor']['data']['stringify'](_0x222787);}['_normalizeResponseHeadings'](_0x1c3aca){const _0x55d6a7=new _0x4bdcac(this['editor']['editing']['view']['document']),_0x26681d=new _0x1be03a({'name':/^h[1-5]$/}),_0x2dbd4a=[];let _0x150d31=!0x1;for(const _0x42b575 of _0x1c3aca)_0x42b575['is']('element')&&_0x26681d['match'](_0x42b575)&&(_0x2dbd4a['push'](_0x42b575),'h1'==_0x42b575['name']&&(_0x150d31=!0x0));if(_0x150d31){for(const _0x614a98 of _0x2dbd4a)_0x55d6a7['rename']('h'+(parseInt(_0x614a98['name'][0x1])+0x1),_0x614a98);}}['_isH1TagSupportEnabled'](){const {data:_0x42d092,editing:_0xc85ee1}=this['editor'],_0x3809b5=_0x42d092['htmlProcessor']['toView']('<h1></h1>'),_0x8fee3e=_0x42d092['toView'](_0x42d092['toModel'](_0x3809b5));return!!_0xc85ee1['view']['domConverter']['viewToDom'](_0x8fee3e)['querySelector']('h1');}['_sanitizeHTML'](_0x2e74f3){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x2e74f3),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x1709a8){const _0x30bf9b=_0x1709a8['trim']();return _0x30bf9b['startsWith']('```html')?_0x30bf9b['endsWith']('```')?_0x30bf9b['substring'](0x7,_0x30bf9b['length']-0x3):_0x30bf9b['substring'](0x7):_0x1709a8;}}const _={'REPLACE':'replace','INSERT':'insert'};class yr extends _0x5aa8e0{constructor(_0x1aaa34){super(_0x1aaa34),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x29dbb9=>qn(_0x1aaa34,'AI_'+_0x29dbb9['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](qn(_0x1aaa34,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](qn(_0x1aaa34,'Try\x20again')),this['stopButton']=this['_createButton'](qn(_0x1aaa34,'Stop'));const _0x3bb9c5=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3bb9c5['if']('isVisible','ck-hidden',_0x324a94=>!_0x324a94)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x86907c,_0x16dc3e){const _0x784a03=new _0x23f64b(this['locale']);return _0x784a03['set']({'label':_0x86907c,'class':_0x16dc3e||'','isVisible':!0x0,'withText':!0x0}),_0x784a03;}}class gr extends _0x1fbe2f{['contentFieldView'];['copyButtonView'];constructor(_0x401405,_0x35ac15=''){super(_0x401405),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x2af294=this['bindTemplate'];this['contentFieldView']=new Qn(_0x401405,_0x35ac15),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x2af294['if']('isVisible','ck-hidden',_0x1fe738=>!_0x1fe738)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x2af294['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 _0x33b9be=!0x1;this['on']('change:value',(_0x3db380,_0x5eab45,_0x1a3c14)=>{const _0x234d9c=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x1a3c14),this['isProcessing']&&_0x234d9c&&!_0x33b9be&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x21a740,_0x468c45,_0x465b1a)=>{_0x33b9be=!0x1,_0x465b1a?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x33b9be=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x33b9be=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x525e46=this['locale'],_0x230d86=new _0x23f64b(this['locale']),_0x257a85='ck-ai-form__copy-button';return _0x230d86['set']({'label':qn(_0x525e46,'Copy'),'icon':_0x242b0e,'class':_0x257a85,'tooltip':!0x0}),_0x230d86['bind']('isVisible')['to'](this,'value',_0x41efe4=>!!_0x41efe4),_0x230d86['bind']('isEnabled')['to'](this,'isProcessing',_0x4d18f3=>!_0x4d18f3),_0x230d86['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x230d86['icon']=_0x44639d,_0x230d86['class']=_0x257a85+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x230d86['icon']=_0x242b0e,_0x230d86['class']=_0x257a85;},0x3e8);}),_0x230d86;}['_copyHTMLToClipboard'](_0x32a139){const {window:_0x41a279,document:_0x577762}=_0x221a5;if(_0x41a279['ClipboardItem']){const {Blob:_0x56516f,ClipboardItem:_0x4e66c4}=_0x41a279,_0x46fad3=[new _0x4e66c4({'text/html':new _0x56516f([_0x32a139['innerHTML']],{'type':'text/html'}),'text/plain':new _0x56516f([_0x32a139['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x46fad3);}else{const _0x31125f=_0x577762['createElement']('div');_0x31125f['style']['position']='absolute',_0x31125f['style']['left']='-9999px',_0x31125f['innerHTML']='<span>[</span>'+_0x32a139['innerHTML']+'<span>]</span>',_0x577762['body']['appendChild'](_0x31125f);const _0x322398=_0x577762['createRange']();_0x322398['setStartAfter'](_0x31125f['firstElementChild']),_0x322398['setEndBefore'](_0x31125f['lastElementChild']);const _0x2111e3=_0x41a279['getSelection']();_0x2111e3['removeAllRanges'](),_0x2111e3['addRange'](_0x322398),_0x577762['execCommand']('copy'),_0x31125f['remove']();}}}class Qn extends _0x1fbe2f{constructor(_0x429712,_0x49c28a=''){super(_0x429712),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x49c28a,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x29c53f){this['element']['innerHTML']=_0x29c53f;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x308504=new _0x1fbe2f(),_0x5c6aae=this['locale'],_0x1d6d45=new _0x33e627();return _0x1d6d45['isVisible']=!0x0,_0x308504['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x1d6d45,{'text':qn(_0x5c6aae,'AI\x20is\x20writing...')}]}),_0x308504['render'](),_0x308504;}}class Er extends _0x1fbe2f{constructor(_0x3227be,_0x240cc3=''){super(_0x3227be);const _0x11dd72=new _0x285b99(),_0x328e79=this['bindTemplate'];this['set']('text',_0x240cc3),_0x11dd72['content']=_0x131586,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x11dd72,{'text':_0x328e79['to']('text')}]});}}class vr extends _0x250640{['submitButtonView'];['showHistoryButtonView'];constructor(_0x4def6b,_0x3d9587){super(_0x4def6b,_0x3d9587),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',(_0x23321d,_0x497d8a)=>{_0x23321d['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x497d8a());});}['_createSubmitButton'](){const _0x3d75f1=new _0x23f64b(this['locale']),_0xa576c3=this['locale'];return _0x3d75f1['set']({'icon':_0x1f7b2c,'label':qn(_0xa576c3,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x3d75f1['on']('execute',()=>{this['submit']();}),_0x3d75f1['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x254add,_0x131c1a)=>!_0x254add&&_0x131c1a),_0x3d75f1;}['_createShowHistoryButton'](){const _0x104c7a=new _0x23f64b(this['locale']),_0x33ae9b=this['resultsView'],_0x3df72b=this['locale'];_0x104c7a['set']({'label':qn(_0x3df72b,'History'),'withText':!0x1,'icon':dt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x104c7a['bind']('isOn')['to'](_0x33ae9b,'isVisible'),_0x104c7a['bind']('isEnabled')['to'](this,'isEnabled'),_0x104c7a['on']('execute',()=>{_0x33ae9b['isVisible']=!_0x33ae9b['isVisible'],_0x33ae9b['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x3f8df7=()=>{_0x221a5['window']['requestAnimationFrame'](()=>{if(_0x4a2145(this['element'])){const _0x501a7f=new _0x1f7ba8(this['queryView']['fieldView']['element']),_0x324260=_0x501a7f['width'],_0xf4f46d='rtl'===_0x3df72b['uiLanguageDirection']?'left':'right';_0x501a7f['excludeScrollbarsAndBorders'](),_0x104c7a['element']['style'][_0xf4f46d]=_0x324260-_0x501a7f['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x3f8df7),this['on']('render',_0x3f8df7),_0x104c7a;}['submit'](){const _0x895ca5=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x895ca5);}['focus'](_0x5667c3){-0x1===_0x5667c3?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Ar extends _0x5253cf{['historyGroupView'];['clearHistoryButton'];constructor(_0x205015){super(_0x205015),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x139840(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=qn(_0x205015,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4a94bd=0x0;for(const _0x36fb11 of this['items'])_0x4a94bd+=_0x36fb11['items']['length'];return{'resultsCount':_0x4a94bd,'totalItemsCount':_0x4a94bd};}['_createClearHistoryButton'](){const _0x1c3aa6=this['locale'],_0x5ed9fb=new _0x23f64b(this['locale']);return _0x5ed9fb['set']({'label':'('+qn(_0x1c3aa6,'Clear')+')','withText':!0x0}),_0x5ed9fb['on']('execute',()=>this['fire']('clearHistory')),_0x5ed9fb;}}class Pr extends _0x57e588{constructor(_0x26f95a){super();const _0x1fd7cb=new _0x1eeb89(),_0x289ca6=new _0x23f64b(this['locale'],_0x1fd7cb);this['children']['add'](_0x289ca6),_0x289ca6['set']({'label':_0x26f95a['prompt'],'withText':!0x0}),_0x289ca6['on']('execute',()=>{this['fire']('execute',{'value':_0x57909f(_0x26f95a['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class jr extends _0x3925ff{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4e85a5,_0x5e9859)=>{const _0x5e104f=fo(_0x5e9859['prompt']);for(const _0x30207e of this)if(_0x30207e!=_0x5e9859&&fo(_0x30207e['prompt'])===_0x5e104f){this['remove'](_0x30207e);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x527851=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x527851));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0xc8b61b=>_0xc8b61b)));}}function fo(_0x4ccc0b){return _0x4ccc0b['toLowerCase']()['trim']();}class k extends _0x1fbe2f{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2b4ef5,_0xbc87b,_0x29a6ee=''){super(_0x2b4ef5),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(_0x2b4ef5),this['contentArea']=new gr(_0x2b4ef5,_0x29a6ee),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 _0x2cffef(),this['keystrokes']=new _0x46a36b(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x14e425({'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 _0x4f09c8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0xbc87b],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x4f09c8['if']('isError','ck-hidden',_0x185c5b=>!_0x185c5b)]},'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'](_0x2708c1=0x1){-0x1===_0x2708c1?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 _0x945b25=this['locale'],_0xfd5bd5=new vr(_0x945b25,{'queryView':{'label':qn(_0x945b25,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x59eec3,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':qn(_0x945b25,'Empty\x20history'),'secondary':qn(_0x945b25,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0xfd5bd5['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x542f8b,_0x404aff)=>_0x542f8b&&!_0x404aff),this['listenTo'](_0xfd5bd5,'submit',(_0x14f3e5,_0x3b3557)=>{this['prompt']=_0x3b3557;const _0x1c5978=_0x49969b(_0x3b3557);this['fire']('submitPrompt',_0x1c5978),_0x3b3557['trim']()&&this['_promptHistory']['add']({'prompt':_0x1c5978},0x0);},{'priority':'high'}),_0xfd5bd5;}['_createHistoryView'](){const _0x398f7b=new Ar(this['locale']);return _0x398f7b['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Pr),_0x398f7b['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x398f7b;}['_createToolbar'](){const _0x596dfb=new yr(this['locale']);return _0x596dfb['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xf1ee4d,_0x2f25cb,_0x27052a)=>_0xf1ee4d&&!_0x2f25cb&&!!_0x27052a),_0x596dfb['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x596dfb['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x28a191,_0x34c2ac,_0x131760)=>_0x28a191&&!_0x34c2ac&&!!_0x131760),_0x596dfb['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x596dfb['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2b2f95,_0x32f7b7)=>_0x2b2f95&&!_0x32f7b7),_0x596dfb['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x596dfb['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x596dfb['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x596dfb;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x33fb5c=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=qn(_0x33fb5c,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x422f0c){const _0x43229b=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x422f0c||qn(_0x43229b,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x4075a7{['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[_0x450c57,a,x,_0x52d042];}constructor(_0x5dd67a){super(_0x5dd67a),_0x5dd67a['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x5dd67a['config']['define']('ai.assistant.contentAreaCssClass',''),_0x5dd67a['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x5dd67a['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x1a9527}=this;this['_aiAdapter']=_0x1a9527['plugins']['get'](x),this['_dialog']=_0x1a9527['plugins']['get'](_0x52d042),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x2910f9=new E(_0x1a9527,Array['from'](this['_commandDefinitions']['values']()));_0x1a9527['commands']['add']('showAIAssistant',_0x2910f9),_0x1a9527['ui']['componentFactory']['add']('aiCommands',_0xa1b4bb=>{const _0x52c7fd=_0x43e2d9(_0xa1b4bb);return _0x52c7fd['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x52c7fd['buttonView']['set']({'label':qn(_0xa1b4bb,'AI\x20Commands'),'icon':_0x4741cd,'tooltip':!0x0}),_0x52c7fd['on']('execute',_0x3933d1=>this['_onExecute'](_0x3933d1['source']['id'])),_0x3ded9c(_0x52c7fd,_0x1a9527['ui']['view']['body'],function(_0x373744){const _0xdec65f=o(_0x373744['config']['get']('ai.assistant.commands'),_0x373744['locale']),_0x3da80e=U(_0x373744,_0xdec65f)['filter'](_0x2b3c56=>_0x2b3c56['commands']['length']);if(0x1===_0x3da80e['length'])return U(_0x373744,_0x3da80e[0x0]['commands'])['map'](_0x41b369=>({'id':_0x41b369['id'],'label':_0x41b369['label']}));return _0x3da80e['map'](_0x422820=>{const {groupId:_0x80fb00,groupLabel:_0x32357b,commands:_0x1f475d}=_0x422820,_0x10b5d2=U(_0x373744,_0x1f475d)['map'](_0x10a257=>({'id':_0x10a257['id'],'label':_0x10a257['label']}));return{'id':_0x80fb00,'menu':_0x32357b||_0x80fb00,'children':_0x10b5d2};});}(_0x1a9527),{'ariaLabel':qn(_0xa1b4bb,'AI\x20Commands')}),_0x52c7fd['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x2910f9['on']('change:enabledCommandsIds',_0x225428),_0x52c7fd['menuView']['once']('render',_0x225428),_0x52c7fd;function _0x225428(){_0x52c7fd['isEnabled']=_0x2910f9['enabledCommandsIds']['length']>0x0;for(const _0x49a288 of _0x52c7fd['menuView']['buttons'])_0x49a288['isEnabled']=_0x2910f9['enabledCommandsIds']['includes'](_0x49a288['id']);}}),_0x1a9527['ui']['componentFactory']['add']('menuBar:aiCommands',_0x5189a8=>{const _0x3db5c9=new _0x890a74(_0x5189a8);_0x3db5c9['buttonView']['set']({'label':qn(_0x5189a8,'AI\x20Commands'),'icon':_0x4741cd}),_0x3db5c9['bind']('isEnabled')['to'](_0x2910f9,'enabledCommandsIds',_0xeeecb7=>_0xeeecb7['length']>0x0);const _0x3c309b=o(_0x1a9527['config']['get']('ai.assistant.commands'),_0x5189a8);return this['_populateMenuBarMenu'](_0x2910f9,_0x3db5c9,_0x3c309b,_0x3144df=>this['_onExecute'](_0x3144df)),_0x3db5c9;}),_0x1a9527['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x14fdfb=this['_createAIAssistantUIButton'](_0x23f64b);return _0x14fdfb['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x14fdfb;}),_0x1a9527['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x39e38f=this['_createAIAssistantUIButton'](_0x6490d1);return _0x39e38f['set']({'role':'menuitemcheckbox'}),_0x39e38f;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x17184f=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0xe3166e;for(const _0x40bb4e in _0x17184f){const _0x49957b=_0x40bb4e,_0x4f0b43=_0x17184f[_0x49957b];if('aiLicenseKeyValid'==_0x4f0b43||'aiLicenseKeyInvalid'==_0x4f0b43||'aiLicenseKeyExpired'==_0x4f0b43||'aiLicenseKeyDomainLimit'==_0x4f0b43||'aiLicenseKeyNotAllowed'==_0x4f0b43||'aiLicenseKeyEvaluationLimit'==_0x4f0b43||'aiLicenseKeyTrialLimit'==_0x4f0b43||'aiLicenseKeyUsageLimit'==_0x4f0b43){delete _0x17184f[_0x49957b],_0xe3166e=_0x4f0b43,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0xe3166e&&_0x17184f['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0xe3166e&&_0x17184f['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0xe3166e&&_0x17184f['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0xe3166e&&_0x17184f['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0xe3166e&&_0x17184f['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0xe3166e&&_0x17184f['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0xe3166e&&_0x17184f['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0xe5b1aa='',_0x2eb44e='',_0x4d312e='custom'){const _0x1baf7f=this['editor'],_0x196adf=_0x1baf7f['editing']['view'],_0x81d178=_0x1baf7f['plugins']['get'](a),_0x5abd31=_0x1baf7f['plugins']['get'](_0x450c57);_0x81d178['showFakeVisualSelection']();const _0x2d0d83=new w(),_0x15cf52=new ClipboardEvent('copy',{'clipboardData':_0x2d0d83}),_0x4e75e3=new _0x2f9531(_0x2d0d83),_0x2b2726=new _0x42a9c7(_0x196adf,_0x15cf52,{'dataTransfer':_0x4e75e3});_0x5abd31['_forceMarkersCopy']('comment',()=>{_0x196adf['document']['fire']('copy',_0x2b2726);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x1baf7f,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x527a24=_0x4e75e3['getData']('text/html');const _0x323392=_0x1baf7f['model']['document']['selection'],_0x28e890=Array['from'](_0x323392['getRanges']());0x1===_0x28e890['length']&&_0x28e890[0x0]['isFlat']&&!_0x323392['getSelectedElement']()&&''!==_0x527a24['replace'](/&nbsp;/g,'')['trim']()&&(_0x527a24='<p>'+_0x527a24+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x4d312e,'query':_0xe5b1aa,'htmlContent':_0x527a24,'label':_0x2eb44e,'mainActionLabel':_[_0x1baf7f['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x4c55ed,'title':qn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x51762f['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x81d178['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0xf4cce2=new Map(),_0x447c21=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0xb9c307 of _0x447c21)for(const _0x21fbc1 of _0xb9c307['commands'])_0xf4cce2['set'](_0x21fbc1['id'],{..._0x21fbc1,'groupId':_0xb9c307['groupId'],'groupLabel':_0xb9c307['groupLabel']||_0xb9c307['groupId']});return _0xf4cce2;}['_createAIAssistantUIButton'](_0x710ec8){const _0xe778f2=this['editor'],_0xcadcbf=_0xe778f2['commands']['get']('showAIAssistant'),_0x57733d=new _0x710ec8(_0xe778f2['locale']);return _0x57733d['set']({'label':qn(_0xe778f2['locale'],'AI\x20Assistant'),'icon':_0x4c55ed,'isToggleable':!0x0}),_0x57733d['bind']('isEnabled')['to'](_0xcadcbf),_0x57733d['bind']('isOn')['to'](this['_dialog'],'id',_0x5cb775=>'aiAssistant'===_0x5cb775),this['listenTo'](_0x57733d,'execute',()=>{_0x57733d['isOn']?this['hideUI']():_0xcadcbf['execute']();}),_0x57733d;}['_initView'](){const _0x581457=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',()=>{_0x581457['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x581457['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x469eb7,ui:{ariaLiveAnnouncer:_0x585738}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x4232b2,_0x319637,_0x3c573f)=>{const _0x679b3=this['_aiAssistantController']['currentContext'];_0x3c573f?_0x585738['announce'](qn(_0x469eb7,'AI\x20is\x20writing')):_0x679b3&&_0x585738['announce'](qn(_0x469eb7,'Generated\x20content:\x20%0',_0x679b3),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x12ab4a,_0xe85e3e,_0x4d2b83)=>{if(_0x4d2b83){const _0x3d3a32=this['_formView']['errorView']['text'];_0x585738['announce'](qn(_0x469eb7,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3d3a32));}});}['_onExecute'](_0x2abb94){const _0x5708f7=this['_commandDefinitions']['get'](_0x2abb94),_0x1ef156=this['editor'],_0x2952db=_0x1ef156['model']['document']['selection'],_0x58abd5=_0x1ef156['commands']['get']('showAIAssistant'),_0x3cb95c=_0x1ef156['plugins']['get'](a),_0x5602bd=''+(_0x5708f7['groupId']!==K?_0x5708f7['groupLabel']+':\x20':'')+_0x5708f7['label'];if(!0x1!==_0x5708f7['requiresContent']&&_0x2952db['isCollapsed']){const _0xc5f689=_0x41a078(_0x2952db['getSelectedBlocks']())||_0x1ef156['model']['schema']['getLimitElement'](_0x2952db);_0x1ef156['model']['change'](_0x30ab66=>{_0x30ab66['setSelection'](_0xc5f689,'in');});}_0x3cb95c['showFakeVisualSelection'](),_0x58abd5['execute'](_0x5708f7['prompt'],_0x5602bd,'command:'+_0x2abb94);}['_populateMenuBarMenu'](_0x4f2a84,_0x39a17b,_0x4d9553,_0x3fbdf3){const _0x461a14=this['editor'],_0x3d9f12=_0x461a14['locale'],_0x4a7539=new _0x4f9a9e(_0x3d9f12),_0x42aa26=U(_0x461a14,_0x4d9553)['filter'](_0x284df4=>_0x284df4['commands']['length']);0x1===_0x42aa26['length']?this['_getMenuBarGroupButtons']({'command':_0x4f2a84,'commands':_0x42aa26[0x0]['commands'],'parentMenuView':_0x39a17b,'onExecute':_0x3fbdf3})['forEach'](_0x41041b=>_0x4a7539['items']['add'](_0x41041b)):_0x42aa26['forEach'](({groupId:_0xd058b,groupLabel:_0x21598a,commands:_0x1ec9a1})=>{const _0xfd280d=new _0x2db487(_0x3d9f12,_0x39a17b),_0x3c0c13=new _0x890a74(_0x3d9f12),_0x50ecec=new _0x4f9a9e(_0x3d9f12),_0x164db7=this['_getMenuBarGroupButtons']({'command':_0x4f2a84,'commands':_0x1ec9a1,'parentMenuView':_0x3c0c13,'onExecute':_0x3fbdf3});_0x3c0c13['buttonView']['set']({'label':_0x21598a||_0xd058b}),_0x3c0c13['delegate']('execute')['to'](_0x39a17b),_0x50ecec['items']['addMany'](_0x164db7),_0x3c0c13['panelView']['children']['add'](_0x50ecec),_0xfd280d['children']['add'](_0x3c0c13),_0x4a7539['items']['add'](_0xfd280d);}),_0x39a17b['panelView']['children']['add'](_0x4a7539);}['_getMenuBarGroupButtons']({command:_0x4f0490,commands:_0x12f3b8,parentMenuView:_0x4005ea,onExecute:_0x65792f}){const _0x39f38b=this['editor'],_0x1a652e=_0x39f38b['locale'];return U(_0x39f38b,_0x12f3b8)['map'](_0x5772f0=>{const _0x16a7c4=new _0x2db487(_0x1a652e,_0x4005ea),_0x4bffa4=new _0x6490d1(_0x1a652e);return _0x4bffa4['set']({'label':_0x5772f0['label']}),_0x4bffa4['delegate']('execute')['to'](_0x4005ea),_0x4bffa4['on']('execute',()=>_0x65792f(_0x5772f0['id'])),_0x4bffa4['bind']('isEnabled')['to'](_0x4f0490,'enabledCommandsIds',_0x41fff1=>_0x41fff1['includes'](_0x5772f0['id'])),_0x16a7c4['children']['add'](_0x4bffa4),_0x16a7c4;});}}function T(_0x1c19d1,_0x5149f2){return void 0x0!==_0x1c19d1['order']&&void 0x0===_0x5149f2['order']?0x1:void 0x0===_0x1c19d1['order']&&void 0x0!==_0x5149f2['order']?-0x1:void 0x0!==_0x1c19d1['order']&&void 0x0!==_0x5149f2['order']?_0x1c19d1['order']-_0x5149f2['order']:0x0;}function U(_0x5106ab,_0x361ae2){_0x361ae2['sort'](T);const _0x4c87a9={},_0x4b821b=[];for(const _0x184aa2 of _0x361ae2)if(void 0x0!==_0x184aa2['order']){if(_0x184aa2['order']in _0x4c87a9)throw new _0x5b2487('ai-commands-config-order-collision',_0x5106ab,{'conflictingDefinitions':[_0x184aa2,_0x4c87a9[_0x184aa2['order']]]});_0x4c87a9[_0x184aa2['order']]=_0x184aa2,_0x4b821b['splice'](_0x184aa2['order'],0x0,_0x184aa2);}else _0x4b821b['push'](_0x184aa2);return _0x4b821b;}class Xn extends _0x4075a7{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1ff0c3){super(_0x1ff0c3);const _0x555813=_0x1ff0c3['config'],_0x4ec320=_0x1ff0c3['locale'];_0x555813['define']('ai.assistant.preserveComments',!0x0),_0x555813['define']('ai.assistant.commands',zn(_0x4ec320)),_0x555813['define']('ai.assistant.extraCommandGroups',[]),_0x555813['define']('ai.assistant.removeCommands',[]);let _0xcd6d6e=o(_0x555813['get']('ai.assistant.commands'),_0x4ec320);const _0x5b1b2d=_0x555813['get']('ai.assistant.extraCommandGroups'),_0x249930=_0x555813['get']('ai.assistant.removeCommands');_0x5b1b2d['forEach'](_0x5aeca8=>{const _0x73c5e4=_0xcd6d6e['find'](_0x1152e4=>_0x1152e4['groupId']===_0x5aeca8['groupId']);_0x73c5e4?_0x73c5e4['commands']=_0x73c5e4['commands']['concat'](_0x5aeca8['commands']):_0xcd6d6e['push'](_0x5aeca8);}),_0xcd6d6e=_0xcd6d6e['filter'](_0x2d75e8=>!_0x249930['includes'](_0x2d75e8['groupId'])),_0xcd6d6e['forEach'](_0x2603f8=>{_0x2603f8['commands']=_0x2603f8['commands']['filter'](_0x1f3a73=>!_0x249930['includes'](_0x1f3a73['id']));}),_0x555813['set']('ai.assistant.commands',_0xcd6d6e);}}function zn(_0x3234b1){return[{'groupId':'editOrReview','groupLabel':qn(_0x3234b1,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':qn(_0x3234b1,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':qn(_0x3234b1,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':qn(_0x3234b1,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':qn(_0x3234b1,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':qn(_0x3234b1,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':qn(_0x3234b1,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':qn(_0x3234b1,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':qn(_0x3234b1,'Change\x20tone'),'commands':[{'id':'professional','label':qn(_0x3234b1,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':qn(_0x3234b1,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':qn(_0x3234b1,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':qn(_0x3234b1,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':qn(_0x3234b1,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':qn(_0x3234b1,'Change\x20style'),'commands':[{'id':'business','label':qn(_0x3234b1,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':qn(_0x3234b1,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':qn(_0x3234b1,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':qn(_0x3234b1,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':qn(_0x3234b1,'Translate'),'commands':[{'id':'translateEnglish','label':qn(_0x3234b1,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':qn(_0x3234b1,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':qn(_0x3234b1,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':qn(_0x3234b1,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':qn(_0x3234b1,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':qn(_0x3234b1,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':qn(_0x3234b1,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':qn(_0x3234b1,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class pe extends _0x4075a7{['abortController'];static get['requires'](){return[x];}constructor(_0x2b962b){super(_0x2b962b),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'](_0x2817dd){return this['sendRequest'](_0x2817dd)['catch'](_0x3bf04e=>{if(_0x3bf04e instanceof tr)return Promise['reject'](_0x3bf04e);if('AbortError'==_0x3bf04e['name'])return Promise['resolve']();throw console['error'](_0x3bf04e),new _0x5b2487('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x537c38,_0x388145){const _0x449e3a=this['editor']['locale'],_0x1f9ca1={'Content-Type':'application/json'};if('object'==typeof _0x537c38)Object['assign'](_0x1f9ca1,_0x537c38);else{if(_0x537c38)try{const _0x157c03=await _0x537c38(_0x388145);Object['assign'](_0x1f9ca1,_0x157c03);}catch{return Promise['reject'](new tr(qn(_0x449e3a,'AI_ERROR_GET_HEADERS')));}}return _0x1f9ca1;}async['_prepareRequestParameters'](_0x36c47f,_0x4fb145){const _0x274b8d=this['editor']['locale'];if('object'==typeof _0x36c47f)return _0x36c47f;try{return await _0x36c47f(_0x4fb145);}catch{return Promise['reject'](new tr(qn(_0x274b8d,'AI_ERROR_GET_PARAMETERS')));}}}class Jn extends pe{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x1aa52b){super(_0x1aa52b),_0x1aa52b['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x1aa52b['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x1aa52b['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x1aa52b['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x1aa52b['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x1aa52b['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x49885a,context:_0x5a06d8,onData:_0x2b4e65,actionId:_0x3fb8d4}){const _0x48414c=this['editor']['locale'],_0x2d1b7d=await this['prepareMessages'](_0x49885a,_0x5a06d8,_0x3fb8d4),_0x74a34c=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3fb8d4),_0x55d87e=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3fb8d4),_0x433f3a={'messages':_0x2d1b7d,..._0x55d87e},_0x2d98f9={'method':'POST','headers':_0x74a34c,'body':JSON['stringify'](_0x433f3a),'signal':this['abortController']['signal']},_0x267b4b=await fetch(this['_apiUrl'],_0x2d98f9);if(_0x267b4b['ok'])return _0x55d87e['stream']?await this['_readStreamableResponse'](_0x267b4b,_0x2b4e65):await this['_readStaticResponse'](_0x267b4b,_0x2b4e65),Promise['resolve']();{const _0x472c22=await _0x267b4b['text']();return _0x472c22['includes']('context_length_exceeded')?Promise['reject'](new tr(qn(_0x48414c,'AI_ERROR_CONTEXT_LENGTH'))):_0x472c22['includes']('Moderation')?Promise['reject'](new tr(qn(_0x48414c,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x472c22));}}async['prepareMessages'](_0x444171,_0x5c8a63,_0x2bfce7){let _0xb600e,_0x19770e;return _0x5c8a63?(_0xb600e='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.',_0x19770e='Instruction:\x0a'+_0x444171+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x5c8a63):(_0xb600e='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.',_0x19770e=_0x444171),[{'role':'system','content':_0xb600e},{'role':'user','content':_0x19770e}];}async['_readStreamableResponse'](_0x51979,_0xdeaa7b){const _0x3db108=_0x51979['body']['getReader'](),_0x195561=new TextDecoder();let _0x562abf='',_0x2bfcc1='',_0x37060b='',_0x365055=!0x1;for(;!_0x365055;){const {done:_0x48a27c,value:_0x10445a}=await _0x3db108['read'](),_0x1fec23=_0x562abf+_0x195561['decode'](_0x10445a);let _0x4a7a3a='';_0x365055=_0x48a27c;try{_0x4a7a3a=this['_cleanUpData'](_0x1fec23),_0x562abf='';}catch{_0x562abf=_0x1fec23;continue;}_0x2bfcc1+=_0x4a7a3a,!_0x365055&&this['_isBufferIncomplete'](_0x2bfcc1)||_0x2bfcc1&&(_0x37060b+=_0x2bfcc1,_0x2bfcc1='',_0xdeaa7b(_0x37060b));}return Promise['resolve']();}async['_readStaticResponse'](_0x426a43,_0x5545d4){return _0x5545d4((await _0x426a43['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x58223b){const _0x27fb5a=_0x58223b['split']('<')['length']!==_0x58223b['split']('>')['length'],_0x210fde=_0x58223b['length']<0x1e;return _0x27fb5a&&_0x210fde;}['_cleanUpData'](_0x44a667){return _0x44a667['split'](/\n(?![^{]*\})/g)['map'](_0x5285f1=>_0x5285f1['replace']('data:\x20',''))['filter'](_0x473d14=>_0x473d14&&_0x473d14['length']>0x0&&'[DONE]'!==_0x473d14)['map'](_0x1fb059=>{const {choices:_0x3bda60}=JSON['parse'](_0x1fb059);if(_0x3bda60[0x0]?.['delta']?.['content'])return _0x3bda60[0x0]['delta']['content'];})['filter'](_0x51e270=>_0x51e270)['join']('');}}class Zn extends pe{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x2d236d){super(_0x2d236d),_0x2d236d['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x2d236d['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']=_0x2d236d['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x2d236d['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x2d236d['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x2d236d['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x16b2db,context:_0x1e9dcc,onData:_0x128b03,actionId:_0x3710c6}){const {model:_0x2f64f1,stream:_0x3bfcfc,..._0x140417}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3710c6),_0x43a871={'prompt':await this['preparePrompt'](_0x16b2db,_0x1e9dcc,_0x2f64f1,_0x3710c6),..._0x140417};this['_apiUrl']?await this['_processProxyRequest'](_0x43a871,_0x2f64f1,_0x3bfcfc,_0x128b03,_0x3710c6):await this['_processAWSRequest'](_0x43a871,_0x2f64f1,_0x3bfcfc,_0x128b03);}async['preparePrompt'](_0x22efdf,_0x3e6bdc,_0x16fd36,_0x2b695c){let _0x152994,_0x4d6564;return _0x3e6bdc?(_0x152994='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.',_0x4d6564='Instruction:\x0a'+_0x22efdf+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3e6bdc):(_0x152994='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.',_0x4d6564=_0x22efdf),'meta.llama'==this['getModelFamily'](_0x16fd36)?'<<SYS>>\x0a'+_0x152994+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x4d6564+'\x0a[/INST]':'Human:\x0a'+_0x152994+'\x0a'+_0x4d6564+'\x0a\x0aAssistant:';}['getModelFamily'](_0x243bea){if(/^anthropic\.claude/['test'](_0x243bea))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x243bea))return'ai21.j2';if(/^cohere\.command/['test'](_0x243bea))return'cohere.command';if(/^meta\.llama/['test'](_0x243bea))return'meta.llama';throw new tr(qn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x243bea));}async['_processProxyRequest'](_0x2fad22,_0x19472b,_0x221a7f,_0x4c4bd8,_0x1906af){const _0x59e38d={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x1906af),'body':JSON['stringify']({..._0x2fad22,'model':_0x19472b,'stream':_0x221a7f}),'signal':this['abortController']['signal']},_0xa7f58f=await fetch(this['_apiUrl'],_0x59e38d);_0x221a7f?await this['_readStreamableResponse'](_0xa7f58f,_0x19472b,_0x4c4bd8):await this['_readStaticResponse'](_0xa7f58f,_0x19472b,_0x4c4bd8);}async['_processAWSRequest'](_0x37b6a7,_0x5b68c2,_0x145a54,_0x47fddf){const _0xa4ef7a=new _0x11fa39(this['_bedrockClientConfig']),_0x1a17b2={'body':JSON['stringify'](_0x37b6a7),'contentType':'application/json','accept':'application/json','modelId':_0x5b68c2};let _0x271724;if(_0x145a54){const _0x5efdce=new _0x4808b4(_0x1a17b2);_0x271724=await _0xa4ef7a['send'](_0x5efdce,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x271724,_0x5b68c2,_0x47fddf);}else{const _0x3a0732=new _0x50c2d9(_0x1a17b2);_0x271724=await _0xa4ef7a['send'](_0x3a0732,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x271724,_0x5b68c2,_0x47fddf);}}async['_readAsyncIterableResponse'](_0x2390df,_0x59a94f,_0x335cbd){const _0x1d813e=_0x2390df['body'],_0xeabb81=new TextDecoder('utf-8');let _0x5447d4='';for await(const _0x1a8019 of _0x1d813e)if(_0x1a8019['chunk']){const _0x1394ac=_0xeabb81['decode'](_0x1a8019['chunk']['bytes']),_0x1650b6=JSON['parse'](_0x1394ac);_0x5447d4+=this['_getGeneratedText'](_0x1650b6,_0x59a94f),_0x335cbd(_0x5447d4);}return Promise['resolve']();}async['_readStreamableResponse'](_0x3ae9ad,_0x2f513c,_0x15f152){const _0x172323=_0x3ae9ad['body'],_0xaa38ca=new TextDecoder('utf-8'),_0x4ebd9e=_0x172323['getReader']();let _0x458c09='',_0x2f20c7='',_0x32e448=!0x1;for(;!_0x32e448;){const {done:_0x5d9e44,value:_0x28a2ca}=await _0x4ebd9e['read']();if(_0x32e448=_0x5d9e44,_0x32e448)break;const _0x3418d5=(_0x458c09+_0xaa38ca['decode'](_0x28a2ca))['split']('\x0a')['map'](_0x2c02ca=>{try{return _0x458c09='',JSON['parse'](_0x2c02ca);}catch{return _0x458c09=_0x2c02ca,null;}})['filter'](_0x12a875=>null!==_0x12a875);_0x3418d5['length']&&(_0x2f20c7+=_0x3418d5['map'](_0x2db492=>this['_getGeneratedText'](_0x2db492,_0x2f513c))['join'](''),_0x15f152(_0x2f20c7));}return Promise['resolve']();}async['_readStaticResponse'](_0x1277f4,_0x495e57,_0x2ab424){let _0x446ca5;return _0x446ca5=_0x1277f4 instanceof Response?await _0x1277f4['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x1277f4['body'])),(_0x2ab424(this['_getGeneratedText'](_0x446ca5,_0x495e57)),Promise['resolve']());}['_getGeneratedText'](_0x29ae80,_0x1e26fa){switch(this['getModelFamily'](_0x1e26fa)){case'anthropic.claude':return _0x29ae80['completion'];case'ai21.j2':return _0x29ae80['completions'][0x0]['data']['text'];case'cohere.command':return _0x29ae80['generations'][0x0]['text'];case'meta.llama':return _0x29ae80['generation'];}}}class ia extends _0x23f64b{constructor(_0x418e79,_0x105b7a={}){super(_0x418e79),this['isToggleable']=!0x0,this['set']('side',_0x105b7a['side']||'top');const _0x3dd726=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x25b36d(_0x105b7a['class']||[]),_0x3dd726['to']('side',_0x209606=>'ck-tab-button_'+_0x209606),_0x3dd726['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x1fbe2f{['children'];constructor(_0x72af22,_0x4b6d82={}){super(_0x72af22);const _0x8cbef6=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x25b36d(_0x4b6d82['class']||[]),_0x8cbef6['to']('class'),_0x8cbef6['if']('isVisible','ck-hidden',_0x24582c=>!_0x24582c)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x1fbe2f{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x23edb6,_0x477047={}){super(_0x23edb6),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x477047['side']||'top'),this['set']('isMaximized',!0x1);const _0x4f35e7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x25b36d(_0x477047['class']||[]),_0x4f35e7['to']('side',_0x349a68=>'ck-tabs_'+_0x349a68),_0x4f35e7['to']('class'),_0x4f35e7['to']('isMaximized',_0x2c71c4=>_0x2c71c4?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x4f35e7['to']('side',_0x2e3456=>'ck-tabs__buttons-container_'+_0x2e3456)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x4f35e7['to']('side',_0x1b0d06=>'ck-tabs__panels-container_'+_0x1b0d06)]},'children':this['panelViews']},..._0x25b36d(_0x477047['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x129e0d){const _0x32c2ef=this['_tabs']['get'](_0x129e0d);return _0x32c2ef||null;}['addTab'](_0x3c269c){const _0x5411e7=this['_setupButton']({'id':_0x3c269c['id'],'label':_0x3c269c['buttonLabel'],'icon':_0x3c269c['buttonIcon'],'order':_0x3c269c['order']}),_0x228051=new ea(this['locale']);return _0x228051['render'](),_0x3c269c['content']&&_0x228051['children']['add'](_0x3c269c['content']),this['panelViews']['add'](_0x228051),this['_tabs']['set'](_0x3c269c['id'],{'button':_0x5411e7,'panel':_0x228051,'order':void 0x0!==_0x3c269c['order']?_0x3c269c['order']:null}),this['fire']('addTab:'+_0x3c269c['id'],{'id':_0x3c269c['id'],'button':_0x5411e7,'panel':_0x228051}),null===this['activeTab']?this['activateTab'](_0x3c269c['id']):this['_hidePanel'](_0x3c269c['id']),{'button':_0x5411e7,'panel':_0x228051};}['activateTab'](_0x27dfc4){if(null!==_0x27dfc4&&!this['getTab'](_0x27dfc4))throw new _0x5b2487('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x27dfc4});this['activeTab']!==_0x27dfc4&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x27dfc4,_0x27dfc4&&this['_showPanel'](_0x27dfc4),this['fire']('activateTab:'+_0x27dfc4,_0x27dfc4));}['showTab'](_0xaeb14a){if(!this['getTab'](_0xaeb14a))throw new _0x5b2487('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xaeb14a});this['_showPanel'](_0xaeb14a),this['_showButton'](_0xaeb14a),this['fire']('show:'+_0xaeb14a,_0xaeb14a);}['hideTab'](_0x43fe79){if(!this['getTab'](_0x43fe79))throw new _0x5b2487('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x43fe79});const _0x42d316=this['activeTab'];this['_hidePanel'](_0x43fe79),this['_hideButton'](_0x43fe79);const _0x18b8c3=this['getTabIds']();_0x42d316===_0x43fe79&&_0x18b8c3['length']>0x1&&this['activateTab'](_0x18b8c3['find'](_0x205793=>_0x205793!==_0x43fe79)),this['fire']('hide:'+_0x43fe79,_0x43fe79);}['_getPanel'](_0x9cb1f5){const _0x2e0da2=this['_tabs']['get'](_0x9cb1f5);return _0x2e0da2?_0x2e0da2['panel']:null;}['_showPanel'](_0x3d41b5){null!==this['activeTab']&&this['activeTab']!==_0x3d41b5||this['_getPanel'](_0x3d41b5)['show']();}['_hidePanel'](_0x432325){const _0x393671=this['_getPanel'](_0x432325);_0x393671['isVisible']&&(this['activeTab']===_0x432325&&(this['activeTab']=null),_0x393671['hide']());}['_getButton'](_0xe54d6c){const _0x276abc=this['_tabs']['get'](_0xe54d6c);return _0x276abc?_0x276abc['button']:null;}['_showButton'](_0x47ba6b){this['_getButton'](_0x47ba6b)['show']();}['_hideButton'](_0x5ef9d2){this['_getButton'](_0x5ef9d2)['hide']();}['_setupButton'](_0x2f0377){const _0x57c89b=new ia(this['locale'],{'side':this['side']}),_0x22b15c=this['buttonViews'];if(_0x57c89b['set']({'label':_0x2f0377['label'],'icon':_0x2f0377['icon'],'tooltip':!0x0,'withText':!0x0}),_0x57c89b['bind']('isOn')['to'](this,'activeTab',_0x4163f2=>_0x4163f2===_0x2f0377['id']),_0x57c89b['bind']('side')['to'](this,'side'),_0x2f0377['order']){const _0x272a5f=[...this['_tabs']]['reduce']((_0x569b6d,_0x10b16d)=>{const _0xf40719=_0x10b16d[0x0],{order:_0x5d2ed2}=_0x10b16d[0x1];return!_0x5d2ed2||_0x5d2ed2>_0x2f0377['order']?_0x569b6d:_0x5d2ed2>=_0x569b6d['order']?{'id':_0xf40719,'order':_0x5d2ed2}:_0x569b6d;},{'id':'','order':0x0}),_0x5997cc=_0x22b15c['getIndex'](this['_getButton'](_0x272a5f['id']));_0x22b15c['add'](_0x57c89b,_0x5997cc+0x1);}else _0x22b15c['add'](_0x57c89b);return _0x57c89b['on']('execute',()=>{this['activateTab'](_0x2f0377['id']);}),_0x57c89b;}}const pi=['overlay','sidebar','custom'],di=['left','right'];class ui extends ss{constructor(_0x13cac1,_0x2e09d4={}){super(_0x13cac1,_0x2e09d4),this['set']('type',_0x2e09d4['type']||'sidebar'),this['set']('side',_0x2e09d4['side']||'right'),this['set']('isVisible',_0x2e09d4['visibleByDefault']??!0x0);const _0x2b1d1b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x2b1d1b['if']('type','ck-ai-tabs__overlay',_0x4326db=>'overlay'===_0x4326db),_0x2b1d1b['if']('type','ck-ai-tabs__sidebar',_0x2d3cb5=>'sidebar'===_0x2d3cb5),_0x2b1d1b['if']('isVisible','ck-hidden',_0x44a7db=>!_0x44a7db)]}}),this['buttonViews']['on']('add',(_0x58e18f,_0xed9888)=>{_0xed9888['set']('withText',!0x1);});}}class Tt extends _0x5ac5c7{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5b2632){super(_0x5b2632);const _0x5e615b=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x5e615b)throw new _0x5b2487('ai-tabs-configuration-not-found');if(void 0x0!==_0x5e615b['showResizeButton']&&(this['showResizeButton']=_0x5e615b['showResizeButton']),'sidebar'!==_0x5e615b['type']&&'overlay'!==_0x5e615b['type']||_0x5e615b['side']&&(this['side']=_0x5e615b['side']),'sidebar'===_0x5e615b['type']){if(this['container']=_0x5e615b['element'],this['set']('type','sidebar'),!this['container'])throw new _0x5b2487('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x5e615b['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new ui(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x5e615b['visibleByDefault']||_0x5e615b['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 Ct&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x4739be){if(_0x4739be&&this['type']!==_0x4739be){if(!pi['includes'](_0x4739be))throw new _0x5b2487('ai-tabs-unsupported-ui-type');this['type']=_0x4739be;}}['switchSide'](_0x1c9be5){if(_0x1c9be5&&this['side']!==_0x1c9be5){if(!di['includes'](_0x1c9be5))throw new _0x5b2487('ai-tabs-unsupported-ui-side');this['side']=_0x1c9be5;}}['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 _0x5ac5c7{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x545c73){super(_0x545c73),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 _0x24a8da=this['context']['plugins']['get']('CloudServices');if(!_0x24a8da['token'])throw new _0x5b2487('ai-missing-token',this);this['_token']=_0x24a8da['token'];}['startConversation'](_0x10c626,_0xb6ef1c){const _0x19c650=this['_sendApiRequest']('/conversations','POST',{'id':_0x10c626,'group':_0xb6ef1c});return{'getConversation':async()=>(await _0x19c650['request'])['json'](),'abortController':_0x19c650['abortController']};}['queryAssistant']({message:_0x5c3b16,conversationId:_0x40b80e,parts:_0x4efdfc,capabilities:_0x5a6060,model:_0xc383df,quickActionData:_0x221340}){const _0x17d312={..._0x221340&&{'quickActionData':_0x221340}},_0x500ced={'prompt':_0x5c3b16,'content':_0x4efdfc,'model':_0xc383df,..._0x5a6060&&{'capabilities':_0x5a6060},...Object['keys'](_0x17d312)['length']>0x0&&{'attributes':_0x17d312}},_0x572437=this['_sendApiRequest']('/conversations/'+_0x40b80e+'/messages','POST',_0x500ced);return{'getStream':async()=>{const _0xf4f258=(await _0x572437['request'])['body'];return this['_getStreamReader'](_0xf4f258);},'abortController':_0x572437['abortController']};}['executeCustomAction']({content:_0x4fc0b2,message:_0x18503a,model:_0x47bdef,outputFormat:_0x3383f8}){const _0x2e85dd={'content':[{'type':'text','content':_0x4fc0b2}],'prompt':_0x18503a,'model':_0x47bdef,'outputFormat':_0x3383f8},_0x3f7ba7=this['_sendApiRequest']('/actions/custom/calls','POST',_0x2e85dd);return{'getStream':async()=>{const _0x4a71c3=(await _0x3f7ba7['request'])['body'];return this['_getStreamReader'](_0x4a71c3);},'abortController':_0x3f7ba7['abortController']};}['executeAction']({actionName:_0x29b388,content:_0xc26b74,args:_0x8cf50e}){const _0x33a6e2={'content':[{'type':'text','content':_0xc26b74}],'args':_0x8cf50e},_0x33ae93=this['_sendApiRequest']('/actions/system/'+_0x29b388+'/calls','POST',_0x33a6e2);return{'getStream':async()=>{const _0x7822c2=(await _0x33ae93['request'])['body'];return this['_getStreamReader'](_0x7822c2);},'abortController':_0x33ae93['abortController']};}['uploadFile'](_0x30feea,_0x66643e,_0x1a995f){const _0x94f544=new FormData();_0x94f544['append']('file',_0x66643e,_0x66643e['name']),_0x1a995f&&_0x94f544['append']('attributes',JSON['stringify'](_0x1a995f));const _0x38993e=this['_sendApiRequest']('/conversations/'+_0x30feea+'/files','POST',_0x94f544);return{'getId':async()=>(await _0x38993e['request'])['json'](),'abortController':_0x38993e['abortController']};}['fetchDocument'](_0x1da768,_0x51e1ce){const _0x4f9eb2=this['_sendApiRequest']('/conversations/'+_0x1da768+'/documents/'+_0x51e1ce,'GET');return{'getDocument':async()=>(await _0x4f9eb2['request'])['json'](),'abortController':_0x4f9eb2['abortController']};}['uploadDocument'](_0x47d1b3,_0x4c517c,_0x5ca45c){const _0x2dd30b={'content':_0x4c517c};_0x5ca45c&&(_0x2dd30b['attributes']=_0x5ca45c);const _0x414966=this['_sendApiRequest']('/conversations/'+_0x47d1b3+'/documents','POST',_0x2dd30b);return{'getId':async()=>(await _0x414966['request'])['json'](),'abortController':_0x414966['abortController']};}['fetchConversations'](_0x3012e4,_0x49951b){const _0x57098f=new URLSearchParams();_0x57098f['append']('excludeEmpty','true'),_0x57098f['append']('limit','100'),_0x57098f['append']('group',_0x3012e4),_0x49951b&&_0x57098f['append']('search',_0x49951b);const _0x5684d5=this['_sendApiRequest']('/conversations?'+_0x57098f['toString'](),'GET');return{'getConversations':async()=>{const _0x3ab506=await _0x5684d5['request'];return(await _0x3ab506['json']())['items'];},'abortController':_0x5684d5['abortController']};}['deleteConversation'](_0x2e5117){const _0x368387=this['_sendApiRequest']('/conversations/'+_0x2e5117,'DELETE');return{'execute':async()=>{await _0x368387['request'];},'abortController':_0x368387['abortController']};}['updateConversation'](_0x2df52b,_0x2ac974){const _0x317962=this['_sendApiRequest']('/conversations/'+_0x2df52b,'PATCH',_0x2ac974);return{'getResult':async()=>(await _0x317962['request'],_0x2ac974),'abortController':_0x317962['abortController']};}['fetchConversation'](_0x73b2f9){const _0x363fa6=this['_sendApiRequest']('/conversations/'+_0x73b2f9,'GET');return{'getConversation':async()=>(await _0x363fa6['request'])['json'](),'abortController':_0x363fa6['abortController']};}['fetchConversationMessages'](_0x26e4ee){const _0x47dd47=this['_sendApiRequest']('/conversations/'+_0x26e4ee+'/messages','GET');return{'getMessages':async()=>{const _0x2f6f45=await _0x47dd47['request'];return(await _0x2f6f45['json']())['items'];},'abortController':_0x47dd47['abortController']};}['uploadUrl'](_0x465f9c,_0x1e37fc,_0x23e6cc){const _0x1ce31e=this['_sendApiRequest']('/conversations/'+_0x465f9c+'/web-resources','POST',{'url':_0x1e37fc,'attributes':_0x23e6cc});return{'getId':async()=>(await _0x1ce31e['request'])['json'](),'abortController':_0x1ce31e['abortController']};}['getModels'](){const _0x48c980=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>await(await _0x48c980['request'])['json'](),'abortController':_0x48c980['abortController']};}['deleteFile'](_0x252424,_0x1c225f){const _0x380800=this['_sendApiRequest']('/conversations/'+_0x252424+'/files/'+_0x1c225f,'DELETE');return{'execute':async()=>{await _0x380800['request'];},'abortController':_0x380800['abortController']};}['deleteDocument'](_0x2f9e50,_0x167f31){const _0x486c14=this['_sendApiRequest']('/conversations/'+_0x2f9e50+'/documents/'+_0x167f31,'DELETE');return{'execute':async()=>{await _0x486c14['request'];},'abortController':_0x486c14['abortController']};}['deleteWebResource'](_0x4f42b4,_0x128164){const _0x4e89d0=this['_sendApiRequest']('/conversations/'+_0x4f42b4+'/web-resources/'+_0x128164,'DELETE');return{'execute':async()=>{await _0x4e89d0['request'];},'abortController':_0x4e89d0['abortController']};}['callSystemReview']({reviewName:_0x25a328,content:_0x223898,args:_0x34cf7e}){const _0x36f96b=this['_sendApiRequest']('/reviews/system/'+_0x25a328+'/calls','POST',{'content':[{'type':'text','content':_0x223898}],'args':_0x34cf7e});return{'getStream':async()=>{const _0x1458a3=(await _0x36f96b['request'])['body'];return this['_getStreamReader'](_0x1458a3);},'abortController':_0x36f96b['abortController']};}['callCustomReview']({content:_0x3cdee3,prompt:_0x2ea1a9,model:_0x50f151}){const _0x5115e6=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x3cdee3}],'prompt':_0x2ea1a9,'model':_0x50f151});return{'getStream':async()=>{const _0x32b759=(await _0x5115e6['request'])['body'];return this['_getStreamReader'](_0x32b759);},'abortController':_0x5115e6['abortController']};}['upsertAIChatRating'](_0x1396c8,_0x5404d4,_0x1ac0c8){const _0x448c3a=this['_sendApiRequest']('/conversations/'+_0x1396c8+'/messages/'+_0x5404d4+'/ratings','PUT',{'positiveCount':_0x1ac0c8['positiveCount'],'totalCount':_0x1ac0c8['totalCount'],'modificationId':_0x1ac0c8['modificationId']});return{'execute':async()=>{await _0x448c3a['request'];},'abortController':_0x448c3a['abortController']};}['upsertAIActionRating'](_0x2351ba,_0x6b929d,_0xa02b62){const _0xa90a9e=this['_sendApiRequest']('/actions/system/'+_0x2351ba+'/calls/'+_0x6b929d+'/ratings','PUT',{'positiveCount':_0xa02b62['positiveCount'],'totalCount':_0xa02b62['totalCount']});return{'execute':async()=>{await _0xa90a9e['request'];},'abortController':_0xa90a9e['abortController']};}['upsertCustomAIActionRating'](_0x55f5ae,_0x2b07d1){const _0x2b7ae7=this['_sendApiRequest']('/actions/custom/calls/'+_0x55f5ae+'/ratings','PUT',{'positiveCount':_0x2b07d1['positiveCount'],'totalCount':_0x2b07d1['totalCount']});return{'execute':async()=>{await _0x2b7ae7['request'];},'abortController':_0x2b7ae7['abortController']};}['upsertAIReviewRating'](_0x257419,_0x3ce7c2,_0x14db45,_0x4e248c){const _0xfa1d46=this['_sendApiRequest']('/reviews/system/'+_0x257419+'/calls/'+_0x3ce7c2+'/ratings','PUT',{'positiveCount':_0x14db45['positiveCount'],'totalCount':_0x14db45['totalCount'],'dataId':_0x4e248c});return{'execute':async()=>{await _0xfa1d46['request'];},'abortController':_0xfa1d46['abortController']};}['upsertCustomAIReviewRating'](_0x755256,_0x53043a,_0x1b939f){const _0x280adb=this['_sendApiRequest']('/reviews/custom/calls/'+_0x755256+'/ratings','PUT',{'positiveCount':_0x53043a['positiveCount'],'totalCount':_0x53043a['totalCount'],'dataId':_0x1b939f});return{'execute':async()=>{await _0x280adb['request'];},'abortController':_0x280adb['abortController']};}['_sendApiRequest'](_0x4ef8e3,_0x355f3c,_0x25fd30){const _0x47b2f9=new AbortController(),_0x26bab1=_0x25fd30 instanceof FormData,_0x44b362={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x25fd30&&!_0x26bab1&&(_0x44b362['Content-Type']='application/json');const _0x133d2e={'method':_0x355f3c,'headers':_0x44b362,'signal':_0x47b2f9['signal']};return _0x25fd30&&(_0x133d2e['body']=_0x26bab1?_0x25fd30:JSON['stringify'](_0x25fd30)),{'request':fetch(''+this['_apiUrl']+_0x4ef8e3,_0x133d2e)['catch'](_0xbfade7=>{this['_handleError'](_0xbfade7);})['then'](_0x2296be=>{if(!_0x2296be['ok'])throw new _0x5b2487('ai-request-failed',this,{'url':this['_apiUrl'],'path':_0x4ef8e3,'method':_0x355f3c,'body':_0x25fd30,'status':(_0x2296be||{})['status'],'statusText':(_0x2296be||{})['statusText']});return _0x2296be;}),'abortController':_0x47b2f9};}async*['_getStreamReader'](_0x3c5adb){const _0x5da3dc=[],_0x4701db=_0x3c5adb['getReader'](),_0x2aef85=$t({'onError':_0x147b15=>{this['_handleError'](_0x147b15);},'onEvent':_0x75105=>{_0x75105['data']=JSON['parse'](_0x75105['data']),_0x5da3dc['push'](_0x75105);}});try{let _0x282d46=!0x1;for(;!_0x282d46;){const {done:_0x44326b,value:_0x1904f5}=await _0x4701db['read']();_0x44326b&&(_0x282d46=!0x0),_0x2aef85['feed'](this['_decoder']['decode'](_0x1904f5,{'stream':!0x0})),yield*_0x5da3dc,_0x5da3dc['length']=0x0;}}catch(_0x1fa578){this['_handleError'](_0x1fa578);}finally{_0x4701db['releaseLock'](),_0x2aef85['reset']();}}['_handleError'](_0x223443){if(_0x223443 instanceof _0x5b2487)throw _0x223443;if(_0x223443 instanceof Error&&'AbortError'===_0x223443['name'])throw new _0x5b2487('ai-request-aborted',this,{'originalError':_0x223443});throw new _0x5b2487('ai-request-failed',this,{'originalError':_0x223443});}}function i(_0xc6c07b,_0x4c182b,_0x1ebe8a){const t=_0xc6c07b['t'];switch(_0x4c182b){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'},_0x1ebe8a);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_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.'},_0x1ebe8a);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.'},_0x1ebe8a);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.'},_0x1ebe8a);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_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'},_0x1ebe8a);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'},_0x1ebe8a);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x1ebe8a);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'},_0x1ebe8a);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x1ebe8a);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'},_0x1ebe8a);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x1ebe8a);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.'},_0x1ebe8a);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.'},_0x1ebe8a);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.'},_0x1ebe8a);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.'},_0x1ebe8a);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'},_0x1ebe8a);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_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.'},_0x1ebe8a);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_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 _0x4c182b;}}function Li(_0x4bbd30,_0x521718){const _0x5e81aa=new _0x23f64b(_0x4bbd30),_0x30da43=i(_0x4bbd30,'AI_TABS_LABEL_MINIMIZE'),_0x466cab=i(_0x4bbd30,'AI_TABS_LABEL_MAXIMIZE');return _0x5e81aa['set']({'withText':!0x1,'icon':_0x187bdc,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x5e81aa['bind']('label')['to'](_0x521718,'isMaximized',_0xa71b04=>_0xa71b04?_0x30da43:_0x466cab),_0x5e81aa['bind']('icon')['to'](_0x521718,'isMaximized',_0x4ddcbf=>_0x4ddcbf?to:_0x187bdc),_0x5e81aa['bind']('isOn')['to'](_0x521718,'isMaximized'),_0x5e81aa['on']('execute',()=>{_0x521718['fire']('resizeTabs');}),_0x5e81aa;}function sr(_0xa30e37){return _0x409f9f(_0xa30e37);}function xt(_0x3fa671){return _0x6c271b(_0x3fa671);}function Nt(_0x4adb4f,_0x4c8de3,_0xf0e59b){const _0x12c22f=null!==_0x4c8de3?_0xbfbc8=>_0xbfbc8['attribs'][_0x4adb4f]===_0x4c8de3:_0xeb1bee=>Boolean(_0xeb1bee['attribs'][_0x4adb4f]);return Ot(_0x2143ec=>_0x184c31(_0x2143ec)&&_0x12c22f(_0x2143ec),_0xf0e59b);}function Ne(_0x2130ff,_0x14e379,_0x3f8d6a){const _0x2db699=null!==_0x14e379?_0x34c748=>_0x34c748['attribs'][_0x2130ff]===_0x14e379:_0x3a4ff6=>Boolean(_0x3a4ff6['attribs'][_0x2130ff]);return _0x57b4b6(_0x14a148=>_0x184c31(_0x14a148)&&_0x2db699(_0x14a148),_0x3f8d6a);}function bt(_0x11fc5d,_0x3ecfe5){return _0x11fc5d&&_0x184c31(_0x11fc5d)?_0x11fc5d['attribs'][_0x3ecfe5]:null;}function ze(_0x2bcae5,_0x82ef75,_0x2b6b79){_0x184c31(_0x2bcae5)&&(null===_0x2b6b79?delete _0x2bcae5['attribs'][_0x82ef75]:_0x2bcae5['attribs'][_0x82ef75]=_0x2b6b79);}function We(_0x58bcab,_0x18f0b7,_0x313daa){const _0x39eed1=_0x18f0b7['cloneNode'](!0x0);'beforebegin'===_0x313daa?_0x15b0b3(_0x58bcab,_0x39eed1):'afterbegin'===_0x313daa?_0x5799cf(_0x58bcab,_0x39eed1):'beforeend'===_0x313daa?_0x1b6d1c(_0x58bcab,_0x39eed1):'afterend'===_0x313daa&&_0x326e1b(_0x58bcab,_0x39eed1);}function Qe(_0x2cda6a){const _0x269d2b=[];let _0x1dfd4c=_0x2cda6a;for(;_0x1dfd4c;)_0x1dfd4c=_0x129d47(_0x1dfd4c),_0x1dfd4c&&_0x269d2b['push'](_0x1dfd4c);return _0x269d2b;}function Ur(_0x20af88){return _0x20af88['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Xe(_0x222838){let _0x4086ea=0x0;for(;_0x222838['parentNode'];)_0x222838=_0x222838['parentNode'],_0x4086ea++;return _0x4086ea;}function Ze(_0x539e33){const _0x1c236e=[];let _0x20b905=_0x539e33['nextSibling'];for(;_0x20b905;)_0x1c236e['push'](_0x20b905),_0x20b905=_0x20b905['nextSibling'];_0x1c236e['forEach'](_0x322cf6=>{_0x2efcb7(_0x322cf6);});}class $i extends/* #__PURE__ -- @preserve */
25
- ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x5a34ab();}['convertMarkdownToHTML'](_0x3294c3){const _0x3c4488=this['_m2html']['parse'](_0x3294c3);return this['parseAndNormalizeHTML'](_0x3c4488);}['parseAndNormalizeHTML'](_0x44efa6){return this['_parseHTML'](_0x44efa6);}['_parseHTML'](_0x4ffa76){const _0x40d7d2=sr('<dummy>'+_0x4ffa76['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x40d7d2['children']=_0x40d7d2['children'][0x0]['children'],_0x40d7d2;}}class tn extends/* #__PURE__ -- @preserve */
26
- ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x110567){super(),this['_generateUid']=_0x110567||_0x5fe9bf;}['merge'](_0x4536ad,_0x48eb4e,_0x3384e5){const _0x27edd2=_0x4536ad['cloneNode'](!0x0);if(0x0===_0x48eb4e['childNodes']['length']){const _0x862af5=[];return Ne('data-id','new-element',_0x27edd2)['forEach'](_0x31697b=>{const _0xba7f86=this['_generateUid']();ze(_0x31697b,'data-id',_0xba7f86),_0x862af5['push'](_0xba7f86);}),this['_removeSpecialComments'](_0x27edd2),{'parsedContent':_0x27edd2,'newNodeIds':_0x862af5,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x3384e5&&_0x3384e5['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x27edd2),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ne('data-id',null,_0x48eb4e)['map'](_0x20caba=>bt(_0x20caba,'data-id'))['filter'](_0x4769a1=>!!_0x4769a1));let _0x4f8c1b=-0x1,_0x49940b=!0x1;const _0x3901d6=_0x27edd2['childNodes'],_0x3e7f38=Array['from'](_0x3901d6)['filter'](_0x598257=>!(0x3===_0x598257['nodeType']&&''===xt(_0x598257)['trim']())),_0xf037ca=_0x3e7f38['length'];for(let _0x229fad=0x0;_0x229fad<_0xf037ca;_0x229fad++){const _0x151585=_0x3e7f38[_0x229fad],_0x2cbb53=_0x3e7f38[_0x229fad+0x1];if(this['_isNewNode'](_0x151585)){if(-0x1===_0x4f8c1b&&(_0x4f8c1b=_0x229fad),this['_markWrappedElements'](_0x151585),!this['_isNewNode'](_0x2cbb53)){const [_0xbb1e6e,_0x10cc3e]=this['_findReferenceNode'](_0x151585,_0x49940b,_0x48eb4e);if(_0xbb1e6e){const _0x39951d=Array['from'](_0x3e7f38)['slice'](_0x4f8c1b,_0x229fad+0x1);this['_insertNodes'](_0xbb1e6e,_0x39951d,_0x10cc3e),_0x4f8c1b=-0x1;}}}else{if(this['_isExistingContentComment'](_0x151585))_0x49940b=!0x0;else{if(this['_isExistingNode'](_0x151585)){const _0x438326=bt(_0x151585,'data-id');if(_0x438326&&this['_existingDataIds']['has'](_0x438326)){const _0xd32885=Nt('data-id',_0x438326,_0x48eb4e);this['_replaceNode'](_0xd32885,_0x151585);}if(this['_touchedNodesState']['removedIds']['includes'](_0x438326)){const _0x11307e=this['_touchedNodesState']['removedIds']['indexOf'](_0x438326);this['_touchedNodesState']['removedIds']['splice'](_0x11307e,0x1);}}else{if(this['_isDelNode'](_0x151585)){const _0x51e349=bt(_0x151585,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x51e349)||this['_storeDeletedElementIds'](_0x151585);}}}}}for(const _0x47f2b4 of this['_touchedNodesState']['removedIds']){const _0x508b2f=Nt('data-id',_0x47f2b4,_0x48eb4e);if(_0x508b2f){if(_0x3384e5&&_0x3384e5['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x47f2b4;const _0x50a8d2=_0x3384e5['replaceRemovedWith']['cloneNode'](!0x0);ze(_0x50a8d2,'data-id',_0x47f2b4),ze(_0x50a8d2,'data-removed','true'),_0x30ee20(_0x508b2f,_0x50a8d2);}else _0x2efcb7(_0x508b2f);}}if(Ne('data-wrapped-id',null,_0x48eb4e)['forEach'](_0x229448=>{const _0x1324e5=Nt('data-id',bt(_0x229448,'data-wrapped-id'),_0x48eb4e);var _0x2b2e01,_0x412024;_0x1324e5&&(_0x412024=_0x229448,_0x2efcb7(_0x2b2e01=_0x1324e5),_0x30ee20(_0x412024,_0x2b2e01));}),Ne('data-id','new-element',_0x48eb4e)['forEach'](_0x32187f=>{const _0x31da8a=this['_getUid'](_0x32187f);ze(_0x32187f,'data-id',_0x31da8a),this['_touchedNodesState']['newIds']['push'](_0x31da8a);}),this['_removeSpecialComments'](_0x48eb4e),_0x3384e5&&_0x3384e5['markUnstableElements']&&this['_markUnstableElements'](_0x48eb4e,_0x3384e5['markUnstableElementsDepth']||0x0),_0x3384e5&&_0x3384e5['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x4f2b9d=Nt('data-id',this['_touchedNodesState']['lastTouchedId'],_0x48eb4e);for(;_0x4f2b9d;)Ze(_0x4f2b9d),_0x4f2b9d=_0x4f2b9d['parentNode'];}return{'parsedContent':_0x48eb4e,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x52a485,_0x4f8f85,_0x238fb4){for(const _0x468307 of _0x4f8f85){const _0x113541=this['_getUid'](_0x468307);ze(_0x468307,'data-id',_0x113541),this['_touchedNodesState']['newIds']['push'](_0x113541),this['_touchedNodesState']['lastTouchedId']=_0x113541;}const _0x3f9405='afterbegin'===_0x238fb4||'afterend'===_0x238fb4?_0x4f8f85['reverse']():_0x4f8f85;for(const _0x33f4b3 of _0x3f9405)We(_0x52a485,_0x33f4b3,_0x238fb4);}['_replaceNode'](_0x5a0bfd,_0x475a29){if(!_0x5a0bfd)return;if(_0x4c7a67=_0x475a29,Ur(xt(_0x5a0bfd))===Ur(xt(_0x4c7a67)))return;var _0x4c7a67;const _0x4374bb=this['_getUid'](_0x5a0bfd);ze(_0x475a29,'data-id',_0x4374bb),this['_touchedNodesState']['modifiedIds']['push'](_0x4374bb),this['_touchedNodesState']['lastTouchedId']=_0x4374bb,_0x30ee20(_0x5a0bfd,_0x475a29['cloneNode'](!0x0));}['_findReferenceNode'](_0x2d7c54,_0x5bc05e,_0x1446ec){const _0x198303=this['_findPrevElementWithDataId'](_0x2d7c54,!0x1);if(_0x198303){const _0x187883=this['_getNodeDataId'](_0x198303),_0x36e347=Nt('data-id',_0x187883,_0x1446ec);if(_0x36e347)return[_0x36e347,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x187883);}const _0x3bfdd6=this['_findNextElementWithDataId'](_0x2d7c54,!0x1);if(_0x3bfdd6){const _0x252d65=this['_getNodeDataId'](_0x3bfdd6),_0x26ffbb=Nt('data-id',_0x252d65,_0x1446ec);if(_0x26ffbb)return[_0x26ffbb,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x252d65);}return _0x5bc05e?_0x2d7c54['nextSibling']?this['_findFallbackReferenceNode'](_0x2d7c54,_0x1446ec):[_0x1446ec['childNodes'][_0x1446ec['childNodes']['length']-0x1],'afterend']:[_0x1446ec['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x3cb7b3,_0x2af1bb){const _0x458c6e=[],_0x4b6bec=this['_findPrevElementWithDataId'](_0x3cb7b3,!0x0);if(_0x4b6bec){const _0x56ff7c=Nt('data-id',this['_getNodeDataId'](_0x4b6bec),_0x2af1bb);_0x56ff7c&&_0x458c6e['push']([_0x56ff7c,'afterend']);}const _0x227b1b=this['_findNextElementWithDataId'](_0x3cb7b3,!0x0);if(_0x227b1b){const _0xa92d43=Nt('data-id',this['_getNodeDataId'](_0x227b1b),_0x2af1bb);_0xa92d43&&_0x458c6e['push']([_0xa92d43,'beforebegin']);}if(_0x458c6e['length']>0x1)return Xe(_0x458c6e[0x0][0x0])<=Xe(_0x458c6e[0x1][0x0])?_0x458c6e[0x0]:_0x458c6e[0x1];return 0x1===_0x458c6e['length']?_0x458c6e[0x0]:[_0x2af1bb['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x25a6af,_0x3dbdf5){let _0x2929d4=_0x25a6af['nextSibling'],_0x2b09a9=null,_0x12036b=!0x1;for(;_0x2929d4;){if(_0x31699d(_0x2929d4)){if(this['_isDelNode'](_0x2929d4)&&(_0x2b09a9=_0x2929d4),this['_isExistingContentComment'](_0x2929d4)&&_0x3dbdf5&&!_0x12036b){_0x12036b=!0x0,_0x2929d4=_0x2929d4['nextSibling'];continue;}break;}const _0x1a33a7=bt(_0x2929d4,'data-id');if(_0x1a33a7&&'new-element'!==_0x1a33a7&&this['_existingDataIds']['has'](_0x1a33a7)){_0x2b09a9=_0x2929d4;break;}_0x2929d4=_0x2929d4['nextSibling'];}return _0x2b09a9;}['_findPrevElementWithDataId'](_0x66c47d,_0x1adb9f){let _0x24cae5=_0x66c47d['previousSibling'],_0x53e07d=null,_0x327b84=!0x1;for(;_0x24cae5;){if(_0x31699d(_0x24cae5)){if(this['_isDelNode'](_0x24cae5)&&(_0x53e07d=_0x24cae5),this['_isExistingContentComment'](_0x24cae5)&&_0x1adb9f&&!_0x327b84){_0x327b84=!0x0,_0x24cae5=_0x24cae5['previousSibling'];continue;}break;}const _0x2eb4c2=bt(_0x24cae5,'data-id');if(_0x2eb4c2&&'new-element'!==_0x2eb4c2&&this['_existingDataIds']['has'](_0x2eb4c2)){_0x53e07d=_0x24cae5;break;}_0x24cae5=_0x24cae5['previousSibling'];}return _0x53e07d;}['_markWrappedElements'](_0x30d9f9){_0x184c31(_0x30d9f9)&&Ne('data-id',null,_0x30d9f9)['forEach'](_0x4141fa=>{this['_isExistingNode'](_0x4141fa)&&!this['_hasWrappedParent'](_0x4141fa)&&(ze(_0x4141fa,'data-wrapped-id',bt(_0x4141fa,'data-id')),ze(_0x4141fa,'data-id',null));});}['_getNodeDataId'](_0x274df4){if(!_0x274df4)return null;if(_0x184c31(_0x274df4))return bt(_0x274df4,'data-id');if(_0x31699d(_0x274df4)){const _0x2cea2b=xt(_0x274df4)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x2cea2b&&_0x2cea2b[0x1])return _0x2cea2b[0x1];}return null;}['_storeDeletedElementIds'](_0x54f123){if(_0x31699d(_0x54f123)){const _0x4ff3cf=xt(_0x54f123)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x4ff3cf&&_0x4ff3cf[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x4ff3cf[0x1]);}}['_getUid'](_0x1ef906){return this['_isExistingNode'](_0x1ef906)?bt(_0x1ef906,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x1d7767){(function(_0x107eeb){return _0x40e565(_0xf8bf25=>_0x31699d(_0xf8bf25),_0x107eeb,!0x0,0x1/0x0);}(_0x1d7767)['filter'](_0x1cd353=>this['_isDelNode'](_0x1cd353)||this['_isExistingContentComment'](_0x1cd353))['forEach'](_0x21227b=>{_0x2efcb7(_0x21227b);}));}['_markLastTagElementUnstable'](_0x5f2954){const _0xeca178=_0x5f2954['childNodes'],_0xaa0be3=_0xeca178[_0xeca178['length']-0x1];_0xaa0be3&&_0x184c31(_0xaa0be3)&&ze(_0xaa0be3,'data-unstable','true');}['_markUnstableElements'](_0x19f9ed,_0x4922eb){const _0x5d68fa=Nt('data-unstable','true',_0x19f9ed);if(!_0x5d68fa)return;const _0x3e749b=Qe(_0x5d68fa)['slice'](0x0,-0x1),_0x2ce59d=_0x3e749b['length'];let _0x288082=_0x5d68fa;if(_0x2ce59d>_0x4922eb){let _0x15727e=_0x2ce59d,_0x5e8486=null;for(;_0x15727e>_0x4922eb&&_0x15727e>=0x0;)_0x15727e--,_0x5e8486=_0x3e749b[_0x15727e];_0x5e8486&&(_0x288082=_0x5e8486,ze(_0x5d68fa,'data-unstable',null),ze(_0x5e8486,'data-unstable','true'));}else{if(_0x2ce59d<_0x4922eb){let _0x210ce5=_0x2ce59d,_0x567aac=_0x5d68fa;for(;_0x210ce5<_0x4922eb;){const _0xd57dcb=_0x567aac['childNodes']['filter'](_0x156add=>_0x184c31(_0x156add));if(0x0===_0xd57dcb['length'])break;_0x210ce5++,_0x567aac=_0xd57dcb[_0xd57dcb['length']-0x1];}_0x567aac&&(_0x288082=_0x567aac,ze(_0x5d68fa,'data-unstable',null),ze(_0x567aac,'data-unstable','true'));}}let _0x1a5629=_0x288082;for(;_0x1a5629;){for(;_0x1a5629['nextSibling'];)_0x1a5629=_0x1a5629['nextSibling'],_0x184c31(_0x1a5629)&&ze(_0x1a5629,'data-unstable','true');_0x1a5629=_0x1a5629['parentNode'];}}['_isNewNode'](_0x5bc93c){return Boolean('new-element'===bt(_0x5bc93c,'data-id'));}['_isExistingNode'](_0x3f7c53){return Boolean((bt(_0x3f7c53,'data-id')||'')['length']>0x0&&'new-element'!==bt(_0x3f7c53,'data-id'));}['_isDelNode'](_0x5a9940){return!!_0x5a9940&&Boolean(_0x31699d(_0x5a9940)&&xt(_0x5a9940)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x334774){let _0x3de1a7=_0x334774['parentNode'];for(;_0x3de1a7;){if(bt(_0x3de1a7,'data-wrapped-id'))return!0x0;_0x3de1a7=_0x3de1a7['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x48ab6c){return Boolean(_0x31699d(_0x48ab6c)&&xt(_0x48ab6c)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function et({editor:_0x4a0892,changeGroups:_0xca8cf,documentContextContent:_0x411c7f,showDiff:_0x4ecb68,trimUnchanged:_0x2b609a=!0x0}){return _0xca8cf['map'](_0x1b7646=>{const _0x23b79a=new Mt([]),_0x138724=new Mt([]);for(const _0x4c192f of _0x1b7646['changes'])if(_0x4ecb68&&'removed'==_0x4c192f['type']||_0x138724['children']['push'](_0x4c192f['node']['cloneNode'](!0x0)),'new'!=_0x4c192f['type']&&(_0x4ecb68||'removed'!=_0x4c192f['type'])){const _0x8c9c56=Ot(_0xca295e=>bt(_0xca295e,'data-id')==_0x4c192f['id'],_0x411c7f,!0x0);_0x8c9c56&&_0x23b79a['children']['push'](_0x8c9c56['cloneNode'](!0x0));}const {content:_0x100718,hasChanges:_0x218028}=function(_0x127099,_0x55535a,_0x4ed0d4,_0x3b560b,_0x57d34a=!0x0){const _0x3ce063=_0x127099['plugins']['get']('DocumentCompare'),_0x197dae=xt(_0x55535a),_0x48972c=xt(_0x4ed0d4),_0x5b5911=_0x127099['data']['parse'](_0x197dae,'$root'),_0x86f243=_0x127099['model']['createPositionAt'](_0x5b5911,0x0),_0xadc2fd=_0x3ce063['getDiff'](_0x197dae,_0x48972c,{'anchor':_0x86f243,'markDeletions':_0x3b560b}),_0x4661ca=_0xadc2fd['getOperations']();if(0x0==_0x4661ca['length'])return{'content':_0x55535a['cloneNode'](!0x0),'hasChanges':!0x1};_0x3b560b?function(_0x34fc63,_0x108006,_0x5cad84){if(0x0==_0x34fc63['length'])return;const _0x1837c0=_0x5cad84['plugins']['get']('DocumentCompare'),_0x11c8e2=_0x5cad84['plugins']['get']('SuggestionsConversion');_0x5cad84['model']['change'](_0x121382=>{const _0x15912c=new Set();for(let _0x522fe1=0x0;_0x522fe1<_0x34fc63['length'];_0x522fe1++){const _0x7586c3=_0x34fc63[_0x522fe1];if(_0x7586c3['baseVersion']=null,_0x7586c3['isDocumentOperation']=!0x1,_0x1837c0['isMarkedRemoveOperation'](_0x7586c3)){const _0x174df7=_0x4d872a(_0x7586c3['newRange'],_0x5cad84['model']),_0x8480f0='suggestion:deletion:'+_0x5fe9bf()+':$aiSuggestion';_0x108006['markers']['set'](_0x8480f0,_0x174df7);}else switch(_0x7586c3['type']){case'rename':{if(_0x7586c3['oldName']==_0x7586c3['newName'])break;_0x121382['batch']['addOperation'](_0x7586c3),_0x5cad84['model']['applyOperation'](_0x7586c3);const _0x18763f='$elementName',_0x67644a=_0x7586c3['position'],_0x356903=_0x5cad84['model']['createRange'](_0x67644a,_0x5cad84['model']['createPositionAt'](_0x67644a['nodeAfter'],'end')),_0x265d62='suggestion:attribute:'+_0x18763f+':'+_0x5fe9bf()+':$aiSuggestion';_0x108006['markers']['set'](_0x265d62,_0x356903);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x7586c3['oldValue']==_0x7586c3['newValue'])break;_0x121382['batch']['addOperation'](_0x7586c3),_0x5cad84['model']['applyOperation'](_0x7586c3);const _0x32948a=_0x7586c3['key'];if(!_0x11c8e2['isRegisteredAttribute'](_0x32948a))break;const _0x418e82=_0x4d872a(_0x7586c3['range'],_0x5cad84['model']),_0x546720='suggestion:attribute:'+_0x32948a+':'+_0x5fe9bf()+':$aiSuggestion';_0x108006['markers']['set'](_0x546720,_0x418e82);break;}case'insert':{_0x121382['batch']['addOperation'](_0x7586c3),_0x5cad84['model']['applyOperation'](_0x7586c3);if(_0x34fc63[_0x522fe1+0x1]&&'move'==_0x34fc63[_0x522fe1+0x1]['type']){ro(_0x108006,_0x7586c3);break;}const _0x203b98=_0x7586c3['position'],_0x2af0e2=_0x7586c3['howMany'],_0x36e059=_0x4d872a(_0x5cad84['model']['createRange'](_0x203b98,_0x203b98['getShiftedBy'](_0x2af0e2)),_0x5cad84['model']),_0x5c876b='suggestion:insertion:'+_0x5fe9bf()+':$aiSuggestion';_0x108006['markers']['set'](_0x5c876b,_0x36e059);break;}case'split':{_0x121382['batch']['addOperation'](_0x7586c3),_0x5cad84['model']['applyOperation'](_0x7586c3);const _0x1cef2f=_0x7586c3['splitPosition'],_0x29fa0f=_0x7586c3['moveTargetPosition'],_0x2cb463=_0x5cad84['model']['createRange'](_0x1cef2f,_0x29fa0f),_0x40f51f='suggestion:insertion:'+_0x5fe9bf()+':$aiSuggestion';_0x108006['markers']['set'](_0x40f51f,_0x2cb463);break;}case'move':{_0x121382['batch']['addOperation'](_0x7586c3),_0x5cad84['model']['applyOperation'](_0x7586c3),_0x34fc63[_0x522fe1-0x1]&&'insert'==_0x34fc63[_0x522fe1-0x1]['type']&&ro(_0x108006,_0x7586c3);const _0x450b36=_0x7586c3['getMovedRangeStart'](),_0x5b5f2e=_0x7586c3['howMany'];for(let _0x5a8793=0x0;_0x5a8793<_0x5b5f2e;_0x5a8793++){const _0x547db9=_0x450b36['getShiftedBy'](_0x5a8793)['nodeAfter'];_0x15912c['add'](_0x547db9);}break;}case'remove':{const _0x3b989b=_0x7586c3['sourcePosition'],_0x5dba76=_0x7586c3['howMany'],_0x505bcc=new lt(_0x3b989b,_0x5dba76);_0x121382['batch']['addOperation'](_0x505bcc),_0x5cad84['model']['applyOperation'](_0x505bcc);break;}}}for(const _0x415f73 of _0x15912c){const _0x4ca75f=_0x5cad84['model']['createRangeOn'](_0x415f73),_0x44929e='suggestion:formatBlock:$fakeWrap:'+_0x5fe9bf()+':$aiSuggestion';_0x108006['markers']['set'](_0x44929e,_0x4d872a(_0x4ca75f,_0x5cad84['model']));}});}(_0x4661ca,_0x5b5911,_0x127099):_0x127099['model']['change'](_0x591d21=>{for(const _0x1fb428 of _0x4661ca)if('remove'==_0x1fb428['type']){const _0x436c5f=_0x1fb428['sourcePosition'],_0x29fb40=_0x1fb428['howMany'],_0xb3ac84=new lt(_0x436c5f,_0x29fb40);_0x591d21['batch']['addOperation'](_0xb3ac84),_0x127099['model']['applyOperation'](_0xb3ac84);}else{if('marker'==_0x1fb428['type']){const _0x21d775=_0x1fb428['name'],_0x306c66=_0x1fb428['newRange'];_0x5b5911['markers']['set'](_0x21d775,_0x306c66);}else _0x1fb428['baseVersion']=null,_0x1fb428['isDocumentOperation']=!0x1,_0x591d21['batch']['addOperation'](_0x1fb428),_0x127099['model']['applyOperation'](_0x1fb428);}});if(_0x57d34a){const _0x536900=Dt(_0x127099,_0x4661ca,_0x5b5911);Rt(_0x127099['model'],_0x536900),function(_0x2f9b10,_0x1e1184){const _0x555eac=_0x1e1184['getFirstRange']()['start'];let _0x47e93a=_0x1e1184['getFirstRange']()['end'];const _0x39e67a=_0x555eac['root'];(_0x47e93a['textNode']||_0x47e93a['nodeAfter']&&_0x47e93a['nodeAfter']['is']('$text'))&&(_0xc8d065(_0x47e93a,'...'),_0x47e93a=_0x47e93a['getShiftedBy'](0x3)),(_0x555eac['textNode']||_0x555eac['nodeBefore']&&_0x555eac['nodeBefore']['is']('$text'))&&(_0xc8d065(_0x555eac,'...'),function(_0x4d3885,_0x4d34cc,_0x554a90){for(let [_0x33d3ee,_0x11f961]of _0x4d3885['markers']){const _0x2f2575=_0x11f961['_getTransformedByInsertion'](_0x4d34cc,_0x554a90,!0x1);_0x11f961=_0x2f2575[0x0],_0x4d3885['markers']['set'](_0x33d3ee,_0x11f961);}}(_0x39e67a,_0x555eac,0x3),_0x555eac['parent']==_0x47e93a['parent']&&(_0x47e93a=_0x47e93a['getShiftedBy'](0x3)));const _0x34a9c9=_0x2f9b10['createRange'](_0x2f9b10['createPositionAt'](_0x39e67a,0x0),_0x555eac),_0x17e82b=_0x2f9b10['createRange'](_0x47e93a,_0x2f9b10['createPositionAt'](_0x39e67a,'end')),_0x24f715=[..._0x34a9c9['getMinimalFlatRanges'](),..._0x17e82b['getMinimalFlatRanges']()];_0x24f715['reverse']();for(const _0x463692 of _0x24f715)_0x180cb5(_0x463692),Wr(_0x39e67a,_0x463692);}(_0x127099['model'],_0x536900);}const _0x492c8f=_0x127099['data']['stringify'](_0x5b5911,{'showSuggestionHighlights':!0x0});return{'content':sr(_0x492c8f),'hasChanges':!0x0};}(_0x4a0892,_0x23b79a,_0x138724,_0x4ecb68,_0x2b609a);return{'type':_0x1b7646['changes'][0x0]['type'],'index':_0x1b7646['index'],'content':_0x100718,'hasChanges':_0x218028};});}function ro(_0x54f1db,_0x6e5912){for(const [_0x123eda,_0x41ef8d]of _0x54f1db['markers']){const _0x5d0a33=ht['_createFromRanges'](_0x41ef8d['getTransformedByOperation'](_0x6e5912));_0x54f1db['markers']['set'](_0x123eda,_0x5d0a33);}}function Dt(_0x35a972,_0x19e2a6,_0x43ae72){const _0x535d1a=_0x35a972['plugins']['get']('DocumentCompare');let _0x120b63=_0x35a972['model']['createPositionAt'](_0x43ae72,Number['POSITIVE_INFINITY']),_0x183b54=_0x35a972['model']['createPositionAt'](_0x43ae72,0x0);for(const _0x9d3c2c of _0x19e2a6){let _0x24e790,_0x5275cd;if(_0x535d1a['isMarkedRemoveOperation'](_0x9d3c2c))_0x24e790=_0x9d3c2c['newRange']['start'],_0x5275cd=_0x9d3c2c['newRange']['end'];else switch(_0x120b63=_0x120b63['getTransformedByOperation'](_0x9d3c2c),_0x183b54=_0x183b54['getTransformedByOperation'](_0x9d3c2c),_0x9d3c2c['type']){case'rename':_0x24e790=_0x9d3c2c['position'],_0x5275cd=_0x24e790['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x24e790=_0x9d3c2c['range']['start'],_0x5275cd=_0x9d3c2c['range']['end'];break;case'insert':_0x24e790=_0x9d3c2c['position'],_0x5275cd=_0x24e790['getShiftedBy'](_0x9d3c2c['howMany']);break;case'split':_0x24e790=_0x9d3c2c['splitPosition'],_0x5275cd=_0x9d3c2c['moveTargetPosition'];break;case'merge':{const _0x5f554c=_0x9d3c2c['targetPosition']['path']['slice'](0x0,-0x1);_0x24e790=_0x35a972['model']['createPositionFromPath'](_0x43ae72,_0x5f554c),_0x5275cd=_0x24e790['getShiftedBy'](0x1);break;}case'remove':{const _0x29ffe5=_0x9d3c2c['howMany'],_0x1e69e6=_0x9d3c2c['sourcePosition']['_getTransformedByInsertion'](_0x9d3c2c['targetPosition'],_0x29ffe5),_0x42d2fd=_0x9d3c2c['getMovedRangeStart']();'remove'==_0x9d3c2c['type']?(_0x24e790=_0x1e69e6,_0x5275cd=_0x1e69e6):(_0x24e790=_0x42d2fd,_0x5275cd=_0x42d2fd['getShiftedBy'](_0x29ffe5));break;}}_0x24e790&&_0x24e790['isBefore'](_0x120b63)&&(_0x120b63=_0x24e790['clone'](),_0x120b63['stickiness']='toNone'),_0x5275cd&&_0x5275cd['isAfter'](_0x183b54)&&(_0x183b54=_0x5275cd['clone'](),_0x183b54['stickiness']='toNone');}return _0x35a972['model']['createSelection'](_0x35a972['model']['createRange'](_0x120b63,_0x183b54));}function Rt(_0x4ac18b,_0x71fa55){so(_0x4ac18b,_0x71fa55,'forward');const _0x3b2722=_0x71fa55['getFirstRange']();_0x71fa55['setTo']([]),_0x71fa55['setTo'](_0x3b2722,{'backward':!0x0}),so(_0x4ac18b,_0x71fa55,'backward');}function so(_0x499b9c,_0x4338b3,_0x3a49d1){let _0x1b5c5e=0x14;for(;_0x1b5c5e;){_0x499b9c['modifySelection'](_0x4338b3,{'unit':'word','direction':_0x3a49d1}),_0x1b5c5e--;const _0x1f89fb=_0x4338b3['focus']['forward'==_0x3a49d1?'nodeBefore':'nodeAfter'];if(_0x1f89fb&&_0x1f89fb['is']('element')&&_0x499b9c['schema']['isBlock'](_0x1f89fb)&&_0x499b9c['schema']['isObject'](_0x1f89fb))break;}}function Wr(_0x21e323,_0x2000a8){for(const [_0x5e2df9,_0x3d1915]of _0x21e323['markers']){const _0x5a28ce=_0x3d1915['_getTransformedByDeletion'](_0x2000a8['start'],_0x2000a8['end']['offset']-_0x2000a8['start']['offset']);null!=_0x5a28ce?_0x21e323['markers']['set'](_0x5e2df9,_0x5a28ce):_0x21e323['markers']['delete'](_0x5e2df9);}}const Yr=['modification-delta','text-delta','web-search','reasoning'],$r=['conversation-title'];class ke extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new Mt([]);['parsedMergedContent']=new Mt([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0xc32b38,content:_0x45776f='',isDone:_0x1a0248=!0x1,interactionId:_0x1e43c7,areActionsDisabled:_0x1baf51,documentContextContent:_0x54c648,editor:_0x3d0295,id:_0x32516c}){super(),this['id']=_0x32516c||_0x5fe9bf(),this['interactionId']=_0x1e43c7,this['type']=_0xc32b38,this['areActionsDisabled']=!!_0x1baf51,this['editor']=_0x3d0295,this['aiResponseParser']=new $i(),this['aiResponseApplier']=new tn(),this['documentContextContent']=sr(_0x54c648||''),this['set']('isDone',_0x1a0248),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x45776f);}['appendContent'](_0x50a61c){this['set']('content',this['content']+_0x50a61c);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x1505c9,_0x6c7c28){this['changeGroups'][_0x1505c9]['state']=_0x6c7c28,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x1505c9,'state':_0x6c7c28});}['getContentParts']({showDiff:_0x5c8d2b,groupIndex:_0x3d522c}){if(!this['editor'])throw new _0x5b2487('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x37ad9f=this['_getCachedContentParts'](_0x5c8d2b,_0x3d522c);if(_0x37ad9f)return _0x37ad9f;let _0x166509=[];if(void 0x0===_0x3d522c)_0x166509=this['changeGroups'];else{const _0x8966d7=this['changeGroups']['find'](({index:_0x4f2db2})=>_0x4f2db2===_0x3d522c);if(!_0x8966d7)throw new _0x5b2487('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x3d522c});_0x166509=[_0x8966d7];}const _0x3a635d=et({'editor':this['editor'],'showDiff':_0x5c8d2b,'changeGroups':_0x166509,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x5c8d2b,_0x3a635d),_0x3a635d;}['_getCachedContentParts'](_0x424eec,_0x52084a){const _0x3a980e=_0x424eec?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x3a980e]['length'])return null;const _0x161f06=this['cachedSuggestionContentParts'][_0x3a980e];if(void 0x0===_0x52084a)return _0x221916(_0x161f06);{const _0x36cb06=_0x161f06['find'](({index:_0x1197c6})=>_0x1197c6===_0x52084a);if(_0x36cb06)return[_0x221916(_0x36cb06)];}return null;}['_setCachedContentParts'](_0x586663,_0x406f44){const _0x6ebac1=_0x586663?'withDiff':'withoutDiff';_0x406f44['forEach'](_0x53d44a=>{const _0x3dd91b=this['cachedSuggestionContentParts'][_0x6ebac1],_0x244eb7=_0x3dd91b['find'](({index:_0x47d34c})=>_0x47d34c===_0x53d44a['index']);if(_0x244eb7){const _0x24e3e2=_0x3dd91b['indexOf'](_0x244eb7);_0x3dd91b['splice'](_0x24e3e2,0x1,_0x53d44a);}else _0x3dd91b['push'](_0x53d44a);});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x333273=this['changeGroups'];this['updateChangeGroups']();const _0x5a0fc6=this['_getDifferentChangeGroups'](_0x333273,this['changeGroups']);(_0x5a0fc6['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x5a0fc6),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x5d9742,_0x8045da){const _0x2599f4=[];for(const _0x255ca7 of _0x8045da){const _0x10012=_0x5d9742[_0x255ca7['index']];_0x10012?_0x10012['changes']['length']!==_0x255ca7['changes']['length']?_0x2599f4['push'](_0x255ca7):_0x10012['changes']['forEach']((_0x3342cb,_0x8f312a)=>{const _0xaf9baa=_0x255ca7['changes'][_0x8f312a];_0x3342cb['id']!==_0xaf9baa['id']&&_0x2599f4['push'](_0x255ca7);}):_0x2599f4['push'](_0x255ca7);}return _0x2599f4;}['updateChangeGroups'](){const _0x2f9592=new _0x3bfaba('p',{},[new _0x3bfaba('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0xb8da44(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x2ef588=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x2f9592,'cutAfterLastChange':!this['isDone']});if(!_0x2ef588['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x2ef588['parsedContent'];let _0x182f59=[];if(_0x57b4b6(_0x5101ad=>{const _0xb71287=bt(_0x5101ad,'data-id');if(!_0xb71287||!_0x47ee0f(_0xb71287))return!0x1;const _0x11e079=[_0x5101ad,...Qe(_0x5101ad)]['at'](-0x2);if(_0x5101ad!=_0x11e079){const _0x48b440=bt(_0x11e079,'data-id');_0x47ee0f(_0x48b440)||(_0x182f59['push']({'node':_0x11e079,'id':_0x48b440,'type':'modified'}),_0x2ef588['modifiedNodeIds']['push'](_0x48b440));}else _0x2ef588['modifiedNodeIds']['includes'](_0xb71287)?_0x182f59['push']({'node':_0x5101ad,'type':'modified','id':_0xb71287}):_0x2ef588['newNodeIds']['includes'](_0xb71287)?_0x182f59['push']({'node':_0x5101ad,'type':'new','id':_0xb71287,'anchorId':bt(_0x5101ad['previousSibling'],'data-id')}):_0x182f59['push']({'node':_0x5101ad,'type':'removed','id':_0xb71287});return!0x0;},this['parsedMergedContent']),_0x182f59=_0x182f59['filter'](({node:_0x2aaeee})=>[...Qe(_0x2aaeee),_0x2aaeee]['every'](_0x458b65=>!bt(_0x458b65,'data-unstable'))),0x0==_0x182f59['length'])return;const _0x23f68f=[[_0x182f59[0x0]]];for(let _0x125e8a=0x1;_0x125e8a<_0x182f59['length'];_0x125e8a++){const _0x52691e=_0x23f68f[_0x23f68f['length']-0x1],_0x4a24dc=_0x52691e[_0x52691e['length']-0x1];_0x182f59[_0x125e8a]['node']['previousSibling']==_0x4a24dc['node']&&'modified'!=_0x182f59[_0x125e8a]['type']&&'modified'!=_0x4a24dc['type']?_0x52691e['push'](_0x182f59[_0x125e8a]):_0x23f68f['push']([_0x182f59[_0x125e8a]]);}for(const _0x2558d5 of _0x23f68f){const _0x5e0533=_0x2558d5[0x0],_0x4667e9=_0x2558d5[_0x2558d5['length']-0x1],_0x375ce8=_0x72c7d3(_0x5e0533['node']['previousSibling']);_0x375ce8&&_0x2558d5['unshift'](_0x375ce8);const _0x3402ea=_0x72c7d3(_0x4667e9['node']['nextSibling']);_0x3402ea&&_0x2558d5['push'](_0x3402ea);}function _0x47ee0f(_0x3ea69b){return _0x2ef588['modifiedNodeIds']['includes'](_0x3ea69b)||_0x2ef588['newNodeIds']['includes'](_0x3ea69b)||_0x2ef588['removedNodeIds']['includes'](_0x3ea69b);}function _0x72c7d3(_0x44d408){if(_0x44d408&&bt(_0x44d408,'data-id')&&!bt(_0x44d408,'data-unstable')){const _0x4f4b0d=bt(_0x44d408,'data-id');if(!_0x47ee0f(_0x4f4b0d))return{'node':_0x44d408,'type':'context','id':_0x4f4b0d};}return null;}this['changeGroups']=_0x23f68f['map']((_0xe52197,_0x26e079)=>({'changes':_0xe52197,'state':'pending','index':_0x26e079}));}}function Wi(_0x5ac95c){return Object['values'](Yr)['includes'](_0x5ac95c);}function Ni(_0x3e4096){return $r['includes'](_0x3e4096);}function Pi(_0xf6f616){return'conversation-title'===_0xf6f616;}function Qi(_0x47bb68){return'source'===_0x47bb68;}const je=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','error'];class xe extends _0x49ef7b(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x4ce237,editor:_0x5ea60f}){super(),this['id']=_0x5fe9bf(),this['connector']=_0x4ce237,this['isStopped']=!0x0,this['editor']=_0x5ea60f;}async['start'](){let _0x3376d2;const _0x361437=[];this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x2d4978=await this['currentRequest']['getStream']();for await(const _0x4c39bb of _0x2d4978){if(this['isStopped'])return;if('error'===_0x4c39bb['event'])return void this['fire']('error',{'error':new _0x5b2487('ai-chat-interaction-error',this)});if('message-metadata'!==_0x4c39bb['event']){if('action-metadata'!==_0x4c39bb['event']){if(Pi(_0x4c39bb['event'])&&this['setConversationTitle'](_0x4c39bb['data']['conversationTitle'],!0x0),Qi(_0x4c39bb['event']))_0x361437['push'](_0x4c39bb['data']['source']);else{if(Wi(_0x4c39bb['event'])){if(_0x4c39bb['event']!==_0x3376d2){if(_0x3376d2=_0x4c39bb['event'],'web-search'===_0x4c39bb['event']){this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));continue;}if('reasoning'===_0x4c39bb['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':_0x4c39bb['event'],'interactionId':this['id'],'id':_0x4c39bb['data']?.['id']}),_0x361437['length']>0x0&&'modification-delta'===_0x4c39bb['event']&&(this['currentReply']['sources']=_0x361437['splice'](0x0));}_0x4c39bb['data']['textDelta']&&this['currentReply']['appendContent'](_0x4c39bb['data']['textDelta']);}else Ni(_0x4c39bb['event'])||_0x5ace8a('ai-interaction-invalid-event-type',{'chunk':_0x4c39bb});}}else this['actionCallId']=_0x4c39bb['data']['callId'];}else this['messageId']=_0x4c39bb['data']['messageId'];}}finally{this['isStopped']||(_0x361437['length']>0x0&&(this['currentReply']['sources']=_0x361437['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x3f7b9d){return this['replies']['find'](_0x5647b7=>_0x5647b7['id']===_0x3f7b9d);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x67f357=>_0x67f357['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x3d3c13){const _0x1aa30c=new ke({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x3d3c13});return this['replies']['push'](_0x1aa30c),_0x1aa30c['delegate'](...je)['to'](this),this['fire']('replyCreated',_0x1aa30c),_0x1aa30c;}['setConversationTitle'](_0x446b3e,_0x3b77f5=!0x1){this['fire']('setConversationTitle',_0x446b3e,_0x3b77f5);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Ie=function(_0x17c200){return _0x17c200['FILE']='file',_0x17c200['DOCUMENT']='document',_0x17c200['URL']='web-resource',_0x17c200['TEXT']='text',_0x17c200['SELECTION']='selection',_0x17c200;}({}),be=function(_0x8c5a9d){return _0x8c5a9d['TEXT']='text',_0x8c5a9d['MARKDOWN']='markdown',_0x8c5a9d['HTML']='html',_0x8c5a9d;}({});const qi=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Mi extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x345a95,config:_0x1f59b5,ownerId:_0x363ede}){super(),this['_connector']=_0x345a95,this['_config']=_0x1f59b5,this['_ownerId']=_0x363ede;}['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'](_0x1b11a6){const _0x161106=await this['_createContextItemFromContent'](_0x1b11a6);return this['_addToConversationContextItem'](_0x161106),'current-document'===_0x161106['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x161106;}async['_createContextItemFromContent'](_0x57ecca){if(_0x57ecca['type']===Ie['DOCUMENT']){const _0x29daf0=await this['_connector']['fetchDocument'](this['_ownerId'],_0x57ecca['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x57ecca['type'],'content':_0x29daf0['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x29daf0['attributes']?.['version'],'sessionId':_0x29daf0['attributes']?.['sessionId']};}return{'id':_0x57ecca['id'],'uiId':_0x57ecca['id'],'label':_0x57ecca['attributes']?.['label']||_0x57ecca['name']||_0x57ecca['url']||_0x57ecca['id'],'type':_0x57ecca['type'],..._0x57ecca?.['attributes']?.['resourceId']?{'resourceId':_0x57ecca['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x19bfff){const _0x7a0db6=this['_pendingContextItems']['get'](_0x19bfff);_0x7a0db6?.['isReadOnly']||this['_removeContextItem'](_0x19bfff);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0xe46d60 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0xe46d60['uiId']);const _0x2ea4f9=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x2ea4f9&&this['_addContextItem']({..._0x2ea4f9,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x5809ad){for(const _0x277b85 of _0x5809ad['values']())this['_addToConversationContextItem'](_0x277b85);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'](_0x5e9cf2){return Array['from'](_0x5e9cf2['values']())['map'](_0x54fd99=>this['_mapContextItemToRequestData'](_0x54fd99))['filter'](_0x95c0d1=>null!==_0x95c0d1);}async['addFilesToContext'](_0x52b518,_0x1d243b,_0x1c4ffd=Ie['FILE']){const _0x1505c8='files-'+_0x5fe9bf();this['_startUploadOperation'](_0x1505c8);try{await Promise['all'](_0x52b518['map'](async _0x68586f=>{const _0x28cc26='file-'+_0x5fe9bf(),_0x112dfc=_0x49969b(_0x68586f['name']);try{this['_addContextItem']({'type':_0x1c4ffd,'label':_0x1d243b?.['label']||_0x112dfc,'uiId':_0x28cc26,'resourceId':_0x1d243b?.['resourceId']},!0x0);const _0x28463b=this['_connector']['uploadFile'](this['_ownerId'],_0x68586f,_0x1d243b);this['_ongoingUploads']['set'](_0x28cc26,_0x28463b['abortController']);const {id:_0x263ba4}=await _0x28463b['getId']();this['_ongoingUploads']['delete'](_0x28cc26),this['_finishContextItemLoading']({'type':_0x1c4ffd,'id':_0x263ba4,'label':_0x1d243b?.['label']||_0x112dfc,'uiId':_0x28cc26,'resourceId':_0x1d243b?.['resourceId']},!0x1);}catch(_0x220268){this['_ongoingUploads']['delete'](_0x28cc26);if(!_0x220268['message']['startsWith']('ai-request-aborted')){const _0x1e2555=new _0x5b2487('ai-chat-file-upload-failed',null,{'fileName':_0x112dfc});_0x1e2555['stack']=_0x220268['stack'],this['fire']('error',{'error':_0x1e2555,'fileName':_0x112dfc});}this['_removeContextItem'](_0x28cc26);}}));}finally{this['_finishUploadOperation'](_0x1505c8);}}['addCurrentDocumentToContext'](_0x423fe4){if(this['isCurrentDocumentInContext']())return;const _0x847975={'type':Ie['DOCUMENT'],'uiId':'current-document','label':_0x423fe4,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x847975);}async['updateCurrentDocument'](_0x1d0a4e,_0x4ea3d7,_0x281082,_0x49c18d){const _0x487dee=this['_pendingContextItems']['get']('current-document');if(_0x487dee&&_0x1d0a4e){_0x487dee['selection']=_0x49c18d?_0x49c18d['map'](_0x133dd3=>({'start':_0x133dd3['start'],'end':_0x133dd3['end']})):[];try{if(_0x487dee['version']===_0x4ea3d7)return;const {id:_0x31aae5}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x1d0a4e,{'version':_0x4ea3d7,'sessionId':_0x281082})['getId']();_0x487dee['id']=_0x31aae5,_0x487dee['content']=_0x1d0a4e,_0x487dee['version']=_0x4ea3d7,_0x487dee['sessionId']=_0x281082;}catch(_0x3bb5c9){const _0x3c87e8=new _0x5b2487('ai-chat-document-upload-failed',null);_0x3c87e8['stack']=_0x3bb5c9['stack'],this['fire']('error',{'error':_0x3c87e8});}}}['addSelectionToContext'](_0x204d96){this['_addContextItem']({'type':Ie['SELECTION'],'label':_0x204d96,'uiId':'selection','content':_0x204d96});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x4bff05,_0x5572cd){const _0x299e11='url-'+_0x5fe9bf();this['_startUploadOperation'](_0x299e11);const _0x186f16='url-'+_0x5fe9bf();try{this['_addContextItem']({'type':Ie['URL'],'label':_0x5572cd?.['label']||_0x4bff05,'uiId':_0x186f16,'resourceId':_0x5572cd?.['resourceId']},!0x0);const _0x3187ca=this['_connector']['uploadUrl'](this['_ownerId'],_0x4bff05,_0x5572cd);this['_ongoingUploads']['set'](_0x186f16,_0x3187ca['abortController']);const {id:_0x552ca4}=await _0x3187ca['getId']();this['_ongoingUploads']['delete'](_0x186f16),this['_finishContextItemLoading']({'type':Ie['URL'],'id':_0x552ca4,'label':_0x5572cd?.['label']||_0x4bff05,'uiId':_0x186f16,'resourceId':_0x5572cd?.['resourceId']},!0x1);}catch(_0x121d84){this['_ongoingUploads']['delete'](_0x186f16),(_0x121d84['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x5b2487('ai-chat-url-upload-failed',this,{'url':_0x4bff05,'originalError':_0x121d84}),'url':_0x4bff05}),this['_removeContextItem'](_0x186f16));}finally{this['_finishUploadOperation'](_0x299e11);}}async['loadSourceResources'](_0x2c994d,_0x40093e,_0x26f72b){const _0x74fa2f=this['_addContextOptionsState']['sources']['find'](_0x3c548f=>_0x3c548f['id']===_0x2c994d);if(!_0x74fa2f)return this['fire']('error',{'error':new _0x5b2487('ai-chat-source-not-found',this,{'sourceId':_0x2c994d}),'sourceId':_0x2c994d}),[];try{const _0x2e2df0=(await _0x74fa2f['getResources'](_0x40093e))['map'](_0x594dac=>{const _0x53257b=this['_isResourceInContext'](_0x594dac['id']);return{..._0x594dac,'isInContext':_0x53257b};});return _0x74fa2f['resources']=_0x2e2df0,this['fire']('sourceResourcesLoaded',{'sourceId':_0x2c994d,'source':_0x74fa2f,'resources':_0x2e2df0,'uid':_0x26f72b}),_0x2e2df0;}catch(_0x299d8d){return this['fire']('error',{'error':new _0x5b2487('ai-chat-source-resources-load-failed',this,{'sourceId':_0x2c994d,'originalError':_0x299d8d}),'sourceId':_0x2c994d,'sourceLabel':_0x74fa2f['label']}),[];}}async['addResourceToContext'](_0x5e710d,_0x659fef){if(this['_isResourceInContext'](_0x659fef['id']))return;let _0x27e36a=_0x659fef['data'];if(!_0x27e36a&&_0x5e710d['getData'])try{_0x27e36a=await _0x5e710d['getData'](_0x659fef['id']);}catch(_0x2740d1){return void this['fire']('error',{'error':new _0x5b2487('ai-chat-resource-load-failed',this,{'resourceId':_0x659fef['id'],'sourceId':_0x5e710d['id'],'originalError':_0x2740d1}),'resourceId':_0x659fef['id'],'sourceId':_0x5e710d['id']});}if(_0x27e36a)switch(_0x659fef['type']){case Ie['URL']:if('string'!=typeof _0x27e36a)return void this['fire']('error',{'error':new _0x5b2487('ai-chat-context-invalid-data',this,{'resourceId':_0x659fef['id'],'sourceId':_0x5e710d['id'],'expectedType':'string','actualType':typeof _0x27e36a}),'resourceId':_0x659fef['id'],'sourceId':_0x5e710d['id']});await this['addUrlToContext'](_0x27e36a,{'label':_0x659fef['label'],'resourceId':_0x659fef['id']});break;case Ie['FILE']:if(!(_0x27e36a instanceof File))return void this['fire']('error',{'error':new _0x5b2487('ai-chat-context-invalid-data',this,{'resourceId':_0x659fef['id'],'sourceId':_0x5e710d['id'],'expectedType':'File','actualType':typeof _0x27e36a}),'resourceId':_0x659fef['id'],'sourceId':_0x5e710d['id']});await this['addFilesToContext']([_0x27e36a],{'label':_0x659fef['label'],'resourceId':_0x659fef['id']});break;case Ie['TEXT']:if('object'!=typeof _0x27e36a||!('content'in _0x27e36a)||!('type'in _0x27e36a))return void this['fire']('error',{'error':new _0x5b2487('ai-chat-context-invalid-data',this,{'resourceId':_0x659fef['id'],'sourceId':_0x5e710d['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x27e36a}),'resourceId':_0x659fef['id'],'sourceId':_0x5e710d['id']});_0x27e36a=Mi['_convertTextResourceToFile'](_0x27e36a,_0x659fef['label']),await this['addFilesToContext']([_0x27e36a],{'label':_0x659fef['label'],'resourceId':_0x659fef['id']},Ie['TEXT']);break;default:this['fire']('error',{'error':new _0x5b2487('ai-chat-context-unsupported-type',this,{'resourceId':_0x659fef['id'],'sourceId':_0x5e710d['id'],'resourceType':_0x659fef['type']}),'resourceId':_0x659fef['id'],'sourceId':_0x5e710d['id']});}else this['fire']('error',{'error':new _0x5b2487('ai-chat-resource-no-data',this,{'resourceId':_0x659fef['id'],'sourceId':_0x5e710d['id']}),'resourceId':_0x659fef['id'],'sourceId':_0x5e710d['id']});}static['_convertTextResourceToFile'](_0x47c0fc,_0x12b13f){switch(_0x47c0fc['type']){case be['MARKDOWN']:return new File([_0x47c0fc['content']],_0x12b13f,{'type':'text/markdown'});case be['HTML']:return new File([_0x47c0fc['content']],_0x12b13f,{'type':'text/html'});default:return new File([_0x47c0fc['content']],_0x12b13f,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x13752f){switch(_0x13752f['type']){case Ie['FILE']:return{'type':Ie['FILE'],'id':_0x13752f['id']};case Ie['URL']:return{'type':Ie['URL'],'id':_0x13752f['id']};case Ie['DOCUMENT']:return{'type':Ie['DOCUMENT'],'id':_0x13752f['id'],..._0x13752f['selection']?.['length']&&{'selection':_0x13752f['selection']}};case Ie['TEXT']:return{'type':Ie['FILE'],'id':_0x13752f['id']};default:return null;}}['_addContextItem'](_0x38e22b,_0x278af3=!0x1){if(this['_pendingContextItems']['set'](_0x38e22b['uiId'],_0x38e22b),_0x38e22b['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x38e22b,'isLoading':_0x278af3}),'current-document'===_0x38e22b['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x38e22b['resourceId']){const _0x5a8fec=this['_findSourceIdsByResourceId'](_0x38e22b['resourceId']);_0x5a8fec&&_0x5a8fec['forEach'](_0x512006=>{this['_updateResourceInContextState'](_0x512006,_0x38e22b['resourceId'],!0x0);});}}['_removeContextItem'](_0x522eb9){const _0x4f4a9c=this['_pendingContextItems']['get'](_0x522eb9),_0x305d5c=this['_ongoingUploads']['get'](_0x522eb9);if(_0x305d5c&&(_0x305d5c['abort'](),this['_ongoingUploads']['delete'](_0x522eb9)),_0x4f4a9c?.['resourceId']){const _0x4d7ece=this['_findSourceIdsByResourceId'](_0x4f4a9c['resourceId']);_0x4d7ece&&_0x4d7ece['forEach'](_0x567185=>{this['_updateResourceInContextState'](_0x567185,_0x4f4a9c['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x522eb9),this['fire']('contextItemRemoved',{'uiId':_0x522eb9,'type':_0x4f4a9c?.['type']}),'current-document'===_0x522eb9&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x533806,_0x54c3b8){if(this['_pendingContextItems']['has'](_0x533806['uiId'])&&(this['_pendingContextItems']['set'](_0x533806['uiId'],_0x533806),this['fire']('contextItemLoadingEnded',{'contextItem':_0x533806,'isLoading':_0x54c3b8}),_0x533806['resourceId'])){const _0x368547=this['_findSourceIdsByResourceId'](_0x533806['resourceId']);_0x368547&&_0x368547['forEach'](_0x74ffda=>{this['_updateResourceInContextState'](_0x74ffda,_0x533806['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x1d7b31){this['_conversationContextItems']['set'](_0x1d7b31['uiId'],_0x1d7b31);}['_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'](_0x43c0dc=>({..._0x43c0dc,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x36be36=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x36be36,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x10bc0e){for(const _0x91a441 of this['_pendingContextItems']['values']())if(_0x91a441['resourceId']===_0x10bc0e)return!0x0;for(const _0x1c678b of this['_conversationContextItems']['values']())if(_0x1c678b['resourceId']===_0x10bc0e)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x48ec53){const _0x2b8cee=[];for(const _0x541d9f of this['_addContextOptionsState']['sources']){_0x541d9f['resources']['find'](_0x2b87c4=>_0x2b87c4['id']===_0x48ec53)&&_0x2b8cee['push'](_0x541d9f['id']);}return 0x0===_0x2b8cee['length']?null:_0x2b8cee;}['_updateResourceInContextState'](_0x579f7e,_0x2c5fe2,_0x5e30f0){const _0x1864fa=this['_addContextOptionsState']['sources']['find'](_0x67ef1f=>_0x67ef1f['id']===_0x579f7e);if(!_0x1864fa)return;const _0x5d97c7=_0x1864fa['resources']['find'](_0x5c1ccb=>_0x5c1ccb['id']===_0x2c5fe2);_0x5d97c7&&(_0x5d97c7['isInContext']=_0x5e30f0,this['fire']('resourceStateChanged',{'sourceId':_0x579f7e,'resourceId':_0x2c5fe2,'isInContext':_0x5e30f0}));}['_startUploadOperation'](_0x2665cc){this['_ongoingUploadOperations']['set'](_0x2665cc,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x1664a3){this['_ongoingUploadOperations']['delete'](_0x1664a3),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const zi=['capabilitiesUpdated'];class Fi extends _0x49ef7b(){['_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'](_0x58721e){const _0x351770={};return _0x58721e&&_0x58721e['isWebSearchEnabled']&&(_0x351770['webSearch']={}),_0x58721e&&_0x58721e['isReasoningEnabled']&&(_0x351770['reasoning']={}),_0x351770;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x493df7){_0x493df7!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x493df7,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x1b62e4){_0x1b62e4!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x1b62e4,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ui extends xe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x1c8961){super(_0x1c8961),this['conversationId']=_0x1c8961['conversationId'],this['contextItems']=_0x1c8961['contextItems'],this['capabilities']=_0x1c8961['capabilities'],this['userMessage']=_0x1c8961['userMessage'],this['model']=_0x1c8961['model'],this['quickActionData']=_0x1c8961['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Mi['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Fi['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class vt extends _0x49ef7b(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x1b1474){super(),this['options']=_0x1b1474,this['connector']=_0x1b1474['connector'],this['chatModels']=_0x1b1474['chatModels'],this['id']=_0x1b1474['conversationId'];}async['init'](_0x5e4afa){try{this['chatContext']=new Mi({'connector':this['connector'],'config':_0x5e4afa,'ownerId':this['id']}),this['chatContext']['delegate'](...qi)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Fi(),this['chatCapabilities']['delegate'](...zi)['to'](this),this['chatCapabilities']['init']();const _0x1a5187=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x1a5187});const _0xad2639=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0xad2639&&await this['setModel'](_0xad2639);}catch(_0x3c3a18){const _0x2cf605=new _0x5b2487('ai-chat-conversation-init-failed',null,{'message':_0x3c3a18['message']});_0x2cf605['stack']=_0x3c3a18['stack'],this['fire']('error',{'error':_0x2cf605});}}async['start'](){if(this['isStarted'])throw new _0x5b2487('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x5b2487('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x236de8}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x236de8,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x1f4ac9){const _0x3c1134=new _0x5b2487('ai-chat-conversation-start-failed',null,{'message':_0x1f4ac9['message']});_0x3c1134['stack']=_0x1f4ac9['stack'],this['fire']('error',{'error':_0x3c1134});}}async['load'](_0x1d2cc9,_0x6b7a73){try{const _0x1f7979=await this['connector']['fetchConversation'](_0x1d2cc9)['getConversation'](),_0x51ce5a=await this['connector']['fetchConversationMessages'](_0x1d2cc9)['getMessages'](),_0x53e822=_0x51ce5a[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x1f7979['id'],'title'in _0x1f7979?this['fire']('setConversationTitle',_0x1f7979['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x24e604=(await this['chatModels']['getAll']())['find'](_0x2d1dd6=>_0x2d1dd6['id']['toLowerCase']()===_0x53e822['toLowerCase']());return this['selectedModel']=_0x24e604,this['fire']('modelSelected',{'selectedModel':_0x24e604,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x51ce5a,_0x6b7a73,_0x53e822),this['currentInteraction']=void 0x0,this;}catch(_0x4bd719){const _0x5eaacf=new _0x5b2487('ai-chat-conversation-init-from-id-failed',null,{'message':_0x4bd719['message'],'conversationId':_0x1d2cc9});throw _0x5eaacf['stack']=_0x4bd719['stack'],this['fire']('error',{'error':_0x5eaacf}),_0x5eaacf;}}async['_processMessagesToInteractions'](_0xe40653,_0xfded47,_0x443a24){let _0x454c87;for(const _0x3aabc3 of _0xe40653)if('user'===_0x3aabc3['role']){const _0x5ab449=await this['_extractContextItems'](_0x3aabc3),_0x10b581={'isReasoningEnabled':Object['hasOwn'](_0x3aabc3['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x3aabc3['capabilities'],'webSearch')};_0x454c87=this['createInteraction']({'userMessage':_0x3aabc3['prompt'],'contextItems':_0x5ab449,'capabilities':_0x10b581,'modelId':_0x443a24,'quickActionData':_0x3aabc3['attributes']?.['quickActionData']}),this['currentInteraction']=_0x454c87,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x3aabc3['role']&&_0x454c87)for(const _0x3e8579 of _0x3aabc3['content']){const _0xfc3bb2='text'===_0x3e8579['type']?'text-delta':'modification-delta',_0x4877c2=_0x454c87['getDocumentContext']()?.['sessionId']!==_0xfded47;_0x454c87['currentReply']=_0x454c87['createReply']({'type':_0xfc3bb2,'isDone':!0x0,'interactionId':_0x454c87['id'],'areActionsDisabled':_0x4877c2}),_0x454c87['currentReply']['appendContent'](_0x3e8579['content']);}}}async['_extractContextItems'](_0x12d184){const _0x210688=new Map();if(!_0x12d184['content'])return _0x210688;for(const _0x1a350b of _0x12d184['content']){const _0x37c372=await this['chatContext']['populateFromMessage'](_0x1a350b);_0x37c372&&_0x210688['set'](_0x37c372['id'],_0x37c372);}return _0x210688;}async['handleUserInteraction']({userMessage:_0xf82aa0,quickActionData:_0xb164c6}){if(!this['isStarted'])throw new _0x5b2487('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x5b2487('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x15ed00=this['chatContext']['getPendingContextItems'](),_0x4c0f39=this['chatCapabilities']['getCapabilitiesConfig'](),_0x24e3e7=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0xf82aa0,'contextItems':_0x15ed00,'capabilities':_0x4c0f39,'modelId':_0x24e3e7,'quickActionData':_0xb164c6}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x39abd9){this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x39abd9});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x5eaefb,contextItems:_0x43c361,capabilities:_0x3f4482,modelId:_0x147c5a,quickActionData:_0x271e39}){const _0x18ffad=new Ui({'userMessage':_0x5eaefb,'contextItems':_0x43c361,'capabilities':_0x3f4482,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x147c5a,'quickActionData':_0x271e39});return _0x18ffad['delegate'](...je)['to'](this),this['interactions']['push'](_0x18ffad),this['fire']('interactionCreated',_0x18ffad),_0x18ffad;}['getInteraction'](_0x32a066){return this['interactions']['find'](_0x23f5f2=>_0x23f5f2['id']===_0x32a066);}['removeInteraction'](_0x14c7a6){const _0x3075fd=this['getInteraction'](_0x14c7a6);_0x3075fd&&(_0x3075fd['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x3075fd),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x310f0e){this['chatContext']['addCurrentDocumentToContext'](_0x310f0e);}async['updateCurrentDocumentInContext']({content:_0x35fbaf,version:_0x153e62,sessionId:_0x18a4d9,selections:_0x487f74}){await this['chatContext']['updateCurrentDocument'](_0x35fbaf,_0x153e62,_0x18a4d9,_0x487f74);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x588450){this['chatContext']['addSelectionToContext'](_0x588450);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x421555){this['chatContext']['addFilesToContext'](_0x421555);}['addUrlToContext'](_0x1bacfb){this['chatContext']['addUrlToContext'](_0x1bacfb);}['addResourceToContext'](_0x97f449,_0x112b3b){this['chatContext']['addResourceToContext'](_0x97f449,_0x112b3b);}['loadSourceResources'](_0xc4d546,_0x33a9fc,_0x518dd1){return this['chatContext']['loadSourceResources'](_0xc4d546,_0x33a9fc,_0x518dd1);}['removeFromContext'](_0xa8e8d2){this['chatContext']['removeFromContext'](_0xa8e8d2);}['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'](_0x6b2063){_0x6b2063?!0x1===await this['chatModels']['isAvailable'](_0x6b2063)&&(_0x5ace8a('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x6b2063}),_0x6b2063=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x5ace8a('ai-chat-conversation-set-model-null',{'conversation':this}),_0x6b2063=(await this['chatModels']['getAvailableModels']())[0x0]),_0x6b2063['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x6b2063,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x6b2063}));}}function q(_0x1fe7ee){if(_0x1fe7ee instanceof Ct)return _0x1fe7ee;if(_0x1fe7ee?.['editors']&&_0x1fe7ee['editors']['get'](0x0))return _0x1fe7ee['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.'),_0x1fe7ee['editors']['get'](0x0);throw new _0x5b2487('ai-get-editor-from-context-no-editor');}const wt='ai-selection';class N extends _0x5ac5c7{['_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 _0x2c6fbc=q(this['context']),_0x2bf382=_0x2c6fbc['plugins']['has']('RealTimeCollaborationClient')&&_0x2c6fbc['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x2bf382||_0x5fe9bf();}return this['_sessionId'];}['getDocumentData'](){const _0x36c602=q(this['context']),_0x13a338=_0x36c602['model'],_0x12aa9d=_0x36c602['data']['toView'](_0x13a338['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x2a931b=new kt(_0x36c602['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x12aa9d,_0x2a931b);let _0x2f1994=_0x36c602['data']['processor']['toData'](_0x12aa9d);const _0x498375=this['_getMarkersInDocumentOrder'](),_0x17cb7f=[];for(const _0x1ea4c8 of _0x498375){const _0x1f5a59='<'+_0x1ea4c8['name']+':start></'+_0x1ea4c8['name']+':start>',_0x36cd9d=_0x2f1994['indexOf'](_0x1f5a59);_0x2f1994=_0x2f1994['substring'](0x0,_0x36cd9d)+_0x2f1994['substring'](_0x36cd9d+_0x1f5a59['length']);const _0x2ab281='<'+_0x1ea4c8['name']+':end></'+_0x1ea4c8['name']+':end>',_0x4d8def=_0x2f1994['indexOf'](_0x2ab281);_0x2f1994=_0x2f1994['substring'](0x0,_0x4d8def)+_0x2f1994['substring'](_0x4d8def+_0x2ab281['length']),_0x17cb7f['push']({'markerName':_0x1ea4c8['name'],'start':_0x36cd9d,'end':_0x4d8def,'htmlFragment':_0x2f1994['substring'](_0x36cd9d,_0x4d8def)});}return{'content':_0x2f1994,'version':_0x36c602['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x17cb7f};}async['afterInit'](){this['context']instanceof Ct?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x403375,_0xd70677)=>{_0xd70677['on']('ready',()=>{this['_integrateEditor'](_0xd70677);});});}['_integrateEditor'](_0x1475ba){_0x1475ba['conversion']['for']('editingDowncast')['markerToHighlight']({'model':wt,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x1475ba['conversion']['for']('dataDowncast')['markerToElement']({'model':wt,'view':(_0x5882e1,{writer:_0x29d4e4,options:_0x9c74ed})=>_0x9c74ed['convertAiChatSelectionMarker']?_0x29d4e4['createUIElement'](_0x5882e1['markerName']+':'+(_0x5882e1['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x5bb3c5,_0x1096d0,_0x13bcdd=!0x1,_0x1a0d6b=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x1a0d6b)return!0x1;const _0x284533=q(this['context'])['model'];return _0x284533['change'](_0x2e9ffa=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x1096d0,this['_displayedFakeSelectionLocked']=_0x13bcdd;let _0x37ea38=0x0;for(let _0x4c1445 of _0x5bb3c5){const _0x3e2192=wt+':'+_0x37ea38;if(_0x4c1445['start']['isAtEnd']){const _0x46d5f1=_0x4c1445['start']['getLastMatchingPosition'](({item:_0xfff43d})=>!_0x284533['schema']['isContent'](_0xfff43d),{'boundaries':_0x4c1445});_0x4c1445=_0x2e9ffa['createRange'](_0x46d5f1,_0x4c1445['end']);}_0x2e9ffa['addMarker'](_0x3e2192,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4c1445}),_0x37ea38++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x48f68b){if(this['_displayedFakeSelectionId']!=_0x48f68b)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x24c0ab=q(this['context']),_0x487d46=_0x24c0ab['model']['markers']['getMarkersGroup'](wt);return _0x24c0ab['model']['change'](_0xe55149=>{for(const _0x4944e1 of _0x487d46)_0xe55149['removeMarker'](_0x4944e1);}),!0x0;}['modelToViewWithIds'](_0x54d3f8){const _0x1fd081=q(this['context']),_0x5aa04f=_0x1fd081['data']['toView'](_0x54d3f8),_0x5651b6=new kt(_0x1fd081['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x5aa04f,_0x5651b6),_0x5aa04f;}['_setDataIdsOnChildren'](_0x20eb8c,_0x5de7dd){let _0x417cff=!0x1;const _0x4a3da4=new Set();for(const _0x595b74 of _0x20eb8c['getChildren']()){const _0x26ee79=_0x595b74['is']('emptyElement')||_0x595b74['is']('containerElement');if(!_0x595b74['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x595b74,_0x5de7dd)||_0x26ee79)&&(_0x5de7dd['setAttribute']('data-id',this['_nextDataId'](_0x4a3da4),_0x595b74),_0x417cff=!0x0);}return _0x417cff;}['_nextDataId'](_0x158e68){let _0x509c4a;do{_0x509c4a='';for(let _0x130b11=0x0;_0x130b11<0x4;_0x130b11++)_0x509c4a+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x158e68['has'](_0x509c4a));return _0x158e68['add'](_0x509c4a),_0x509c4a;}['getSelectionText'](){const {model:_0x4dd6eb}=q(this['context']),_0x44e6d0=_0x4dd6eb['document']['selection'],_0x5e308d=_0x4dd6eb['getSelectedContent'](_0x44e6d0),_0x51f4c7=[],_0xaa054b=_0x4dd6eb['createRangeIn'](_0x5e308d)['getWalker']();for(const {item:_0x533659}of _0xaa054b)_0x533659['is']('$textProxy')?_0x51f4c7['push'](_0x533659['data']):_0x533659['is']('element')&&_0x51f4c7['length']>0x0&&'\x20'!==_0x51f4c7[_0x51f4c7['length']-0x1]&&_0x51f4c7['push']('\x20');return'\x22'+_0x51f4c7['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x39aa78=q(this['context'])['model'];return Array['from'](_0x39aa78['markers']['getMarkersGroup'](wt))['sort']((_0x283719,_0x32cdc4)=>_0x283719['getStart']()['isBefore'](_0x32cdc4['getStart']())?-0x1:_0x283719['getStart']()['isAfter'](_0x32cdc4['getStart']())?0x1:0x0);}}const H=['applySuggestion','insertSuggestion','showChangeInText'];class hh extends _0x1fbe2f{['actionsButton'];['children'];['applySuggestionModel'];['showChangeInTextModel'];['insertSuggestionModel'];['_partsCount']=0x1;['_dropdownOriginalConfig'];['_dropdownCurrentConfig'];['_firstRender']=!0x0;constructor(_0x299842,_0x2972ba){super(_0x299842),this['_dropdownOriginalConfig']=_0x2972ba||[...H],this['_dropdownCurrentConfig']=[...this['_dropdownOriginalConfig']];const _0x3d56f1=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['applySuggestionModel']=new _0x355792({'label':Un('applySuggestion',_0x299842,this['_partsCount']),'icon':_0x44639d,'withText':!0x0,'type':'button','actionName':'applySuggestion'}),this['showChangeInTextModel']=new _0x355792({'label':Un('showChangeInText',_0x299842,this['_partsCount']),'icon':_0x61e054,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x355792({'label':Un('insertSuggestion',_0x299842,this['_partsCount']),'icon':_0x163e8a,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x299842),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',_0x3d56f1['if']('isVisible','ck-hidden',_0x2bd39e=>!_0x2bd39e)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_dropdownCurrentConfig']=this['isTrackChangesOn']?this['_dropdownOriginalConfig']['filter'](_0x4e1cf8=>'applySuggestion'!==_0x4e1cf8):[...this['_dropdownOriginalConfig']],this['_updateDropdownActions'](_0x299842);});}['_updateDropdownActions'](_0x2a0102){this['actionsButton']&&this['children']['has'](this['actionsButton'])&&(this['children']['remove'](this['actionsButton']),this['actionsButton']['destroy']()),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x2a0102),this['actionsButton']&&this['children']['add'](this['actionsButton']);}['_createActionsDropdownOrButton'](_0x33132e){if(0x0==this['_dropdownCurrentConfig']['length'])return null;const _0x73fdb=0x1===this['_dropdownCurrentConfig']['length']?this['_createActionsButton'](_0x33132e):this['_createActionsDropdown'](_0x33132e),_0x38d966=this['_firstRender']?'':'ck-ai-chat__feed__ai-suggestion__actions--no-animation';_0x73fdb['set']({'label':Un(this['_dropdownCurrentConfig'][0x0],_0x33132e,this['_partsCount']),'tooltip':Rn(this['_dropdownCurrentConfig'][0x0],_0x33132e,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions\x20'+_0x38d966});for(const _0x5cc3ab of this['_dropdownCurrentConfig'])_0x73fdb['on'](_0x5cc3ab,()=>{this['fire'](_0x5cc3ab);});return this['_firstRender']=!0x1,_0x73fdb;}['_createActionsButton'](_0x294665){const _0x5697fe=new _0x23f64b(_0x294665);return _0x5697fe['set']({'class':'ck-ai-button-primary','withText':!0x0}),_0x5697fe['on']('execute',()=>{_0x5697fe['fire'](this['_dropdownCurrentConfig'][0x0]);}),_0x5697fe;}['_createActionsDropdown'](_0x5b802c){const _0x19d61b=new Pn(_0x5b802c,{'listItemModels':this['_dropdownCurrentConfig']['map'](_0x5830b2=>{switch(_0x5830b2){case'applySuggestion':return this['applySuggestionModel'];case'showChangeInText':return this['showChangeInTextModel'];case'insertSuggestion':return this['insertSuggestionModel'];}})});return _0x19d61b['set']({'label':Un(this['_dropdownCurrentConfig'][0x0],_0x5b802c,this['_partsCount']),'tooltip':Rn(this['_dropdownCurrentConfig'][0x0],_0x5b802c,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),_0x19d61b['bind']('isEnabled')['to'](this),_0x19d61b;}['updateLabels'](_0x1065a8){const _0x5b5973=this['locale'];this['_partsCount']=_0x1065a8||this['_partsCount'],this['actionsButton']['set']({'label':Un(this['_dropdownCurrentConfig'][0x0],_0x5b5973,this['_partsCount']),'tooltip':Rn(this['_dropdownCurrentConfig'][0x0],_0x5b5973,this['_partsCount'])}),this['applySuggestionModel']['label']=Un('applySuggestion',_0x5b5973,this['_partsCount']),this['showChangeInTextModel']['label']=Un('showChangeInText',_0x5b5973,this['_partsCount']),this['insertSuggestionModel']['label']=Un('insertSuggestion',_0x5b5973,this['_partsCount']);}}class Pn extends _0x5c1602{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x2534c0,_0x480e91){super(_0x2534c0),this['balloonPanelView']=new _0x506f25(this['locale']),this['bodyCollection']=new _0x203f54(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x480e91['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 _0xb6cc2d=_0x480e91['listItemModels'][0x0]['actionName'];this['fire'](_0xb6cc2d),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']?Hn:Ln]}),this['listView']['focus']());}),_0x39650b({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x5b67c5){const _0x1aca62=this['locale'],_0x41452e=new _0x5253cf(_0x1aca62);for(const _0xd54d23 of _0x5b67c5){const _0x4bb776=new _0x57e588(_0x1aca62),_0x176762=new _0x37a4cc(_0x1aca62);_0x176762['bind'](...Object['keys'](_0xd54d23))['to'](_0xd54d23),_0x176762['delegate']('execute')['to'](_0x41452e),_0x4bb776['children']['add'](_0x176762),_0x41452e['items']['add'](_0x4bb776);}return _0x41452e['items']['delegate']('execute')['to'](this),_0x41452e['on']('execute',_0x5443c0=>{const _0x48d437=_0x5443c0['source'];this['fire'](_0x48d437['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x41452e;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0x46a36b(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x1250f9,_0x1377e8)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x1377e8();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function Hn(_0x206744){return{'top':_0x206744['bottom'],'left':_0x206744['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function Ln(_0x51ee71,_0x540b7c){return{'top':_0x51ee71['bottom'],'left':_0x51ee71['left']-(_0x540b7c['width']-_0x51ee71['width']),'name':'arrowless','config':{'withArrow':!0x1}};}function Un(_0xd1dcf1,_0x2d091b,_0x5666a7){switch(_0xd1dcf1){case'applySuggestion':return i(_0x2d091b,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x5666a7);case'showChangeInText':return i(_0x2d091b,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x5666a7);case'insertSuggestion':return i(_0x2d091b,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x5666a7);}}function Rn(_0x368c77,_0x4e9ba1,_0x1a92a9){switch(_0x368c77){case'applySuggestion':return i(_0x4e9ba1,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x1a92a9);case'showChangeInText':return i(_0x4e9ba1,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP',_0x1a92a9);case'insertSuggestion':return i(_0x4e9ba1,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP',_0x1a92a9);}}class ni extends _0x49ef7b(){['_connector'];['_availableModels'];['_defaultModelId'];['_modelList']=[];constructor({connector:_0x131280,availableModels:_0x1078e9,defaultModelId:_0x532782}){super(),this['_connector']=_0x131280,this['_availableModels']=_0x1078e9,this['_defaultModelId']=_0x532782;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x26a1ff=this['_connector']['getModels'](),_0x4ec382=await _0x26a1ff['list']();this['_modelList']=_0x4ec382['items'];}catch(_0x546023){throw new _0x5b2487('ai-models-unable-to-retrieve',null,{'error':_0x546023});}return[...this['_modelList']];}async['getAvailableModels'](){const _0x3398d7=await this['getAll']();return this['_filterModels'](_0x3398d7,this['_availableModels']);}async['getModel'](_0x1cc4bf){const _0x49eb99=await this['getAll']();if(!_0x49eb99['length'])return null;if(_0x1cc4bf){const _0x30795b=this['_getModelById'](_0x49eb99,_0x1cc4bf);if(_0x30795b)return _0x30795b;_0x5ace8a('ai-chat-model-id-unrecognized',{'modelId':_0x1cc4bf,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x591141=await this['getAvailableModels']();if(!_0x591141['length'])return null;if(this['_defaultModelId']){const _0x3cd3a3=this['_getModelById'](_0x591141,this['_defaultModelId']);if(_0x3cd3a3)return _0x3cd3a3;_0x5ace8a('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x591141[0x0]['id']});}return _0x591141[0x0];}async['isAvailable'](_0x53cfe2){return(await this['getAvailableModels']())['some'](_0x36b16d=>_0x36b16d['name']===_0x53cfe2['name']&&_0x36b16d['provider']===_0x53cfe2['provider']);}['_filterModels'](_0x5372d0,_0x1bd420){let _0x267092;if(_0x1bd420){_0x267092=[];const _0x47927b='string'==typeof _0x1bd420?[_0x1bd420['toLocaleLowerCase']()]:_0x1bd420['map'](_0x39e819=>_0x39e819['toLocaleLowerCase']());for(const _0x11bf6e of _0x47927b)for(const _0x4ed791 of _0x5372d0)(_0x4ed791['id']['toLocaleLowerCase']()===_0x11bf6e||_0x4ed791['name']['toLocaleLowerCase']()===_0x11bf6e||$e(_0x4ed791)&&'auto'===_0x11bf6e||_0x4ed791['provider']['toLocaleLowerCase']()===_0x11bf6e||_0x4ed791['id']['toLocaleLowerCase']()['startsWith'](_0x11bf6e))&&_0x267092['push'](_0x4ed791);}else _0x267092=_0x5372d0;return _0x267092;}['_getModelById'](_0x29ecb2,_0x1e1a70){return _0x29ecb2['find'](_0x4d7800=>$e(_0x4d7800)&&'auto'===_0x1e1a70?_0x4d7800:_0x4d7800['id']===_0x1e1a70)||null;}static['getLocalized'](_0x2e28ee,_0x5147ea){return _0x5147ea['map'](_0xe1e7de=>{if($e(_0xe1e7de))_0xe1e7de['name']=i(_0x2e28ee,'AI_MODEL_NAME_AUTO'),_0xe1e7de['description']=i(_0x2e28ee,'AI_MODEL_DESCRIPTION_AUTO');else i(_0x2e28ee,'AI_MODEL_DESCRIPTION_'+_0xe1e7de['id']['toUpperCase']())['startsWith']('AI_MODEL_DESCRIPTION_')||(_0xe1e7de['description']=i(_0x2e28ee,'AI_MODEL_DESCRIPTION_'+_0xe1e7de['id']['toUpperCase']()));return _0xe1e7de;});}}function $e(_0x680b60){return _0x680b60['id']['startsWith']('agent');}class Et extends ni{async['getAll'](){return(await super['getAll']())['sort']((_0x36e582,_0x5e09bd)=>{const _0x4ce9fd=Object['values'](_0x36e582['capabilities'])['filter'](_0x36fece=>_0x36fece['enabled'])['length'];return Object['values'](_0x5e09bd['capabilities'])['filter'](_0x503c07=>_0x503c07['enabled'])['length']-_0x4ce9fd;});}}function rt({editor:_0x140f22,interaction:_0x179b5d,reply:_0x45743d,groups:_0x2325a9,transform:_0x2866af,documentCompare:_0x5dbd0d,documentCompareOptions:_0x56be0a}){const _0x466546=_0x179b5d['getDocumentContext']();if(!_0x466546)return[];const _0x169459=_0x466546['content'],_0x230f0a=_0x466546['version'],_0x5c6730=_0x45743d['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x129966}of _0x2325a9){const _0x2eaba5=_0x129966['filter'](_0x18cdcc=>'new'!=_0x18cdcc['type'])['map'](_0x24623e=>Nt('data-id',_0x24623e['id'],_0x5c6730)),_0x413e9b=_0x129966['filter'](_0x44e6a7=>'removed'!=_0x44e6a7['type'])['map'](_0x4d8790=>_0x4d8790['node']['cloneNode'](!0x0));let _0x159e40=null;if(_0x2eaba5['length']){_0x159e40=_0x2eaba5[0x0]['previousSibling'];for(let _0x27a5db=0x0;_0x27a5db<_0x2eaba5['length'];_0x27a5db++)_0x2efcb7(_0x2eaba5[_0x27a5db]);}if(_0x413e9b['length']){_0x159e40||(_0x129966[0x0]['anchorId']?_0x159e40=Nt('data-id',_0x129966[0x0]['anchorId'],_0x5c6730):(_0x159e40=_0x413e9b['shift'](),_0x5799cf(_0x5c6730,_0x159e40)));for(let _0x18a019=0x0;_0x18a019<_0x413e9b['length'];_0x18a019++)_0x326e1b(_0x159e40,_0x413e9b[_0x18a019]),_0x159e40=_0x413e9b[_0x18a019];}}const _0x4ccb53=xt(_0x5c6730),_0x2b42cb=_0x5dbd0d['getDiff'](_0x169459,_0x4ccb53,_0x56be0a)['getOperations']();if(_0x2866af){const _0x131425=_0x140f22['model']['document']['history']['getOperations'](_0x230f0a),_0x565bf6={'document':_0x140f22['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return ut(_0x2b42cb,_0x131425,_0x565bf6)['operationsA'];}return _0x2b42cb;}function ot(_0x48002b,_0xf4ef28){if('marker'!=_0xf4ef28['type'])return;const _0x49dc47=_0x48002b['model']['markers']['get'](_0xf4ef28['name']);_0x49dc47&&(_0xf4ef28['oldRange']=_0x49dc47['getRange']());}class Vr extends _0x5aa8e0{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x12295d,_0x13f1fb={},_0x4bfca7){super(_0x12295d),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x13f1fb};const _0x4660fc=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x4660fc?'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'](_0x4bfca7),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 _0x23f64b(this['locale']),this['likeButton']['set']({'icon':_0x17e08c,'label':i(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0xbba167=>!_0xbba167),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x23f64b(this['locale']),this['dislikeButton']['set']({'icon':_0x1f016c,'label':i(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x174971=>!_0x174971),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x23f64b(this['locale']),this['copyButton']['set']({'icon':_0x35a582,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x598d9f=>!_0x598d9f);const _0x35d230=new _0x285b99();_0x35d230['set']({'content':_0x1fb727}),_0x35d230['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'](_0x35d230);}['_setupShowChangesButton'](_0x14e2e5){this['showChangesButton']=new _0x23f64b(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':_0x14e2e5}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x54fa53=>!_0x54fa53),this['showChangesButton']['on']('execute',()=>{const _0x41d11b=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x41d11b,'icon':_0x41d11b?_0x3c5bb2:tt}),this['fire']('toggleShowChanges',_0x41d11b);});}}class Lr extends _0x1fbe2f{['showChangesToggleView'];constructor(_0x493882,_0x2896f5){super(_0x493882),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Qr(_0x493882),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x493882,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x2896f5['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x4f2083=>_0x4f2083?_0x44b5c0:_0x573537),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x411e81=new _0x285b99();_0x411e81['content']=_0x5d66c2,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x2896f5['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x411e81,{'tag':'span','children':[i(_0x493882,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Qr extends _0x23f64b{['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(_0x14806a){this['options']={'delay':_0x14806a['delay']??0x14,'textNodeStyle':_0x14806a['textNodeStyle'],'onStreamUpdate':_0x14806a['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x4a4430,targetElement:_0x534b97,abortSignal:_0x355442}){this['isStreaming']&&this['stop'](),_0x355442?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x586262(_0x4a4430,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0x5ace8a('ai-html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x313b0b=0x0;_0x313b0b<this['currentIndex'];_0x313b0b++)this['nodesList'][_0x313b0b]['shouldBeStreamed']=!0x0;let _0x222e9e=0x0;for(let _0x3da716=this['currentIndex'];_0x3da716<this['nodesList']['length'];_0x3da716++){const _0x58d551=Date['now'](),_0x5d83be=this['nodesList'][_0x3da716],_0x5b4922=_0x58d551-_0x222e9e;_0x5d83be['shouldBeStreamed']=!0x0;let _0x515c1c=_0x5d83be['parent'];for(;_0x515c1c;)_0x515c1c['shouldBeStreamed']=!0x0,_0x515c1c=_0x515c1c['parent'];if(_0x5b4922<this['options']['delay'])try{const {promise:_0x83d3bb,abortController:_0xcad8b3}=br(this['options']['delay']-_0x5b4922);this['timeoutAbortController']=_0xcad8b3,await _0x83d3bb;}catch(_0x18e576){return;}_0xb5422d(_0x534b97,'<'+_0x534b97['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x534b97['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x3da716,_0x222e9e=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x429288}){Array['from'](_0x429288['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x531242=>{_0x531242['replaceWith'](_0x531242['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x65fc23){let _0x44a510='';if(function(_0x946f40){return _0x10a30b(_0x946f40);}(_0x65fc23)){for(const _0x36ddd6 of _0x65fc23['children'])_0x44a510+=this['renderNode'](_0x36ddd6);}else{if(pr(_0x65fc23)){if(!_0x65fc23['shouldBeStreamed'])return'';const _0x28af76=_0x65fc23,_0x4774f0=Object['entries'](_0x28af76['attribs'])['map'](([_0x7b3c9a,_0x25aa39])=>_0x7b3c9a+'=\x22'+_0x25aa39+'\x22')['join']('\x20');_0x44a510+='<'+_0x28af76['tagName']+(_0x4774f0?'\x20'+_0x4774f0:'')+'>';for(const _0x445210 of _0x304494(_0x28af76))_0x44a510+=this['renderNode'](_0x445210);_0x44a510+='</'+_0x28af76['tagName']+'>';}else{if(!dr(_0x65fc23))return'';if(!_0x65fc23['shouldBeStreamed'])return'';!function(_0x310794){if(!_0x310794['parent']||!pr(_0x310794['parent']))return!0x1;if(!ar['includes'](_0x310794['parent']['tagName']))return!0x1;return!_0x233945(_0x310794)['match'](/^\s*[<>]\s*$/);}(_0x65fc23)?_0x44a510+=_0x6c271b(_0x65fc23):_0x44a510+=_0x6c271b(new _0x3bfaba('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x65fc23]));}}return _0x44a510;}['getParsedDocumentNodeList'](){const _0xb63def=[];return function(_0x3add64,_0x3838eb){const _0x2bee4a=_0x4ae889=>{if(_0x3838eb(_0x4ae889),_0x4ae889 instanceof _0x41a8e)for(let _0x3f7dd7=0x0;_0x3f7dd7<_0x4ae889['children']['length'];_0x3f7dd7++){const _0x1f3c40=_0x4ae889['children'][_0x3f7dd7];_0x2bee4a(_0x1f3c40);}};for(let _0x403d8e=0x0;_0x403d8e<_0x3add64['children']['length'];_0x403d8e++)_0x2bee4a(_0x3add64['children'][_0x403d8e]);}(this['document'],_0x24082b=>{if(dr(_0x24082b)){const _0x330c91=this['splitTextNodeIntoWordNodes'](_0x24082b);_0x330c91['length']&&_0xb63def['push'](..._0x330c91);}_0x24082b['isWordSplitSource']||_0x24082b['isWordSplitResult']||_0xb63def['push'](_0x24082b);}),_0xb63def;}['splitTextNodeIntoWordNodes'](_0xaad248){if(_0xaad248['isWordSplitSource']||_0xaad248['isWordSplitResult'])return[];const _0x1c7a61=_0x233945(_0xaad248)['match'](/(?:\s*\S+\s*)/g),_0x43364b=[];if(_0x1c7a61&&_0x1c7a61['length']>0x1){for(const _0x610eaa of _0x1c7a61){const _0x240343=new _0xb8da44(_0x610eaa);_0x240343['isWordSplitResult']=!0x0,_0x15b0b3(_0xaad248,_0x240343),_0x43364b['push'](_0x240343);}_0xaad248['isWordSplitSource']=!0x0,_0x2efcb7(_0xaad248);}return _0x43364b;}}const ar=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function dr(_0x8d0ccc){return _0x590eb2(_0x8d0ccc);}function pr(_0x1e36d9){return _0x184c31(_0x1e36d9);}function br(_0x1c4960){const _0x479681=new AbortController();return{'promise':new Promise((_0x313d71,_0x16dc0c)=>{const _0x2825e7=setTimeout(_0x313d71,_0x1c4960);_0x479681['signal']['addEventListener']('abort',()=>{clearTimeout(_0x2825e7),_0x16dc0c();});}),'abortController':_0x479681};}const Ee=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class na extends _0x1fbe2f{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x40f823,{part:_0x48b043,uiIndex:_0x1fd082,areActionsDisabled:_0x43689d,availableActions:_0x20bce8}){super(_0x40f823),this['set']('partDefinition',_0x48b043),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x26faf9=>'pending'==_0x26faf9&&!_0x43689d),this['children']=this['createCollection'](),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Bn(_0x40f823,{'part':_0x48b043,'uiIndex':_0x1fd082,'availableActions':_0x20bce8}),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 _0x1dbe08=this['bindTemplate'];this['contentView']=new _0x1fbe2f(),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',_0x1dbe08['to']('state',_0x1c5fc8=>'ck-ai-suggestion__body__content-part_'+_0x1c5fc8),_0x1dbe08['to']('isEnabled',_0x587f40=>_0x587f40?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x1dbe08['if']('isVisible','ck-hidden',_0x8532b3=>!_0x8532b3)]},'children':this['children'],'on':{'mouseenter':_0x1dbe08['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x48b043['index']});}),'mouseleave':_0x1dbe08['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x48b043['index']});})}});}async['updateContent']({part:_0x4b4860,renderingStrategy:_0x38e63e,showUnchangedParts:_0x179bc0=!0x1,abortSignal:_0x430966}){this['partDefinition']=_0x4b4860,this['isVisible']=this['partDefinition']['hasChanges']||_0x179bc0,this['isVisible']&&('streaming'===_0x38e63e?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x430966}):this['contentView']['element']['innerHTML']=xt(this['partDefinition']['content']));}['toggleHeader'](_0x493c2e){_0x493c2e?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Bn extends _0x1fbe2f{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];['_iconStateOutdated'];constructor(_0x3860f5,{part:_0x4a9e16,uiIndex:_0x48f137,availableActions:_0x43ef46}){super(_0x3860f5),this['set']('partDefinition',_0x4a9e16),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x193484=new _0x285b99();_0x193484['content']=_0x1db00b,_0x193484['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x2aca70=[];if(_0x43ef46['includes']('showChangeInText')){const _0x5dcda0=new _0x23f64b(_0x3860f5);_0x5dcda0['set']({'label':i(_0x3860f5,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x61e054}),_0x5dcda0['bind']('isEnabled')['to'](this),_0x5dcda0['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x4a9e16['index']});}),_0x2aca70['push'](_0x5dcda0);}if(_0x43ef46['includes']('insertSuggestion')){const _0x3f2b48=new _0x23f64b(_0x3860f5);_0x3f2b48['set']({'label':i(_0x3860f5,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x163e8a}),_0x3f2b48['bind']('isEnabled')['to'](this),_0x3f2b48['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x4a9e16['index']});}),_0x2aca70['push'](_0x3f2b48);}const _0x2a56fc=new _0x23f64b(_0x3860f5);_0x2a56fc['set']({'label':i(_0x3860f5,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x52a4f2}),_0x2a56fc['bind']('isEnabled')['to'](this),_0x2a56fc['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x4a9e16['index']});}),_0x2aca70['push'](_0x2a56fc),this['_toolbarView']=new _0x5aa8e0(_0x3860f5),this['_toolbarView']['items']['addMany'](_0x2aca70),this['_iconStateAccepted']=new _0x285b99(),this['_iconStateAccepted']['content']=_0x94b735,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':i(_0x3860f5,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x285b99(),this['_iconStateRejected']['content']=_0x3e809b,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':i(_0x3860f5,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}}),this['_iconStateOutdated']=new _0x285b99(),this['_iconStateOutdated']['content']=_0x3e809b,this['_iconStateOutdated']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-outdated'],'data-cke-tooltip-text':i(_0x3860f5,'AI_SUGGESTION_CONTENT_PART_OUTDATED'),'data-cke-tooltip-position':'n'}});const _0x3d5dfe=new _0x1fbe2f(_0x3860f5);_0x3d5dfe['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x3860f5,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x48f137['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x193484,_0x3d5dfe,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',(_0x1a3ec5,_0x4b4312,_0x205c32,_0x18fd6c)=>{switch(_0x18fd6c){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(_0x205c32){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 _0x49ef7b(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x39e501){const _0x992fb4=this['createTask'](_0x39e501);return this['queue']['push'](_0x992fb4),this['_processQueue'](),_0x992fb4['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(_0x246797=>{this['once']('_queueEmpty',()=>{_0x246797();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x4670bc=this['queue']['shift']();try{await _0x4670bc['callback'](this['_abortController']['signal']),_0x4670bc['resolve']();}catch(_0x2de9ac){_0x4670bc['reject'](_0x2de9ac);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x527006){let _0x4bad5f,_0x32d66b;const _0x1681ea=new Promise((_0x18fda,_0x58bd6f)=>{_0x4bad5f=_0x18fda,_0x32d66b=_0x58bd6f;});return{'callback':_0x527006,'resolve':_0x4bad5f,'reject':_0x32d66b,'completePromise':_0x1681ea};}}class Fr extends _0x1fbe2f{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x87c6f){super();const _0x572da1=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']=_0x87c6f,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x572da1['if']('isDone','ck-ai-chat__feed__item_done'),_0x572da1['if']('isVisible','ck-hidden',_0xbe0a2b=>!_0xbe0a2b),'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'](_0x51a58e=>{_0x51a58e['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x39f0fe,_0x1e0920,_0x25778a){await this['htmlStreamer']['stream']({'document':_0x39f0fe,'targetElement':_0x1e0920,'abortSignal':_0x25778a});}}class Me extends Fr{constructor(_0x54afd2){super(_0x54afd2),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-error','warning'===_0x54afd2['level']?'ck-ai-chat-error_warning':'']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x235855){this['element']['innerHTML']=_0x235855;}}class Dr extends _0x1fbe2f{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x1faeb8,_0xe79c48){super(_0x1faeb8);const {areActionsDisabled:_0x45c145,showUnchangedParts:_0x4f2e57,availableActions:_0x19f3b6}=_0xe79c48;this['_areActionsDisabled']=_0x45c145,this['_showUnchangedParts']=_0x4f2e57,this['_availableActions']=_0x19f3b6,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new st(),this['_emptyPartsWarningView']=new Me({'id':'empty-parts-warning','initialContent':i(_0x1faeb8,'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:_0x541e66,renderingStrategy:_0x399851,abortSignal:_0x518760}){this['_children']['length']?_0x541e66['forEach'](_0x510835=>{const _0x3aaef8=this['_cachedContentParts']['findIndex'](_0x1ff752=>_0x1ff752['index']==_0x510835['index']);-0x1===_0x3aaef8?this['_cachedContentParts']['push'](_0x510835):this['_cachedContentParts'][_0x3aaef8]=_0x510835;}):this['_cachedContentParts']=_0x541e66;for(const _0x17c85d of _0x541e66['filter'](_0x519a11=>_0x519a11['hasChanges']))this['_updateContentPartsPromiseQueue']['enqueue'](async _0x586fe8=>{let _0x58a1ad=this['getPartView'](_0x17c85d['index']);_0x58a1ad||(_0x58a1ad=new na(this['locale'],{'part':_0x17c85d,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x58a1ad['delegate'](...Ee)['to'](this),this['_children']['add'](_0x58a1ad),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x58a1ad['toggleHeader'](this['_children']['length']>0x1),await _0x58a1ad['updateContent']({'part':_0x17c85d,'renderingStrategy':_0x399851,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x586fe8});});return _0x518760?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x153058,_0x32fe58){const _0x3e1046=this['getPartView'](_0x153058);_0x3e1046&&(_0x3e1046['state']=_0x32fe58),this['hasPendingParts']='pending'==_0x32fe58||Array['from'](this['_children'])['some'](_0x56a5b0=>'pending'==_0x56a5b0['state']);}['getPartView'](_0x2a5683){return this['_children']['find'](_0x3599cf=>_0x3599cf['partDefinition']['index']==_0x2a5683)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0xd5bd6f=!this['_cachedContentParts']['find'](({hasChanges:_0x537092})=>_0x537092),_0x478626=!!this['_cachedContentParts']['find'](({hasChanges:_0x1b6e2f})=>!_0x1b6e2f);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x478626,_0xd5bd6f?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'](_0x31e943=>_0x31e943['partDefinition']['hasChanges']);}}class Si extends _0x33e627{constructor(_0x18a1a7=void 0x0){super();const _0x448a92=_0x18a1a7?'ck-ai-spinner_'+_0x18a1a7:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x448a92]}});}}class F extends _0x1fbe2f{['bodyView'];['miniToolbarView'];['children'];['headerView'];['loaderView'];['errorView'];['sourcesView'];constructor(_0x287551,_0x3b7040){super(_0x287551);const {showDiff:_0x185842,areActionsDisabled:_0x1a65f5,miniToolbarConfig:_0x1d1828,hideHeader:_0xef70e6,showLoader:_0x5a1968,showUnchangedParts:_0x203c34,availableActions:_0xccbdee}=_0x3b7040;this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x5a1968),this['set']('isErrorVisible',!0x1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0xef70e6||(this['headerView']=new Lr(_0x287551,{'showDiff':_0x185842}),this['headerView']['on']('toggleShowChanges',(_0x56c13e,_0x55c0f8)=>{this['areChangesVisible']=_0x55c0f8['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x55c0f8['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new Dr(_0x287551,{'areActionsDisabled':_0x1a65f5,'showUnchangedParts':!!_0x203c34,'availableActions':_0xccbdee}),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 Vr(_0x287551,_0x1d1828,_0x185842),this['miniToolbarView']['delegate'](...Ee)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x1b475e,_0x391bcf)=>{this['areChangesVisible']=_0x391bcf,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x391bcf});}),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']),_0x5a1968&&(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'](_0x6c6800){await this['bodyView']['updateContentParts'](_0x6c6800);}['updateSources'](_0x2d6c99){this['sourcesView']['children']['addMany'](_0x2d6c99['map'](_0x17d845=>new Rr(this['locale'],_0x17d845))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['showError'](_0x222b8c){if(this['errorView']){const _0x220cf=this['errorView']['element']?.['querySelector']('.ck-ai-suggestion__error-text');_0x220cf&&(_0x220cf['textContent']=_0x222b8c),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'](_0x2eb1bd){this['miniToolbarView']['items']['add'](_0x2eb1bd);}['removeNavigationItem'](_0x186f2b){this['miniToolbarView']['items']['remove'](_0x186f2b);}['_createLoaderView'](){const _0x4502d0=new _0x1fbe2f(this['locale']),_0xb3e104=new Si('small');_0xb3e104['isVisible']=!0x0;const _0x4b0cdd=new _0x1fbe2f(this['locale']);return _0x4b0cdd['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[i(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x4502d0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x5adce9=>!_0x5adce9)]},'children':[_0xb3e104,_0x4b0cdd]}),_0x4502d0;}['_createErrorView'](){const _0x239ef0=new _0x1fbe2f(this['locale']),_0x396308=new _0x1fbe2f(this['locale']);return _0x396308['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[i(this['locale'],'AI_CHAT_GENERIC_ERROR')]}),_0x239ef0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x54d9a4=>!_0x54d9a4)]},'children':[_0x396308]}),_0x239ef0;}}class Sr extends _0x1fbe2f{['children'];constructor(_0x5f56dc){super(_0x5f56dc),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',_0x43cae5=>!_0x43cae5)]},'children':this['children']});const _0xccf79b=new _0x1fbe2f(this['locale']),_0x32e5cb=new _0x285b99();_0x32e5cb['content']=_0x3aa839,_0xccf79b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x32e5cb,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0xccf79b);}}class Rr extends _0x23f64b{constructor(_0x27f536,_0x3cd564){super(_0x27f536),this['set']({'label':_0x3cd564['title'],'tooltip':_0x3cd564['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0xfb50cb=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0xfb50cb['to'](()=>{window['open'](_0x3cd564['url'],'_blank');})}}),_0x3cd564['favicon']){const _0x3aa9da=new _0x1fbe2f(_0x27f536);_0x3aa9da['setTemplate']({'tag':'img','attributes':{'src':_0x3cd564['favicon']||_0x3aa839,'alt':_0x3cd564['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x3aa9da);}else this['set']('icon',_0x3aa839);}}class cs extends _0x5aa8e0{constructor(_0xa68918,_0x135502=!0x0,_0x330c70=!0x0){super(_0xa68918),this['set']('isLoading',!0x1),_0x135502&&(this['applyButton']=this['_createButton'](i(_0xa68918,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x1716fd=>!_0x1716fd),this['items']['add'](this['applyButton'])),_0x330c70&&(this['suggestButton']=this['_createButton'](i(_0xa68918,'AI_BALLOON_SUGGEST_BUTTON'),_0x135502?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x8829df=>!_0x8829df),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x5ce1dc,_0x4189e7){const _0x478608=new _0x23f64b(this['locale']);return _0x478608['set']({'label':_0x5ce1dc,'class':_0x4189e7||'','isVisible':!0x0,'withText':!0x0}),_0x478608;}}class ls extends _0x1fbe2f{constructor(_0x572e09){super(_0x572e09),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(_0x572e09,'AI_DISCLAIMER_TEXT')}]}]});}}const B=['applySuggestion','insertSuggestion','showNext','showPrevious'];class D extends _0x1fbe2f{['focusTracker'];['keystrokes'];['focusCycler'];['_availableActions'];['_focusables'];['_errorView'];constructor(_0x350870,_0x343270,_0x2cbff4,_0x5c97d6){super(_0x350870),this['_availableActions']=_0x2cbff4,this['set']('isLoading',!0x1),this['set']('isTrackChangesOn',_0x5c97d6),this['set']('isErrorVisible',!0x1),this['set']('errorMessage',''),this['focusTracker']=new _0x2cffef(),this['keystrokes']=new _0x46a36b(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x14e425({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0xa90262(),this['_addContentView'](_0x343270['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x343270['showApplyButton'],_0x343270['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'](_0x343270['showApplyButton'],_0x343270['showSuggestButton']);});}['render'](){super['render']();for(const _0x3f7ad2 of this['_focusables'])this['focusTracker']['add'](_0x3f7ad2['element']);this['keystrokes']['listenTo'](this['element']);}['focus'](_0x5d4cdb){-0x1===_0x5d4cdb?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['showError'](_0x573ae4){this['_errorView']||(this['_errorView']=this['_createErrorView'](),this['_dialogContent']['addMany']([this['_errorView']],0x0)),this['errorMessage']=_0x573ae4,this['isErrorVisible']=!0x0;}['hideError'](){this['isErrorVisible']=!0x1;}['showRecoverableError'](_0x415bc6){this['showError'](_0x415bc6);}['showBlockingError'](_0x4165df){this['showError'](_0x4165df),this['toolbar']&&(this['toolbar']['applyButton']&&(this['toolbar']['applyButton']['isEnabled']=!0x1),this['toolbar']['suggestButton']&&(this['toolbar']['suggestButton']['isEnabled']=!0x1));}['setupRotator'](_0x311fc5){const _0x1e93d4=this['_createNextButtonView'](),_0x5ea83d=this['_createPreviousButtonView']();_0x311fc5['view']['headerView']['children']['add'](_0x1e93d4,0x2),_0x311fc5['view']['headerView']['children']['add'](_0x5ea83d,0x0),this['_focusables']['addMany']([_0x1e93d4,_0x5ea83d]),this['focusTracker']['add'](_0x1e93d4['element']),this['focusTracker']['add'](_0x5ea83d['element']);}['_addContentView'](_0x4501cf){this['_mainView']=_0x4501cf,this['_dialogContent']['add'](this['_mainView']);}['updateContent'](_0x2b5240){const _0x3e6717=this['_dialogContent']['getIndex'](this['_mainView']);this['_dialogContent']['remove'](this['_mainView']),this['_mainView']=_0x2b5240,this['_dialogContent']['add'](this['_mainView'],_0x3e6717),this['hideError']();}['_addDisclaimerView'](){this['disclaimerView']=new ls(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x11958b=!0x0,_0x569f95=!0x0){_0x11958b=_0x11958b&&!this['isTrackChangesOn']&&this['_availableActions']['includes']('applySuggestion'),_0x569f95=_0x569f95&&this['_availableActions']['includes']('insertSuggestion'),this['toolbar']=new cs(this['locale'],_0x11958b,_0x569f95),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x1d5dc4=new _0x23f64b(this['locale']);return _0x1d5dc4['set']({'icon':_0x4742cd,'tooltip':i(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x1d5dc4['on']('execute',()=>{this['fire']('showNext');}),_0x1d5dc4;}['_createPreviousButtonView'](){const _0x1de9b2=new _0x23f64b(this['locale']);return _0x1de9b2['set']({'icon':_0x2875b9,'tooltip':i(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x1de9b2['on']('execute',()=>{this['fire']('showPrevious');}),_0x1de9b2;}['_createErrorView'](){const _0x4a10bb=new _0x1fbe2f(this['locale']),_0xd13608=new _0x1fbe2f(this['locale']);return _0xd13608['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('errorMessage')}]}),_0x4a10bb['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ai-balloon-error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x159f71=>!_0x159f71)]},'children':[_0xd13608]}),_0x4a10bb;}}const z=0xa;class it extends _0x5ac5c7{static get['requires'](){return[R,N];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['_isUpdatingMarkers']=!0x1;['_pendingRenderCallback']=null;['open'](_0x117e94){const _0x347530=q(this['context']);if(this['_config']=_0x117e94,this['isOpen'])return void this['_updateBalloon'](_0x117e94);const _0x4c955e=this['context']['config']['get']('ai.availableReplyActions')||[...H],_0x33d979=_0x347530?.['commands']['get']('trackChanges'),_0x398975=_0x33d979?.['value'];this['balloonView']=new D(_0x347530['locale'],_0x117e94,_0x4c955e,!!_0x398975),this['balloonView']['delegate'](...B)['to'](this),_0x33d979&&this['balloonView']['bind']('isTrackChangesOn')['to'](_0x33d979,'value'),this['_showDialog'](_0x117e94);}['close'](){q(this['context'])['plugins']['get']('Dialog')['hide']();}['_updateBalloon'](_0x52e8b9){const _0x106a61=q(this['context']),_0x14b9f7=_0x106a61['plugins']['get']('Dialog');this['_pendingRenderCallback']&&(_0x106a61['editing']['view']['off']('render',this['_pendingRenderCallback']),this['_pendingRenderCallback']=null),this['_isUpdatingMarkers']=!0x0,_0x14b9f7['view']?.['headerView']&&(_0x14b9f7['view']['headerView']['label']=_0x52e8b9['title'],_0x14b9f7['view']['headerView']['iconView']&&_0x52e8b9['icon']&&(_0x14b9f7['view']['headerView']['iconView']['content']=_0x52e8b9['icon'])),this['balloonView']['updateContent'](_0x52e8b9['mainView']),this['_setupVisualSelection'](_0x52e8b9['ranges'],_0x52e8b9['index']),this['_pendingRenderCallback']=()=>{this['_isUpdatingMarkers']=!0x1,this['_pendingRenderCallback']=null,_0x14b9f7['view']&&_0x14b9f7['view']['updatePosition']();},_0x106a61['editing']['view']['once']('render',this['_pendingRenderCallback']);}['_setupVisualSelection'](_0x175caa,_0x485a9d){this['context']['plugins']['get'](N)['showFakeVisualSelection'](_0x175caa,'ai-balloon-'+_0x485a9d,!0x0,!0x0);}['_showDialog'](_0x1ea979){const _0x5e1dd0=q(this['context']);this['_setupVisualSelection'](_0x1ea979['ranges'],_0x1ea979['index']);const _0x554b84=this['_getSelectionElements']();_0x554b84&&_0x554b84[0x0]&&_0x43244e({'target':_0x554b84[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),_0x5e1dd0['plugins']['get']('Dialog')['show']({'title':_0x1ea979['title'],'icon':_0x1ea979['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x1ea979['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x5cb955=>{_0x1ea979['showRotator']&&this['balloonView']['setupRotator'](_0x5cb955),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'](_0x5387a6,_0x2d7cb5){if(!_0x2d7cb5)return null;const _0x55fd24=this['_getSelectionElements']();if(!_0x55fd24||0x0===_0x55fd24['length'])return{'left':Math['round'](_0x2d7cb5['left']+_0x2d7cb5['width']/0x2-_0x5387a6['width']/0x2),'top':Math['round'](_0x2d7cb5['top']+_0x2d7cb5['height']/0x2-_0x5387a6['height']/0x2)};const _0x583528=Math['round'](_0x2d7cb5['left']+_0x2d7cb5['width']/0x2-_0x5387a6['width']/0x2),_0x23de53=new _0x1f7ba8(_0x55fd24[0x0]),_0x396977=new _0x1f7ba8(_0x55fd24[_0x55fd24['length']-0x1]),_0x366f67=_0x5387a6['height'],_0xc78de8=this['_config']['showRotator']?0x8:0x0;return{'left':_0x583528,'top':this['_calculateOptimalTopPosition'](_0x23de53,_0x396977,_0x366f67,_0xc78de8,_0x2d7cb5)};}['_calculateOptimalTopPosition'](_0xf64e31,_0x2fda28,_0x39fcba,_0x42b3a9=0x0,_0x40cf73){const _0x24d5fb=_0x39fcba+_0x42b3a9,_0x6b8ae2=new _0x1f7ba8(_0x221a5['window']),_0x49d9c7=[_0xf64e31['getVisible'](),_0x2fda28['getVisible']()]['filter'](_0x17d5ac=>_0x17d5ac),_0x4fe60a=_0x1f7ba8['getBoundingRect'](_0x49d9c7);if(!_0x4fe60a)return Math['round'](_0x40cf73['top']+_0x40cf73['height']/0x2);const _0xafa7f9=_0x6b8ae2['getIntersection'](_0x4fe60a);if(!_0xafa7f9)return Math['round'](_0x40cf73['top']+_0x40cf73['height']/0x2);const _0x19c216=_0x40cf73['getVisible'](),_0x3f1fac=_0x19c216&&_0x4fe60a['height']>_0x19c216['height'],_0x267315=_0xafa7f9['top'],_0x97afd0=_0xafa7f9['bottom'];if(_0x3f1fac){const _0x24fcd1=(_0x19c216||_0x6b8ae2)['height']/0x2-_0x24d5fb/0x2,_0xe59bbc=_0x267315-z-_0x40cf73['top'],_0x14d187=_0x40cf73['bottom']-_0x97afd0-z;return _0xe59bbc>=_0x24d5fb?Math['max'](z,_0x267315-_0x24d5fb-z):_0x14d187>=_0x24d5fb?_0x97afd0+z:Math['max'](z,_0x24fcd1);}const _0x47c2b8=_0x267315-_0x24d5fb,_0xf31dbb=_0x40cf73['bottom']-_0x97afd0-z,_0x4ef005=_0x267315-z-_0x40cf73['top'];let _0x6ea48f;if(_0xf31dbb>=_0x24d5fb)_0x6ea48f=_0x97afd0+z;else{if(_0x4ef005>=_0x24d5fb)_0x6ea48f=_0x47c2b8-z;else _0x6ea48f=_0x267315+_0x4fe60a['height']/0x2-_0x24d5fb/0x2;}return _0x6ea48f;}['_setupMarkerRemovalListener'](){const _0x596651=q(this['context']);this['listenTo'](_0x596651['model']['document'],'change',()=>{if(this['_isUpdatingMarkers'])return;for(const {name:_0x43479d,data:{newRange:_0x3e57eb}}of _0x596651['model']['document']['differ']['getChangedMarkers']())if(_0x43479d['startsWith']('ai-selection:')&&(_0x3e57eb&&(_0x3e57eb['start']['isEqual'](_0x3e57eb['end'])||'$graveyard'==_0x3e57eb['root']['rootName'])||null==_0x3e57eb)){const _0x53ef35=i(this['context']['locale'],'AI_ACTIONS_SELECTION_REMOVED_ERROR');this['balloonView']['showBlockingError'](_0x53ef35),this['fire']('selectionRemoved');}});}['_cleanupMarkerRemovalListener'](){const _0x57e4c7=q(this['context']);this['stopListening'](_0x57e4c7['model']['document']);}['_getSelectionElements'](){const _0x5937f7=q(this['context']);return _0x7efeec(_0x5937f7['editing'],[..._0x5937f7['model']['markers']['getMarkersGroup']('ai-selection'),..._0x5937f7['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class _t extends _0x5ac5c7{['_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 Et({'connector':this['_aiConnector'],'availableModels':this['context']['config']['get']('ai.chat.models.displayedModels'),'defaultModelId':this['context']['config']['get']('ai.chat.models.defaultModelId')});const _0x14c279=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x4d9052,_0x285b3a)=>{this['_handleUIUserMessage']({'userMessage':_0x285b3a});}),this['listenTo'](_0x14c279,'resizedTabs',(_0x55f07b,_0x5f58b3)=>{this['_setIsMaximized'](_0x5f58b3);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x14c279['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x5400c8,_0x43025f)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x43025f));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x5e5d5b,_0x4e3b5b)=>{this['activeConversation']?.['addUrlToContext'](_0x4e3b5b);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x30b2ca,_0x925359)=>{this['activeConversation']?.['addResourceToContext'](_0x925359['source'],_0x925359['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0xeed450,_0x2b793c)=>{this['_removeFromContext'](_0x2b793c);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x15e1ab,_0x2bcb4a)=>{this['activeConversation']?.['loadSourceResources'](_0x2bcb4a['sourceId'],_0x2bcb4a['query'],_0x2bcb4a['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x455f7a,_0x241caa)=>{this['activeConversation']?.['setModel'](_0x241caa);}),this['listenTo'](this['_aiChatUi'],'like',(_0x5b051d,{replyId:_0x2c0f38})=>{console['log']('Liked\x20response',_0x2c0f38);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x2750d5,{replyId:_0x401e79})=>{console['log']('Disliked\x20response',_0x401e79);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x5e75cd,_0x2fdcf4)=>{this['context']['plugins']['get'](it)['close'](),this['_insertSuggestion'](_0x2fdcf4);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x3d9953,{replyId:_0x44325e,partIndex:_0x506262})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x44325e,_0x506262);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x18f559,{replyId:_0x3fd91b,partIndex:_0x134a0e})=>{const _0x2b9d5e=this['_getDocumentRangeForReplyChanges'](_0x3fd91b,_0x134a0e);_0x2b9d5e&&'$graveyard'!=_0x2b9d5e['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x2b9d5e['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x5f4622,_0x545f6d)=>{this['context']['plugins']['get'](it)['close'](),this['_applySuggestion'](_0x545f6d);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x1637a0,{replyId:_0x955a3e,showDiff:_0x301d7e})=>{const {reply:_0x569ea4}=this['getInteractionAndReplyById'](_0x955a3e),_0x23749e=_0x569ea4['getContentParts']({'showDiff':_0x301d7e});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x569ea4['id'],'parts':_0x23749e,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x2bb3b7,{replyId:_0x50cc72,partIndex:_0x7eafc6})=>{this['_previewedChangeGroup']?.['replyId']==_0x50cc72&&this['_previewedChangeGroup']?.['partIndex']==_0x7eafc6&&this['context']['plugins']['get'](it)['close']();const {reply:_0x52667e}=this['getInteractionAndReplyById'](_0x50cc72);_0x52667e['setChangeGroupState'](_0x7eafc6,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof Ct?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x194e16,_0x219679)=>{_0x219679['on']('ready',()=>{this['_integrateEditor'](_0x219679);});}),await this['_startConversationSafely']();}['_insertSuggestion'](_0x215a9f){const _0x944fce=q(this['context']);if(!_0x944fce['plugins']['has']('TrackChanges'))throw new _0x5b2487('ai-no-track-changes',null);const _0x350e8b=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x38fe0b,interaction:_0x57a5ea}=this['getInteractionAndReplyById'](_0x215a9f['replyId']),_0x63a872=this['_getDocumentRangeForReplyChanges'](_0x215a9f['replyId'],_0x215a9f['partIndex']),_0x21e0e1=void 0x0!==_0x215a9f['partIndex']?[_0x38fe0b['changeGroups'][_0x215a9f['partIndex']]]:_0x38fe0b['changeGroups']['filter'](_0x48f970=>'pending'==_0x48f970['state']),_0x5cc9ff=_0x21e0e1['map'](_0x5f4bab=>_0x38fe0b['changeGroups']['indexOf'](_0x5f4bab));if(!_0x63a872||'$graveyard'==_0x63a872['range']['root']['rootName'])return void _0x5cc9ff['forEach'](_0x4974d1=>_0x38fe0b['setChangeGroupState'](_0x4974d1,'outdated'));_0x5cc9ff['forEach'](_0x539b8e=>_0x38fe0b['setChangeGroupState'](_0x539b8e,'accepted'));const _0x38f7d3=rt({'editor':_0x944fce,'reply':_0x38fe0b,'interaction':_0x57a5ea,'groups':_0x21e0e1,'transform':!0x0,'documentCompare':_0x350e8b,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x594e7c;_0x63a872&&this['_scrollToSuggestionRange'](_0x63a872['range']),_0x944fce['model']['change'](_0x5293a8=>{_0x594e7c=_0x5293a8['batch'],_0x944fce['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x38f7d3),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x594e7c,{'interactionId':_0x57a5ea['id'],'replyId':_0x38fe0b['id'],'indexes':_0x5cc9ff['slice']()}),this['_updateRatings'](_0x38fe0b);}['_applySuggestion'](_0x2d8583){const _0x1a9fe7=q(this['context']),_0x16ddb1=this['context']['plugins']['get'](nt),{reply:_0x415870,interaction:_0x4e9e4b}=this['getInteractionAndReplyById'](_0x2d8583['replyId']),_0x5c42cb=this['_getDocumentRangeForReplyChanges'](_0x2d8583['replyId'],_0x2d8583['partIndex']),_0x255738=void 0x0!==_0x2d8583['partIndex']?[_0x415870['changeGroups'][_0x2d8583['partIndex']]]:_0x415870['changeGroups']['filter'](_0x7ce5c2=>'pending'==_0x7ce5c2['state']),_0x142918=_0x255738['map'](_0x21318e=>_0x415870['changeGroups']['indexOf'](_0x21318e));if(!_0x5c42cb||'$graveyard'==_0x5c42cb['range']['root']['rootName'])return void _0x142918['forEach'](_0x331b68=>_0x415870['setChangeGroupState'](_0x331b68,'outdated'));_0x142918['forEach'](_0x111b1b=>_0x415870['setChangeGroupState'](_0x111b1b,'accepted'));const _0x501f86=rt({'editor':_0x1a9fe7,'reply':_0x415870,'interaction':_0x4e9e4b,'groups':_0x255738,'transform':!0x0,'documentCompare':_0x16ddb1,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x27fec4;_0x5c42cb&&this['_scrollToSuggestionRange'](_0x5c42cb['range']),_0x1a9fe7['model']['change'](_0xc6b3b7=>{_0x27fec4=_0xc6b3b7['batch'];for(const _0x47831a of _0x501f86)_0x47831a['baseVersion']=_0x1a9fe7['model']['document']['version'],ot(_0x1a9fe7,_0x47831a),_0xc6b3b7['batch']['addOperation'](_0x47831a),_0x1a9fe7['model']['applyOperation'](_0x47831a);}),this['_batchToChanges']['set'](_0x27fec4,{'interactionId':_0x4e9e4b['id'],'replyId':_0x415870['id'],'indexes':_0x142918['slice']()}),this['_updateRatings'](_0x415870);}['_openBalloonFor'](_0x3c87e5,_0x4454e8){const _0x4cca8a=q(this['context']),_0x2a7139=this['_getDocumentRangeForReplyChanges'](_0x3c87e5,_0x4454e8),_0x5285e9=this['context']['plugins']['get'](it);if(!_0x2a7139)return void _0x5285e9['close']();const {range:_0x5563e6,currentIndex:_0x3df9c1}=_0x2a7139;if('$graveyard'==_0x5563e6['root']['rootName']){const {reply:_0x54c1a5}=this['getInteractionAndReplyById'](_0x3c87e5);return _0x54c1a5['setChangeGroupState'](_0x3df9c1,'outdated'),void _0x5285e9['close']();}if(this['_previewedChangeGroup']?.['replyId']==_0x3c87e5&&this['_previewedChangeGroup']?.['partIndex']==_0x3df9c1)return;this['stopListening'](_0x5285e9),this['_previewedChangeGroup']={'replyId':_0x3c87e5,'partIndex':_0x3df9c1};let _0x276669=_0x4cca8a['config']['get']('ai.availableReplyActions')||[...H];_0x4cca8a['plugins']['has']('TrackChanges')||(_0x276669=_0x276669['filter'](_0x536f6a=>'insertSuggestion'!=_0x536f6a));const _0x273e91=new F(_0x4cca8a['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0,'availableActions':_0x276669});this['stopListening'](_0x273e91);const {reply:_0x5dedab}=this['getInteractionAndReplyById'](_0x3c87e5),_0x3a15f7=_0x5dedab['getContentParts']({'showDiff':this['_balloonShowDiff']})['filter'](_0x38b065=>_0x38b065['hasChanges']),_0x1e2304=_0x3a15f7['findIndex'](_0x27b530=>_0x27b530['index']==_0x3df9c1);if(-0x1==_0x1e2304)return;const _0x595753=_0x3a15f7[_0x1e2304],_0x354914=_0x3a15f7['at']((_0x1e2304-0x1)%_0x3a15f7['length'])?.['index'],_0x523514=_0x3a15f7['at']((_0x1e2304+0x1)%_0x3a15f7['length'])?.['index'];_0x273e91['updateContent']({'parts':[_0x595753],'renderingStrategy':'static'});const _0x4951fd=_0x3df9c1!==_0x354914;this['_scrollToSuggestionRange'](_0x5563e6,!0x0),_0x5285e9['open']({'index':_0x3df9c1,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x1e2304+0x1)['toString']()),'icon':Ut,'mainView':_0x273e91,'showRotator':_0x4951fd,'showApplyButton':!0x0,'showSuggestButton':_0x4cca8a['plugins']['has']('TrackChanges'),'ranges':[_0x5563e6]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x3c87e5,_0x3df9c1),this['listenTo'](_0x273e91,'toggleSuggestionDisplayMode',(_0xcb7b39,{showDiff:_0x45903d})=>{this['_balloonShowDiff']=_0x45903d;const {reply:_0x4e00eb}=this['getInteractionAndReplyById'](_0x3c87e5),_0x244962=_0x4e00eb['getContentParts']({'showDiff':_0x45903d,'groupIndex':_0x3df9c1});_0x273e91['updateContent']({'parts':_0x244962,'renderingStrategy':'static'});}),this['listenTo'](_0x5285e9,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x3c87e5,'partIndex':_0x3df9c1}),_0x4951fd?this['_openBalloonFor'](_0x3c87e5,_0x523514):_0x5285e9['close']();}),this['listenTo'](_0x5285e9,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x3c87e5,'partIndex':_0x3df9c1}),_0x4951fd?this['_openBalloonFor'](_0x3c87e5,_0x523514):_0x5285e9['close']();}),_0x4951fd&&(this['listenTo'](_0x5285e9,'showNext',()=>{this['_openBalloonFor'](_0x3c87e5,_0x523514);}),this['listenTo'](_0x5285e9,'showPrevious',()=>{this['_openBalloonFor'](_0x3c87e5,_0x354914);})),this['listenTo'](_0x5285e9,'dialogClosed',()=>{this['stopListening'](_0x5285e9),this['stopListening'](_0x273e91),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x321710,_0x1603ad){const _0x58e354=q(this['context']),{reply:_0x56182f,interaction:_0x228731}=this['getInteractionAndReplyById'](_0x321710),_0x13a23e=_0x56182f['changeGroups']['filter'](_0x46209e=>'pending'==_0x46209e['state']),_0x1f160e=_0x13a23e['map'](_0x380159=>_0x56182f['changeGroups']['indexOf'](_0x380159));void 0x0===_0x1603ad&&(_0x1603ad=_0x1f160e[0x0]);const _0x59f337=_0x1f160e['indexOf'](_0x1603ad);if(-0x1==_0x59f337)return null;const _0x2811a1=_0x13a23e[_0x59f337],_0x523a3b=new Mt([]),_0x2292b4=new Mt([]);for(const _0x4569c3 of _0x2811a1['changes'])if('removed'!=_0x4569c3['type']&&_0x2292b4['children']['push'](_0x4569c3['node']['cloneNode'](!0x0)),'new'!=_0x4569c3['type']){const _0x44ad0d=Ot(_0x119617=>bt(_0x119617,'data-id')==_0x4569c3['id'],_0x56182f['documentContextContent'],!0x0);_0x523a3b['children']['push'](_0x44ad0d['cloneNode'](!0x0));}if(0x0==_0x523a3b['children']['length']){if(_0x2811a1['changes'][0x0]['anchorId']){const _0x2bcb4c=Nt('data-id',_0x2811a1['changes'][0x0]['anchorId'],_0x56182f['documentContextContent']);_0x523a3b['children']['unshift'](_0x2bcb4c['cloneNode'](!0x0)),_0x2292b4['children']['unshift'](_0x2bcb4c['cloneNode'](!0x0)),_0x2bcb4c['nextSibling']&&(_0x523a3b['children']['push'](_0x2bcb4c['nextSibling']['cloneNode'](!0x0)),_0x2292b4['children']['push'](_0x2bcb4c['nextSibling']['cloneNode'](!0x0)));}else{const _0x56ab96=_0x56182f['documentContextContent']['children'][0x0];if(!_0x56ab96)return null;_0x523a3b['children']['push'](_0x56ab96['cloneNode'](!0x0)),_0x2292b4['children']['push'](_0x56ab96['cloneNode'](!0x0));}}const _0xf5a67c=_0x228731['getDocumentContext'](),_0x2d968e=_0x58e354['data']['parse'](_0xf5a67c['content']),_0x3888ca=xt(_0x523a3b),_0x74d29a=_0x58e354['data']['parse'](_0x3888ca),_0x751cc8=_0x58e354['data']['parse'](_0x3888ca),_0xb92c1e=_0x58e354['model']['createPositionAt'](_0x74d29a,0x0),_0x238ef4=xt(_0x2292b4),_0x2ba95e={'anchor':_0xb92c1e,'markDeletions':!0x1},_0x93bd68=_0x58e354['plugins']['get'](nt)['getDiff'](_0x3888ca,_0x238ef4,_0x2ba95e)['getOperations']();if(!_0x93bd68['length'])return null;_0x58e354['model']['change'](_0xd143e7=>{for(const _0x4c23f2 of _0x93bd68)if('remove'==_0x4c23f2['type']){const _0x4a172a=_0x4c23f2['sourcePosition'],_0x215c7c=_0x4c23f2['howMany'],_0x3698d3=new lt(_0x4a172a,_0x215c7c);_0xd143e7['batch']['addOperation'](_0x3698d3),_0x58e354['model']['applyOperation'](_0x3698d3);}else'marker'!==_0x4c23f2['type']&&(_0x4c23f2['baseVersion']=null,_0x4c23f2['isDocumentOperation']=!0x1,_0xd143e7['batch']['addOperation'](_0x4c23f2),_0x58e354['model']['applyOperation'](_0x4c23f2));});const _0xe59a85=Dt(_0x58e354,_0x93bd68,_0x74d29a);Rt(_0x58e354['model'],_0xe59a85);const _0x7fa9c7=_0xe59a85['getFirstRange']()['start']['path']['slice'](),_0x42d897=_0xe59a85['getFirstRange']()['end']['path']['slice'](),_0x5987d9=[];let _0x32a1b0=_0x74d29a,_0x3b8c96=_0x751cc8;for(let _0x3a1693=0x0;_0x3a1693<_0x42d897['length'];_0x3a1693++){const _0x6dd066=_0x32a1b0['maxOffset']-_0x42d897[_0x3a1693];_0x5987d9[_0x3a1693]=_0x3b8c96['maxOffset']-_0x6dd066,_0x32a1b0=_0x32a1b0['getChildAtOffset'](_0x42d897[_0x3a1693]),_0x3b8c96=_0x3b8c96['getChildAtOffset'](_0x5987d9[_0x3a1693]);}const _0x5ca742=_0x58e354['model']['createRange'](_0x58e354['model']['createPositionFromPath'](_0x751cc8,_0x7fa9c7),_0x58e354['model']['createPositionFromPath'](_0x751cc8,_0x5987d9)),_0x5ad105=_0x751cc8['getChild'](0x0)['getAttribute'](St),_0x3642a9=Array['from'](_0x2d968e['getChildren']())['find'](_0x23064d=>_0x23064d['getAttribute'](St)==_0x5ad105)['getPath'](),_0x3e60cf=_0x5ca742['start']['path']['slice'](),_0x3e0037=_0x5ca742['end']['path']['slice']();_0x3e60cf[0x0]=_0x3642a9[0x0]+_0x3e60cf[0x0],_0x3e0037[0x0]=_0x3642a9[0x0]+_0x3e0037[0x0];let _0x5f234d=_0x58e354['model']['createRange'](_0x58e354['model']['createPositionFromPath'](_0x58e354['model']['document']['getRoot'](),_0x3e60cf),_0x58e354['model']['createPositionFromPath'](_0x58e354['model']['document']['getRoot'](),_0x3e0037));const _0x8ff94a=_0x58e354['model']['document']['history']['getOperations'](_0xf5a67c['version']);for(const _0x751e9d of _0x8ff94a)_0x5f234d=ht['_createFromRanges'](_0x5f234d['getTransformedByOperation'](_0x751e9d));return{'range':_0x5f234d,'currentIndex':_0x1603ad};}['_integrateEditor'](_0x390fdc){if(!_0x390fdc['plugins']['has']('Undo'))return;const _0x4cbbe2=_0x390fdc['commands']['get']('undo'),_0x3b1f9f=_0x390fdc['commands']['get']('redo');this['listenTo'](_0x4cbbe2,'revert',(_0x3498e4,_0x2f846e,_0x127bc3)=>{const _0x4c0a5a=this['_batchToChanges']['get'](_0x2f846e);if(!_0x4c0a5a)return;const _0x58921c=this['activeConversation']['getInteraction'](_0x4c0a5a['interactionId'])['getReply'](_0x4c0a5a['replyId']);_0x4c0a5a['indexes']['forEach'](_0x313be1=>_0x58921c['setChangeGroupState'](_0x313be1,'pending')),this['_batchToChanges']['delete'](_0x2f846e),this['_batchToChanges']['set'](_0x127bc3,_0x4c0a5a);}),this['listenTo'](_0x3b1f9f,'revert',(_0x723ab2,_0x55888a,_0x5cdca7)=>{const _0x1db0b9=this['_batchToChanges']['get'](_0x55888a);if(!_0x1db0b9)return;const _0x10d3a6=this['activeConversation']['getInteraction'](_0x1db0b9['interactionId'])['getReply'](_0x1db0b9['replyId']);_0x1db0b9['indexes']['forEach'](_0x227e34=>_0x10d3a6['setChangeGroupState'](_0x227e34,'accepted')),this['_batchToChanges']['delete'](_0x55888a),this['_batchToChanges']['set'](_0x5cdca7,_0x1db0b9);});}async['loadConversation'](_0x573031){this['context']['plugins']['get'](it)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{const _0x14735a=this['context']['plugins']['get'](Tt);this['updateConversationTitle']('\x20'),_0x14735a['view']['activateTab']('chat'),await this['_startConversationSafely'](_0x573031);const {sessionId:_0x1a4530}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x573031,_0x1a4530),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x53e1d3){console['error']('Failed\x20to\x20load\x20conversation',_0x53e1d3);}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x257dba){this['activeConversation']['id']===_0x257dba&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x1c88e6=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x1c88e6),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:_0xbbac2c,quickActionData:_0x293d8e}){await this['_handleUIUserMessage']({'userMessage':_0xbbac2c,'quickActionData':_0x293d8e});}['getGroupId'](){const _0x42a7e7=this['context']['config']['get']('collaboration.channelId');if(!_0x42a7e7)throw new _0x5b2487('ai-chat-missing-channel-id',this);return _0x42a7e7;}async['_startConversationSafely'](_0x327156){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x327156);}catch(_0x336d08){At('ai-chat-conversation-start-failed',_0x336d08),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x48ca08){const _0x1edbf6=this['context']['plugins']['get'](it);let _0x5d46b2;_0x1edbf6['isOpen']&&_0x1edbf6['close'](),_0x48ca08||!this['activeConversation']?_0x5d46b2=this['context']['config']['get']('ai.chat.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x5d46b2=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x169814=this['getGroupId'](),_0xa12028=_0x48ca08||_0x5fe9bf();this['activeConversation']=new vt({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x5d46b2,'conversationId':_0xa12028,'group':_0x169814,'getEditor':()=>q(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x47fafa,_0x4b50c2)=>{this['_aiChatUi']['createConversation'](_0x4b50c2),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x48ca08||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x5e1484,_0x1143ec)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x1143ec['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x4b7270,_0x2b9a22)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x2b9a22);}),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',(_0x1a2193,_0x317619)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x317619,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x261945,_0x31dc41)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x31dc41,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x4a5943,_0xd50b31)=>{this['_aiChatUi']['removeFeedInteraction'](_0xd50b31['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x471c44,_0x48e991,_0x33e2e5)=>{this['updateConversationTitle'](_0x48e991,_0x33e2e5);}),this['activeConversation']['on']('replyCreated',(_0x34e248,_0x3a7055)=>{'text-delta'===_0x3a7055['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x3a7055):this['_aiChatUi']['addFeedItemAISuggestion'](_0x3a7055);}),this['activeConversation']['on']('replyContentUpdated',async(_0x9fe5d1,_0x4de3c6)=>{await this['_updateReplyContent']({'reply':_0x4de3c6});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x2279fd,{reply:_0x5c3ef5,index:_0x134daf,state:_0x5a84e1})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x5c3ef5['id'],'index':_0x134daf,'state':_0x5a84e1});}),this['activeConversation']['on']('contextItemAdded',(_0x54b143,_0x29107e)=>{if(this['_aiChatUi']['addContextItem'](_0x29107e['contextItem'],_0x29107e['isLoading']),'selection'===_0x29107e['contextItem']['type']){const _0x3e3203=[...q(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x3e3203,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x2685fc,_0x20e373)=>{this['_aiChatUi']['removeContextItem'](_0x20e373['uiId']),'current-document'==_0x20e373['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x20e373['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x5c35d5,_0x566989)=>{this['_aiChatUi']['setContextItemLoading'](_0x566989['contextItem']['uiId'],_0x566989['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x2883e8,_0x5bc2a1)=>{this['_aiChatUi']['setConversationContext'](_0x5bc2a1['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x30dd58,_0x1bcb51)=>{this['_aiChatUi']['setAddContextOptions'](_0x1bcb51['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x5c2805,_0xfb5303)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0xfb5303['sourceId'],_0xfb5303['source'],_0xfb5303['resources'],_0xfb5303['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x5772ad,_0x1a573b)=>{this['_aiChatUi']['updateResourceState'](_0x1a573b['sourceId'],_0x1a573b['resourceId'],_0x1a573b['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0xf1485f,_0x5df5de)=>{this['_aiChatUi']['updateCapabilities'](_0x5df5de);}),this['activeConversation']['on']('modelSelected',(_0x38c688,_0x9b8b16)=>{this['_aiChatUi']['setSelectedModel'](_0x9b8b16['selectedModel'],_0x9b8b16['isDisabled']);}),this['activeConversation']['on']('error',(_0x3fc046,{error:_0x4f2696,interactionId:_0x597727,fileName:_0x416e3d,url:_0x5c6f98,sourceId:_0x2438eb,sourceLabel:_0x3e0760})=>{const _0x5ca52c=_0x597727?_0x597727+':'+_0x5fe9bf():_0x5fe9bf();_0x4f2696['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x5ca52c}):_0x4f2696['message']['startsWith']('ai-chat-conversation-init-failed')||_0x4f2696['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x5ca52c}),this['_logError'](_0x4f2696)):_0x4f2696['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x416e3d),'id':_0x5ca52c}):_0x4f2696['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x5c6f98),'id':_0x5ca52c}):_0x4f2696['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x5ca52c}):_0x4f2696['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x5ca52c}):_0x4f2696['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x2438eb&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x2438eb),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x3e0760||'source'),'id':_0x5ca52c}),this['_logError'](_0x4f2696)):_0x4f2696['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x5ca52c}),this['_logError'](_0x4f2696)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x5ca52c}),this['_logError'](_0x4f2696));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x48ca08||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x3ce0c8,quickActionData:_0x2c51d6}){if(!this['activeConversation'])throw new _0x5b2487('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':_0x3ce0c8,'quickActionData':_0x2c51d6}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x5a296d=q(this['context'])['model'],_0x47c64b=Array['from'](_0x5a296d['markers']['getMarkersGroup'](wt));_0x5a296d['change'](_0x459e48=>{_0x47c64b['forEach'](_0x1bf58b=>_0x459e48['removeMarker'](_0x1bf58b));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x30792a){this['_aiChatUi']['setIsMaximized'](_0x30792a);}['_logError'](_0x147169){At(_0x147169['message']);}['_removeFromContext'](_0x511c57){this['activeConversation']?.['removeFromContext'](_0x511c57);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x462ce2){const [_0x2a5fda,_0x24a6bb]=_0x462ce2['split'](':'),_0x172abd=this['activeConversation']['getInteraction'](_0x2a5fda),_0x33a4f8=_0x172abd['getReply'](_0x24a6bb);return{'interaction':_0x172abd,'reply':_0x33a4f8};}['_scrollToSuggestionRange'](_0x384b23,_0x171b26=!0x1){const _0x5a1a04=q(this['context']),_0x4ec44d={'target':_0x5a1a04['editing']['view']['domConverter']['viewRangeToDom'](_0x5a1a04['editing']['mapper']['toViewRange'](_0x384b23)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x171b26};_0x171b26&&(_0x4ec44d['alignToTop']=!0x0),_0x43244e(_0x4ec44d);}['updateConversationTitle'](_0x1a3784,_0x3854d3=!0x1){this['_aiChatUi']['setConversationTitle'](_0x1a3784||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x3854d3);}async['_updateReplyContent']({reply:_0x7d42a6,renderingStrategy:_0x28fd02}){const {id:_0x532007,isDone:_0x37800c,type:_0xb90218,parsedContent:_0x2ecb66}=_0x7d42a6;if('modification-delta'===_0xb90218){const _0x56040e=_0x7d42a6['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x532007,'parts':_0x56040e,'renderingStrategy':_0x28fd02,'isDone':_0x37800c});}else'text-delta'===_0xb90218&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x532007,'parsedContent':_0x2ecb66,'renderingStrategy':_0x28fd02,'isDone':_0x37800c});_0x37800c&&_0x7d42a6['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x532007,_0x7d42a6['sources']);}async['_stopLastInteraction'](){const _0x495c12=this['activeConversation']?.['lastInteraction'];_0x495c12&&(_0x495c12['stop'](),this['_aiChatUi']['stopInteraction'](_0x495c12));}async['_flushLastInteractionUI'](){const _0x19589f=this['activeConversation']?.['lastInteraction'];if(_0x19589f){for await(const _0x14b71d of _0x19589f['replies'])await this['_updateReplyContent']({'reply':_0x14b71d,'renderingStrategy':'static'});}}['_updateRatings'](_0x53d778){const _0x4b1723={'positiveCount':_0x53d778['changeGroups']['filter'](_0x267125=>'accepted'===_0x267125['state'])['length'],'totalCount':_0x53d778['changeGroups']['length'],'modificationId':_0x53d778['id']},_0x404b6b=this['activeConversation']['getInteraction'](_0x53d778['interactionId'])['messageId'];this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x404b6b,_0x4b1723);}}const Gt=[...Ee,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class Le extends Fr{['containerView'];['actionsView'];constructor(_0x4a48e7,_0x52fd23){super(_0x52fd23),this['set']('isTrackChangesOn',!0x1),this['containerView']=new F(_0x4a48e7,{'showDiff':_0x52fd23['showDiff'],'areActionsDisabled':_0x52fd23['areActionsDisabled'],'availableActions':_0x52fd23['availableActions']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x80eea,_0xe18c86)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0xe18c86['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',(_0x28a427,{index:_0x170516})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x170516});}),this['containerView']['on']('insertSuggestion',(_0x2d415f,{index:_0x2a5270})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2a5270});}),this['containerView']['on']('rejectSuggestion',(_0x2b173c,{index:_0x78df8e})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x78df8e});}),this['containerView']['on']('mouseOverSuggestion',(_0x150ab6,{index:_0x1b9e41})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1b9e41});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x24f61c,{index:_0x3cf6a9})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3cf6a9});}),this['actionsView']=new hh(_0x4a48e7,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']});}),_0x52fd23['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'](_0x2d670c){await this['containerView']['updateContent'](_0x2d670c),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x428c02,_0x1cfa8c){this['containerView']['bodyView']['updatePartState'](_0x428c02,_0x1cfa8c);}['updateSources'](_0x52518b){this['containerView']['updateSources'](_0x52518b);}['getPartView'](_0x1541c9){return this['containerView']['bodyView']['getPartView'](_0x1541c9);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class Te extends Fr{['replyContainer'];constructor(_0x8cbcf9,_0x4c8f87){super(_0x4c8f87),this['locale']=_0x8cbcf9,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x1fbe2f(),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':sr(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x2c90cb,renderingStrategy:_0x2917bc,abortSignal:_0x210999}){'streaming'===_0x2917bc?await this['streamIntoElement'](_0x2c90cb,this['replyContainer']['element'],_0x210999):this['replyContainer']['element']['innerHTML']=_0x6c271b(_0x2c90cb);}['updateSources'](_0x372039){const _0x617e82=new Sr(this['locale']);_0x617e82['children']['addMany'](_0x372039['map'](_0x1b43a5=>new Rr(this['locale'],_0x1b43a5))),_0x617e82['isVisible']=!0x0,this['children']['add'](_0x617e82);}}const bn={'file':_0x151b3b,'document':_0xc22ba7,'web-resource':_0x4138cd,'text':_0x151b3b,'selection':_0x52cd3c},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 _0x23f64b{constructor(_0x311904,_0x11637d,_0x131801,_0x51fd32,_0x389d77=!0x1){super(_0x311904),this['_isAnimationOnEnterEnabled']=_0x51fd32,this['_initializeProperties'](_0x11637d,_0x131801,_0x389d77),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'](_0x5c0165,_0xa4e8a6,_0x2939e8){this['set']('label',_0x5c0165['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x5c0165['type']),this['set']('id',_0x5c0165['uiId']),this['set']('readonly',_0xa4e8a6),this['set']('isLoading',_0x2939e8);}['_setupTemplate'](){const _0x5b2ff3=this['_createIconView'](),_0x27613f=this['_createRemoveButton'](),_0x19c6dd=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x19c6dd),'children':this['_createTemplateChildren'](_0x5b2ff3,_0x27613f,_0x19c6dd)});}['_createTemplateAttributes'](_0x1fbff2){return{'class':[Zr,_0x1fbff2['if']('itemType',oa,_0x3daefe=>'document'==_0x3daefe),_0x1fbff2['if']('itemType',ra,_0xf5d8a2=>'selection'==_0xf5d8a2)],'data-cke-tooltip-text':_0x1fbff2['to']('label',gn),'data-cke-tooltip-position':On,'data-cke-tooltip-class':da};}['_createTemplateChildren'](_0x359b13,_0x5051af,_0x12709a){const _0xa45c44=this['_createLabelElement'](_0x12709a),_0x230b44=this['_createLoaderIcon']();return this['readonly']?[_0x359b13,_0xa45c44]:[_0x359b13,_0x230b44,_0xa45c44,_0x5051af];}['_createLabelElement'](_0x135b9a){return{'tag':'span','attributes':{'class':ca},'children':[{'text':_0x135b9a['to']('label')}]};}['_createRemoveButton'](){const _0x3f236a=new _0x23f64b(this['locale']);return _0x3f236a['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x254221}),this['_setupRemoveButtonEvent'](_0x3f236a),_0x3f236a;}['_setupRemoveButtonEvent'](_0x5c3922){_0x5c3922['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x5287a2=this['bindTemplate'],_0x1c9b52=new _0x285b99();return _0x1c9b52['content']=bn[this['itemType']],_0x1c9b52['extendTemplate']({'attributes':{'class':[la,_0x5287a2['if']('isLoading','ck-hidden',_0x23dd40=>_0x23dd40)]}}),_0x1c9b52;}['_handleAnimationEndOnce'](_0x38493a,_0x2429c6){if(!_0x38493a)return;const _0x5aba6b=()=>{_0x2429c6(),_0x38493a['removeEventListener']('animationend',_0x5aba6b),_0x38493a['removeEventListener']('webkitAnimationEnd',_0x5aba6b);};_0x38493a['addEventListener']('animationend',_0x5aba6b),_0x38493a['addEventListener']('webkitAnimationEnd',_0x5aba6b);}['_createLoaderIcon'](){const _0x2ce2d8=new Si('small');return _0x2ce2d8['bind']('isVisible')['to'](this,'isLoading',_0x3d5a99=>_0x3d5a99),_0x2ce2d8;}}function gn(_0x3bc9ea){if(!_0x3bc9ea)return _0x3bc9ea;if(_0x3bc9ea['length']<=0x78)return _0x3bc9ea;const _0x28a374=_0x3bc9ea['slice'](0x0,0x78),_0x178a83=_0x28a374['lastIndexOf']('\x20');return(_0x178a83>0x0?_0x28a374['slice'](0x0,_0x178a83):_0x28a374)+'…';}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(_0x5ed721,_0x119233,_0x225b09,_0x41c322,_0x2873ff){this['_locale']=_0x5ed721,this['_visibleChips']=_0x119233,this['_config']={...wn,..._0x225b09,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x225b09['cssClasses']}},this['_overflowChips']=new _0x3925ff(),this['_bodyCollection']=_0x41c322,this['_parentView']=_0x2873ff||null;}['setContainerElement'](_0x2eb0f1){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x2eb0f1,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 _0x178834=[...this['_visibleChips'],...this['_overflowChips']],_0x22b6ff=this['_createCalculationContainer'](),_0x21c082=this['_calculateOverflowInContainer'](_0x22b6ff,_0x178834),_0x6c98fa=_0x22b6ff['_ancestorsToRestore'];_0x6c98fa&&this['_restoreAncestorVisibility'](_0x6c98fa),_0x22b6ff['remove'](),this['_applyOverflowResults'](_0x178834,_0x21c082);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x39650b({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x18adf5=new _0x23f64b(this['_locale']);_0x18adf5['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x46fca1=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x46fca1['push'](this['_config']['cssClasses']['controlsButton']),_0x18adf5['extendTemplate']({'attributes':{'class':_0x46fca1}}),_0x18adf5;}['_createShowMoreBalloonPanelView'](){const _0x4c5499=new _0x506f25(this['_locale']);return _0x4c5499['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x4c5499),_0x4c5499;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x5ce708=>{_0x5ce708['disableAnimationOnEnter']();});const _0x838219=new _0x1fbe2f(this['_locale']);_0x838219['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x838219);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x2957e9=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x2957e9?'':'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'](_0xdf7d7a){const _0x222706=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x53a180=this['_containerElement']?.['classList'];if(_0x53a180){const _0x16b354=_0x53a180[0x0]||'',_0xed7e4b=_0xdf7d7a['querySelector']('.'+_0x16b354),_0x2f87b3=_0xdf7d7a['querySelector'](_0x222706);return _0xed7e4b||_0x2f87b3||_0xdf7d7a;}return _0xdf7d7a['querySelector'](_0x222706)||_0xdf7d7a;}['_calculateContainerWidth'](){const _0x10a611=this['_parentView']?.['element']||this['_containerElement'];if(!_0x10a611)return dn;const _0x2d066c=window['getComputedStyle'](_0x10a611)['width'];if('auto'===_0x2d066c||'0px'===_0x2d066c||!_0x2d066c){const _0x63d09c=_0x10a611['parentElement'];if(_0x63d09c){const _0x3ed910=window['getComputedStyle'](_0x63d09c);return'auto'!==_0x3ed910['width']?_0x3ed910['width']:dn;}return dn;}return _0x2d066c;}['_applyCalculationStyles'](_0xd623ad,_0x2b0d51){this['_config']['cssClasses']['calculationContainer']&&_0xd623ad['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0xd623ad['style']['width']=_0x2b0d51,_0xd623ad['style']['position']='absolute',_0xd623ad['style']['top']='-9999px',_0xd623ad['style']['left']='-9999px',_0xd623ad['style']['opacity']='0',_0xd623ad['style']['pointerEvents']='none',_0xd623ad['style']['zIndex']='-1',_0xd623ad['style']['visibility']='visible\x20!important',_0xd623ad['style']['display']='block\x20!important',_0xd623ad['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x2b5889){_0x2b5889['forEach'](({element:_0x10c903,originalDisplay:_0x1f47a7,originalVisibility:_0x50ac3e})=>{_0x10c903['style']['display']=_0x1f47a7,_0x10c903['style']['visibility']=_0x50ac3e;});}['_makeAncestorsVisible'](_0x365de4){const _0x121a14=[];let _0x1ad0b2=_0x365de4;for(;_0x1ad0b2&&_0x1ad0b2!==document['body'];){const _0x410dc5=window['getComputedStyle'](_0x1ad0b2);'none'!==_0x410dc5['display']&&'hidden'!==_0x410dc5['visibility']||(_0x121a14['push']({'element':_0x1ad0b2,'originalDisplay':_0x1ad0b2['style']['display'],'originalVisibility':_0x1ad0b2['style']['visibility']}),_0x1ad0b2['style']['display']='block',_0x1ad0b2['style']['visibility']='visible'),_0x1ad0b2=_0x1ad0b2['parentElement'];}return _0x121a14;}['_createContainerElements'](){let _0x490cf5,_0x5d49d0;return this['_parentView']?.['element']?(_0x490cf5=this['_parentView']['element']['cloneNode'](!0x0),_0x5d49d0=this['_findTargetContainer'](_0x490cf5)):(_0x490cf5=document['createElement']('div'),_0x5d49d0=_0x490cf5),{'calculationContainer':_0x490cf5,'targetContainer':_0x5d49d0};}['_createCalculationContainer'](){const {calculationContainer:_0x15aff7,targetContainer:_0x2aa59c}=this['_createContainerElements'](),_0x1a4680=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x15aff7,_0x1a4680);const _0x41b20e=this['_parentView']?.['element']||this['_containerElement'],_0x62c90f=_0x41b20e?.['parentElement'];_0x62c90f?_0x62c90f['appendChild'](_0x15aff7):document['body']['appendChild'](_0x15aff7),_0x15aff7['_targetContainer']=_0x2aa59c;const _0x5cc9d0=this['_makeAncestorsVisible'](_0x62c90f||null);return _0x15aff7['offsetWidth'],_0x15aff7['_ancestorsToRestore']=_0x5cc9d0,_0x15aff7;}['_calculateOverflowInContainer'](_0x573f64,_0x39d2df){const _0x4cd84e=_0x573f64['_targetContainer']||_0x573f64,_0x54948d=[],{rowCount:_0x8a4d72}=this['_renderChipsAndCountRows'](_0x4cd84e,_0x39d2df);if(_0x8a4d72<=this['_config']['maxVisibleRows'])return _0x54948d;const _0x2c6712=_0x39d2df['slice']();for(;_0x2c6712['length']>0x0;){if(this['_testButtonFit'](_0x573f64,_0x4cd84e,_0x2c6712)){const _0x18e5f6=_0x39d2df['filter'](_0x1c8ff1=>!_0x2c6712['includes'](_0x1c8ff1));_0x54948d['push'](..._0x18e5f6);break;}if(!_0x2c6712['pop']())break;}return _0x54948d;}['_renderChipsAndCountRows'](_0x6c585f,_0xf242d3){_0x6c585f['innerHTML']='',_0xf242d3['forEach'](_0x5a4d7a=>{if(_0x5a4d7a['element']){const _0x42f015=_0x5a4d7a['element']['cloneNode'](!0x0);_0x6c585f['appendChild'](_0x42f015);}}),_0x6c585f['offsetWidth'];const _0x551486=_0x6c585f['children'],_0x16b558=[];return Array['from'](_0x551486)['forEach'](_0x2d4484=>{const _0x3ca4b8=_0x2d4484['getBoundingClientRect']()['top'];_0x16b558['some'](_0x585ed5=>Math['abs'](_0x585ed5-_0x3ca4b8)<this['_config']['rowDetectionTolerance'])||_0x16b558['push'](_0x3ca4b8);}),{'rowCount':_0x16b558['length']};}['_createMockButton'](){const _0x2dcf08=document['createElement']('button');return _0x2dcf08['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x2dcf08['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x2dcf08['textContent']='+\x201',_0x2dcf08;}['_testButtonFit'](_0x1b8514,_0x5b66bb,_0x11554e){this['_renderChipsAndCountRows'](_0x5b66bb,_0x11554e);const _0x3bd655=this['_createMockButton']();_0x1b8514['appendChild'](_0x3bd655),_0x1b8514['offsetWidth'];const _0x4fa2ef=[..._0x5b66bb['children'],_0x3bd655],_0x16cd9a=[];_0x4fa2ef['forEach'](_0x28963c=>{const _0x32d06b=_0x28963c['getBoundingClientRect']()['top'];_0x16cd9a['some'](_0xd83ac4=>Math['abs'](_0xd83ac4-_0x32d06b)<this['_config']['rowDetectionTolerance'])||_0x16cd9a['push'](_0x32d06b);});const _0x1429ce=_0x16cd9a['length'];return _0x3bd655['remove'](),_0x1429ce<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x431ea5,_0x5a1c0c){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x431ea5['forEach'](_0x4110f1=>{_0x5a1c0c['includes'](_0x4110f1)?this['_overflowChips']['add'](_0x4110f1):this['_visibleChips']['add'](_0x4110f1);});}['_updateOverflowUI'](_0x239377){if(_0x239377>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x239377>0x0&&this['_showMoreButtonView']){const _0x177942=''+this['_config']['showMoreLabelPrefix']+(_0x239377<0x63?_0x239377:'99');this['_showMoreButtonView']['label']=_0x177942;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x280fa5,_0x29521c){this['_distributeChips'](_0x280fa5,_0x29521c),this['_updateOverflowUI'](_0x29521c['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x4a742a=>{_0x4a742a[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 _0x317ce1=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x317ce1['width']||0x0===_0x317ce1['height'])return!0x1;const _0x475644=window['innerHeight']||document['documentElement']['clientHeight'],_0x56717a=window['innerWidth']||document['documentElement']['clientWidth'],_0x44a035=0xc8;return _0x317ce1['bottom']>=-0xc8&&_0x317ce1['top']<=_0x475644+_0x44a035&&_0x317ce1['right']>=-0xc8&&_0x317ce1['left']<=_0x56717a+_0x44a035;}}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 ah extends _0x1fbe2f{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x42128c,_0xb540ca,_0x347143){super(_0x42128c),this['_bodyCollection']=_0x347143,this['_createContextChips'](_0xb540ca);const _0x1a9589={'cssClasses':{'showMoreButton':ga,'showMoreBalloon':Ea,'overflowContainer':Ia,'controlsButton':Aa}};this['_overflowManager']=new Ao(_0x42128c,this['_contextChips'],_0x1a9589,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 _0x5256e5=this['element']['querySelector']('.'+_a);_0x5256e5&&(this['_overflowManager']['setContainerElement'](_0x5256e5),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x12f1a2){for(const _0x3354dd of _0x12f1a2){const _0x3118d0=new bo(this['locale'],_0x3354dd,!0x0,!0x1);this['_contextChips']['add'](_0x3118d0);}}}class Ve extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x27b1d2,_0x29ec48,_0x1f490b){super(_0x29ec48),this['_locale']=_0x27b1d2,this['_bodyCollection']=_0x1f490b,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 ah(this['_locale'],this['options']['contextItems']['filter'](_0x290bd3=>!_0x290bd3['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x1fbe2f(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 Ft extends Fr{['capabilities'];constructor(_0x3afd69,_0x5ae8fd){super(_0x5ae8fd);const {isWebSearchEnabled:_0x4a49b5,isReasoningEnabled:_0x2ce225}=_0x5ae8fd['capabilities'],_0x39fb74=[];let _0x36f1c1='';_0x4a49b5&&_0x2ce225?(_0x36f1c1=i(_0x3afd69,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x39fb74['push'](aa(_0x3aa839)),_0x39fb74['push'](aa(_0x4ef1cb))):_0x4a49b5?(_0x36f1c1=i(_0x3afd69,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x39fb74['push'](aa(_0x3aa839))):_0x2ce225&&(_0x36f1c1=i(_0x3afd69,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x39fb74['push'](aa(_0x4ef1cb))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x36f1c1?'':'ck-hidden']}});const _0x5275d2=new _0x1fbe2f();_0x5275d2['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x39fb74,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x36f1c1]}]}),this['children']['add'](_0x5275d2),this['capabilities']=_0x5ae8fd['capabilities'];}}function aa(_0x399ed1){const _0xc32b93=new _0x285b99();return _0xc32b93['content']=_0x399ed1,_0xc32b93;}const ws=['wheel','touchstart','pointerdown','keydown'],As=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Oe{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x403998){this['element']=_0x403998,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0xf9665b of ws){const _0x275ec3='keydown'!==_0xf9665b;this['element']['addEventListener'](_0xf9665b,this['_onUserEvent']['bind'](this),{'passive':_0x275ec3,'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'](_0x43df55){if(this['isRunning']){if('keydown'===_0x43df55['type']){const _0x17d6ed=_0x43df55['key'];if(!As['includes'](_0x17d6ed))return;}_0x43df55 instanceof WheelEvent?_0x43df55['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x469487,scrollHeight:_0x1133bb,clientHeight:_0x4fba15}=this['element'];return _0x1133bb-_0x469487-_0x4fba15<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class vi extends _0x1fbe2f{constructor(_0x3021b4,_0x20165e){super(_0x3021b4),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x20165e)});}['_createSkeletonItems'](_0x420d00){const _0x83dd05=['ck','ck-ai-skeleton__item'];return _0x420d00['map'](_0x222878=>{let _0x13e713='';switch(_0x222878['attributes']['align']){case'right':_0x13e713='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x13e713='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x13e713='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x222878['tag'],'attributes':{'class':[..._0x83dd05,_0x222878['attributes']['class']?_0x222878['attributes']['class']:''],'style':'width:\x20'+_0x222878['attributes']['width']+';\x20height:\x20'+_0x222878['attributes']['height']+';'+_0x13e713}};});}}const xi={'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(_0x5749ff,_0x34860f,_0x283b2e,_0x27e59b){return new Array(_0x5749ff)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x34860f,'height':_0x283b2e,'align':_0x27e59b}}));}class Bi extends _0x1fbe2f{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x185acc,_0x71a539){super(_0x185acc),this['_bodyCollection']=_0x71a539,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Gt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Oe(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x38d1cd,_0x2a1aaf){let _0x10d82c;'ai-reply'===_0x38d1cd?_0x10d82c=new Te(this['locale'],_0x2a1aaf):'ai-suggestion-reply'===_0x38d1cd?(_0x10d82c=new Le(this['locale'],_0x2a1aaf),_0x10d82c['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn')):_0x10d82c='user-message'===_0x38d1cd?new Ve(this['locale'],_0x2a1aaf,this['_bodyCollection']):'interaction-header'===_0x38d1cd?new Ft(this['locale'],_0x2a1aaf):new Me(_0x2a1aaf),this['children']['add'](_0x10d82c);}async['updateReplyItem']({id:_0x30dfcb,parsedContent:_0x3dd727,renderingStrategy:_0x2d2985,abortSignal:_0xf975a5}){const _0x3fd6f8=this['getItemById'](_0x30dfcb);if(!(_0x3fd6f8 instanceof Te))throw new _0x5b2487('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x3fd6f8,'id':_0x30dfcb,'parsedContent':_0x3dd727});await _0x3fd6f8['updateContent']({'parsedContent':_0x3dd727,'renderingStrategy':_0x2d2985,'abortSignal':_0xf975a5});}async['updateWebSources'](_0x5d3730,_0x2a373f){const _0x1fb750=this['getItemById'](_0x5d3730);if(_0x1fb750 instanceof Le)_0x1fb750['updateSources'](_0x2a373f);else{if(!(_0x1fb750 instanceof Te))throw new _0x5b2487('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x1fb750,'id':_0x5d3730,'sources':_0x2a373f});_0x1fb750['updateSources'](_0x2a373f);}}async['updateSuggestionItem']({id:_0x3def97,parts:_0x2896f0,renderingStrategy:_0x403738,abortSignal:_0x5486fb}){const _0x2fb031=this['getItemById'](_0x3def97);if(!(_0x2fb031 instanceof Le))throw new _0x5b2487('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x2fb031,'id':_0x3def97,'parts':_0x2896f0});await _0x2fb031['updateContent']({'parts':_0x2896f0,'renderingStrategy':_0x403738,'abortSignal':_0x5486fb});}['updateSuggestionPartState']({id:_0x6b4c32,index:_0x1a0e4c,state:_0x4618f0}){const _0x1aa6e9=this['getItemById'](_0x6b4c32);if(!(_0x1aa6e9 instanceof Le))throw new _0x5b2487('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x6b4c32});_0x1aa6e9['updatePartState'](_0x1a0e4c,_0x4618f0);}['markItemAsDone'](_0x272a09){this['getItemById'](_0x272a09)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x3e1a82=>_0x3e1a82['options']['id']);}['removeItem'](_0x5e5e36){this['children']['remove'](this['getItemById'](_0x5e5e36));}['scrollToSuggestion'](_0xe7116f,_0x214d5d){const _0x8c6a7e=this['getItemById'](_0xe7116f);if(!(_0x8c6a7e instanceof Le))return void _0x5ace8a('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0xe7116f,'partIndex':_0x214d5d});const _0x40a0e6=_0x8c6a7e['getPartView'](_0x214d5d);_0x40a0e6?_0x43244e({'target':_0x40a0e6['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x5ace8a('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0xe7116f,'partIndex':_0x214d5d});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x4ab47c=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x4ab47c,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x1169a4=new vi(this['locale'],xi['aiFeed']);return _0x1169a4['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x1b2ae4=>!_0x1b2ae4)]}}),_0x1169a4;}['_createFeedItems'](){const _0x3cc299=new _0x1fbe2f(this['locale']);return _0x3cc299['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x3cc299;}['_createFeedLoader'](){const _0x598642=new _0x1fbe2f(this['locale']);return _0x598642['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x30b5e1=>!_0x30b5e1)]},'children':this['_createLoaderChildren']()}),_0x598642;}['_createLoaderChildren'](){const _0x7bd40a=new Si();return _0x7bd40a['isVisible']=!0x0,[_0x7bd40a,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x326569){const _0x51cce4=this['children']['find'](_0x575888=>_0x575888['options']['id']['includes'](_0x326569));if(!_0x51cce4)throw new _0x5b2487('ai-chat-feed-view-item-not-found',this,{'id':_0x326569});return _0x51cce4;}['setLoadingMessage'](_0x5bd10b){this['set']('loadingMessage',_0x5bd10b);}['toggleLoadingSkeleton'](_0x322387){this['set']('isLoadingSkeletonVisible',_0x322387);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Ir extends _0x5253cf{['filter'](){let _0x4c8d10=0x0;for(const _0x1b6d23 of this['items'])_0x4c8d10+=_0x1b6d23['items']['length'];return{'resultsCount':_0x4c8d10,'totalItemsCount':_0x4c8d10};}}class ps extends _0x250640{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x4a5aaf,_0x7a3a83){super(_0x4a5aaf,{'queryView':{'label':'','creator':_0x59eec3,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Ir(_0x4a5aaf),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x7a3a83,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',(_0x67c7eb,_0x563780)=>!_0x67c7eb&&!_0x563780),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x1675cc,_0x17b54e)=>{this['isUploadInProgress']||this['isEmpty']||_0x1675cc['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x17b54e());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x5bdcd9=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x5bdcd9)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x1fbf23=_0x49969b(_0x5bdcd9);this['fire']('sendUserMessage',_0x1fbf23),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x305b7a){this['queryView']['fieldView']['set']('placeholder',_0x305b7a);}['_createSubmitButton'](){const _0x3b5e08=new _0x23f64b(this['locale']);return _0x3b5e08['set']({'icon':_0x1f7b2c,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x3b5e08['on']('execute',()=>{this['submit']();}),_0x3b5e08;}['setIsUploadInProgress'](_0x261c78){this['isUploadInProgress']=_0x261c78;}['_setUpAddContextButtonPositioning'](){const _0x856bad=this['locale'],_0x59124f=()=>{_0x221a5['window']['requestAnimationFrame'](()=>{if(_0x4a2145(this['element'])){const _0x1fd228=new _0x1f7ba8(this['queryView']['fieldView']['element']),_0x3b7d33=new _0x1f7ba8(this['_addContextButtonView']['element']),_0x4405b9=_0x1fd228['width'],_0x322aa6='rtl'===_0x856bad['uiLanguageDirection']?'right':'left';_0x1fd228['excludeScrollbarsAndBorders']();const _0x38266a=_0x4405b9-_0x1fd228['width']+0x1;this['_addContextButtonView']['element']['style'][_0x322aa6]='calc('+(_0x4405b9-_0x3b7d33['width']-_0x38266a)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x59124f),this['on']('render',()=>{_0x59124f(),this['_queryViewResizeObserver']=new _0x25fce8(this['queryView']['fieldView']['element'],()=>{_0x59124f();});});}}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 us extends _0x1fbe2f{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x546a5a){super(_0x546a5a),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',_0xe843=>_0xe843),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x1be4ee=>_0x1be4ee?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x2e9388=>_0x2e9388),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x48e595=>_0x48e595),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x457989=>!_0x457989),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x193a9a=>i(this['locale'],_0x193a9a?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x16b7dc=>_0x16b7dc),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x2370ff=>!_0x2370ff),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x36bda3=>i(this['locale'],_0x36bda3?'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 _0x3925ff(),_0x11fa7b(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x11c563,_0x1dd6d9){if(this['set']('modelSelectorVisible',!(_0x1dd6d9&&_0x11c563['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x11c563?.['length']){const _0x4febca=ni['getLocalized'](this['locale'],_0x11c563);for(const _0x43adab of _0x4febca){const _0x369b9=new _0x355792({'label':_0x43adab['name'],'withText':!0x0,'role':'menuitemradio','id':_0x43adab['id'],'model':_0x43adab});_0x369b9['bind']('isOn')['to'](this,'activeModelId',_0x3b41a7=>_0x3b41a7===_0x43adab['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x369b9,'labelView':new Ra(this['locale'],_0x43adab)});}}}['setWebSearch'](_0x42efc5){this['set']('webSearchActive',_0x42efc5);}['setReasoning'](_0x2ad68e){this['set']('reasoningActive',_0x2ad68e);}['setModel'](_0x2b4f36){if(!_0x2b4f36)return;this['activeModelId']=_0x2b4f36['id'],this['activeModelName']=_0x2b4f36['name']||_0x2b4f36['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x2b4f36['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x2b4f36['name']);const _0x55e1f1=_0x2b4f36['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x55e1f1),this['_webSearchButton']['set']('isVisible',_0x55e1f1);const _0x453ffd=_0x2b4f36['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x453ffd),this['_reasoningButton']['set']('isVisible',_0x453ffd);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x235cfa){this['set']('modelSelectorEnabled',!0x1),_0x235cfa&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x3fa7d5=new _0x23f64b();return _0x3fa7d5['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x3aa839,'class':pa,'isToggleable':!0x0,'tooltipPosition':Oa}),_0x3fa7d5['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x3fa7d5;}['_createReasoningButton'](){const _0x124846=new _0x23f64b();return _0x124846['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x4ef1cb,'class':pa,'isToggleable':!0x0,'tooltipPosition':Oa}),_0x124846['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x124846;}['_createCommandsButton'](){const _0x4e87ba=new _0x23f64b();return _0x4e87ba['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':Ut,'withText':!0x0,'class':pa,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Oa}),_0x4e87ba['extendTemplate']({'attributes':{'class':[Ta]}}),_0x4e87ba['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x4e87ba;}['_createModelSelectionDropdown'](){const _0x4c1642=_0x43e2d9(this['locale']);return _0x4c1642['set']({'panelPosition':'ne','class':[Ca]}),_0x4c1642['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Oa}),this['listenTo'](_0x4c1642,'execute',_0x33998e=>{this['fire']('selectModel',_0x33998e['source']['model']);}),_0x4c1642;}['_createModelNameView'](){const _0x39dc1c=new Ko(this['locale']);return _0x39dc1c['bind']('text')['to'](this,'activeModelName',_0x30524c=>_0x30524c??''),_0x39dc1c['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0xe955dd,_0x27d6d0)=>!_0xe955dd&&!_0x27d6d0?.['toLowerCase']()['startsWith']('agent')),_0x39dc1c;}}let Ra=class extends _0x1eeb89{constructor(_0x43992f,_0x5c1ce3){super();const _0x4e29b5=this['bindTemplate'],_0x22deb8=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x4e29b5['to']('style'),'id':_0x4e29b5['to']('id')},'children':[{'tag':'div','attributes':{'class':[wa]},'children':[{'text':_0x4e29b5['to']('text')}]},{'tag':'div','attributes':{'class':[fa]},'children':[{'tag':'span','children':[{'text':_0x5c1ce3['description']}]}]},{'tag':'div','attributes':{'class':[Sa]},'children':_0x22deb8}]}),_0x22deb8['addMany'](this['_getCapabilityParts'](_0x43992f,_0x3aa839,'AI_CHAT_SEARCH_WEB',_0x5c1ce3['capabilities']['webSearch']?.['enabled']??!0x1)),_0x22deb8['addMany'](this['_getCapabilityParts'](_0x43992f,_0x4ef1cb,'AI_CHAT_REASONING',_0x5c1ce3['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x5ed04f,_0x528718,_0x3bdd5e,_0x3c5e32){const _0x267059=new _0x285b99();_0x267059['content']=_0x528718;const _0x5c89c6=new _0x1fbe2f(_0x5ed04f);_0x5c89c6['setTemplate']({'tag':'span','children':[{'text':i(_0x5ed04f,_0x3bdd5e)+':\x20'}]});const _0x59d46a=new _0x1fbe2f(_0x5ed04f);return _0x59d46a['setTemplate']({'tag':'span','children':[{'text':i(_0x5ed04f,_0x3c5e32?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x267059,_0x5c89c6,_0x59d46a];}};class Ko extends _0x1fbe2f{constructor(_0x2696c5){super(_0x2696c5),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x13131b=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x13131b['if']('isVisible','ck-hidden',_0x3a0be1=>!_0x3a0be1)]},'children':[{'text':_0x13131b['to']('text')}]});}}const ba='ck-ai-chat-context-controls__url-form',Na='ck-ai-chat-context-controls__url-input-section';class To extends _0x1fbe2f{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x594592){super(_0x594592),this['focusTracker']=new _0x2cffef(),this['keystrokes']=new _0x46a36b(),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 _0x14e425({'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'](_0x3cd85c=>{this['focusTracker']['add'](_0x3cd85c['element']),this['keystrokes']['listenTo'](_0x3cd85c['element']);}),_0x33fe91({'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'](_0x3cc5da){this['urlInputField']['errorText']=_0x3cc5da,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x1a639a=new _0x23f64b(this['locale']);return _0x1a639a['set']({'icon':_0x2875b9,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x1a639a;}['_createUrlInputField'](){const _0x42a73d=new _0x3ce94b(this['locale'],th);return _0x42a73d['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x42a73d['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x42a73d;}['_createConfirmButton'](){const _0x425ad6=new _0x23f64b(this['locale']);return _0x425ad6['set']({'icon':_0x1fb727,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x425ad6;}['_setupTemplate'](){const _0x2d1e8f=new _0x5e15d9(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'});_0x2d1e8f['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':ba,'tabindex':'-1'},'children':[_0x2d1e8f,{'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',_0x1deded=>{_0x1deded['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x3fcdfb,_0x21aacd)=>{this['clear'](),this['fire']('cancel'),_0x21aacd();});}['_handleSubmit'](){const _0x19d10d=this['getValue']()['trim']();_0x19d10d?this['_isValidUrl'](_0x19d10d)?(this['clearError'](),this['fire']('submitUrl',_0x19d10d)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x4dff48=this['getValue']()['trim'](),_0x5e095b=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x4dff48['length']>0x0&&!_0x5e095b;}['_isValidUrl'](_0x530eff){try{return!!new URL(_0x530eff);}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 _0x57e588{['resource'];['_titleView'];['_iconView'];constructor(_0x3a9557,_0x1c402f){super(_0x3a9557),this['resource']=_0x1c402f,this['set']('isInContext',!!_0x1c402f['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x9d81e6){if(_0x9d81e6['isInContext'])return _0x1fb727;switch(_0x9d81e6['type']){case Ie['DOCUMENT']:return _0xc22ba7;case Ie['URL']:return _0x4138cd;case Ie['FILE']:case Ie['TEXT']:return _0x151b3b;default:return _0x4a05c2;}}['highlightText'](_0x40f47){if(!_0x40f47||''===_0x40f47['trim']())return void this['_titleView']['highlightText'](null);const _0x3a3b68=new RegExp(_0x22ea74(_0x40f47),'gi');this['_titleView']['highlightText'](_0x3a3b68);}['updateResourceState'](_0x105345){this['resource']['isInContext']=_0x105345,this['isInContext']=_0x105345,this['_updateIcon']();}['_createTitleView'](){const _0x176eb5=new _0x4bd456();return _0x176eb5['text']=this['resource']['label'],_0x176eb5['extendTemplate']({'tag':'span','attributes':{'class':[va]}}),_0x176eb5;}['_createIconView'](){const _0x394a7a=new _0x285b99();return _0x394a7a['content']=this['getResourceIcon'](this['resource']),_0x394a7a;}['_setupTemplate'](){const _0x5c4a98=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[ka,_0x5c4a98['if']('isVisible','ck-hidden',_0x2f6433=>!_0x2f6433),_0x5c4a98['if']('isInContext',ya)]},'children':[{'tag':'div','attributes':{'class':[xa]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x5c4a98['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const La='ck-ai-chat-resources__list';class qr extends _0x5253cf{['_source'];constructor(_0x17b7c0,_0x426bb4){super(_0x17b7c0),this['_source']=_0x426bb4,this['extendTemplate']({'attributes':{'class':[La]}});}['setResources'](_0x44b985,_0x1c664c){this['items']['clear']();let _0x1c574b=_0x44b985;if(this['_source']['useDefaultFiltering']&&_0x1c664c&&''!==_0x1c664c['trim']()){const _0x13ecea=new RegExp(_0x1c664c['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x1c574b=_0x44b985['filter'](_0x59cdf6=>_0x13ecea['test'](_0x59cdf6['label']));}for(const _0xd7538b of _0x1c574b){const _0x1d6e65=new tc(this['locale'],_0xd7538b);_0x1d6e65['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0xd7538b);}),this['items']['add'](_0x1d6e65);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x1c664c);}['highlightText'](_0xb25c2c){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x3bb7e4=>{_0x3bb7e4['highlightText'](_0xb25c2c);});}['updateResourceState'](_0x15c4de,_0x3878eb){for(const _0x324613 of this['items']){const _0x2a6b1f=_0x324613;_0x2a6b1f['resource']['id']===_0x15c4de&&_0x2a6b1f['updateResourceState'](_0x3878eb);}}['_handleResourceSelection'](_0x122c61,_0x45821f){this['fire']('addResourceToContext',{'source':_0x122c61,'resource':_0x45821f});}}class Tr extends _0x3ce94b{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x153678){const t=_0x153678['t'],_0x69868d={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':i(_0x153678,'AI_CHAT_SEARCH_RESOURCES')};super(_0x153678,_0x69868d['creator']),this['label']=_0x69868d['label'],this['_viewConfig']=_0x69868d,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x153678,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x61126){this['fire']('search',_0x61126);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x285b99(),this['iconView']['content']=_0x3213b0,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x2c907f,t){this['resetButtonView']=new _0x23f64b(_0x2c907f),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0xead019,'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',_0x25d64e=>!_0x25d64e),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 _0x1fbe2f{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0xa500c7,_0x36792){super(_0xa500c7),this['_source']=_0x36792['source'],this['_searchInputVisibleFrom']=_0x36792['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 _0xa90262([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Tr(this['locale']);}['_createSearchSection'](){const _0x1e6c4c=new _0x1fbe2f(this['locale']);return _0x1e6c4c['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x26076a,_0x326b15)=>{this['loadResources'](_0x326b15),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x326b15);}),_0x1e6c4c;}['_createResourcesListView'](){const _0xe8c504=new qr(this['locale'],this['_source']);return _0xe8c504['delegate']('addResourceToContext')['to'](this),_0xe8c504['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0xe8c504;}['_createSkeletonView'](){const _0x559dbb=new vi(this['locale'],xi['aiChatResources']);return _0x559dbb['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x7eb276=>!_0x7eb276)]}}),_0x559dbb;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x15243d){const _0x2b3543=_0x5fe9bf();this['_latestLoadResourcesUid']=_0x2b3543,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x15243d,'uid':_0x2b3543}),this['isLoading']=!0x0;}['setResources'](_0xb3df4a,_0x467629){if(_0x467629&&_0x467629!==this['_latestLoadResourcesUid'])return;const _0x5e7161=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0xb3df4a,_0x5e7161),_0xb3df4a['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x15c480,_0x3a1cdd){this['_resourcesListView']['updateResourceState'](_0x15c480,_0x3a1cdd);}}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(_0x31e024,_0x35a036,_0x44d577){this['_locale']=_0x31e024,this['_bodyCollection']=_0x35a036,this['_config']=_0x44d577;}['showSourceResourcesBalloon'](_0x4081fe){let _0x31a681=this['_sourceResourceBalloons']['get'](_0x4081fe['id']);_0x31a681||(_0x31a681=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x4081fe['id'],_0x31a681),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x31a681)),this['_addSourceResourceContent'](_0x31a681,_0x4081fe),_0x31a681['show']();const _0x7167fc=this['_config']['getTargetElement']();_0x7167fc&&_0x31a681['pin']({'target':_0x7167fc,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x3c9d39,_0x30b4ce,_0x413cf8){const _0x3d78dc=this['_sourceResourceBalloons']['get'](_0x3c9d39);if(!_0x3d78dc)return;const _0x27e8cb=this['_getResourcesViewFromBalloon'](_0x3d78dc);_0x27e8cb&&(_0x27e8cb['setResources'](_0x30b4ce,_0x413cf8),_0x27e8cb['once']('change:isLoading',()=>{_0x3d78dc['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x3e2c53){const _0x414d1f=this['_sourceResourceBalloons']['get'](_0x3e2c53);_0x414d1f&&requestAnimationFrame(()=>{_0x414d1f['hide'](),this['_sourceResourceBalloons']['delete'](_0x3e2c53),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x577fab of this['_sourceResourceBalloons']['values']())if(_0x577fab['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x4319c1,_0x4097e8,_0x30757a){const _0xcfd099=this['_sourceResourceBalloons']['get'](_0x4319c1);if(!_0xcfd099||!_0xcfd099['isVisible'])return;const _0x32dbb3=this['_config']['getTargetElement']();if(!_0x32dbb3)return;_0xcfd099['pin']({'target':_0x32dbb3,'limiter':this['_config']['getLimiterElement']()});const _0x116cab=this['_getResourcesViewFromBalloon'](_0xcfd099);_0x116cab&&_0x116cab['updateResourceState'](_0x4097e8,_0x30757a);}['destroy'](){for(const _0x200e77 of this['_sourceResourceBalloons']['values']())_0x200e77['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x1bcc22=new _0x506f25(this['_locale']);return _0x1bcc22['extendTemplate']({'attributes':{'class':Da}}),this['_bodyCollection']['add'](_0x1bcc22),_0x1bcc22;}['_addSourceResourceContent'](_0x3e5fa3,_0x5a1531){_0x3e5fa3['content']['clear']();const _0x2ac36b=this['_createBalloonHeader'](_0x3e5fa3,_0x5a1531);_0x3e5fa3['content']['add'](_0x2ac36b);const _0x5bf9de=this['_createBalloonResourcesView'](_0x5a1531);_0x3e5fa3['content']['add'](_0x5bf9de);}['_createBalloonHeader'](_0x47c407,_0x15b9ac){const _0x23ea64=this['_createBackButton'](_0x47c407),_0x9ec93f=new _0x5e15d9(this['_locale'],{'label':_0x15b9ac['label'],'class':Ha});return _0x9ec93f['children']['add'](_0x23ea64,0x0),_0x9ec93f;}['_createBackButton'](_0x157e8c){const _0x707ac9=new _0x23f64b(this['_locale']);return _0x707ac9['set']({'icon':_0x2875b9,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Pa}),_0x707ac9['on']('execute',()=>{_0x157e8c['hide'](),this['_config']['onBackToContext']();}),_0x707ac9;}['_createBalloonResourcesView'](_0x316b71){const _0x357cd4=new Or(this['_locale'],{'source':_0x316b71,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x357cd4['on']('loadSourceResources',(_0x444ebd,_0x552b5c)=>{this['_config']['onLoadSourceResources'](_0x552b5c);}),_0x357cd4['on']('addResourceToContext',(_0xb8350c,_0x20878d)=>{this['_config']['onResourceSelected'](_0x20878d['source'],_0x20878d['resource']),this['closeSourceResourceBalloon'](_0x316b71['id']);}),_0x357cd4;}['_getResourcesViewFromBalloon'](_0xfb03ba){const _0x48928c=_0xfb03ba['content']['get'](0x1);return _0x48928c instanceof Or?_0x48928c:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x412d44){_0x39650b({'emitter':_0x412d44,'contextElements':[_0x412d44['element']],'callback':()=>{_0x412d44['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x412d44['isVisible']});}}const bs=['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=[_0x506f25['defaultPositions']['northArrowSouthWest'],_0x506f25['defaultPositions']['northArrowSouth'],_0x506f25['defaultPositions']['northArrowSouthEast'],_0x506f25['defaultPositions']['southArrowNorthWest'],_0x506f25['defaultPositions']['southArrowNorth'],_0x506f25['defaultPositions']['southArrowNorthEast']];class ms extends _0x1fbe2f{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x8af820,_0x6df15){super(_0x8af820),this['bodyCollection']=_0x6df15['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x8af820),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x8af820),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x8af820),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x8af820,_0x6df15);const _0x52563a={'cssClasses':{'showMoreButton':Oo,'showMoreBalloon':Mo,'overflowContainer':No,'controlsButton':Lo}};this['_overflowManager']=new Ao(_0x8af820,this['_currentContextsChips'],_0x52563a,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'](_0x4c46d1,_0x28e2dd){const _0x1f206e=this['_createContextButton'](_0x4c46d1,'current',!0x0,_0x28e2dd);this['_addContextToCollection'](_0x1f206e,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x176a9a){this['_removeContextFromCollection'](_0x176a9a,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x176a9a,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x2c4826,_0x8d60c2){let _0x2263bb=this['_currentContextsChips']['find'](_0x4afa04=>_0x4afa04['id']===_0x2c4826);_0x2263bb||(_0x2263bb=this['_overflowManager']['overflowChips']['find'](_0x2de240=>_0x2de240['id']===_0x2c4826)),_0x2263bb&&(_0x2263bb['isLoading']=_0x8d60c2);}['setConversationContext'](_0x5f0928){this['_conversationContextsChips']['clear']();for(const _0x1b3ffd of _0x5f0928){const _0x1ffa79=this['_createContextButton'](_0x1b3ffd,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x1ffa79,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x3e8104,_0x2368d9,_0x912028){this['_resourcesBalloonView']['updateResourceState'](_0x3e8104,_0x2368d9,_0x912028);}['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'](_0x23c3e7){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x23c3e7),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x305493,_0xe0cd98,_0x466e11,_0x29c620){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x305493,_0x466e11,_0x29c620);}['closeSourceResourceBalloon'](_0x4a94ae){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x4a94ae),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x390b4a){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x390b4a),this['_setAddContextButtonEnabled'](_0x390b4a);}['_setAddContextButtonEnabled'](_0x61d4f5){const _0x59e48a=!_0x61d4f5['document']['isHidden']&&_0x61d4f5['document']['enabled'],_0x32f9e6=_0x61d4f5['urls']['enabled'],_0x339acd=_0x61d4f5['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x59e48a||_0x32f9e6||_0x339acd;}['_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'](_0x378a94){const _0x361928=new _0x23f64b(_0x378a94);return _0x361928['set']({'label':i(_0x378a94,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Lo+'\x20'+Io,'icon':_0x116d7d,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x361928;}['_createAddContextBalloonPanelView'](_0x4aaef9){return this['_createBaseBalloonPanel'](_0x4aaef9,Vo);}['_createUrlBalloonPanelView'](_0x48232a){const _0x5a41a5=this['_createBaseBalloonPanel'](_0x48232a,Po);return this['_addUrlContent'](_0x5a41a5,_0x48232a),_0x5a41a5;}['_createResourcesBalloonView'](_0x512919,_0x5e3799){const _0x2c4c0d={'searchInputVisibleFrom':_0x5e3799['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});},'onResourceSelected':(_0x214f70,_0x10482b)=>{this['fire']('addResourceToContext',{'source':_0x214f70,'resource':_0x10482b});},'onLoadSourceResources':_0x5303be=>{this['fire']('loadSourceResources',_0x5303be);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new ko(_0x512919,_0x5e3799['bodyCollection'],_0x2c4c0d);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Ho)||document['body'];}['_createBaseBalloonPanel'](_0x3a7588,_0x10afaf){const _0x4a74fd=new _0x506f25(_0x3a7588);return _0x4a74fd['extendTemplate']({'attributes':{'class':_0x10afaf}}),this['bodyCollection']['add'](_0x4a74fd),_0x4a74fd;}['_setBalloonPanelContent'](_0x47c24f,_0x5f2f93,_0x24ec3a){if(_0x47c24f['content']['clear'](),!_0x24ec3a['document']['isHidden']&&_0x24ec3a['document']['enabled']){const _0x2f79ce=this['_createBalloonButton'](_0x5f2f93,{'label':i(_0x5f2f93,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0xc22ba7});_0x2f79ce['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x47c24f['content']['add'](_0x2f79ce);}if(_0x24ec3a['urls']['enabled']){const _0x3517ab=this['_createBalloonButton'](_0x5f2f93,{'label':i(_0x5f2f93,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x4138cd});_0x3517ab['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo}),this['_urlInputView']['focus']();}),_0x47c24f['content']['add'](_0x3517ab);}if(_0x24ec3a['files']['enabled']){const _0x5a0e5f=new _0xf15140(_0x5f2f93);_0x5a0e5f['set']({'label':i(_0x5f2f93,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x118169,'withText':!0x0,'tooltip':!0x0,'class':Ro,'allowMultipleFiles':!0x0}),_0x5a0e5f['on']('done',(_0x59ccd2,_0x1c6c29)=>{this['fire']('addFileToContext',_0x1c6c29),this['hideAddContextBalloonPanel']();}),_0x5a0e5f['tooltip']=!0x0,_0x47c24f['content']['add'](_0x5a0e5f);}for(const _0x3d560e of _0x24ec3a['sources']){const _0x3fd507=this['_createBalloonButton'](_0x5f2f93,{'label':_0x3d560e['label'],'icon':_0x3d560e['icon']||_0x4a05c2,'type':'source'});_0x47c24f['content']['add'](_0x3fd507),_0x3fd507['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x3d560e);});}}['_addUrlContent'](_0x3dbe51,_0x38096d){this['_urlInputView']=new To(_0x38096d),this['_urlInputView']['on']('submitUrl',(_0x271f38,_0x5baef8)=>{this['_handleUrlSubmit'](_0x5baef8);}),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});}),_0x3dbe51['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x293b1a,_0x54156b){const _0x4d359b='source'===_0x54156b['type']?new Ma(_0x293b1a):new _0x23f64b(_0x293b1a);return _0x4d359b['set']({'label':_0x54156b['label'],'icon':_0x54156b['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Ro}),_0x4d359b;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x39650b({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x87a7e0){const _0x40d8e8=this['_addContextBalloonConfig'];_0x40d8e8['buttonView']['isOn']=_0x87a7e0,_0x87a7e0?_0x40d8e8['balloonView']['show']():_0x40d8e8['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x23be74,buttonView:_0x1c3158,hideMethod:_0x946f48}=this['_addContextBalloonConfig'];_0x39650b({'emitter':_0x23be74,'contextElements':[_0x23be74['element'],_0x1c3158['element']],'callback':()=>{_0x946f48();},'activator':()=>_0x1c3158['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x343c18,_0x41b4c1,_0x13ca87=!0x1,_0x2d0134=!0x1){const _0x36da75='conversation'===_0x41b4c1||!0x0===_0x343c18['isReadOnly'],_0x1b47ee=new bo(this['locale'],_0x343c18,_0x36da75,_0x13ca87,_0x2d0134);return _0x36da75||_0x1b47ee['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x1b47ee['id']);}),_0x1b47ee;}['_addContextToCollection'](_0x15b495,_0x105dfa){_0x105dfa['add'](_0x15b495,0x0);}['_removeContextFromCollection'](_0x43b06b,_0xad67b){const _0x241db2=_0xad67b['find'](_0x52ccfe=>_0x52ccfe['id']===_0x43b06b);_0x241db2&&_0xad67b['remove'](_0x241db2);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo}));}['_handleUrlSubmit'](_0x4cb1e1){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x4cb1e1);}}class Ma extends _0x23f64b{['arrowView'];constructor(_0xf6bf4d){super(_0xf6bf4d),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 _0x2c33c8=new _0x285b99();return _0x2c33c8['content']=_0x1a8e14,_0x2c33c8['extendTemplate']({'attributes':{'class':Uo+'__arrow'}}),_0x2c33c8;}}class gs extends _0x1fbe2f{['_cancelButtonView'];['_loaderView'];constructor(_0x1c456f){super(_0x1c456f),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 _0x3c56c6=new _0x23f64b(this['locale']);return _0x3c56c6['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x1575c2}),_0x3c56c6['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x3c56c6;}['_createLoaderView'](){const _0x56ae47=new _0x1fbe2f(this['locale']);return _0x56ae47['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')}]}),_0x56ae47;}}class Gi extends _0x1fbe2f{['_displayedModels']=[];['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x48bba6,_0x311f4c){super(_0x48bba6),this['_contextPanelView']=this['_createContextPanelView'](_0x48bba6,{'bodyCollection':_0x311f4c['bodyCollection'],'searchInputVisibleFrom':_0x311f4c['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x48bba6),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x48bba6),this['_loaderView']=this['_createLoaderView'](_0x48bba6),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x48bba6),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'](...bs)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x555da3=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x555da3['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x555da3['if']('isLoading','ck-hidden',_0x5212b2=>_0x5212b2||!this['isModelAvailable']),_0x555da3['if']('isModelAvailable','ck-hidden',_0x54d927=>!_0x54d927||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x555da3['if']('isLoading','ck-hidden',_0xce8121=>!_0xce8121)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x555da3['if']('isModelAvailable','ck-hidden',_0x529e9b=>_0x529e9b)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x39650b({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x4029e9,_0x2a6dc5){return new ms(_0x4029e9,_0x2a6dc5);}['_createPromptInputView'](_0x3dc5c5){return new ps(_0x3dc5c5,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x3d739f){return new us(_0x3d739f);}['_createLoaderView'](_0x5d8572){return new gs(_0x5d8572);}['_createModelUnavailableMessageView'](_0xffece2){const _0x88dc22=new _s(_0xffece2);return _0x88dc22['delegate']('startConversation')['to'](this),_0x88dc22;}['_handlePromptInputFocus'](_0x395591,_0x35da04,_0x296748){_0x296748?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x3d012c,_0xb95c12){this['_contextPanelView']['addContextItem'](_0x3d012c,_0xb95c12);}['removeContextItem'](_0x6e0adc){this['_contextPanelView']['removeContextItem'](_0x6e0adc);}['setContextItemLoading'](_0x1e339b,_0x4e6766){this['_contextPanelView']['setContextItemLoading'](_0x1e339b,_0x4e6766);}['setIsUploadInProgress'](_0x42e59b){this['_promptInputView']['setIsUploadInProgress'](_0x42e59b);}['setConversationContext'](_0x18fed3){this['_contextPanelView']['setConversationContext'](_0x18fed3);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x5ca596,_0x1a6d8f,_0x1a26f2){this['_contextPanelView']['updateResourceState'](_0x5ca596,_0x1a6d8f,_0x1a26f2);}['setWebSearch'](_0x8bd2e3){this['_promptCapabilitiesView']['setWebSearch'](_0x8bd2e3);}['setReasoning'](_0xfa63e7){this['_promptCapabilitiesView']['setReasoning'](_0xfa63e7);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x4b2154){this['_contextPanelView']['setAddContextOptions'](_0x4b2154);}['setInputPlaceholder'](_0x2c5c99){this['_promptInputView']['setPlaceholderText'](_0x2c5c99);}['setModelList'](_0x562904,_0x240d8f){this['_displayedModels']=_0x562904,this['_promptCapabilitiesView']['setModelList'](_0x562904,_0x240d8f);}['setModel'](_0x4cd5df){(_0x4cd5df?this['_displayedModels']['find'](_0x5f143e=>_0x5f143e['id']===_0x4cd5df['id']):null)?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x4cd5df)):_0x4cd5df?.['id']['startsWith']('agent')?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](this['_displayedModels'][0x0])):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x48bfd6){this['_promptCapabilitiesView']['disableModelSelector'](_0x48bfd6);}['populateSourceResourceBalloon'](_0x4c3db0,_0x1765fc,_0x3422d8,_0x44c764){this['_contextPanelView']['populateSourceResourceBalloon'](_0x4c3db0,_0x1765fc,_0x3422d8,_0x44c764);}['closeSourceResourceBalloon'](_0x4b8f8a){this['_contextPanelView']['closeSourceResourceBalloon'](_0x4b8f8a);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class _s extends _0x1fbe2f{constructor(_0x41a81a){super(_0x41a81a);const _0x4df87c=new _0x23f64b(_0x41a81a);_0x4df87c['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x4df87c['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'},_0x4df87c]}]});}}class Ji extends _0x5e15d9{['conversationStartButton'];['resizeButton'];constructor(_0x1d99c4,_0x336e2d){super(_0x1d99c4,{'label':i(_0x1d99c4,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Lt}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x1d99c4),this['children']['add'](this['conversationStartButton']),_0x336e2d&&(this['resizeButton']=Li(_0x1d99c4,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x1f7b8a){const _0x5cbded=new _0x23f64b(_0x1f7b8a);return _0x5cbded['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x55a7fb,'class':'ck-ai-chat__start-conversation'}),_0x5cbded['on']('execute',()=>{this['fire']('startConversation');}),_0x5cbded;}}class Ki extends _0x1fbe2f{constructor(_0x4f1d33){super(_0x4f1d33),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x4f1d33,'AI_DISCLAIMER_TEXT')}]}]});}}class Ht extends _0x1fbe2f{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x1ef52b,_0x5c8494){super(_0x1ef52b),this['_bodyCollection']=new _0x203f54(_0x1ef52b),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Ji(_0x1ef52b,_0x5c8494['showResizeButton']),this['chatHeader']['delegate'](...Gt)['to'](this),this['chatFeed']=new Bi(_0x1ef52b,this['_bodyCollection']),this['chatFeed']['delegate'](...Gt)['to'](this),this['chatControls']=new Gi(_0x1ef52b,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x5c8494['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Gt)['to'](this),this['chatDisclaimer']=new Ki(_0x1ef52b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x1ef52b['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x5b3258,_0x1355ef,_0xc080c3,_0xb5a0cf){this['chatControls']['populateSourceResourceBalloon'](_0x5b3258,_0x1355ef,_0xc080c3,_0xb5a0cf);}['closeSourceResourceBalloon'](_0x3dc163){this['chatControls']['closeSourceResourceBalloon'](_0x3dc163);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ft extends _0x5ac5c7{static get['requires'](){return[Tt];}['_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(_0x1b8c2d){super(_0x1b8c2d);const _0x57f5a5=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new st(),this['_view']=new Ht(this['context']['locale'],{'showResizeButton':_0x57f5a5['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Gt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0xf6975a,{showDiff:_0x18089d})=>{this['showDiff']=_0x18089d;}),_0x57f5a5['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':Lt,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x33815b=>_0x33815b),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x3f001e=>_0x3f001e),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x5dc733){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x5dc733['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:_0x5c713e,staticMessage:_0x4a9b0b}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x5c713e,'initialContent':'<p>'+_0x4a9b0b+'</p>'});}['addFeedItemUserMessage'](_0x49e29b){const _0x25e83f=_0x49e29b['quickActionData']?.['displayedPrompt']||_0x49e29b['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x49e29b['contextItems']['values']()),'initialContent':'<p>'+_0x25e83f+'</p>','id':_0x49e29b['id']});}['addFeedItemError']({errorMessage:_0x4b63ed,id:_0x1e7c73}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x4b63ed+'</p>','id':_0x1e7c73});}['addFeedItemAIReply'](_0x3a8287){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x3a8287['interactionId']+':'+_0x3a8287['id']}),this['setLoadingMessage'](null);});}async['addFeedItemAISuggestion'](_0x7c37c2){const _0x48a88d=q(this['context']);let _0x5b4523=_0x48a88d['config']['get']('ai.availableReplyActions')||[...H];if(_0x48a88d['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x3fc3ab=_0x48a88d['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x3fc3ab,'value');}}else _0x5b4523=_0x5b4523['filter'](_0x3087f4=>'insertSuggestion'!=_0x3087f4);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x7c37c2['interactionId']+':'+_0x7c37c2['id'],'areActionsDisabled':_0x7c37c2['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x5b4523}),this['setLoadingMessage'](null);});}['addFeedInteractionHeader'](_0x34e80f,_0x18f0f9){const _0x1296c2=this['_view']['chatFeed']['children']['last'];if(_0x1296c2 instanceof Ft)return this['_view']['chatFeed']['children']['remove'](_0x1296c2),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x34e80f['id'],'capabilities':{'isWebSearchEnabled':_0x1296c2['capabilities']['isWebSearchEnabled']||_0x18f0f9['isWebSearchEnabled'],'isReasoningEnabled':_0x1296c2['capabilities']['isReasoningEnabled']||_0x18f0f9['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x34e80f['id'],'capabilities':_0x18f0f9});}['updateFeedInteractionHeader'](_0xb0e73b){const _0x105708=this['_view']['chatFeed']['children']['find'](_0x53187f=>_0x53187f['options']['id']==_0xb0e73b['id']&&_0x53187f instanceof Ft);_0x105708&&_0x105708['set']('isVisible',_0xb0e73b['isVisible']);}async['updateFeedItemAIReplyContent'](_0x4551b5){const _0x563b2a=_0x4551b5['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x5d42e9=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x4551b5,'abortSignal':_0x5d42e9,'renderingStrategy':_0x563b2a}),_0x4551b5['isDone']&&this['markFeedItemAsDone'](_0x4551b5['id']);});}['updateFeedItemAIReplySources'](_0x1574f2,_0x31373a){this['_view']['chatFeed']['updateWebSources'](_0x1574f2,_0x31373a);}async['updateFeedItemAIReplySuggestionContent'](_0x416e86){const _0x254b81=_0x416e86['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x2c36f7=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x416e86,'abortSignal':_0x2c36f7,'renderingStrategy':_0x254b81}),_0x416e86['isDone']&&this['markFeedItemAsDone'](_0x416e86['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x5af026){this['_view']['chatFeed']['updateSuggestionPartState'](_0x5af026);}['markFeedItemAsDone'](_0x5c8956){this['_view']['chatFeed']['markItemAsDone'](_0x5c8956);}['removeFeedInteraction'](_0x2b4cc8){this['_view']['chatFeed']['getItemIds']()['filter'](_0x41e335=>_0x41e335['startsWith'](_0x2b4cc8))['forEach'](_0x1e6a4c=>this['_view']['chatFeed']['removeItem'](_0x1e6a4c));}['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'](_0x16645e){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x554448=>_0x554448['startsWith'](_0x16645e['id']))['forEach'](_0x52e5ce=>this['markFeedItemAsDone'](_0x52e5ce)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x42c685,_0x4c8bba){this['_view']['chatControls']['addContextItem'](_0x42c685,_0x4c8bba);}['removeContextItem'](_0x3365e2){this['_view']['chatControls']['removeContextItem'](_0x3365e2);}['setContextItemLoading'](_0x1f02c2,_0x8b539f){this['_view']['chatControls']['setContextItemLoading'](_0x1f02c2,_0x8b539f);}['setIsUploadInProgress'](_0x59abab){this['_view']['chatControls']['setIsUploadInProgress'](_0x59abab);}['setConversationContext'](_0x55462c){this['_view']['chatControls']['setConversationContext'](_0x55462c);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x18c85e,_0x30001e,_0x22b5a7){this['_view']['chatControls']['updateResourceState'](_0x18c85e,_0x30001e,_0x22b5a7);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x315e38){this['_view']['chatControls']['setAddContextOptions'](_0x315e38);}['updateCapabilities'](_0x4102d0){this['_view']['chatControls']['setWebSearch'](_0x4102d0['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x4102d0['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x4102d0));}['setSelectedModel'](_0x4b7f8f,_0x508b5f){this['_view']['chatControls']['setModel'](_0x4b7f8f),_0x508b5f&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0xbaf8e1){this['feedItemRenderingStrategy']=_0xbaf8e1;}['toggleLoadingSkeleton'](_0x18da2b){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x18da2b);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x4806fc,_0x11b778=!0x1){if(_0x11b778&&!Pt()&&_0x4806fc['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x4806fc);this['_view']['chatHeader']['label']=_0x4806fc;}['setLoadingMessage'](_0x12c235){const _0x55ff30=this['_getLoadingMessage'](_0x12c235);this['_view']['chatFeed']['setLoadingMessage'](_0x55ff30);}['_animateConversationTitle'](_0x574911){let _0x50ed49=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x574911[_0x50ed49],_0x50ed49++,_0x50ed49===_0x574911['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x121e31){this['_view']['chatHeader']['isMaximized']=_0x121e31;}['_getLoadingMessage'](_0x6135c5){return _0x6135c5?_0x6135c5['isWebSearchEnabled']&&_0x6135c5['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x6135c5['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x6135c5['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR'):'';}['_getInputPlaceholder'](_0x2fedbc){return _0x2fedbc?_0x2fedbc['isWebSearchEnabled']&&_0x2fedbc['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x2fedbc['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x2fedbc['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'](_0x355ce1,_0xe3dcc3,_0x18f540,_0x182dee){this['_view']['populateSourceResourceBalloon'](_0x355ce1,_0xe3dcc3,_0x18f540,_0x182dee);}['closeSourceResourceBalloon'](_0x27c206){this['_view']['closeSourceResourceBalloon'](_0x27c206);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x3a97dd,_0x35067f){this['_view']['chatFeed']['scrollToSuggestion'](_0x3a97dd,_0x35067f);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class bi extends _0x5253cf{['sections'];constructor(_0x18f625,_0x43d264){super(_0x18f625),this['sections']=_0x43d264,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x5cdb75){let _0x5dc902=0x0,_0x3819fb=0x0;for(const _0x356a67 of this['sections']){const {resultsCount:_0x2d3aae,totalItemsCount:_0x3e351d}=_0x356a67['filter'](_0x5cdb75);_0x5dc902+=_0x2d3aae,_0x3819fb+=_0x3e351d;}return{'resultsCount':_0x5dc902,'totalItemsCount':_0x3819fb};}}class Ei extends _0x57e588{['title'];['itemsViews'];['_itemsListView'];constructor(_0x243974,{title:_0x10c5de,items:_0x3971bf}){super(_0x243974);const _0x46cd22=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x10c5de,this['itemsViews']=_0x3971bf;const _0x205638=new _0x1fbe2f(_0x243974);_0x205638['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x5253cf(_0x243974),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x46cd22['if']('isVisible','ck-hidden',_0x420be1=>!_0x420be1)]},'children':[_0x205638,this['_itemsListView']]});}['filter'](_0x2a0d6c){const _0x268852=this['itemsViews']['length'];let _0x5dfcda=0x0;for(const _0x44b063 of this['itemsViews']){if(_0x2a0d6c){const _0x430d9e=_0x44b063['isMatching'](_0x2a0d6c);_0x44b063['isVisible']=!!_0x430d9e,_0x44b063['highlightText'](_0x2a0d6c);}else _0x44b063['isVisible']=!0x0,_0x44b063['highlightText'](null);_0x44b063['isVisible']&&_0x5dfcda++;}return this['isVisible']=_0x5dfcda>0x0,{'resultsCount':_0x5dfcda,'totalItemsCount':_0x268852};}['getItem'](_0x40e2e2){return this['itemsViews']['find'](_0x221257=>_0x221257['id']===_0x40e2e2);}['removeItem'](_0x4c7658){const _0x4ef218=this['itemsViews']['indexOf'](_0x4c7658);-0x1!==_0x4ef218&&(this['itemsViews']['splice'](_0x4ef218,0x1),this['_itemsListView']['items']['remove'](_0x4c7658));}}class Ri extends/* #__PURE__ -- @preserve */
27
- _0xf55989(_0x57e588){['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(_0x18a61f,_0x8064ef){super(_0x18a61f);const _0x4ece66=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x8064ef['pinned']),this['set']('loadingState',null),this['id']=_0x8064ef['id'];const {title:_0x1cdf42,createdAt:_0x3d8edb,active:_0x356639=!0x1}=_0x8064ef;this['_titleView']=new _0x4bd456(),this['_titleView']['text']=_0x1cdf42,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x223dbe=this['_createCheckView'](),_0x39c13b=this['_createPinButtonView'](_0x18a61f),_0xc689cc=this['_createMenuDropdownView'](),_0x243108=this['_createEditInputView'](_0x18a61f,_0x1cdf42),_0x15e303=this['_createAcceptEditButtonView'](_0x18a61f,_0x243108),_0x517345=this['_createCancelEditButtonView'](_0x18a61f,_0x243108);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x39c13b),this['actions']['add'](_0xc689cc),this['on']('change:isEdit',(_0x26b820,_0x5ab09b,_0x323132)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x323132?(this['actions']['add'](_0x15e303),this['actions']['add'](_0x517345),this['mainContent']['add'](_0x243108),_0x243108['element']['focus']()):(this['actions']['add'](_0x39c13b),this['actions']['add'](_0xc689cc),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x356639?'ck-ai-chat-history__item--active':'',_0x4ece66['if']('isVisible','ck-hidden',_0x45dfd3=>!_0x45dfd3),_0x4ece66['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',_0x4ece66['if']('loadingState','ck-hidden',_0x42f1ae=>!!_0x42f1ae)]},'children':_0x356639?[_0x223dbe]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x4ece66['if']('loadingState','ck-hidden',_0x6e3732=>!_0x6e3732)]},'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',_0x4ece66['if']('loadingState','ck-hidden',_0x364f2b=>!!_0x364f2b)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x4ece66['if']('loadingState','ck-hidden',_0x5c80c1=>!_0x5c80c1)]},'children':[{'text':_0x4ece66['to']('loadingState',_0x3a62df=>_0x3a62df?i(this['locale'],Ri['LOADING_LABELS'][_0x3a62df]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x3d8edb]}]},{'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'](_0x5cf0d1){this['_titleView']['text']=_0x49969b(_0x5cf0d1);}['updateLoadingState'](_0x4bf3d3,_0x249df1){this['set']('loadingState',_0x249df1?_0x4bf3d3:null);}['_createCheckView'](){const _0x253567=new _0x285b99();return _0x253567['set']({'content':_0x44639d}),_0x253567;}['_createPinButtonView'](_0x4adfe7){const _0x55a8c1=new _0x23f64b(_0x4adfe7);return _0x55a8c1['set']({'label':i(_0x4adfe7,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x137ba3,'withText':!0x1,'tooltip':!0x0}),_0x55a8c1['bind']('isOn')['to'](this,'pinned'),_0x55a8c1['on']('execute',()=>{const _0x4ed4cc=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x4ed4cc});}),_0x55a8c1;}['_createMenuDropdownView'](){const _0xb184e6=_0x43e2d9(this['locale'],_0x33205d),_0x51b3e3=_0xb184e6['panelView']['children'];_0xb184e6['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x533464}),_0xb184e6['panelPosition']='sw';const _0xf6bd68=new _0x23f64b(this['locale']);_0xf6bd68['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0xf6bd68['withText']=!0x0,_0xf6bd68['on']('execute',()=>{this['isEdit']=!0x0;});const _0x13df05=new _0x23f64b(this['locale']);_0x13df05['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x13df05['withText']=!0x0,_0x13df05['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x42f148=new _0x5253cf(this['locale']),_0x1d57a4=new _0x57e588(this['locale']);_0x1d57a4['children']['add'](_0xf6bd68);const _0x4b29ba=new _0x57e588(this['locale']);return _0x4b29ba['children']['add'](_0x13df05),_0x42f148['items']['addMany']([_0x1d57a4,_0x4b29ba]),_0x51b3e3['add'](_0x42f148),_0xb184e6;}['_createEditInputView'](_0x1f74c7,_0x2dfb02){const _0x28f8d2=new _0x1f4d7f(_0x1f74c7),_0x2a1982=_0x28f8d2['bindTemplate'];return _0x28f8d2['value']=_0x2dfb02,_0x28f8d2['extendTemplate']({'on':{'keydown':_0x2a1982['to'](_0x3febca=>{'Enter'==_0x3febca['key']&&this['_commitEditInputValue'](_0x28f8d2);})}}),_0x28f8d2;}['_createAcceptEditButtonView'](_0x38ce04,_0x55f861){const _0x5408e7=new _0x23f64b(_0x38ce04);return _0x5408e7['set']({'icon':_0x44639d,'withText':!0x1,'tooltip':i(_0x38ce04,'AI_CHAT_HISTORY_ACCEPT')}),_0x5408e7['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x5408e7['on']('execute',()=>{this['_commitEditInputValue'](_0x55f861);}),_0x5408e7;}['_commitEditInputValue'](_0x4ffdf3){const _0x131990=_0x4ffdf3['element']['value']||'';this['_titleView']['text']=_0x131990,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x131990});}['_createCancelEditButtonView'](_0x13a2b7,_0x6f68cf){const _0x276d49=new _0x23f64b(_0x13a2b7);return _0x276d49['set']({'icon':_0xead019,'withText':!0x1,'tooltip':i(_0x13a2b7,'AI_CHAT_HISTORY_CANCEL')}),_0x276d49['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x276d49['on']('execute',()=>{this['isEdit']=!0x1,_0x6f68cf['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x276d49;}['_createSpinnerView'](){const _0x59f2f1=new Si('tiny');return _0x59f2f1['isVisible']=!0x0,_0x59f2f1;}['isMatching'](_0x4b4fe9){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x4b4fe9)?{'title':!0x0}:null;}['highlightText'](_0x22c78f){this['_titleView']['highlightText'](_0x22c78f);}}class pt extends _0x1fbe2f{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x42908e,_0x1c15c0){super(_0x42908e),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0x3d2fa7=new _0x5e15d9(_0x42908e,{'label':i(_0x42908e,'AI_CHAT_HISTORY_HEADING'),'icon':dt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x1c15c0&&(this['resizeButton']=Li(_0x42908e,this),_0x3d2fa7['children']['add'](this['resizeButton'])),this['sectionsView']=new bi(_0x42908e,[]),this['sectionsView']['delegate'](...ji)['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':[_0x3d2fa7,{'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 _0xe5f0db=new _0xc74ce3(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x2a238e=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x2a238e),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0xe5f0db['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0xe5f0db['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x56442b=>!_0x56442b)]}}),_0xe5f0db;}['_createSkeletonView'](){const _0x58a14e=new vi(this['locale'],xi['aiHistory']);return _0x58a14e['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x1caf50=>!_0x1caf50)]}}),_0x58a14e;}['_createErrorView'](){const _0x12fcb1=new _0x1fbe2f(this['locale']),_0x1d43b3=new _0x23f64b(this['locale']);return _0x1d43b3['set']({'withText':!0x1,'icon':_0xead019,'class':'ck-ai-chat-error__dismiss-button'}),_0x1d43b3['bind']('isVisible')['to'](this,'hasItems',_0x28dbd0=>!!_0x28dbd0),_0x1d43b3['on']('execute',()=>{this['errorMessage']='';}),_0x12fcb1['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x202c2d=>!_0x202c2d)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x1d43b3]}),_0x12fcb1;}['_createEmptyStateView'](){const _0x577f6b=new _0x23f64b(this['locale']);_0x577f6b['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x55a7fb,'class':'ck-ai-chat__start-conversation'}),_0x577f6b['on']('execute',()=>{this['fire']('openChat');});const _0xab9d4=new _0x1fbe2f(this['locale']);return _0xab9d4['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x249027=>!_0x249027)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x577f6b]}),_0xab9d4;}['_createListItemViews'](_0x2debe1,_0x3c4127){const _0x16c359=[];for(const _0x3fb7ab of _0x2debe1){const _0xfa2059=new Ri(_0x3c4127,_0x3fb7ab);_0xfa2059['delegate'](...ji)['to'](this),_0x16c359['push'](_0xfa2059);}return _0x16c359;}['updateHistoryItemsWithCategories'](_0x1c3513){const _0x12031a=this['locale']||'en',_0x313999=[];for(const _0x1a33ce of _0x1c3513){const _0x22851e=this['_createListItemViews'](_0x1a33ce['items'],_0x12031a);_0x313999['push'](new Ei(_0x12031a,{'title':_0x1a33ce['title'],'items':_0x22851e}));}this['sectionsView']['sections']=_0x313999,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x313999),this['hasItems']=_0x1c3513['some'](_0x4ac468=>_0x4ac468['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x1b330b){for(const _0x662c3c of this['sectionsView']['sections']){const _0x37f8c4=_0x662c3c['getItem'](_0x1b330b);if(_0x37f8c4){if(_0x662c3c['removeItem'](_0x37f8c4),0x0===_0x662c3c['itemsViews']['length']){const _0x141b1e=this['sectionsView']['sections']['indexOf'](_0x662c3c);-0x1!==_0x141b1e&&(this['sectionsView']['sections']['splice'](_0x141b1e,0x1),this['sectionsView']['items']['remove'](_0x662c3c));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x390257,_0x4c3d89){for(const _0x1990fc of this['sectionsView']['sections']){const _0x1c201c=_0x1990fc['getItem'](_0x390257);if(_0x1c201c){_0x1c201c['updateTitle'](_0x4c3d89);break;}}}['updateItemLoadingState'](_0x392ae2,_0x53141f,_0x4dce82){for(const _0x258ecf of this['sectionsView']['sections']){const _0xcfd2a5=_0x258ecf['getItem'](_0x392ae2);if(_0xcfd2a5){_0xcfd2a5['updateLoadingState'](_0x53141f,_0x4dce82);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x35be7c=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x35be7c);}}}const ji=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class gt extends _0x5ac5c7{static get['requires'](){return[Tt];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x553287){super(_0x553287);const _0x16e1ea=this['context']['plugins']['get']('AITabs');this['_historyView']=new pt(this['context']['locale'],_0x16e1ea['showResizeButton']),this['_historyView']['delegate'](...ji)['to'](this),_0x16e1ea['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':dt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x5d662e){this['_historyView']['removeHistoryItem'](_0x5d662e);}['updateItems'](_0x9b2bd6){this['_historyView']['updateHistoryItemsWithCategories'](_0x9b2bd6);}['updateItemTitle'](_0x542e9c,_0x3a4b27){this['_historyView']['updateItemTitle'](_0x542e9c,_0x3a4b27);}['updateItemLoadingState'](_0x28a60a,_0x705aa5,_0x5722c0){this['_historyView']['updateItemLoadingState'](_0x28a60a,_0x705aa5,_0x5722c0);}['setLoadingSkeleton'](_0x5b54c3){this['_historyView']['isLoading']=_0x5b54c3;}['showError'](_0x2bf215){this['_historyView']['errorMessage']=_0x2bf215;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0xe31ba9){this['_historyView']['isMaximized']=_0xe31ba9;}}class De extends ts(){['id'];['createdAt'];constructor({id:_0x2880e1,title:_0x557e49,createdAt:_0xa5c487,updatedAt:_0x36e046,pinned:_0x191978}){super(),this['id']=_0x2880e1,this['createdAt']=new Date(_0xa5c487),this['set']('title',_0x557e49),this['set']('updatedAt',_0x36e046?new Date(_0x36e046):null),this['set']('pinned',_0x191978||!0x1);}['updateTitle'](_0x2496e9){this['set']('title',_0x49969b(_0x2496e9)),this['updatedAt']=new Date();}['updatePinned'](_0x575a40){this['set']('pinned',_0x575a40),this['updatedAt']=new Date();}}class It extends _0x49ef7b(){['items']=[];['connector'];['group'];constructor({connector:_0x55c7b3,group:_0x2e25bb}){super(),this['connector']=_0x55c7b3,this['group']=_0x2e25bb;}async['init'](){try{const _0x326564=this['connector']['fetchConversations'](this['group']),_0x56216c=await _0x326564['getConversations']();this['loadItems'](_0x56216c);}catch(_0x424182){this['fire']('error',{'error':_0x424182,'operation':'init'});}}['addItem'](_0x3affc4){this['items']['push'](_0x3affc4);}async['removeItem'](_0x47861c){const _0x34b53a=this['items']['findIndex'](_0x5652a2=>_0x5652a2['id']===_0x47861c);if(-0x1===_0x34b53a)return!0x1;try{return await this['connector']['deleteConversation'](_0x47861c)['execute'](),this['items']['splice'](_0x34b53a,0x1),this['fire']('itemRemoved',{'itemId':_0x47861c}),!0x0;}catch(_0x6ecf7f){return this['fire']('error',{'error':_0x6ecf7f,'operation':'removeItem','itemId':_0x47861c}),!0x1;}}['getItem'](_0x1d7524){return this['items']['find'](_0x1756e9=>_0x1756e9['id']===_0x1d7524);}async['updateItemTitle'](_0x2e4a98,_0x410110){const _0x192258=this['getItem'](_0x2e4a98);if(!_0x192258)return!0x1;try{return await this['connector']['updateConversation'](_0x2e4a98,{'title':_0x410110})['getResult'](),_0x192258['updateTitle'](_0x410110),this['fire']('itemUpdated',{'itemId':_0x2e4a98,'updates':{'title':_0x410110}}),!0x0;}catch(_0x11bbf3){return this['fire']('error',{'error':_0x11bbf3,'operation':'updateItemTitle','itemId':_0x2e4a98}),!0x1;}}async['updateItemPinned'](_0xe07e77,_0x2ca63f){const _0x5bc84c=this['getItem'](_0xe07e77);if(!_0x5bc84c)return!0x1;try{return await this['connector']['updateConversation'](_0xe07e77,{'pinned':_0x2ca63f})['getResult'](),_0x5bc84c['updatePinned'](_0x2ca63f),this['fire']('itemUpdated',{'itemId':_0xe07e77,'updates':{'pinned':_0x2ca63f}}),!0x0;}catch(_0x13ee22){return this['fire']('error',{'error':_0x13ee22,'operation':'updateItemPinned','itemId':_0xe07e77}),!0x1;}}['loadItems'](_0x2be356){try{this['items']=[],_0x2be356['map'](_0x2655cb=>{this['addItem'](new De(_0x2655cb));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x3440a1){this['fire']('error',{'error':_0x3440a1,'operation':'loadItems'});}}['getItems'](_0x482eb8={}){const _0xe62db9=void 0x0!==_0x482eb8['pinned']&&_0x482eb8['pinned'],_0x16183b=_0x482eb8['from']?new Date(_0x482eb8['from']['getFullYear'](),_0x482eb8['from']['getMonth'](),_0x482eb8['from']['getDate']()):null,_0x4bdcaf=_0x482eb8['to']?new Date(_0x482eb8['to']['getFullYear'](),_0x482eb8['to']['getMonth'](),_0x482eb8['to']['getDate']()):null;return this['items']['filter'](_0xa665de=>{if(_0xa665de['pinned']!==_0xe62db9)return!0x1;if(_0x4bdcaf){const _0xd9dca4=new Date(_0xa665de['createdAt']['getFullYear'](),_0xa665de['createdAt']['getMonth'](),_0xa665de['createdAt']['getDate']());return _0x16183b?_0x16183b['getTime']()===_0x4bdcaf['getTime']()?_0xd9dca4['getTime']()===_0x16183b['getTime']():_0xd9dca4<_0x4bdcaf&&_0xd9dca4>=_0x16183b:_0xd9dca4<_0x4bdcaf;}return!0x0;});}}class mt extends _0x5ac5c7{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[R,_t,gt,Tt];}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'](gt),this['_aiChatController']=this['context']['plugins']['get'](_t);const _0x43e968=this['context']['plugins']['get'](Tt),_0x55356d=this['_aiChatController']['getGroupId']();this['history']=new It({'connector':this['_aiConnector'],'group':_0x55356d}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x9e73a9,_0x47a429)=>{this['_setItemLoading'](_0x47a429['id'],'remove'),this['_handleRemove'](_0x47a429['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x51efce,_0x2b837f)=>{this['_setItemLoading'](_0x2b837f['id'],'rename'),this['_handleEditTitle'](_0x2b837f['id'],_0x2b837f['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x2244fd,_0x19a627)=>{void 0x0!==_0x19a627['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x19a627['itemId'],_0x19a627['updates']['title']),void 0x0!==_0x19a627['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x19a627['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x4b8637,_0x41c8f1)=>{this['_aiChatController']['handleRemovedConversation'](_0x41c8f1['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x41c8f1['itemId']),this['_clearItemLoading'](_0x41c8f1['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x84333c,_0x48a703)=>{this['_handleHistoryErrorUI'](_0x48a703['error'],_0x48a703['operation'],_0x48a703['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x1168cf,_0x2cf56b)=>{this['_handleSelectConversation'](_0x2cf56b['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x5d3a4e,_0x78bc76)=>{const _0x2ba0bf=_0x78bc76['pinned']?'pin':'unpin';this['_setItemLoading'](_0x78bc76['id'],_0x2ba0bf),this['_handleTogglePin'](_0x78bc76['id'],_0x78bc76['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x43e968['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x43e968['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x43e968,'resizedTabs',(_0x4e0127,_0x58a7d9)=>{this['_setIsMaximized'](_0x58a7d9);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x43e968['resize']();});}async['_handleEditTitle'](_0x15666b,_0x597151){await this['history']['updateItemTitle'](_0x15666b,_0x597151);}async['_handleTogglePin'](_0x3d319a,_0x20f250){await this['history']['updateItemPinned'](_0x3d319a,_0x20f250);}async['_handleRemove'](_0xa170a5){await this['history']['removeItem'](_0xa170a5);}async['_handleSelectConversation'](_0x53025b){await this['_aiChatController']['loadConversation'](_0x53025b);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0xdd0301=this['_aiChatController']['activeConversation']?.['id'],_0x3ad1fc=this['_getCategorizedItems']()['map'](_0xc9830d=>({'title':_0xc9830d['title'],'items':_0xc9830d['items']['map'](_0xa8b57d=>({'id':_0xa8b57d['id'],'title':_0xa8b57d['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0xa8b57d['createdAt'])['toLocaleDateString'](),'active':_0xa8b57d['id']===_0xdd0301,'pinned':_0xa8b57d['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x3ad1fc);}['_setItemLoading'](_0x479061,_0x26c447){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x479061,_0x26c447,!0x0);}['_clearItemLoading'](_0x61a34f){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x61a34f,null,!0x1);}['_handleHistoryErrorUI'](_0x2003cd,_0x3bf633,_0x115a72){const _0x4d4861=this['_generateErrorMessage'](_0x3bf633,_0x115a72);this['_aiChatHistoryUi']['showError'](_0x4d4861),_0x115a72&&this['_clearItemLoading'](_0x115a72),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x502180,_0x5f2312){const _0x189ffa=_0x5f2312?this['history']['getItem'](_0x5f2312):null,_0x833b8e=_0x189ffa?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x502180){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x833b8e);case'updateItemPinned':{const _0x2f413e=i(this['context']['locale'],_0x189ffa?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x2f413e,_0x833b8e]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x833b8e);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 _0xa9aeb5=new Date(),_0x24bed8=new Date(_0xa9aeb5['getFullYear'](),_0xa9aeb5['getMonth'](),_0xa9aeb5['getDate']()),_0x190dc=new Date(_0x24bed8);_0x190dc['setDate'](_0x190dc['getDate']()-0x1);const _0x1b6d66=new Date(_0x24bed8);_0x1b6d66['setDate'](_0x1b6d66['getDate']()-0xe);const _0x2a01e9=this['history']['getItems']({'pinned':!0x0}),_0x325e91=this['history']['getItems']({'from':_0x24bed8,'to':_0x24bed8}),_0x21e3b9=this['history']['getItems']({'from':_0x190dc,'to':_0x190dc}),_0x587787=this['history']['getItems']({'from':_0x1b6d66,'to':_0x190dc}),_0x5e8086=this['history']['getItems']({'to':_0x1b6d66}),_0x18b85d=[];return _0x2a01e9['length']>0x0&&_0x18b85d['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x2a01e9}),_0x325e91['length']>0x0&&_0x18b85d['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x325e91}),_0x21e3b9['length']>0x0&&_0x18b85d['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x21e3b9}),_0x587787['length']>0x0&&_0x18b85d['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x587787}),_0x5e8086['length']>0x0&&_0x18b85d['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x5e8086}),_0x18b85d;}['_setIsMaximized'](_0x39b5e7){this['_aiChatHistoryUi']['setIsMaximized'](_0x39b5e7);}}class yt extends _0x5ac5c7{static get['requires'](){return[mt,gt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ua extends _0x5ac5c7{static get['requires'](){return[_t,N,ft,yt];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x50accd){super(_0x50accd),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'](_t)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](_t)['startConversation']();}async['sendMessage']({message:_0xc40a96,quickActionData:_0x20bbba}){await this['context']['plugins']['get'](_t)['sendMessage']({'message':_0xc40a96,'quickActionData':_0x20bbba});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](_t)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](_t)['focusPromptInput']();}}class co extends Qt{constructor(_0x47048f){super(_0x47048f);const _0x4e22a0=_0x47048f['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x4e22a0,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x122a46=this['editor']['plugins']['get']('AITabs')['view'];_0x122a46['isVisible']=!_0x122a46['isVisible'];}}class jt extends _0x4075a7{static get['requires'](){return[Tt];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x297b3a=this['editor'];_0x297b3a['commands']['add']('toggleAi',new co(_0x297b3a)),_0x297b3a['ui']['componentFactory']['add']('toggleAi',()=>{const _0x3dd8de=this['_createAIUIButton'](_0x23f64b);return _0x3dd8de['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x3dd8de;}),_0x297b3a['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x48dfc8=this['_createAIUIButton'](_0x6490d1);return _0x48dfc8['set']({'role':'menuitemcheckbox'}),_0x48dfc8;});}['_createAIUIButton'](_0x85cfa4){const _0x430582=this['editor'],_0x421c22=_0x430582['commands']['get']('toggleAi'),_0x2f0b1c=new _0x85cfa4(_0x430582['locale']);return _0x2f0b1c['set']({'label':i(_0x430582['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x53ad3f,'isToggleable':!0x0}),_0x2f0b1c['bind']('isEnabled')['to'](_0x421c22),_0x2f0b1c['bind']('isOn')['to'](_0x421c22,'value',_0x122d10=>!!_0x122d10),this['listenTo'](_0x2f0b1c,'execute',()=>{_0x421c22['execute']();}),_0x2f0b1c;}}class Va extends _0x4075a7{static get['requires'](){return[jt,qt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function ee(_0x552205,_0x126f58,_0x4488a1=!0x1,_0x23038a=!0x0,_0x3a5a16=!0x0){return()=>{const _0x467ac7=_0x552205['locale'],_0x598fb3=new _0x23f64b(_0x467ac7),_0x2be8c5=_0x598fb3['bindTemplate'];_0x3a5a16&&_0x598fb3['extendTemplate']({'on':{'mouseenter':_0x2be8c5['to'](()=>{_0x598fb3['focus']();})}});const _0xe80b34=_0x126f58['icon']??_0x126f58['parent']?.['icon'];return _0x598fb3['set']({'label':_0x126f58['displayedPrompt'],'withText':_0x4488a1,'role':'menuitem','icon':_0x23038a?_0xe80b34??_0x5880d7:void 0x0,'tooltip':!_0x4488a1,'class':'ck-ai-quick-actions-button'}),_0x598fb3['on']('execute',()=>{_0x552205['editing']['view']['focus'](),_0x552205['commands']['execute']('aiQuickAction',_0x126f58);}),_0x598fb3;};}const vs='menu',Ls='menuitem';class ao extends _0x1fbe2f{['_bodyCollection'];['optionsListView'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();constructor(_0x3aecde,_0x51d757,_0x83af5b,_0x5ad420){const _0x143091=_0x3aecde['locale'];super(_0x143091),this['_bodyCollection']=_0x5ad420;const _0x3b33bc=this['_createListItems'](_0x3aecde,_0x51d757,_0x83af5b);this['optionsListView']=new _0x5253cf(_0x143091),this['optionsListView']['role']=vs,this['optionsListView']['items']['addMany'](_0x3b33bc),this['focusTracker']=new _0x2cffef(),this['keystrokes']=new _0x46a36b(),this['_focusables']=_0x3b33bc,this['focusCycler']=new _0x14e425({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x143091['uiLanguageDirection']},'children':[this['optionsListView']]});}['_createListItems'](_0x30c986,_0x431c45,_0x4bdfcb){const _0xaa76d6=new _0xa90262();return _0x431c45['forEach'](_0xd177a=>{'actions'in _0xd177a?_0xaa76d6['add'](this['_createActionGroupButton'](_0x30c986,_0xd177a,_0x4bdfcb)):_0xaa76d6['add'](this['_createActionButton'](_0x30c986,_0xd177a));}),_0xaa76d6;}['_createActionButton'](_0x172399,_0x2dfdd){const _0x10a270=new _0x57e588(this['locale']),_0x1acddd=ee(_0x172399,_0x2dfdd,!0x0,void 0x0!==_0x2dfdd['icon'])();return _0x10a270['children']['add'](_0x1acddd),_0x10a270;}['_createActionGroupButton'](_0x29d336,_0x210462,_0x2a52f1){const _0xc6184b=new _0x57e588(this['locale']),_0x4baa00=new _0x1650b4(this['locale']),_0x1d631d=_0x4baa00['bindTemplate'],_0x4f9587='rtl'===_0x2a52f1['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft',_0x35ab06=this['_createGroupActionsList'](_0x29d336,_0x210462['actions'],_0x2a52f1);_0x4baa00['set']({'label':_0x210462['label'],'withText':!0x0,'role':Ls,'icon':_0x210462['icon']??_0x5880d7}),_0x4baa00['extendTemplate']({'on':{'mouseenter':_0x1d631d['to'](()=>{_0x4baa00['focus']();})}});const _0x17d094=new _0x506f25(this['locale']);return _0x17d094['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x1d631d['to'](_0x4892a6=>{_0x4892a6['key']==_0x4f9587&&(_0x4baa00['focus'](),this['_hideNestedPanel'](_0x17d094));})}}),_0x4baa00['bind']('isOn')['to'](_0x17d094,'isVisible'),this['_bodyCollection']['add'](_0x17d094),_0x17d094['content']['add'](_0x35ab06),this['_setupGroupMenuBehavior'](_0x4baa00,_0x17d094),_0xc6184b['children']['add'](_0x4baa00),_0xc6184b;}['_createGroupActionsList'](_0x52d08c,_0x245a17,_0x2ed32f){const _0x28c9dc=new _0x5253cf(this['locale']);return _0x28c9dc['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x245a17['forEach'](_0x45dcea=>{const _0x592817=new _0x57e588(this['locale']),_0x5eca55=ee(_0x52d08c,_0x45dcea,!0x0,!0x1)();_0x592817['children']['add'](_0x5eca55),_0x2ed32f['focusTracker']['add'](_0x5eca55),_0x28c9dc['items']['add'](_0x592817);}),_0x28c9dc;}['_setupGroupMenuBehavior'](_0x25e0a4,_0x24d997){const _0x13f50e=_0x25e0a4['bindTemplate'],_0x49094a='rtl'===_0x25e0a4['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';_0x25e0a4['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x13f50e['to'](()=>{this['_showNestedPanel'](_0x24d997,_0x25e0a4);}),'mouseleave':_0x13f50e['to'](_0x342a26=>{const _0x1e7503=_0x342a26['relatedTarget'];this['_isMovingToNestedMenu'](_0x1e7503,_0x24d997)||this['_hideNestedPanel'](_0x24d997);}),'keydown':_0x13f50e['to'](_0x5d25e2=>{_0x5d25e2['key']==_0x49094a&&(this['_showNestedPanel'](_0x24d997,_0x25e0a4),_0x24d997['content']['get'](0x0)['focus']());})}}),_0x24d997['on']('render',()=>{_0x24d997['element']?.['addEventListener']('mouseleave',_0x441fd3=>{const _0x29d792=_0x441fd3['relatedTarget'];_0x25e0a4['element']?.['contains'](_0x29d792)||this['_isMovingToNestedMenu'](_0x29d792,_0x24d997)||this['_hideNestedPanel'](_0x24d997);});});}['_showNestedPanel'](_0x42a154,_0x3d0414){this['_openNestedPanels']['forEach'](_0x338dda=>{_0x338dda!==_0x42a154&&_0x338dda['isVisible']&&_0x338dda['hide']();}),_0x42a154['show'](),_0x42a154['pin']({'positions':[_0x5738b9['eastSouth']],'target':_0x3d0414['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x42a154);}['_hideNestedPanel'](_0x388969){_0x388969['hide'](),this['_openNestedPanels']['delete'](_0x388969);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x248485=>_0x248485['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x3d67b4,_0x222c29){if(!_0x3d67b4)return!0x1;if(_0x222c29['element']?.['contains'](_0x3d67b4))return!0x0;const _0x432257=_0x3d67b4;return _0x432257['closest']&&(null!==_0x432257['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x432257['closest']('.ck-ai-quick-actions-group-list')||null!==_0x432257['closest']('.ck-ai-quick-actions-group-button'));}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['optionsListView']['focus']();}}function te(_0x4a1069,_0x298dd1,_0x30b23e,_0x3b52f5){return()=>{const _0x2682dc=_0x4a1069['locale'],_0x538669=_0x43e2d9(_0x2682dc);_0x538669['buttonView']['set']({'icon':_0x30b23e['icon']??_0x5880d7,'label':_0x30b23e['label'],'tooltip':!0x0}),_0x538669['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x54158a=new ao(_0x4a1069,_0x298dd1,_0x538669,_0x3b52f5);return _0x538669['panelView']['children']['add'](_0x54158a),_0x538669;};}const oe='<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>',ae='<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>',se='<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 Kt=function(_0x34d1fd){return _0x34d1fd['CHAT']='CHAT',_0x34d1fd['ACTION']='ACTION',_0x34d1fd['REVIEW']='REVIEW',_0x34d1fd;}({}),Ga=function(_0x5e5b10){return _0x5e5b10['CHAT']='AIChat',_0x5e5b10['ACTION']='AIActions',_0x5e5b10['REVIEW']='AIReviewMode',_0x5e5b10;}({});class ii extends _0x4075a7{static get['requires'](){return[_0x51c989];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_prepareQuickActionsDefinition'](this['_getDefaultAndCustomActions']()),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x36c8a2){return function(_0x1be4aa){const _0xbc1193=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x1be4aa['uiLanguage']),_0xd87dc0=_0xbc1193||'English',_0x566277=[{'id':'ask-ai','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Wt},{'id':'chat-commands','label':i(_0x1be4aa,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Wt,'actions':[{'id':'explain','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':oe['replace']('%0',_0xd87dc0),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ae['replace']('%0',_0xd87dc0),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':se['replace']('%0',_0xd87dc0),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Vt},{'id':'continue','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Bt},{'id':'fix-grammar','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Jt},{'id':'adjust-length','label':i(_0x1be4aa,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Yt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x1be4aa,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':zt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x1be4aa,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Zt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x1be4aa,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x1be4aa,'AI_QUICK_ACTIONS_OTHER'),'icon':Xt,'actions':[]}];return _0x566277;}(_0x36c8a2);}['_getDefaultAndCustomActions'](){const _0x32ae5e=ii['getDefaultQuickActions'](this['editor']['locale']),_0x2b6435=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0xb81c04=>({..._0xb81c04,'icon':void 0x0}));return _0x32ae5e['find'](_0xf3486b=>'other'===_0xf3486b['id'])['actions']['push'](..._0x2b6435),_0x32ae5e;}['_initializeQuickActionsComponentsAndCommands'](){const _0xa96f19=new _0x203f54(this['editor']['locale']);_0xa96f19['attachToDom'](),this['_initializeQuickActionsDropdown'](_0xa96f19),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0xa96f19);}['_initializeQuickActionsDropdown'](_0x3e104c){this['editor']['ui']['componentFactory']['add']('aiQuickActions',te(this['editor'],this['_quickActionsDefinition'],{'icon':_0x5880d7,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},_0x3e104c));}['_prepareQuickActionsDefinition'](_0x243d67){this['_quickActionsDefinition']=_0x243d67['map'](_0x24f190=>{if('actions'in _0x24f190){const _0x5d538e=_0x24f190;return{..._0x5d538e,'actions':_0x5d538e['actions']['map'](_0x116557=>{const {actions:_0x1f5359,..._0x5409d9}=_0x5d538e;return{..._0x116557,'parent':_0x5409d9};})['filter'](_0x56b259=>this['_shouldIncludeAction'](_0x56b259))};}return _0x24f190;})['filter'](_0xf421c3=>'actions'in _0xf421c3?_0xf421c3['actions']['length']>0x0:this['_shouldIncludeAction'](_0xf421c3));}['_shouldIncludeAction'](_0x3929a9){const _0x410d98=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ga[_0x3929a9['type']])&&!_0x410d98['includes'](_0x3929a9['id']);}['_initializeQuickActionsComponents'](_0x33b9fa){this['_quickActionsDefinition']['forEach'](_0x4975fa=>{if('actions'in _0x4975fa){const _0x4a5d12=te(this['editor'],_0x4975fa['actions'],_0x4975fa,_0x33b9fa);this['editor']['ui']['componentFactory']['add'](_0x4975fa['id'],_0x4a5d12),_0x4975fa['actions']['forEach'](_0x279644=>{const _0x3c3fa3=ee(this['editor'],_0x279644);this['editor']['ui']['componentFactory']['add'](_0x279644['id'],_0x3c3fa3);});}else{const _0x73de9a=ee(this['editor'],_0x4975fa,!0x1,!0x0,!0x1);this['editor']['ui']['componentFactory']['add'](_0x4975fa['id'],_0x73de9a);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x2414cd=>{const _0x47c28e=new _0x890a74(_0x2414cd),_0x18492f=i(_0x2414cd,'AI_QUICK_ACTIONS_HEADING');_0x47c28e['buttonView']['set']({'label':_0x18492f,'icon':_0x5880d7});const _0x100664=new _0x4f9a9e(_0x2414cd);_0x100664['set']({'ariaLabel':_0x18492f,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x2a7f40=>{if('actions'in _0x2a7f40){const _0x35d918=_0x2a7f40,_0x1895a2=new _0x2db487(_0x2414cd,_0x47c28e),_0x5e2cff=new _0x890a74(_0x2414cd),_0x40ba5a=new _0x4f9a9e(_0x2414cd);_0x5e2cff['buttonView']['set']({'label':_0x35d918['label'],'icon':_0x35d918['icon']}),_0x35d918['actions']['forEach'](_0x4c6713=>{const _0x1f7549=new _0x2db487(_0x2414cd,_0x5e2cff),_0x21cd8e=new _0x6490d1(_0x2414cd);_0x21cd8e['set']({'label':_0x4c6713['displayedPrompt'],'icon':_0x4c6713['icon'],'role':'menuitem'}),_0x21cd8e['on']('execute',()=>{this['_executeQuickAction'](_0x4c6713);}),_0x21cd8e['delegate']('execute')['to'](_0x5e2cff),_0x1f7549['children']['add'](_0x21cd8e),_0x40ba5a['items']['add'](_0x1f7549);}),_0x5e2cff['panelView']['children']['add'](_0x40ba5a),_0x1895a2['children']['add'](_0x5e2cff),_0x100664['items']['add'](_0x1895a2);}else{const _0x355ad4=_0x2a7f40,_0x4308f6=new _0x2db487(_0x2414cd,_0x47c28e),_0xe4290=new _0x6490d1(_0x2414cd);_0xe4290['set']({'label':_0x355ad4['displayedPrompt'],'icon':_0x355ad4['icon'],'role':'menuitem'}),_0xe4290['on']('execute',()=>{this['_executeQuickAction'](_0x355ad4);}),_0xe4290['delegate']('execute')['to'](_0x47c28e),_0x4308f6['children']['add'](_0xe4290),_0x100664['items']['add'](_0x4308f6);}});const _0x45b51a=Object['values'](Ga)['some'](_0x40a330=>this['editor']['plugins']['has'](_0x40a330));return _0x47c28e['set']({'isEnabled':_0x45b51a}),_0x47c28e['panelView']['children']['add'](_0x100664),_0x47c28e;});}['_executeQuickAction'](_0x2c1205){const _0x22fcbf=this['editor'];_0x22fcbf['editing']['view']['focus'](),_0x22fcbf['commands']['execute']('aiQuickAction',_0x2c1205);const _0x11e888=_0x22fcbf['ui']['view']['menuBarView'];_0x11e888&&_0x11e888['close']&&_0x11e888['close']();}}class ci extends Qt{['execute'](_0x31641e){switch(this['_expandSelectionIfCollapsed'](),_0x31641e['type']){case Kt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x45840e=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x5b2487('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x45840e});}this['_handleAIChatAction'](_0x31641e);break;case Kt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x447e38=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x5b2487('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x447e38});}this['_handleAIActionsAction'](_0x31641e);break;case Kt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0xce1947=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x5b2487('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0xce1947});}this['_handleAIReviewAction'](_0x31641e);}}async['_handleAIChatAction'](_0x5701d9){const _0x13c65b=this['editor']['plugins']['get']('AIChat'),_0x3836bd=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x5701d9['id'])_0x3836bd['removeSelectionFromChatContext'](),await _0x13c65b['addSelectionToChatContext'](),_0x13c65b['focusPromptInput']();else await _0x13c65b['startConversation'](),_0x3836bd['removeSelectionFromChatContext'](),await _0x13c65b['addSelectionToChatContext'](),_0x13c65b['focusPromptInput'](),await _0x13c65b['sendMessage']({'message':_0x5701d9['prompt']||_0x5701d9['displayedPrompt'],'quickActionData':{'id':_0x5701d9['id'],'displayedPrompt':_0x5701d9['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x2fe87b=this['editor'],_0x39243e=_0x2fe87b['model']['document']['selection'];if(!_0x39243e['isCollapsed'])return;const _0x5af63b=_0x41a078(_0x39243e['getSelectedBlocks']())||_0x2fe87b['model']['schema']['getLimitElement'](_0x39243e);_0x2fe87b['model']['change'](_0x544e92=>{_0x544e92['setSelection'](_0x5af63b,'in');});}['_handleAIActionsActionLabel'](_0x1558fd){return _0x1558fd['parent']?.['label']&&'other'!==_0x1558fd['parent']?.['id']?_0x1558fd['parent']['label']+':\x20'+_0x1558fd['displayedPrompt']:_0x1558fd['displayedPrompt'];}async['_handleAIActionsAction'](_0x87afa2){const _0xe53d0d=this['editor']['plugins']['get']('AIActions'),_0x486658=_0x87afa2['prompt']?{'userMessage':_0x87afa2['prompt'],'model':_0x87afa2['model']}:{'actionName':_0x87afa2['actionName']||_0x87afa2['id'],'args':_0x87afa2['args']},_0x16efb4=this['_handleAIActionsActionLabel'](_0x87afa2);await _0xe53d0d['executeAction'](_0x486658,_0x16efb4,_0x87afa2['icon']);}async['_handleAIReviewAction'](_0x285640){console['log']('handleAIReviewAction',_0x285640);}}class ti extends _0x4075a7{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3a5a82=this['editor'],_0x6abea7=new ci(this['editor']);if(_0x3a5a82['commands']['add']('aiQuickAction',_0x6abea7),_0x3a5a82['plugins']['has']('AIChat')){const _0xc27512=this['editor']['plugins']['get']('AIChat');_0x3a5a82['model']['document']['selection']['on']('change:range',(_0x5773fc,_0x50ff18)=>{_0x50ff18['directChange']&&_0xc27512['removeSelectionFromChatContext']();});}}}class Ae extends ke{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x124599=this['documentContextContent']['children']['map'](_0x4c1493=>({'node':_0x4c1493,'id':bt(_0x4c1493,'data-id')})),_0x25d9da=this['parsedMergedContent']['children']['map'](_0x5ecff8=>({'node':_0x5ecff8,'id':bt(_0x5ecff8,'data-id')||_0x5fe9bf()})),_0x43ed8f=_0x53e905(_0x124599,_0x25d9da,{'comparator':(_0x391d56,_0x5c65b9)=>_0x391d56['id']==_0x5c65b9['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x43ed8f['length']&&_0x43ed8f[_0x43ed8f['length']-0x1]['removed'];)_0x43ed8f['pop']();}const _0x38c929=_0x43ed8f['map'](_0x3128c6=>{const _0x41ae36=_0x3128c6['added']?'new':_0x3128c6['removed']?'removed':'modified';return{'node':_0x3128c6['value'][0x0]['node'],'type':_0x41ae36,'id':_0x3128c6['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x38c929,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x44aeef,_0x14f6f2){return _0x14f6f2;}}class Q extends xe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x2197a6){super(_0x2197a6),this['content']=_0x2197a6['content'],this['version']=_0x2197a6['version'],this['actionName']=_0x2197a6['actionName'],this['args']=_0x2197a6['args'],this['userMessage']=_0x2197a6['userMessage'],this['model']=_0x2197a6['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':Ie['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x3ee071){const _0x560922=new Ae({'editor':this['editor'],'documentContextContent':this['content'],..._0x3ee071});return this['replies']['push'](_0x560922),_0x560922['delegate'](...je)['to'](this),this['fire']('replyCreated',_0x560922),_0x560922;}}class ri extends _0x4075a7{static get['requires'](){return[R,_0x52d042,N,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 _0xa90262();['_navigationPreviousButton'];['_navigationCounter'];['_isNavigationCounterInView']=!0x1;['_navigationNextButton'];['_isNavigationPreviousButtonInView']=!0x1;['_isNavigationNextButtonInView']=!0x1;['_promiseQueue'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}constructor(_0x391088){super(_0x391088),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new st(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x41a4e9,_0x4a0d42,_0x2ff584){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x532145,anchorData:_0x551011}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x41a4e9,_0x532145,_0x551011,_0x4a0d42,_0x2ff584);}}const {modelFragment:_0x45917f,anchorData:_0x4cdd27}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x41a4e9,_0x45917f,_0x4cdd27,_0x4a0d42,_0x2ff584);}['_getExecuteDataRegular'](){const _0x3ed2ec=this['editor']['model']['document']['selection'];if(_0x3ed2ec['isCollapsed']){const _0x57e67a=_0x41a078(_0x3ed2ec['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x3ed2ec);this['editor']['model']['change'](_0xbdc270=>{_0xbdc270['setSelection'](_0x57e67a,'in');});}const _0x14bcfe=_0x3ed2ec['getFirstRange'](),_0x5a8787=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x3ed2ec),_0x14bcfe['start'],_0x14bcfe['end']),_0x2f5d12=_0x3ed2ec['getFirstRange']()['start'],_0x48db10=new Map();let _0xfde090=_0x5a8787;for(let _0x15f799=0x0;_0x15f799<_0x2f5d12['path']['length'];_0x15f799++)_0x48db10['set'](_0xfde090,_0x2f5d12['path'][_0x15f799]),_0xfde090=_0xfde090['getChild'](0x0);return{'modelFragment':_0x5a8787,'anchorData':_0x48db10};}['_getExecuteDataInTable'](){const _0x2a53de=this['editor']['model']['document']['selection'],_0x1ca79b=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x2598ab=_0x2a53de['getFirstRange']()['start']['parent']['parent'],_0x203835=this['_wrapWithCommonAncestors'](_0x1ca79b,this['editor']['model']['createPositionBefore'](_0x2598ab),this['editor']['model']['createPositionAfter'](_0x2598ab)),_0x100612=_0x2a53de['getFirstRange']()['start'],_0x30a999=new Map();let _0x5f3ea0=_0x203835;for(let _0x281612=0x0;_0x281612<_0x100612['path']['length'];_0x281612++)if(_0x30a999['set'](_0x5f3ea0,_0x100612['path'][_0x281612]),_0x281612<_0x100612['path']['length']-0x1)_0x5f3ea0=_0x5f3ea0['getChild'](0x0);else{let _0xb21846=_0x5f3ea0['nextSibling'];for(;_0xb21846;)_0x30a999['set'](_0xb21846,_0x100612['path'][_0x281612]),_0xb21846=_0xb21846['nextSibling'];}return{'modelFragment':_0x203835,'anchorData':_0x30a999};}['_executeAction'](_0x3ea45c,_0x511892,_0x2913ce,_0xb391ae,_0x1690be){const _0x4cb951=this['editor']['plugins']['get'](N),_0x3df655=this['editor']['plugins']['get'](it),_0x5befe4=this['editor']['model']['document']['selection'],_0xd765ff=_0x4cb951['modelToViewWithIds'](_0x511892),_0x574ba5=this['editor']['data']['processor']['toData'](_0xd765ff),_0xe64f23=this['editor']['model']['document']['version'],_0x2d55b8=[..._0x5befe4['getRanges']()];let _0x34524f=this['editor']['config']['get']('ai.availableReplyActions')||[...H];this['editor']['plugins']['has']('TrackChanges')||(_0x34524f=_0x34524f['filter'](_0x5cd018=>'insertSuggestion'!=_0x5cd018));const _0x16decc=new F(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0,'availableActions':_0x34524f});return _0x3df655['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0xb391ae,'icon':_0x1690be||_0x5880d7,'mainView':_0x16decc,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':this['editor']['plugins']['has']('TrackChanges'),'ranges':_0x2d55b8}),this['_setLoadingState'](_0x16decc,_0x3df655),this['listenTo'](_0x3df655,'applySuggestion',()=>{this['_applyChanges'](_0x511892,_0x2913ce,!0x1);}),this['listenTo'](_0x3df655,'insertSuggestion',()=>{this['_applyChanges'](_0x511892,_0x2913ce,!0x0);}),this['listenTo'](_0x3df655,'selectionRemoved',()=>{this['_stopInteraction'](),this['_disableCustomViews']();}),this['listenTo'](_0x3df655,'dialogClosed',()=>{if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x31788d=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x3421a4=_0x31788d['changeGroups'][0x0];_0x3421a4&&'pending'===_0x3421a4['state']&&_0x31788d['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x3df655);}),this['_createInteraction'](_0x574ba5,_0xe64f23,_0x16decc,_0x3df655,_0x3ea45c);}['_wrapWithCommonAncestors'](_0x98328e,_0xe510b4,_0xc22d33){const _0xb886e7=this['editor']['model']['createRange'](_0xe510b4,_0xc22d33)['getCommonAncestor'](),_0x3fd237=_0xb886e7['is']('documentFragment')?[]:_0xb886e7['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x3fd237['length']){const _0x2d50e9=_0x3fd237['map'](_0x3acca8=>_0x3acca8['_clone'](!0x1));for(let _0x487c29=0x1;_0x487c29<_0x2d50e9['length'];_0x487c29++)_0x2d50e9[_0x487c29-0x1]['_appendChild'](_0x2d50e9[_0x487c29]);return _0x2d50e9[_0x2d50e9['length']-0x1]['_appendChild'](_0x98328e),new at(_0x2d50e9[0x0]);}return _0x98328e;}async['_createInteraction'](_0x26ba72,_0x578172,_0x18deee,_0x47c932,_0x13ffb4){const _0x524776=this['editor'];this['_interactionParams']={'action':_0x13ffb4,'content':_0x26ba72,'version':_0x578172,'mainView':_0x18deee,'aiBalloon':_0x47c932};const _0x102432=new Q({'connector':this['_aiConnector'],'editor':_0x524776,'content':_0x26ba72,'version':_0x578172,..._0x13ffb4});this['_interactions']['push'](_0x102432),_0x18deee['hideError']();const _0x89d9e0=(_0x211d2e,_0x2ce684,_0x777a08=!0x1,_0x21df55='streaming')=>this['_promiseQueue']['enqueue'](async _0x4f21bb=>{try{const _0x9342b5=et({'editor':_0x524776,'changeGroups':_0x211d2e['changeGroups'],'documentContextContent':_0x211d2e['documentContextContent'],'showDiff':_0x777a08,'trimUnchanged':!0x1});await _0x2ce684['updateContent']({'parts':_0x9342b5,'renderingStrategy':_0x21df55,'abortSignal':_0x4f21bb});}catch(_0x51f98a){if(this['_isAbortError'](_0x51f98a))return;throw _0x51f98a;}});this['_interaction']['on']('replyCreated',(_0x2171c9,_0x4f10db)=>{_0x18deee['hideLoader'](),_0x89d9e0(_0x4f10db,_0x18deee)['catch'](_0x15ceeb=>{this['_isAbortError'](_0x15ceeb)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x15ceeb),this['_setErrorState'](_0x102432,_0x18deee));});}),this['_interaction']['on']('replyContentUpdated',(_0x303a80,_0x4fee71)=>{_0x89d9e0(_0x4fee71,_0x18deee)['catch'](_0x1370fa=>{this['_isAbortError'](_0x1370fa)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x1370fa),this['_setErrorState'](_0x102432,_0x18deee));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x18deee,_0x47c932),this['_updateNavigationUI']();}catch(_0x5d1f66){this['_isAbortError'](_0x5d1f66)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x5d1f66),this['_setErrorState'](_0x102432,_0x18deee));}}),this['listenTo'](_0x18deee,'toggleSuggestionDisplayMode',(_0x3a8aee,{showDiff:_0x587bae})=>{this['_balloonShowDiff']=_0x587bae;const _0x2df726=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x2df726&&_0x89d9e0(_0x2df726,_0x18deee,_0x587bae,'static')['catch'](_0x9c2fc9=>{this['_isAbortError'](_0x9c2fc9)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x9c2fc9),this['_setErrorState'](_0x102432,_0x18deee));});}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x2a1d3a,{reply:_0x1dbf1b})=>{const _0xee150={'positiveCount':_0x1dbf1b['changeGroups']['filter'](_0x374b2e=>'accepted'===_0x374b2e['state'])['length'],'totalCount':_0x1dbf1b['changeGroups']['length']},_0x397e6a=this['_interaction']['actionCallId'],_0x1813a2=this['_interaction']['actionName'];_0x1813a2?this['_aiConnector']['upsertAIActionRating'](_0x1813a2,_0x397e6a,_0xee150):this['_aiConnector']['upsertCustomAIActionRating'](_0x397e6a,_0xee150);}),this['_setLoadingState'](_0x18deee,_0x47c932);try{const _0x18e211=await this['_interaction']['start']();return this['_updateNavigationUI'](),_0x18e211;}catch(_0x1d9cd7){if(this['_isAbortError'](_0x1d9cd7))return;_0x18deee['hideLoader'](),this['_setErrorState'](_0x102432,_0x18deee);}}['_applyChanges'](_0x31df88,_0x58d7a4,_0x43c9ed){const _0xa8eec8=this['editor'];if(_0x43c9ed&&!_0xa8eec8['plugins']['has']('TrackChanges'))throw new _0x5b2487('ai-no-track-changes',null);const _0x9b1371=this['editor']['plugins']['get'](nt),_0x443e58=this['_interaction'],_0x3693fb=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x37d310=_0x3693fb['changeGroups'];_0x3693fb['setChangeGroupState'](0x0,'accepted');let _0x5583b0=rt({'editor':_0xa8eec8,'reply':_0x3693fb,'interaction':_0x443e58,'groups':_0x37d310,'transform':!0x1,'documentCompare':_0x9b1371,'documentCompareOptions':{'anchor':_0xa8eec8['model']['createPositionAt'](_0x31df88,0x0),'markDeletions':_0x43c9ed}});_0x5583b0=this['_filterOperationsOutsideRange'](_0x5583b0,_0x58d7a4);for(const _0x571531 of _0x5583b0)this['_anchorOperation'](_0x58d7a4,_0x571531,_0xa8eec8['model']['document']['getRoot']());const _0x238d0f=_0x443e58['getDocumentContext']()['version'],_0x5e24d7=_0xa8eec8['model']['document']['history']['getOperations'](_0x238d0f),_0x1c22e8={'document':_0xa8eec8['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x2a0b3d=ut(_0x5583b0,_0x5e24d7,_0x1c22e8)['operationsA'];_0xa8eec8['model']['change'](_0x3d0198=>{if(_0x3d0198['setSelection'](_0xa8eec8['model']['document']['selection']['focus']),_0x43c9ed)_0xa8eec8['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x2a0b3d);else{for(const _0x1c6ee5 of _0x2a0b3d)_0x1c6ee5['baseVersion']=_0xa8eec8['model']['document']['version'],ot(_0xa8eec8,_0x1c6ee5),_0x3d0198['batch']['addOperation'](_0x1c6ee5),_0xa8eec8['model']['applyOperation'](_0x1c6ee5);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x3e5f86,_0x69d83a){return _0x3e5f86['filter'](_0x1a1e1b=>{if('rename'==_0x1a1e1b['type']){const _0x369743=_0x1a1e1b['position']['nodeAfter'];return!_0x69d83a['has'](_0x369743);}if(_0x1a1e1b['type']['indexOf']('Attribute')>-0x1){const _0x5b08b0=_0x1a1e1b['range']['start']['nodeAfter'];return!_0x69d83a['has'](_0x5b08b0);}return!0x0;});}['_anchorOperation'](_0x9c06e0,_0x346329,_0x91911c){const _0x1a4723=_0x346329['clone']();for(const _0x11eb6c in _0x346329){const _0x174a14=_0x346329[_0x11eb6c];_0x174a14 instanceof ht?_0x346329[_0x11eb6c]=new ht(_0x15848c(_0x174a14['start']),_0x15848c(_0x174a14['end'])):_0x174a14 instanceof ct&&(_0x346329[_0x11eb6c]=_0x15848c(_0x174a14));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x1a4723['type'])){if(_0x1a4723['isDocumentOperation']=!0x1,_0x1a4723['baseVersion']=null,'remove'==_0x1a4723['type']){const _0x20b1ac=_0x1a4723['sourcePosition'],_0x3d6a95=_0x1a4723['howMany'];new lt(_0x20b1ac,_0x3d6a95)['_execute']();}else _0x1a4723['_execute']();}function _0x15848c(_0x54831c){if('$graveyard'==_0x54831c['root']['rootName'])return _0x54831c;const _0xb2ba15=[];let _0x4b3a6f=_0x54831c['root'];for(let _0x3b37f3=0x0;_0x3b37f3<_0x54831c['path']['length'];_0x3b37f3++){const _0x15b5a2=_0x9c06e0['get'](_0x4b3a6f)||0x0;_0xb2ba15[_0x3b37f3]=_0x54831c['path'][_0x3b37f3]+_0x15b5a2,_0x4b3a6f=_0x4b3a6f['getChildAtOffset'](_0x54831c['path'][_0x3b37f3]);}return new ct(_0x91911c,_0xb2ba15,_0x54831c['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x444cbb,content:_0x241709,version:_0x5ead78,mainView:_0x3fd0b6,aiBalloon:_0xb3f5b6}=this['_interactionParams'];_0x3fd0b6['areChangesVisible']=!0x1,_0x3fd0b6['hideError'](),this['_clearErrorState'](_0x3fd0b6,_0xb3f5b6);const _0x661f8e=_0x3fd0b6;_0x661f8e['miniToolbarView']&&_0x661f8e['miniToolbarView']['showChangesButton']&&_0x661f8e['miniToolbarView']['showChangesButton']['set']({'isOn':!0x1,'icon':tt}),this['_clearSuggestionContent'](_0x3fd0b6),_0x3fd0b6['showLoader'](),this['_updateNavigationUI'](),this['_createInteraction'](_0x241709,_0x5ead78,_0x3fd0b6,_0xb3f5b6,_0x444cbb)['catch'](_0x3e96cf=>{this['_isAbortError'](_0x3e96cf)||console['error']('Error\x20refreshing\x20interaction:',_0x3e96cf);});}['_clearSuggestionContent'](_0x38ed4d){const _0x1cef71=_0x38ed4d['bodyView']['_children'];for(;_0x1cef71['length']>0x0;)_0x1cef71['remove'](_0x1cef71['first']);_0x38ed4d['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x260c0f){return!!_0x260c0f['message']&&_0x260c0f['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;}['_setupCustomViews'](){const _0x536cff=new _0x23f64b(this['editor']['locale']),_0x5b6535=new _0x23f64b(this['editor']['locale']),_0x5ecb2f=new _0x1fbe2f(this['editor']['locale']),_0x43a14d=new _0x23f64b(this['editor']['locale']);_0x536cff['set']({'icon':_0x387b6c,'label':i(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x5b6535['set']({'icon':_0x2875b9,'tooltip':i(this['editor']['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x5ecb2f['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':['1/1']}),_0x43a14d['set']({'icon':_0x4742cd,'tooltip':i(this['editor']['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x536cff['bind']('isEnabled')['to'](this,'isBusy',_0x1d8f11=>!_0x1d8f11),_0x536cff['on']('execute',()=>{this['_refreshInteraction']();}),_0x5b6535['bind']('isEnabled')['to'](this,'isBusy',_0x52b5c4=>!_0x52b5c4),_0x5b6535['on']('execute',()=>{this['_navigateToPrevious']();}),_0x43a14d['bind']('isEnabled')['to'](this,'isBusy',_0x5953c7=>!_0x5953c7),_0x43a14d['on']('execute',()=>{this['_navigateToNext']();}),this['_navigationPreviousButton']=_0x5b6535,this['_navigationCounter']=_0x5ecb2f,this['_navigationNextButton']=_0x43a14d,this['_customViews']['add'](_0x536cff);}['_navigateToPrevious'](){const _0x2cb138=this['_interactions']['length'];this['_currentInteractionIndex']<_0x2cb138-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x3cfcf9){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x3cfcf9;const {mainView:_0x3bf96d}=this['_interactionParams'],_0x19955a=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x19955a)return;if(_0x19955a['hasError'])return this['_setErrorState'](_0x19955a,_0x3bf96d),void this['_updateNavigationUI']();if(!_0x19955a['replies']['length'])return;_0x3bf96d['hideError'](),this['_interactionParams']&&this['_clearErrorState'](_0x3bf96d,this['_interactionParams']['aiBalloon']);const _0x34e26e=_0x19955a['replies'][_0x19955a['replies']['length']-0x1];if(_0x34e26e){const _0x5e6c58=this['editor'];this['_clearSuggestionContent'](_0x3bf96d);try{const _0x2de414=et({'editor':_0x5e6c58,'changeGroups':_0x34e26e['changeGroups'],'documentContextContent':_0x34e26e['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});this['_clearSuggestionContent'](_0x3bf96d),await new Promise(_0x3d1b82=>setTimeout(_0x3d1b82,0x32)),await _0x3bf96d['updateContent']({'parts':_0x2de414,'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0xddaa96){this['_isAbortError'](_0xddaa96)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0xddaa96);}}this['_updateNavigationUI']();}['_updateNavigationUI'](){if(!this['_navigationPreviousButton']||!this['_navigationCounter']||!this['_navigationNextButton'])return;const _0x2d5f76=this['_interactions']['length'],_0x5cd889=_0x2d5f76>0x1,_0xa108a2=this['_interactionParams']?.['mainView'];if(_0x5cd889){this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView']||(this['_customViews']['add'](this['_navigationPreviousButton']),_0xa108a2?.['addNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x0,this['_customViews']['add'](this['_navigationCounter']),_0xa108a2?.['addNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x0,this['_customViews']['add'](this['_navigationNextButton']),_0xa108a2?.['addNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x0);const _0x5b2f4a=_0x2d5f76-this['_currentInteractionIndex'];this['_navigationCounter']['element']&&(this['_navigationCounter']['element']['textContent']=_0x5b2f4a+'/'+_0x2d5f76),this['_navigationPreviousButton']['isEnabled']=this['_currentInteractionIndex']<_0x2d5f76-0x1,this['_navigationNextButton']['isEnabled']=this['_currentInteractionIndex']>0x0;}else(this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView'])&&(this['_customViews']['remove'](this['_navigationPreviousButton']),_0xa108a2?.['removeNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x1,this['_customViews']['remove'](this['_navigationCounter']),_0xa108a2?.['removeNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x1,this['_customViews']['remove'](this['_navigationNextButton']),_0xa108a2?.['removeNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x1);}['_setLoadingState'](_0x1a2e2b,_0x3a17c5){_0x1a2e2b['setLoading'](),_0x3a17c5['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_setErrorState'](_0x2efce1,_0x411456){const _0x2f3fbe=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');_0x411456['showError'](_0x2f3fbe),_0x2efce1['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],_0x411456['setErrorState'](),this['_interactionParams']?.['aiBalloon']['balloonView']['toolbar']&&(this['_interactionParams']['aiBalloon']['balloonView']['toolbar']['isLoading']=!0x0);}['_clearErrorState'](_0x3cbb2a,_0x45e25d){_0x3cbb2a['clearErrorState'](),_0x45e25d['balloonView']['toolbar']&&(_0x45e25d['balloonView']['toolbar']['isLoading']=!0x1);}async['_clearLoadingState'](_0x719657,_0x770202){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x719657['clearLoading'](),_0x770202['balloonView']['clearLoading']();}['_disableCustomViews'](){this['_customViews']['forEach'](_0x17c38e=>{'isEnabled'in _0x17c38e&&(_0x17c38e['isEnabled']=!0x1);});}}class Ba extends _0x4075a7{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x419e7d){super(_0x419e7d),_0x419e7d['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[]});}}class xs{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0xd67fb9,title:_0x4ce8c8,description:_0x66e035,isParameterized:_0x536a18,useArgs:_0x364ff4,options:_0x41eada}){this['id']=_0xd67fb9,this['title']=_0x4ce8c8,this['description']=_0x66e035,this['isParameterized']=_0x536a18,this['useArgs']=_0x364ff4,this['options']=_0x41eada;}}class kr extends xs{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x26e375){this['_models']=_0x26e375;}}class si extends ts(){['_checks'];constructor(_0x44419e){super(),this['_checks']=this['_mapCheckDefinitions'](_0x44419e);}get['checks'](){return this['_checks'];}['getCheckById'](_0x37428b){return this['checks']['find'](_0x30c175=>_0x30c175['id']===_0x37428b);}['_mapCheckDefinitions'](_0x4520f6){return _0x4520f6['map'](_0x15d6ba=>'custom'===_0x15d6ba['id']?new kr(_0x15d6ba):new xs(_0x15d6ba));}}class Cs extends _0x49ef7b(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x4c9878,contentNew:_0xc8e687,contentInitial:_0x22d33c,documentVersion:_0x38b015}){super(),this['id']=_0x4c9878,this['contentNew']=_0xc8e687,this['contentInitial']=_0x22d33c,this['documentVersion']=_0x38b015;}}class Rs extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x33cb94,_0x374809,_0x35821e){super(),this['id']=_0x33cb94,this['parent']=_0x35821e,this['_data']=_0x374809,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class js extends ts(){['id']=_0x5fe9bf();['callId'];['_results']=new Map();['_changes']=[];['_documentData'];['_sourceCheck'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x485016,_0x171671,_0x5b8609,_0x20c858,_0x239ba3){super(),this['_documentData']=_0x485016,this['_sourceCheck']=_0x171671,this['_aiConnector']=_0x5b8609,this['_reviewParams']=_0x20c858,this['_reviewArgs']=_0x239ba3,this['on']('change:status',(_0x1893eb,_0x4229db,_0x337bb1)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x337bb1,'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'](_0x15694c=>'pending'===_0x15694c['status']);}get['currentError'](){return this['_currentError'];}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x44c6dd=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x1840ef of _0x44c6dd)'unmodified'!==_0x1840ef['data']['operation']&&('error'!==_0x1840ef['data']['operation']?'review-metadata'!==_0x1840ef['event']?this['_addReviewCheckResult'](_0x1840ef['data']['dataId'],_0x1840ef['data']['textDelta']):this['callId']=_0x1840ef['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']?this['status']='unmodified':this['status']='ready');}catch(_0x342468){this['_currentError']=_0x342468,_0x342468 instanceof Error&&_0x342468['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'](_0x2a2b22,_0x5d7000){const _0x551929=this['_results']['get'](_0x2a2b22);if(!_0x551929)return;const _0x5458a7=[];_0x5d7000['forEach']((_0x801c6e,_0x25daf7)=>{const _0x79a706=new Rs(_0x551929['id']+'-'+_0x25daf7,_0x801c6e,_0x551929);_0x79a706['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x79a706,'status':_0x79a706['status']});}),_0x79a706['on']('change:isActivated',()=>{_0x79a706['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x79a706}):this['fire']('reviewCheckResultDeactivated',{'change':_0x79a706});}),this['_changes']['push'](_0x79a706),_0x5458a7['push'](_0x79a706);}),this['fire']('reviewCheckResultReady',{'changes':_0x5458a7,'result':_0x551929,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x35c879){const _0x530c11=this['_changes']['find'](_0x2201ed=>_0x2201ed['id']===_0x35c879);return!(!_0x530c11||'pending'!==_0x530c11['status']);}['getActiveChanges'](){return this['_changes']['filter'](_0x51128b=>'pending'===_0x51128b['status']);}['markAllChangesAsAccepted'](){for(const _0x254ef1 of this['_changes'])'pending'===_0x254ef1['status']&&(_0x254ef1['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x57e063){const _0x698d3a=this['_changes']['find'](_0x439656=>_0x439656['id']===_0x57e063);_0x698d3a&&'pending'===_0x698d3a['status']&&(_0x698d3a['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x3113fa){const _0x244a1e=this['_changes']['find'](_0x47c5f1=>_0x47c5f1['id']===_0x3113fa);_0x244a1e&&'pending'===_0x244a1e['status']&&(_0x244a1e['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x3fec41){const _0x3671a7=this['_changes']['find'](_0x14d648=>_0x14d648['id']===_0x3fec41);_0x3671a7&&'pending'===_0x3671a7['status']&&(_0x3671a7['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x29725a){const _0x5b6049=this['_changes']['find'](_0x5390d7=>_0x5390d7['id']===_0x29725a);_0x5b6049&&'outdated'===_0x5b6049['status']&&(_0x5b6049['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x5fa442){this['_changes']['filter'](_0x286494=>_0x286494['isActivated']&&_0x286494['id']!==_0x5fa442)['forEach'](_0x28a75d=>{_0x28a75d['isActivated']=!0x1;});const _0x4724a2=this['_changes']['find'](_0x52630c=>_0x52630c['id']===_0x5fa442);_0x4724a2&&'pending'===_0x4724a2['status']&&(_0x4724a2['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x533ff1=>_0x533ff1['isActivated'])['forEach'](_0x55ea5a=>{_0x55ea5a['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x266708){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x1e9094;if(_0x266708){const _0x97ba00=this['_changes']['find'](_0x3b96c0=>_0x3b96c0['id']===_0x266708);if(_0x97ba00&&_0x97ba00['isRated'])return;_0x97ba00&&(_0x1e9094=_0x97ba00['parent']['id'],_0x97ba00['isRated']=!0x0);}const _0x843dcd={'positiveCount':this['_changes']['filter'](_0x427a12=>'accepted'===_0x427a12['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x843dcd,this['callId'],_0x1e9094);}['_addReviewCheckResult'](_0x2a6c28,_0x5890ce){const _0xed69e=this['_documentData']['elements']['get'](_0x2a6c28);if(!_0xed69e)return;const _0x261c7c=_0xed69e['getContent']();if(_0x261c7c===_0x5890ce)return;const _0x1c91c6=new Cs({'id':_0x2a6c28,'contentInitial':_0x261c7c,'contentNew':_0x5890ce,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x1c91c6['id'],_0x1c91c6),this['fire']('reviewCheckResultAdded',{'result':_0x1c91c6,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x1fdac2=>'pending'===_0x1fdac2['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x295a9f=>'pending'===_0x295a9f['status'])['length']&&(this['status']='finished'));}}class hi extends js{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x1f09ef=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x1a8396=0x0;_0x1a8396<this['_reviewParams']['length'];_0x1a8396++){if(!this['_reviewParams'][_0x1a8396]||!this['_sourceCheck']['options'][_0x1a8396])continue;const _0x56fbcd=this['_sourceCheck']['options'][_0x1a8396],_0xa37d10=_0x56fbcd['data']?.['find'](_0x542fe1=>_0x542fe1['id']===this['_reviewParams'][_0x1a8396]);_0xa37d10&&_0x1f09ef['push'](_0xa37d10['label']);}return _0x1f09ef['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x4a9be8,_0x1c9ad0,_0x173ee5){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x1c9ad0,_0x4a9be8,_0x173ee5);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class oi extends js{['_prompt'];['_model'];constructor(_0x2072eb,_0x1b469a,_0x491190,_0x250e87,_0x3bf46f){super(_0x491190,_0x250e87,_0x3bf46f),this['_prompt']=_0x2072eb,this['_model']=_0x1b469a;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x22f717,_0x5463cc,_0x45b888){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x5463cc,_0x22f717,_0x45b888);}}const ai=[{'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 re extends _0x5ac5c7{['_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 _0xd117bf=this['context']['config']['get']('ai.reviewMode.translations');if(_0xd117bf){for(const _0x2c9f3c of ai)'translate'===_0x2c9f3c['id']&&(_0x2c9f3c['options'][0x0]['data']=_0xd117bf);}const _0x50127c=this['_translateReviewChecks'](ai);this['_aiReviewCheckList']=new si(_0x50127c);const _0x440ebe=this['_aiReviewCheckList']['checks']['find'](_0x189b2c=>'custom'===_0x189b2c['id']);if(_0x440ebe){const _0x1d6090=await new ni({'connector':this['_aiConnector']})['getAll']();_0x440ebe['models']=_0x1d6090['map'](_0x500564=>({..._0x500564,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0x500564['id']['toUpperCase'](),_0x500564['description'])}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x58c2ac,_0x337476)=>{const _0x3dae40=this['_aiReviewCheckList']['getCheckById'](_0x337476['id']);if(_0x3dae40){this['_onDiffChange'](this['_isDiffOn']),_0x337476['isCustom']?this['_currentReviewCheckRun']=new oi(_0x337476['args']['prompt'],_0x337476['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x3dae40,this['_aiConnector']):this['_currentReviewCheckRun']=new hi(this['_aiReviewModeEditing']['getDocumentData'](),_0x3dae40,this['_aiConnector'],_0x337476['params'],_0x337476['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x333905,_0x551057)=>{'data'===_0x551057['status']||'loading'===_0x551057['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x551057)):'finished'===_0x551057['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x551057['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'unmodified'===_0x551057['status']?this['_aiReviewModeUi']['showNoChangesView']():'error-general'===_0x551057['status']?(this['_aiReviewModeUi']['showGeneralErrorView'](),this['_logError'](new _0x5b2487('ai-review-mode-check-run-general-error',this,this['_currentReviewCheckRun']?.['currentError']))):'error-chunk'===_0x551057['status']?(this['_aiReviewModeUi']['showChunkErrorView'](),this['_logError'](new _0x5b2487('ai-review-mode-check-run-chunk-error',this,this['_currentReviewCheckRun']?.['currentError']))):'aborted'===_0x551057['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0)),'ready'!==_0x551057['status']&&'error-chunk'!==_0x551057['status']&&'error-general'!==_0x551057['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x3a59e3,_0x46456a)=>{if(!this['_currentReviewCheckRun'])throw new _0x5b2487('ai-review-mode-no-current-check-run',this);const _0x1eb840=this['_aiReviewModeEditing']['diffContent'](_0x46456a['result']['contentInitial'],_0x46456a['result']['contentNew']);_0x46456a['source']['addResultChanges'](_0x46456a['result']['id'],_0x1eb840);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x3fdbb5,_0x776431)=>{for(const _0x45f39e of _0x776431['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x45f39e);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x776431['changes'],_0x776431['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x12a426,_0x5d2856)=>{this['_aiReviewModeUi']['updateChangeState'](_0x5d2856['change']['id'],_0x5d2856['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x3e791e,_0x5d15b3)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x5d15b3['change']['id']);const _0x354832=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x5d15b3['change']['id']);if(_0x354832){if('content'===this['_changeActivationSource']){const _0x20b50b=this['_aiReviewModeUi']['getChangeElement'](_0x5d15b3['change']['id']);_0x20b50b&&_0x3d185f(_0x20b50b['closest']('.ck-ai-review-mode__check-run-result')||_0x20b50b);}else{if('panel'===this['_changeActivationSource']){const _0xe715b5={'target':_0x354832['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};_0x43244e(_0xe715b5);}}this['_aiReviewModeUi']['showChangeBalloon'](_0x5d15b3['change'],_0x354832['domElement']);}}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults'](),this['_aiReviewModeUi']['hideChangeBalloon']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x1c2c2f){_0x1c2c2f instanceof Error&&_0x1c2c2f['message']['includes']('ai-request-aborted')||(_0x1c2c2f instanceof _0x5b2487?this['_logError'](_0x1c2c2f):this['_logError'](new _0x5b2487('ai-review-mode-check-run-failed',this,{'error':_0x1c2c2f})));}}else this['_logError'](new _0x5b2487('ai-review-mode-source-check-not-found',this,{'checkId':_0x337476['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 _0x184cb7=this['_currentReviewCheckRun']['getActiveChanges']();_0x184cb7['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x184cb7['map'](_0x191e35=>_0x191e35['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted'](),this['_currentReviewCheckRun']['sendRating']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x29c00d,_0x12ba97)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x12ba97['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x12ba97['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x12ba97['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x12ba97['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x3b3424,_0x4d7cf2)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4d7cf2['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x4d7cf2['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x4d7cf2['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4d7cf2['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x18fbcc,_0x19dd1b)=>{this['_isDiffOn']=_0x19dd1b['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&await this['_currentReviewCheckRun']['restart']();}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x11d41b,_0x1df3a1)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x1df3a1['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x4e42f1,_0xf62da8)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0xf62da8['changeId']));}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRemoved',(_0x478dfb,_0x15643d)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x15643d['changeId']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRestored',(_0x265174,_0x4430a6)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x4430a6['changeId']);});}['_onReviewModeRunLeave'](_0x546bb2=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x546bb2&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x7b695b=this['_aiReviewModeEditing']['getEditor']();_0x7b695b&&_0x7b695b['editing']['view']['change'](_0xb391e4=>{const _0xbb12f6=_0x7b695b['editing']['view']['document']['getRoot']();_0xb391e4['removeClass']('ck-ai-review-mode-diff',_0xbb12f6),_0xb391e4['removeClass']('ck-ai-review-mode-highlights',_0xbb12f6);});}['_onDiffChange'](_0x341894){const _0x48c6cc=this['_aiReviewModeEditing']['getEditor']();_0x341894?this['_aiReviewModeUi']['hideDiffInBalloon']():this['_aiReviewModeUi']['showDiffInBalloon'](),_0x48c6cc&&_0x48c6cc['editing']['view']['change'](_0x445a36=>{const _0x18848d=_0x48c6cc['editing']['view']['document']['getRoot']();_0x445a36['removeClass']('ck-ai-review-mode-diff',_0x18848d),_0x445a36['removeClass']('ck-ai-review-mode-highlights',_0x18848d),_0x445a36['addClass'](_0x341894?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights',_0x18848d);});}['_translateReviewChecks'](_0x531013){return _0x531013['map'](_0x49ecb0=>{const _0x362fdd='AI_REVIEW_CHECK_'+_0x49ecb0['id']['toUpperCase']()['replaceAll']('-','_'),_0x4f7243={..._0x49ecb0,'title':this['_getTranslationWithDefault'](_0x362fdd+'_TITLE',_0x49ecb0['title']),'description':this['_getTranslationWithDefault'](_0x362fdd+'_DESCRIPTION',_0x49ecb0['description'])};return _0x49ecb0['options']&&(_0x4f7243['options']=_0x49ecb0['options']['map'](_0x353797=>({..._0x353797,'label':this['_getTranslationWithDefault'](_0x362fdd+'_OPTIONS_LABEL',_0x353797['label']||''),'data':_0x353797['data']?_0x353797['data']['map'](_0x2dc0af=>({..._0x2dc0af,'label':this['_getTranslationWithDefault'](_0x362fdd+'_OPTIONS_DATA_'+_0x2dc0af['id']['toUpperCase'](),_0x2dc0af['label'])})):void 0x0}))),_0x4f7243;});}['_getTranslationWithDefault'](_0xb88ef6,_0x46215b){const _0x4eb3e1=i(this['context']['locale'],_0xb88ef6);return _0x4eb3e1===_0xb88ef6?_0x46215b:_0x4eb3e1;}['_logError'](_0x1fa830){At(_0x1fa830['message']),this['_aiReviewModeUi']['showGeneralErrorView']();}}class Mr extends _0x1fbe2f{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x4f4f09,_0x20791f){super(_0x4f4f09),this['_defaultValue']=_0x20791f['default']||(_0x20791f['data']['length']>0x0?_0x20791f['data'][0x0]['id']:''),this['_defaultLabel']=_0x20791f['data']['find'](_0x5a23a1=>_0x5a23a1['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x43e2d9(this['locale']);const _0x2cb567=this['_prepareListOptions'](_0x20791f['data']);_0x11fa7b(this['_dropdownView'],_0x2cb567,{'role':'menu','ariaLabel':_0x20791f['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2e6630=>{_0x2e6630['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x14268f=>{this['formValue']=_0x14268f['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x14268f['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'](_0x415f15=[]){const _0x59a039=new _0x3925ff();this['resetToDefault']();for(const _0xefd35b of _0x415f15){const _0x16bedc=new _0x355792({'label':_0xefd35b['label'],'withText':!0x0,'role':'menuitemradio','id':_0xefd35b['id'],'model':_0xefd35b});_0x16bedc['bind']('isOn')['to'](this,'formValue',_0x34d01c=>_0x34d01c===_0x16bedc['id']);const _0x5b11c6={'type':'button','model':_0x16bedc};_0x59a039['add'](_0x5b11c6);}return _0x59a039;}}class Qs extends _0x57e588{['_formItem']=null;constructor(_0x573861,_0x150084,_0x745e99){super(_0x573861),this['argsKey']=_0x150084?.['argsKey'];if('dropdown'===_0x150084['formType'])this['_formItem']=new Mr(this['locale'],_0x150084);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x37cc72=new _0x51e522(this['locale'],{'children':[this['_formItem']],'class':[_0x745e99?'ck-form__row_with-submit':'']});_0x745e99&&_0x37cc72['children']['add'](_0x745e99),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x37cc72]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Os extends _0x31b097{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x383210){super(_0x383210),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x46a36b(),this['minRows']=Os['MIN_ROWS'],this['maxRows']=Os['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 Us extends _0x1fbe2f{['focusTracker']=new _0x2cffef();['keystrokes']=new _0x46a36b();['focusCycler'];['_focusables']=new _0xa90262();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x1fbd6b,_0x49d440){super(_0x1fbd6b),this['_check']=_0x49d440,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x49d440['models']&&_0x49d440['models']['length']>0x0?_0x49d440['models'][0x0]['id']:'',this['_defaultLabel']=_0x49d440['models']&&_0x49d440['models']['length']>0x0?_0x49d440['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x3ce94b(this['locale'],()=>new Os(_0x1fbd6b)),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 _0x3925ff(),this['_setModelList'](),_0x11fa7b(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 _0x51e522(this['locale'],{'children':[this['promptInputView']]}),new _0x51e522(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x3481e3,_0x5edad0)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x5edad0()):_0x5edad0();}),this['focusCycler']=new _0x14e425({'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'](_0x5f080a=>{this['_focusables']['add'](_0x5f080a),this['focusTracker']['add'](_0x5f080a['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 _0x3020db of this['_getFormValidators']()){const _0x33043a=_0x3020db();if(_0x33043a)return this['promptInputView']['errorText']=_0x33043a,!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 _0x4fc4ac=new _0x23f64b(this['locale']),t=this['locale']['t'];return _0x4fc4ac['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x4fc4ac['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x4fc4ac;}['_createCancelButtonView'](){const _0x271430=new _0x23f64b(this['locale']),t=this['locale']['t'];return _0x271430['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x271430['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x126e96=>{_0x126e96['stopPropagation']();})}}),_0x271430['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x271430;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0xafad5c=this['_check']['models'];if(this['resetToDefault'](),_0xafad5c?.['length']){const _0x2b87a8=ni['getLocalized'](this['locale'],_0xafad5c);for(const _0x40947f of _0x2b87a8){const _0x51ff8f=new _0x355792({'label':_0x40947f['name'],'withText':!0x0,'role':'menuitemradio','id':_0x40947f['id'],'model':_0x40947f});_0x51ff8f['bind']('isOn')['to'](this,'modelId',_0x265cf1=>_0x265cf1===_0x40947f['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x51ff8f,'labelView':new zs(this['locale'],_0x40947f)});}}}['_createModelSelectionDropdown'](){const _0x1a17bb=_0x43e2d9(this['locale']);return _0x1a17bb['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x1a17bb['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x1a17bb,'execute',_0x393ec9=>{this['modelId']=_0x393ec9['source']['model']['id'],_0x1a17bb['buttonView']['label']=_0x393ec9['source']['label'];}),_0x1a17bb;}['_createActionsFooterView'](){const _0x55053e=new _0x1fbe2f(this['locale']);return _0x55053e['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']]}]}),_0x55053e;}}class zs extends _0x1eeb89{constructor(_0x22eed6,_0x13366a){super();const _0x4616ee=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x4616ee['to']('style'),'id':_0x4616ee['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x4616ee['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x13366a['description']||'']}]}]});}}class Gs extends _0x57e588{['_formItemsCollection']=new _0xa90262();['_customCheckView']=null;constructor(_0x50d22d,_0x4e4b7e,_0x383290){super(_0x50d22d),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x4e4b7e['isParameterized']);const _0x5f5dda=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',_0x58bbd7=>_0x58bbd7),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x74ea33=>_0x74ea33)],'style':{'--ck-ai-review-check-list-item-index':_0x383290}},'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':_0x4e4b7e['title']}]},_0x5f5dda]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x4e4b7e['description']}]}]}]},..._0x4e4b7e['isParameterized']?[this['_createParameterizedView'](_0x4e4b7e)]:[],...'custom'===_0x4e4b7e['id']?[this['_createCustomView'](_0x4e4b7e)]:[]]}),this['on']('click',()=>{_0x4e4b7e['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x4e4b7e['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x39650b({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x495b76=>{_0x495b76['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x2a1ea4=new _0x285b99();return _0x2a1ea4['content']=_0x3b954a,_0x2a1ea4['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x2a1ea4;}['_createParameterizedView'](_0x304f2c){const _0x45ea4a=new _0x1fbe2f(),_0x2ef7d1=this['_createFormView'](_0x304f2c);return _0x45ea4a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x59d42e=>!_0x59d42e)]},'children':[_0x2ef7d1]}),_0x45ea4a;}['_createFormView'](_0x4d007d){const _0x2affd9=new _0x1fbe2f(),_0x30797c=Array['isArray'](_0x4d007d['options'])?_0x4d007d['options']:[],_0x3382fc=new _0x23f64b(this['locale']),t=this['locale']['t'];_0x3382fc['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x3382fc['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x44d45f=>{_0x44d45f['stopPropagation']();})}}),_0x3382fc['on']('execute',()=>{const _0xc4b503=[],_0x31e3af={};this['_formItemsCollection']['forEach'](_0x305c53=>{_0xc4b503['push'](_0x305c53['value']),_0x4d007d['useArgs']&&_0x4d007d['options']&&(_0x31e3af[_0x305c53['argsKey']]=_0x305c53['value']);}),this['fire']('runReviewCheck',{'id':_0x4d007d['id'],'params':_0xc4b503['length']?_0xc4b503:void 0x0,'args':Object['keys'](_0x31e3af)['length']?_0x31e3af:void 0x0});});const _0x451af8=_0x30797c['length'];return _0x30797c['forEach']((_0x3a1719,_0x47dbd2)=>{const _0x58bd2b=_0x47dbd2===_0x451af8-0x1;this['_formItemsCollection']['add'](new Qs(this['locale'],_0x3a1719,_0x58bd2b?_0x3382fc:null));}),_0x2affd9['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x2affd9;}['_createCustomView'](_0x28e9b5){return this['_customCheckView']=new Us(this['locale'],_0x28e9b5),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',_0x312a04=>!_0x312a04)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x5e3679,_0x5c7af6,_0x5ab8c2)=>{_0x5ab8c2||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class Xs extends _0x57e588{['_checkViews'];constructor(_0x3cf99d){super(_0x3cf99d),this['_checkViews']=new _0xa90262();const _0xead9c1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0xead9c1['if']('isVisible','ck-hidden',_0x2fa52e=>!_0x2fa52e)]},'children':this['_checkViews']});}['setChecks'](_0x11eac4){this['_checkViews']['clear']();for(const [_0x4451be,_0x4cad42]of _0x11eac4['entries']()){const _0x41b64f=new Gs(this['locale'],_0x4cad42,_0x4451be);_0x41b64f['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x41b64f);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x185381 of this['_checkViews'])_0x185381 instanceof Gs&&_0x185381['resetToDefault']();}}class Bs extends _0x1fbe2f{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['statusButtonView'];constructor(_0x1964ba,_0x1a9de0){super(_0x1964ba),this['id']=_0x1a9de0,this['set']('status','pending'),this['set']('changeId',_0x1a9de0),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':_0x1a9de0,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x1414cf=new _0x1fbe2f(this['locale']);return _0x1414cf['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',_0xf9bca7=>!_0xf9bca7)]}}),_0x1414cf;}['_createAcceptButtonView'](){const _0xb354df=new _0x23f64b(this['locale']);return _0xb354df['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0xb354df['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x58d413=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x58d413['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x4fc1ec=>'pending'!==_0x4fc1ec)]}}),_0xb354df;}['_createDismissButtonView'](){const _0x133d74=new _0x23f64b(this['locale']);return _0x133d74['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x133d74['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x25d3f9=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x25d3f9['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-result-dismiss-button',this['bindTemplate']['if']('status','ck-hidden',_0x373a15=>'pending'!==_0x373a15)]}}),_0x133d74;}['_createInfoButtonView'](){const _0x44f6a1=new _0x23f64b(this['locale']);return _0x44f6a1['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x12c769,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x44f6a1['bind']('isOn')['to'](this,'isInfoToggleOn',_0x336705=>_0x336705),_0x44f6a1['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x44f6a1;}['_createStatusButtonView'](){const _0x53141a=new _0x23f64b(this['locale']);return _0x53141a['set']({'withText':!0x0,'isEnabled':!0x1}),_0x53141a['bind']('label')['to'](this,'status',_0x343436=>i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_'+_0x343436['toUpperCase']())),_0x53141a['bind']('icon')['to'](this,'status',_0x18b33a=>'ACCEPTED'===_0x18b33a['toUpperCase']()?_0x44639d:'REJECTED'===_0x18b33a['toUpperCase']()?_0xead019:_0x287a66),_0x53141a['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x16f2fc=>'pending'===_0x16f2fc)],'disabled':'disabled'}}),_0x53141a;}}class Ks extends _0x23f64b{constructor(_0x10300c){super(_0x10300c),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 Zs extends _0x57e588{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];constructor(_0x3d68a1){super(_0x3d68a1),this['_resultViews']=new _0xa90262(),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 Ki(_0x3d68a1),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 _0x141d60=this['_createCombinedSkeletonLoader'](),_0x190106=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x190106['if']('isVisible','ck-hidden',_0x2d1934=>!_0x2d1934)]},'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',_0x38015a=>_0x38015a)]},'children':this['_resultViews']},_0x141d60]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x6818c8){const _0x4a94b9=new Bs(this['locale'],_0x6818c8['id']);_0x4a94b9['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x4a94b9),_0x4a94b9['resultResponseView']['element']['innerHTML']=_0x6818c8['contentDiffed'];}['hideResult'](_0x13fbd7,_0x4ba57a){if('pending'===_0x4ba57a)return;const _0x32424a=this['_resultViews']['find'](_0x38b998=>_0x38b998['id']===_0x13fbd7);_0x32424a&&(_0x32424a['status']=_0x4ba57a,_0x32424a['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_grayout'));}['showResult'](_0x1bbb43,_0x1bca74){if('pending'!==_0x1bca74)return;const _0x115d44=this['_resultViews']['find'](_0x4315c7=>_0x4315c7['id']===_0x1bbb43);_0x115d44&&(_0x115d44['status']=_0x1bca74,_0x115d44['element']?.['classList']['remove']('ck-ai-review-mode__check-run-result_grayout'));}['setTitle'](_0x1a0fb8,_0x5bf6f7){this['headerTitle']=_0x1a0fb8,this['headerSubtitle']=_0x5bf6f7||'';}['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 vi(this['locale'],xi['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x416554=new _0x1fbe2f(this['locale']),_0x40ede0=[];for(let _0x520c1b=0x0;_0x520c1b<0x10;_0x520c1b++){const _0xafb686=this['_createSkeletonLoader']();_0xafb686['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x40ede0['push'](_0xafb686);}return _0x416554['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x52e498=>!_0x52e498)]},'children':_0x40ede0}),_0x416554;}['_createErrorView'](){const _0x39d2f8=new _0x1fbe2f(this['locale']),_0x24cbd4=new _0x23f64b(this['locale']),t=this['locale']['t'];return _0x39d2f8['delegate']('retryReview')['to'](this),_0x24cbd4['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x24cbd4['on']('execute',()=>{this['fire']('retryReview');}),_0x39d2f8['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x2098b7=>!_0x2098b7),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x233372=>'chunk'===_0x233372)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-chat-error','ck-ai-chat-error_full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-chat-error_warning',_0x4066c5=>'chunk'===_0x4066c5)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2449d0=>'general'!==_0x2449d0)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2ee0cc=>'chunk'!==_0x2ee0cc)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x24cbd4]}),_0x39d2f8;}['_createCancelButtonView'](){const _0x57e5bb=new _0x23f64b(this['locale']);return _0x57e5bb['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x1575c2}),_0x57e5bb['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x1adf87=>_0x1adf87),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5a6deb=>_0x5a6deb)]}}),_0x57e5bb['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x57e5bb;}['_createToggleDiffButtonView'](){const _0x4906cc=new _0x23f64b(this['locale']);_0x4906cc['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x4906cc['bind']('isEnabled')['to'](this,'isError',_0xdb4cc9=>!_0xdb4cc9),_0x4906cc['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x528dbf=>!_0x528dbf),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3ce8c9=>_0x3ce8c9)]}});const _0x360ff8=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x509e2b=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x4906cc['bind']('isOn')['to'](this,'isToggleDiffOn',_0x4dfe53=>_0x4dfe53),_0x4906cc['bind']('icon')['to'](this,'isToggleDiffOn',_0x5594cb=>_0x5594cb?_0x4017e2:_0x3bb4b0),_0x4906cc['bind']('label')['to'](this,'isToggleDiffOn',_0x255d06=>_0x255d06?_0x360ff8:_0x509e2b),_0x4906cc['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x4906cc;}['_createAcceptAllButtonView'](){const _0x3f363c=new _0x23f64b(this['locale']);return _0x3f363c['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x3f363c['bind']('isEnabled')['to'](this,'isError',_0x4a5c46=>!_0x4a5c46),_0x3f363c['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x52c330=>!_0x52c330),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x18c01d=>_0x18c01d)]}}),_0x3f363c['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x3f363c;}['_createExitReviewButtonView'](){const _0xc3e7a=new _0x23f64b(this['locale']);return _0xc3e7a['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0xc3e7a['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4b6a4f=>!_0x4b6a4f),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x564c2e=>_0x564c2e)]}}),_0xc3e7a['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0xc3e7a;}['_createResultHeaderView'](){const _0x2efc3a=new _0x1fbe2f(this['locale']),_0x38e100=this['_createTitleView']();return _0x2efc3a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai-review-mode__review-completed-header',_0x48fcfd=>_0x48fcfd)]},'children':[_0x38e100,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x2efc3a;}['_createTitleView'](){const _0x84d218=new _0x1fbe2f(this['locale']),_0x4ae6aa=new Si();return _0x4ae6aa['bind']('isVisible')['to'](this,'isResultReady',_0x1dc2e8=>!_0x1dc2e8),_0x84d218['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-wrapper']},'children':[_0x4ae6aa,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2532df=>_0x2532df)]},'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',_0x341e55=>!_0x341e55)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x84d218;}['_createFinishReviewButtonView'](){const _0x55716a=new Ks(this['locale']);return _0x55716a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x17ae76=>!_0x17ae76)]}}),_0x55716a['delegate']('finishReview')['to'](this),_0x55716a;}}class $s extends _0x57e588{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x26b304){super(_0x26b304),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x1aaf6a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x1aaf6a['if']('isVisible','ck-hidden',_0x29149c=>!_0x29149c)]},'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(_0x26b304,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x2847d3=new Ks(this['locale']);return _0x2847d3['delegate']('finishReview')['to'](this),_0x2847d3;}['_createResultHeaderView'](){const _0x46a9a1=new _0x1fbe2f(this['locale']);return _0x46a9a1['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']]}]}),_0x46a9a1;}}class Re extends _0x1fbe2f{['reviewModeHeader'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x32677f){super(_0x32677f),this['reviewModeHeader']=new _0x5e15d9(_0x32677f,{'label':i(_0x32677f,'AI_REVIEW_MODE'),'icon':_0x3fc907,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['reviewCheckListView']=new Xs(_0x32677f),this['reviewCheckListView']['delegate'](...Ys)['to'](this),this['reviewCheckResultsView']=new Zs(_0x32677f),this['reviewCheckResultsView']['delegate'](...Ys)['to'](this),this['reviewCompletedView']=new $s(_0x32677f),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['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'](_0x157f56){this['reviewCheckResultsView']['addResult'](_0x157f56),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;}['showGeneralErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class Ce extends _0x506f25{['resultItemView'];constructor(_0x1c94f9,_0x377126){super(_0x1c94f9),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['content']['add'](this['_createContentView']()),_0x377126['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x2fcce7){this['resultItemView']['changeId']=_0x2fcce7['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x2fcce7['contentDiffed'];}['showBalloon'](_0x5dc642,_0xa435b1){this['updateContent'](_0x5dc642),this['show'](),this['pin']({'target':()=>this['_getBestRectPosition'](_0xa435b1)});}['hideBalloon'](){this['hide'](),this['unpin']();}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange');}['_setupClickOutsideHandler'](){_0x39650b({'emitter':this,'activator':()=>this['isVisible'],'contextElements':[this['element']],'callback':()=>{this['hideBalloon'](),this['deactivateChange']();}});}['_createContentView'](){const _0x13fb27=new _0x1fbe2f();return this['resultItemView']=new Bs(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x13fb27['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion']},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0x13fb27;}['_getBestRectPosition'](_0x5d8794){const _0x31792f=Array['from'](_0x5d8794['getClientRects']());return _0x31792f['find'](_0x3902a2=>_0x3902a2['width']>0x0)||_0x31792f[0x0];}}const Ys=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class me extends _0x5ac5c7{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[Tt];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x238c1a){super(_0x238c1a),this['_bodyCollection']=new _0x203f54(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new Re(this['context']['locale']),this['_reviewModeView']['delegate'](...Ys)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new Ce(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x112eee=this['context']['plugins']['get']('AITabs');_0x112eee['view']['on']('activateTab',(_0x4a102f,_0x5703f6)=>{'reviewMode'===_0x5703f6?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x112eee['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x3fc907,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x2e08cc){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x2e08cc),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x16139b){_0x16139b&&('error-general'!==_0x16139b['status']?'error-chunk'!==_0x16139b['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralErrorView']());}['showCheckRunResult'](_0xc56347){this['_reviewModeView']['addCheckRunResult'](_0xc56347);}['showGeneralErrorView'](){this['_reviewModeView']['showGeneralErrorView']();}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x22eac2,_0x201dfd){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x22eac2,_0x201dfd);}['setActiveStateInResults'](_0x2d6979){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x4ef836=>{_0x4ef836['id']===_0x2d6979&&_0x4ef836['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x2bb3c3=>_0x2bb3c3['setItemAsInactive']());}['updateChangeState'](_0x3aa3dd,_0x5994dd){'accepted'===_0x5994dd||'rejected'===_0x5994dd||'outdated'===_0x5994dd?this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x3aa3dd,_0x5994dd):this['_reviewModeView']['reviewCheckResultsView']['showResult'](_0x3aa3dd,_0x5994dd);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x2f6775,_0x3ef50f){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x2f6775,_0x3ef50f);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['hideDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['showDiffInBalloon']();}['getChangeElement'](_0x4d0e93){const _0x46bf36=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x13062f=>_0x13062f['id']===_0x4d0e93);return _0x46bf36?_0x46bf36['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const we='reviewmode-';class ce extends _0x5ac5c7{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[nt,N];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x122378){super(_0x122378),this['_domEmitter']=new(_0xb2d536())(),this['_eventEmitter']=new(_0x49ef7b())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0xa0cdd5=q(this['context']);_0xa0cdd5['conversion']['for']('editingDowncast')['markerToElement']({'model':we+'insert','view':(_0x10632e,{writer:_0x22b7fb})=>{const _0x5714c8=this['_markers']['get'](_0x10632e['markerName']),_0x742859={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x10632e['markerName']};return _0x22b7fb['createUIElement']('span',_0x742859,function(_0x16b52a){const _0x3d8b07=this['toDomElement'](_0x16b52a);return _0x3d8b07['innerHTML']=_0x5714c8?.['text']||'',_0x3d8b07;});}}),_0xa0cdd5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':we+'remove-only','view':_0x54546d=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x54546d['markerName']}})}),_0xa0cdd5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':we+'remove-context','view':_0x5668fe=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x5668fe['markerName']}})}),_0xa0cdd5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':we+'remove-text','view':_0x1863f4=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x1863f4['markerName']}})}),_0xa0cdd5['conversion']['for']('dataDowncast')['markerToElement']({'model':we+'suggestion-context','view':(_0x22c1b0,{writer:_0x27a64d})=>_0x27a64d['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x22c1b0['isOpening']?'start':'end')})}),_0xa0cdd5['conversion']['for']('downcast')['attributeToAttribute']({'model':St,'view':_0x542bb5}),this['_domEmitter']['listenTo'](document,'click',(_0x1c4576,_0x215086)=>{const _0x7274fc=_0x215086['target'],_0x49c6a4=this['_findMarkerElement'](_0x7274fc);if(!_0x49c6a4)return;const _0xa9ec3c=_0x49c6a4['getAttribute']('data-marker-id'),_0x1d1b0d=_0xa9ec3c['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0xa9ec3c,'changeId':_0x1d1b0d});}),_0xa0cdd5['model']['document']['registerPostFixer'](_0x2c10ab=>this['_validateMarkers'](_0xa0cdd5,_0x2c10ab)),_0xa0cdd5['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0xa0cdd5));}['getDocumentData'](){const _0x3ae72b=this['context']['plugins']['get']('AIEditing'),_0x5f0b7a=q(this['context']),_0xf677a9=_0x5f0b7a['model'],_0x1daed0=new at();for(const _0x276366 of _0xf677a9['document']['getRoot']()['getChildren']()){const _0x49a767=_0x276366['_clone'](!0x0);_0x1daed0['_appendChild'](_0x49a767);}for(const _0x322115 of _0xf677a9['markers'])_0x1daed0['markers']['set'](_0x322115['name'],this['_changeRangeOwnerDocument'](_0x322115['getRange']()['clone'](),_0x1daed0));const _0x496f09=new _0x409913({'ignoreElementEnd':!0x0,'startPosition':_0xf677a9['createPositionAt'](_0x1daed0,0x0)}),_0x5674a7=new Set(),_0x4e2048=new Map();for(const {item:_0x52e2e0}of _0x496f09){if(!_0x52e2e0['is']('$textProxy'))continue;const _0x2610b4=_0x52e2e0['parent'];if((!_0x2610b4||!_0x2610b4['is']('element','caption'))&&(_0x2610b4&&_0x2610b4['is']('element'))){let _0x2b9e9e=_0x2610b4['getAttribute'](St);_0x2b9e9e||(_0x2b9e9e=_0x3ae72b['_nextDataId'](_0x5674a7),_0x2610b4['_setAttribute'](St,_0x2b9e9e)),_0x5674a7['add'](_0x2b9e9e);let _0x1a1036=_0x2610b4;for(;_0x1a1036['parent']&&!_0x1a1036['parent']['is']('documentFragment');)_0x1a1036=_0x1a1036['parent'],_0x1a1036['hasAttribute'](St)&&_0x1a1036['_removeAttribute'](St);_0x4e2048['set'](_0x2b9e9e,{'path':_0x2610b4['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x1a1036['_clone'](!0x0),_0x2b9e9e,_0x5f0b7a['data'])}),_0x496f09['jumpTo'](_0xf677a9['createPositionAfter'](_0x2610b4));}}return{'content':_0x5f0b7a['data']['processor']['toData'](_0x5f0b7a['data']['toView'](_0x1daed0)),'version':_0x5f0b7a['model']['document']['version'],'elements':_0x4e2048};}['diffContent'](_0x535007,_0x3ed3d8){const _0x3b5785=[],_0x5cd4a8=q(this['context']),_0x1d513d=_0x5cd4a8['data']['parse'](_0x535007,'$documentFragment'),_0x2fbc45=_0x5cd4a8['model']['createPositionAt'](_0x1d513d,0x0),_0x10b907=_0x5cd4a8['data']['parse'](_0x3ed3d8,'$documentFragment');if(!this['_hasSameTopLevelElement'](_0x1d513d,_0x10b907))return _0x3b5785;const _0x1436a4=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x535007,_0x3ed3d8,{'anchor':_0x2fbc45,'markDeletions':!0x0})['getOperations']()['filter'](_0x5c3250=>'insert'===_0x5c3250['type']||'marker'===_0x5c3250['type']&&_0x5c3250['name']['startsWith']('$markedRemove')),_0x503597=this['_groupAdjacentOperations'](_0x1436a4);let _0x4afcb3=0x0;return _0x5cd4a8['model']['change'](_0x266d6e=>{for(let _0x37b85d=0x0;_0x37b85d<_0x503597['length'];_0x37b85d++){const _0x56e952=_0x503597[_0x37b85d],_0x50e1fd=_0x266d6e['createDocumentFragment']();for(const _0x53f078 of _0x1d513d['getChildren']())_0x266d6e['append'](_0x53f078['_clone'](!0x0),_0x50e1fd);for(const _0x1880b6 of _0x56e952['operationsIsolated'])if('insert'===_0x1880b6['type']){const _0x499a35=_0x1880b6;_0x499a35['baseVersion']=null,_0x499a35['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x499a35,_0x50e1fd),_0x266d6e['batch']['addOperation'](_0x1880b6),_0x5cd4a8['model']['applyOperation'](_0x1880b6);const _0x336940='suggestion:insertion:id:authorId:'+_0x4afcb3++,_0x552270=_0x5cd4a8['model']['createRange'](_0x499a35['position'],_0x499a35['position']['getShiftedBy'](_0x499a35['howMany']));_0x50e1fd['markers']['set'](_0x336940,_0x552270);}else{if('marker'===_0x1880b6['type']&&_0x1880b6['name']['startsWith']('$markedRemove')){const _0x18c44c=_0x1880b6,_0x10d819='suggestion:deletion:id:authorId:'+_0x4afcb3++;this['_changeOperationOwnerDocument'](_0x18c44c,_0x50e1fd),_0x50e1fd['markers']['set'](_0x10d819,_0x18c44c['newRange']);}}const _0x5f5b01=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x56e952['operationsIsolated'][0x0]),_0x50e1fd),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x56e952['operationsIsolated'][_0x56e952['operationsIsolated']['length']-0x1]),_0x50e1fd));_0x50e1fd['markers']['set'](we+'suggestion-context',new ht(_0x5f5b01['start'],_0x5f5b01['end'])),_0x3b5785['push']({..._0x56e952,'context':this['_createGetContextFn'](_0x50e1fd,_0x5cd4a8['data'],{'ellipsisBefore':_0x5f5b01['hasContentBefore'],'ellipsisAfter':_0x5f5b01['hasContentAfter']}),'content':this['_createGetContentFn'](_0x50e1fd,_0x5cd4a8['data'])});}}),_0x3b5785;}['markChangePositionInEditorContent'](_0x243c9e,_0x9efe17){if(!_0x243c9e['length'])return;const _0x26ccd2=_0x243c9e[0x0]['parent']['id'],_0x476417=_0x9efe17['elements']['get'](_0x26ccd2);if(!_0x476417)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x26ccd2);const _0x57d8bc=_0x476417['path'],_0x3b9e20=q(this['context']),_0x3486b9=_0x3b9e20['model']['document']['history']['getOperations'](_0x9efe17['version']),_0x39072c=[];for(const _0x49dd56 of _0x243c9e){const _0x4d2500=_0x49dd56['operationsIsolated']['map'](_0xfe6502=>this['_translateOperationToEditorContent'](_0xfe6502,_0x57d8bc,_0x3b9e20['model']['document']['getRoots']()[0x0]));if(!_0x4d2500||!_0x4d2500['length'])continue;const _0x197c40=_0x4d2500['every'](_0x5b2c61=>'marker'===_0x5b2c61['type']&&_0x5b2c61['name']['startsWith']('$markedRemove')),_0x24f54b={'document':_0x3b9e20['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x53cf05=ut(_0x4d2500,_0x3486b9,_0x24f54b)['operationsA'];for(const _0x144292 of _0x53cf05)if('insert'===_0x144292['type']){const _0x44b8d1=_0x144292,_0x509199=_0x44b8d1['nodes'];let _0x216c2a='';for(const _0x397db2 of _0x509199)_0x397db2&&_0x397db2['is']('model:$text')&&(_0x216c2a+=_0x397db2['data']);_0x39072c['push']({'start':_0x44b8d1['position'],'end':_0x44b8d1['position'],'type':'insert','groupId':_0x49dd56['id'],'text':_0x216c2a});}else{if('marker'===_0x144292['type']&&_0x144292['name']['startsWith']('$markedRemove')){const _0x37dad1=_0x144292;let _0x31898c='remove-text';if(_0x197c40){const _0x376c53=this['_findAdjacentContextDistance'](_0x37dad1['newRange']['start'],'backward',_0x3b9e20['model']['schema']),_0x44daaa=this['_findAdjacentContextDistance'](_0x37dad1['newRange']['end'],'forward',_0x3b9e20['model']['schema']);if(_0x376c53||_0x44daaa){const _0x16d24e=_0x37dad1['newRange']['start']['getShiftedBy'](-_0x376c53),_0x51dc2a=_0x37dad1['newRange']['end']['getShiftedBy'](_0x44daaa);_0x39072c['push']({'start':_0x16d24e,'end':_0x51dc2a,'groupId':_0x49dd56['id'],'type':'remove-context'});}else _0x31898c='remove-only';}_0x39072c['push']({'start':_0x37dad1['newRange']['start'],'end':_0x37dad1['newRange']['end'],'groupId':_0x49dd56['id'],'type':_0x31898c});}}}this['_insertMarkers'](_0x39072c);}['clearAllMarkers'](){const _0x40acb1=q(this['context']);_0x40acb1['model']['change'](_0x5c7e66=>{for(const _0x320f17 of this['_markers']['keys']())_0x40acb1['model']['markers']['get'](_0x320f17)&&_0x5c7e66['removeMarker'](_0x320f17);}),this['_markers']['clear']();}['switchToReadOnly'](){q(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){q(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x1933b0){const _0x182bbd=q(this['context']),_0x570d9a=_0x182bbd['model'],_0x525e19=_0x1933b0['map'](_0x2b00a3=>this['_getMarkersDataForGroup'](_0x2b00a3))['flat']();_0x570d9a['change'](_0x2943b3=>{for(const _0x12d734 of _0x525e19){const _0x156ff2=_0x182bbd['model']['markers']['get'](_0x12d734['id']);_0x156ff2&&('insert'===_0x12d734['type']?_0x570d9a['insertContent'](_0x2943b3['createText'](_0x12d734['text']||''),_0x156ff2['getRange']()['start']):'remove-text'!==_0x12d734['type']&&'remove-only'!==_0x12d734['type']||_0x570d9a['deleteContent'](_0x570d9a['createSelection'](_0x156ff2['getRange']())),_0x2943b3['removeMarker'](_0x12d734['id']),this['_markers']['delete'](_0x12d734['id']));}});}['rejectChange'](_0x5e5c20){const _0x575759=q(this['context']),_0x7934e0=this['_getMarkersDataForGroup'](_0x5e5c20);_0x575759['model']['change'](_0x4957ba=>{for(const _0x159215 of _0x7934e0)_0x4957ba['removeMarker'](_0x159215['id']),this['_markers']['delete'](_0x159215['id']);});}['getEditor'](){return q(this['context']);}['getMarkerElementForChange'](_0x4fb939){const _0xb123f=Array['from'](this['_markers']['values']())['filter'](_0x54a029=>_0x54a029['groupId']===_0x4fb939);if(!_0xb123f['length'])return null;const _0x5691d6=0x1===_0xb123f['length']?_0xb123f[0x0]:this['_sortMarkers'](_0xb123f)[0x0],_0x136710=q(this['context']),_0x49036f=_0x136710['model']['markers']['get'](_0x5691d6['id']);if(!_0x49036f)return null;const _0x541a1c=_0x49036f['getRange'](),_0x256bed=_0x136710['editing']['view']['getDomRoot']();if(!_0x256bed||!_0x541a1c)return null;const _0x49c2e9=_0x256bed['querySelector']('[data-marker-id=\x22'+_0x5691d6['id']+'\x22]');return _0x49c2e9?{'modelRange':_0x541a1c,'domElement':_0x49c2e9}:null;}['_validateMarkers'](_0x2b0016,_0x862c79){const _0x55439e=Array['from'](this['_markers']['keys']()),_0x5d9288=new Map();for(const _0x5be472 of _0x55439e){const _0x2167bd=_0x2b0016['model']['markers']['get'](_0x5be472);if(!_0x2167bd)continue;const _0x179a7b=_0x2167bd['getStart']()['path'][0x0];_0x5d9288['has'](_0x179a7b)||_0x5d9288['set'](_0x179a7b,[]),_0x5d9288['get'](_0x179a7b)['push'](_0x2167bd);}const _0x7a4658=new Set();for(const _0x272baf of _0x2b0016['model']['document']['differ']['getChanges']()){let _0x379e16=-0x1,_0x2c538a=null;if('insert'===_0x272baf['type'])_0x2c538a=new ht(_0x272baf['position'],_0x272baf['position']['getShiftedBy'](_0x272baf['length'])),_0x379e16=_0x272baf['position']['path'][0x0];else{if('remove'!==_0x272baf['type'])continue;_0x2c538a=new ht(_0x272baf['position']),_0x379e16=_0x272baf['position']['path'][0x0];}const _0x328f17=_0x5d9288['get'](_0x379e16)||[];if(_0x328f17['length']){for(const _0x395136 of _0x328f17)if(_0x2c538a['root']['rootName']===_0x395136['getRange']()['root']['rootName']&&('insert'!==_0x272baf['type']||!_0x2c538a['containsRange'](_0x395136['getRange']()))&&(_0x2c538a['isIntersecting'](_0x395136['getRange']())||_0x2c538a['start']['isTouching'](_0x395136['getRange']()['end'])||_0x2c538a['end']['isTouching'](_0x395136['getRange']()['start']))){const _0xfa1cc2=this['_parseMarkerName'](_0x395136['name']);Array['from'](this['_markers']['values']())['filter'](_0x437194=>_0x437194['groupId']===_0xfa1cc2['groupId'])['forEach'](_0x269815=>_0x7a4658['add'](_0x269815['id']));}}}if(_0x7a4658['size']){for(const _0x20e04b of _0x7a4658)_0x862c79['removeMarker'](_0x20e04b);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x181be6){for(const {name:_0x51a5ea,data:_0x2f57c8}of _0x181be6['model']['document']['differ']['getChangedMarkers']()){if(!_0x51a5ea['startsWith'](we))continue;const _0x161175=_0x2f57c8['oldRange'],_0x33b162=_0x2f57c8['newRange'],_0x5a8876=_0x161175&&'$graveyard'===_0x161175['root']['rootName'],_0x55a20b=_0x33b162&&'$graveyard'===_0x33b162['root']['rootName'];if(_0x5a8876&&_0x55a20b)continue;const _0x293c83=this['_parseMarkerName'](_0x51a5ea);this['_markers']['get'](_0x51a5ea)&&(_0x55a20b||!_0x33b162?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x51a5ea,'changeId':_0x293c83['groupId']}):_0x5a8876&&_0x33b162&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x51a5ea,'changeId':_0x293c83['groupId']}));}}['_parseMarkerName'](_0x4883da){const _0x224a5d=_0x4883da['split'](':'),_0x78851e=(_0x224a5d[0x1]||'')['split']('_');return{'prefix':_0x224a5d[0x0],'groupId':_0x78851e[0x0],'suffix':_0x78851e[0x1]};}['_translateOperationToEditorContent'](_0x506d94,_0x361383,_0x23d6ae){if('insert'===_0x506d94['type']){const _0x556095=_0x506d94;return new _0x33f64c(this['_changePosition'](_0x361383['concat'](_0x556095['position']['offset']),_0x23d6ae),_0x556095['nodes'],_0x556095['baseVersion']);}if('marker'===_0x506d94['type']&&_0x506d94['name']['startsWith']('$markedRemove')){const _0x521595=_0x506d94;return new _0x51c46c(_0x521595['name'],_0x521595['oldRange'],this['_changeRange'](_0x521595['newRange'],_0x361383['concat'](_0x521595['newRange']['start']['offset']),_0x361383['concat'](_0x521595['newRange']['end']['offset']),_0x23d6ae),_0x521595['_markers'],_0x521595['affectsData'],_0x521595['baseVersion']);}return _0x506d94;}['_groupAdjacentOperations'](_0x238c8d){if(!_0x238c8d['length'])return[];const _0x2ed8ae=[];let _0x324efd=0x0,_0x3fb663=0x0,_0x17896e=[];for(let _0x30bb64=0x0;_0x30bb64<=_0x238c8d['length'];_0x30bb64++){const _0xc4a258=_0x238c8d[_0x30bb64],_0x517f09=_0x238c8d[_0x30bb64-0x1];!_0xc4a258||_0x517f09&&!this['_getOperationEnd'](_0x517f09)['isTouching'](this['_getOperationStart'](_0xc4a258))?(_0x2ed8ae['push']({'operations':_0x17896e,'operationsIsolated':_0x17896e['map'](_0x4789fa=>this['_shiftOperation'](_0x4789fa['clone'](),-_0x3fb663)),'groupOffset':_0x324efd}),_0x17896e=_0xc4a258?[_0xc4a258]:[],_0x3fb663+=_0x324efd,_0x324efd=0x0):_0x17896e['push'](_0xc4a258),_0xc4a258&&'insert'===_0xc4a258['type']&&(_0x324efd+=_0xc4a258['howMany']);}return _0x2ed8ae;}['_findAdjacentContextDistance'](_0x915766,_0x3db423,_0x529482,_0x3f76f3=0x1){const _0x147020=new _0x409913({'startPosition':_0x915766,'direction':_0x3db423});let _0x5553c2=0x0;for(let _0x5dc56c=0x0;_0x5dc56c<_0x3f76f3;_0x5dc56c++){let _0xa51b24=0x0,_0x5d3bc5=!0x1,_0x3baac8='forward'===_0x3db423?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x5702ce}of _0x147020)if(_0x5702ce['is']('$textProxy')){const _0x53a9b7=_0x3baac8['exec'](_0x5702ce['data']);if(_0x53a9b7&&_0x53a9b7['length']){if(_0xa51b24+='forward'===_0x3db423?_0x53a9b7['index']+_0x53a9b7[0x0]['length']:_0x5702ce['data']['length']-_0x53a9b7['index'],_0x53a9b7[0x0]['length']!==_0x5702ce['data']['length'])break;_0x5d3bc5=!0x0,_0x3baac8='forward'===_0x3db423?/^\w+/:/\w+$/;}else{if(_0x5d3bc5)break;_0xa51b24+=_0x5702ce['offsetSize'];}}else{if(_0x5702ce['is']('element')){_0x529482['isInline'](_0x5702ce)&&!_0x5d3bc5&&(_0xa51b24+=0x1);break;}}_0x5553c2+=_0xa51b24,_0x147020['jumpTo'](_0x915766['getShiftedBy']('forward'===_0x3db423?_0x5553c2:-_0x5553c2));}return _0x5553c2;}['_getChangeContext'](_0x5979da,_0x41e388){const _0x317309=q(this['context'])['model']['schema'],_0x4979a0=this['_findAdjacentContextDistance'](_0x5979da,'backward',_0x317309,0x6),_0x328206=this['_findAdjacentContextDistance'](_0x41e388,'forward',_0x317309,0x6),_0x1ec98e=_0x5979da['getShiftedBy'](-_0x4979a0),_0x40955f=_0x41e388['getShiftedBy'](_0x328206);return{'start':_0x1ec98e,'end':_0x40955f,'hasContentBefore':!_0x1ec98e['isAtStart'],'hasContentAfter':!_0x40955f['isAtEnd']};}['_insertMarkers'](_0x14bbff){const _0x5d2fca=this['context']['plugins']['get']('AIEditing'),_0x47d4cb=new Set();q(this['context'])['model']['change'](_0x5b96c3=>{for(const _0x598c34 of _0x14bbff){const _0x86bcc7=''+we+_0x598c34['type']+':'+_0x598c34['groupId']+'_'+_0x5d2fca['_nextDataId'](_0x47d4cb);this['_markers']['set'](_0x86bcc7,{'id':_0x86bcc7,'groupId':_0x598c34['groupId'],'type':_0x598c34['type'],'text':_0x598c34['text']}),_0x5b96c3['addMarker'](_0x86bcc7,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5b96c3['createRange'](_0x598c34['start'],_0x598c34['end'])});}});}['_createGetContextFn'](_0x36a7e5,_0x2c2940,_0x49782d){let _0xe160fb='';return()=>{if(!_0xe160fb){const _0x31aaac=_0x2c2940['toView'](_0x36a7e5,{'showSuggestionHighlights':!0x0}),_0x418e4f=_0x31aaac['getChild'](0x0);if(!_0x418e4f)return'';let _0x4019b6=!0x1;const _0x2f5c53=[];for(const _0x515812 of _0x418e4f['getChildren']())_0x515812['is']('element','span')&&_0x515812['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x4019b6=!0x1),_0x4019b6&&_0x2f5c53['push'](_0x515812),_0x515812['is']('element','span')&&_0x515812['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x4019b6=!0x0);_0x418e4f['_removeChildren'](0x0,_0x418e4f['childCount']),_0x49782d?.['ellipsisBefore']&&_0x418e4f['_appendChild']('…'),_0x418e4f['_appendChild'](_0x2f5c53),_0x49782d?.['ellipsisAfter']&&_0x418e4f['_appendChild']('…');const _0x4a0965=_0x2c2940['htmlProcessor']['domConverter']['viewToDom'](_0x31aaac),_0x128411=_0x2c2940['htmlProcessor']['htmlWriter']['getHtml'](_0x4a0965);_0xe160fb=_0x128411;}return _0xe160fb;};}['_createGetContentFn'](_0x33004e,_0x2c6731){let _0xdafd58='';return()=>(_0xdafd58||(_0xdafd58=_0x2c6731['stringify'](_0x33004e,{'showSuggestionHighlights':!0x0})),_0xdafd58);}['_createGetContentUsingDataIdFn'](_0x52a567,_0x4f3a20,_0x532419){let _0x542d4c='';return()=>{if(!_0x542d4c){const _0x203107=_0x532419['toView'](new at(_0x52a567)),_0x20bd95=_0x532419['htmlProcessor']['domConverter']['viewToDom'](_0x203107)['querySelector']('[data-id=\x22'+_0x4f3a20+'\x22]');_0x542d4c=_0x20bd95?.['outerHTML']||'';}return _0x542d4c;};}['_findMarkerElement'](_0x12b7bb,_0x1aaf80=0x5){let _0x356741=_0x12b7bb,_0xf1a7eb=null;for(let _0x5d8434=0x0;_0x5d8434<_0x1aaf80&&_0x356741;_0x5d8434++){if(!_0x356741['className']){_0x356741=_0x356741['parentElement'];continue;}if(!(''+_0x356741['className'])['includes']('ck-ai_review-mode-marker_')){_0x356741=_0x356741['parentElement'];continue;}if(!_0x356741['getAttribute']('data-marker-id'))break;_0xf1a7eb=_0x356741;break;}return _0xf1a7eb;}['_getMarkersDataForGroup'](_0x5c7f2c){return Array['from'](this['_markers']['values']())['filter'](_0x51ecef=>_0x51ecef['groupId']===_0x5c7f2c);}['_getOperationStart'](_0x33312){return'insert'===_0x33312['type']?_0x33312['position']:_0x33312['newRange']['start'];}['_getOperationEnd'](_0x6ee879,_0x3be566=!0x1){return'insert'===_0x6ee879['type']?_0x3be566?_0x6ee879['position']:_0x6ee879['position']['getShiftedBy'](_0x6ee879['howMany']):_0x6ee879['newRange']['end'];}['_shiftOperation'](_0x5841b2,_0x64154a){return'insert'===_0x5841b2['type']?_0x5841b2['position']=_0x5841b2['position']['getShiftedBy'](_0x64154a):'marker'===_0x5841b2['type']&&_0x5841b2['newRange']&&(_0x5841b2['newRange']=new ht(_0x5841b2['newRange']['start']['getShiftedBy'](_0x64154a),_0x5841b2['newRange']['end']['getShiftedBy'](_0x64154a))),_0x5841b2;}['_changeOperationOwnerDocument'](_0x13cdb9,_0x1bc9e9){'insert'===_0x13cdb9['type']?_0x13cdb9['position']=this['_changePositionOwnerDocument'](_0x13cdb9['position'],_0x1bc9e9):'marker'===_0x13cdb9['type']&&_0x13cdb9['newRange']&&(_0x13cdb9['newRange']=this['_changeRangeOwnerDocument'](_0x13cdb9['newRange'],_0x1bc9e9));}['_changePositionOwnerDocument'](_0x473a36,_0x26633e){return new ct(_0x26633e,_0x473a36['path']);}['_changeRangeOwnerDocument'](_0x793ad,_0x3ea37d){return new ht(this['_changePositionOwnerDocument'](_0x793ad['start'],_0x3ea37d),this['_changePositionOwnerDocument'](_0x793ad['end'],_0x3ea37d));}['_changePosition'](_0x470dd6,_0x4e8a33){return new ct(_0x4e8a33,[..._0x470dd6]);}['_changeRange'](_0x260c8c,_0x5acf66,_0x420728,_0x511f44){return new ht(this['_changePosition'](_0x5acf66,_0x511f44),this['_changePosition'](_0x420728,_0x511f44));}['_sortMarkers'](_0x488207){const _0x5a8820=_0x408e28=>{switch(_0x408e28){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x488207['sort']((_0x5dd4cb,_0x586641)=>_0x5a8820(_0x5dd4cb['type'])-_0x5a8820(_0x586641['type']));}['_hasSameTopLevelElement'](_0x2c7718,_0x434e19){const _0x33937d=_0x2c7718['getChild'](0x0),_0x34ba68=_0x434e19['getChild'](0x0);return!(!_0x33937d||!_0x34ba68)&&((!_0x33937d['is']('element')||!_0x34ba68['is']('element')||_0x33937d['name']===_0x34ba68['name'])&&!(_0x33937d['is']('element')&&!_0x34ba68['is']('element')||!_0x33937d['is']('element')&&_0x34ba68['is']('element')));}}class Ka extends _0x5ac5c7{static get['requires'](){return[re,me,ce];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ri as AIActions,x as AIAdapter,Xn as AIAssistant,n as AIAssistantUI,it as AIBalloon,Ua as AIChat,_t as AIChatController,yt as AIChatHistory,mt as AIChatHistoryController,gt as AIChatHistoryUI,ft as AIChatUI,R as AIConnector,N as AIEditing,Va as AIEditorIntegration,Kt as AIQuickActionType,Ba as AIQuickActions,ii as AIQuickActionsUI,tr as AIRequestError,xs as AIReviewCheck,Cs as AIReviewCheckResult,js as AIReviewCheckRun,Ka as AIReviewMode,re as AIReviewModeController,ce as AIReviewModeEditing,me as AIReviewModeUI,Tt as AITabs,pe as AITextAdapter,jt as AIToggleButtonUI,Zn as AWSTextAdapter,Jn as OpenAITextAdapter,E as ShowAIAssistantCommand,co as ToggleAICommand,Li as createResizeButton,zn as getDefaultAICommands};
23
+ import{Plugin as _0x3711b7,Command as Nt,ContextPlugin as _0x267838,Editor as st}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x54fc92,IconCheck as _0x47bafa,IconError as _0x141f49,IconSubmit as _0x3a517e,IconAIHistory as Ht,IconMagicWand as _0x2b987d,IconRobotPencil as _0x547788,IconMaximize as _0x10f52f,IconMinimize as to,IconDocumentWithLoupe as _0x193385,IconAddComment as _0x87ebb0,IconShowChangesOn as _0x5f4a4e,IconShowChangesOff as _0x1c85b2,IconDocument as _0x2cbef8,IconThreeStars as _0x3b149b,IconRemove as _0x449359,IconDocumentWithCheckmark as _0x13c00f,IconDocumentWithCross as _0x5511b4,IconLoupe as _0x15be19,IconCancel as _0x27c5a9,IconStop as _0x2b48d9,IconAIChat as _t,IconPlus as _0x17d64d,IconPin as _0x47880f,IconThreeHorizontalDots as _0x3c01b9,IconChevronRight as _0x5a11af,IconInfo as _0x4ae3dc,IconOutdated as _0x44d7c8,IconEye as _0x554163,IconEyeCrossedOut as _0x320f3e,IconAIReview as _0x30da4f}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x5ef33e,CKEditorError as _0x239292,ObservableMixin as _0x314197,global as _0x218ca6,isVisible as _0x5a4e2b,Rect as _0x507e52,Collection as _0x4c3887,FocusTracker as ts,KeystrokeHandler as _0x4c12a2,first as _0x457991,toArray as _0x2141c6,EmitterMixin as _0x7d5e47,logWarning as _0x361f9e,scrollViewportToShowTarget as _0x10737b,logError as ot,ResizeObserver as _0x459443,_isMotionReduced as It,scrollAncestorsToShowTarget as _0x9d44c8,DomEmitterMixin as _0x14a852}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x4deb4c,ButtonView as _0x5cde82,View as _0x10aa9f,SpinnerView as _0x2265d2,IconView as _0x3dad93,AutocompleteView as _0x329d79,ListView as _0x4a219d,ListItemGroupView as _0x136b89,ListItemView as _0x2ced3c,ButtonLabelView as _0x342201,FocusCycler as $t,createLabeledTextarea as _0x2485cf,Dialog as _0x161ed4,createDropdown as _0x1fe5fd,addMenuToDropdown as _0x11e5a3,MenuBarMenuView as _0x2d240a,MenuBarMenuListItemButtonView as _0x3c5e19,DialogViewPosition as _0x43cf0d,MenuBarMenuListView as ti,MenuBarMenuListItemView as _0x29d062,UIModel as _0x238f2a,SplitButtonView as _0x1cf9f8,BalloonPanelView as _0x179f18,BodyCollection as qt,clickOutsideHandler as _0x2cf367,ListItemButtonView as _0x993614,ViewCollection as _0x285700,addListToDropdown as _0x43d564,submitHandler as _0x256be1,LabeledFieldView as _0x2acda0,createLabeledInputText as _0x3090df,FormHeaderView as _0x4f9b0c,HighlightedTextView as _0x4eed03,FileDialogButtonView as _0x522a32,InputTextView as _0x35834b,SearchTextView as _0x722ee7,DropdownMenuButtonView as _0x15c9c1,DropdownMenuPanelPositioningFunctions as _0x426b9b,BalloonToolbar as zt,FormRowView as _0x4f6c96,TextareaView as _0x317754}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x5586c9,ClipboardMarkersUtils as _0x4939a6}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x298a3f,ViewDataTransfer as _0x390f6a,ViewUpcastWriter as _0x38d8fd,Matcher as _0x1bda3b,_DetachOperation as _0x207911,_insertIntoModelNodeList as _0x2720f2,_removeFromModelNodeList as _0x3666da,ModelRange as _0x473568,ViewDowncastWriter as kt,transformOperationSets as _0x1c1e0c,ModelDocumentFragment as _0x42c406,ModelPosition as _0x2a6f0c,ModelTreeWalker as _0x1c22cf,InsertOperation as te,MarkerOperation as _0x55facf}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0xd2685e,escape as _0x59aba,escapeRegExp as _0x186f47}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x5a8df5,InvokeModelWithResponseStreamCommand as _0x440801,InvokeModelCommand as _0x14bf18}from'@aws-sdk/client-bedrock-runtime';import{createParser as wt}from'eventsource-parser';import{parseDocument as _0x2e2d8f}from'htmlparser2';import{isTag as _0x5bf45b,findOne as gt,getParent as _0x375dfb,findAll as _0x5bf864,removeElement as _0x5de200,replaceElement as _0x3ad05b,prepend as _0x1b3de7,prependChild as _0x10bdac,appendChild as _0x838115,append as _0x24dd09,find as _0x5b38d5,isComment as _0x1f159b,getChildren as _0xbebafa,textContent as _0x439ba7}from'domutils';import _0x259462 from'dom-serializer';import{Document as mt,Element as _0x3d5305,Text as _0x40d4fe,cloneNode as _0x19eeb8,isDocument as _0x2f8491,isText as _0x1ddb5a,NodeWithChildren as _0x10a76f}from'domhandler';import{MarkdownGfmMdToHtml as _0x4652b8}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x2fe0fa,getAllMarkersDomElementsSorted as _0x27098b,DocumentCompare as _0x4176c6,DATA_ID_MODEL_ATTRIBUTE as ct,ConfirmMixin as _0x3a5d8a,LateFocusDropdownButtonView as _0x2515fe,DATA_ID_VIEW_ATTRIBUTE as _0x3ebb99}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x3af120}from'es-toolkit';import{IconThumbUp as _0x5c7a21,IconThumbDown as _0x2b5af5,IconCopy as _0x5165e9,IconCheck as _0x222bf2,IconShowChangesOff as _0x17eb0a,IconShowChangesOn as _0x47c4e2,IconWeb as _0x340ab6,IconNextArrow as _0x1524bc,IconPreviousArrow as _0x52404d,IconAI as Ct,IconClose as _0x3c4bba,IconSelection as _0x5ce07c,IconFileUpload as _0x18f1cd,IconLink as _0xe254f0,IconDocument as _0x3af6f7,IconBulb as _0x18edd5,IconDocumentOutline as _0x2ca83b,IconPaperClip as _0x5e57c2,IconBrowseFiles as _0x2625c2,IconDropdownArrow as _0xb14688,IconAIAskAI as _0x3e2624,IconAIQuickActions as _0x2faead,IconAIChatCommands as Ut,IconAIImproveWriting as Mt,IconAIContinueWriting as Kt,IconAIGrammarCheck as Rt,IconAIAdjustLength as Qt,IconAIChangeTone as xt,IconAITranslate as Dt,IconAIOther as Lt,IconRefresh as _0x384b34}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x2be199 from'morphdom';import{SuggestionsConversion as Pt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{diffArrays as _0x271aee}from'diff';const ei='_ungrouppedCommands';function z(_0x1a1b0e,_0x27ea69){const _0x537c6d=(0x0,_0x27ea69['t'])('Other');return _0x1a1b0e['length']?'groupId'in _0x1a1b0e[0x0]?_0x1a1b0e:[{'groupId':ei,'groupLabel':_0x537c6d,'order':0x1/0x0,'commands':_0x1a1b0e}]:[{'groupId':ei,'groupLabel':_0x537c6d,'order':0x1/0x0,'commands':[]}];}const Fn=globalThis['DataTransfer'],q='ai-ui';class F extends _0x3711b7{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x1c398f}=this,_0x5d64c7=['ck-fake-ai-selection'];_0x1c398f['config']['get']('ai.assistant.useTheme')&&_0x5d64c7['push']('ck-ai-assistant-ui_theme'),_0x1c398f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':q,'view':{'classes':_0x5d64c7,'priority':0xc}}),_0x1c398f['conversion']['for']('editingDowncast')['markerToElement']({'model':q,'view':(_0x434c04,{writer:_0x39d1e3})=>{if(!_0x434c04['markerRange']['isCollapsed'])return null;const _0x4f05d2=_0x39d1e3['createUIElement']('span');return _0x39d1e3['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x4f05d2),_0x4f05d2;}});}['afterInit'](){!async function(_0x10b357){const _0xcdc22=_0x304e5b([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]),_0x2d8b9f=0x3dffc4e1,_0x2fd7b8=0x3df8bcd9^_0x2d8b9f,_0x41af6e=window[_0x304e5b([0x44,0x61,0x74,0x65])][_0x304e5b([0x6e,0x6f,0x77])](),_0x51cd80=_0x10b357[_0x304e5b([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x2c4dd3=new window[(_0x304e5b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xb53b65=>{_0x51cd80[_0x304e5b([0x6f,0x6e,0x63,0x65])](_0x304e5b([0x72,0x65,0x61,0x64,0x79]),_0xb53b65);}),_0x273dd7={[_0x304e5b([0x6b,0x74,0x79])]:_0x304e5b([0x45,0x43]),[_0x304e5b([0x75,0x73,0x65])]:_0x304e5b([0x73,0x69,0x67]),[_0x304e5b([0x63,0x72,0x76])]:_0x304e5b([0x50,0x2d,0x32,0x35,0x36]),[_0x304e5b([0x78])]:_0x304e5b([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]),[_0x304e5b([0x79])]:_0x304e5b([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]),[_0x304e5b([0x61,0x6c,0x67])]:_0x304e5b([0x45,0x53,0x32,0x35,0x36])},_0xf46e4b=_0x51cd80[_0x304e5b([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x304e5b([0x67,0x65,0x74])](_0x304e5b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x13d6e5(){let _0x4bf36b,_0x19828d=null,_0x16dadb=null;try{if(_0xf46e4b==_0x304e5b([0x47,0x50,0x4c]))return _0x304e5b([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x4bf36b=_0x2a50be(),!_0x4bf36b)return _0x304e5b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x4bf36b[_0x304e5b([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x16dadb=_0x12b6dc(_0x4bf36b[_0x304e5b([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x4bf36b[_0x304e5b([0x6a,0x74,0x69])])),await _0x19a8d6()?_0x34c5ce()?_0x4004ce()?_0x304e5b([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3ec629()?(_0x4bf36b[_0x304e5b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x304e5b([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x19828d=_0x1ba171(_0x304e5b([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x4bf36b[_0x304e5b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x304e5b([0x74,0x72,0x69,0x61,0x6c])&&(_0x19828d=_0x1ba171(_0x304e5b([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x163a0c()):_0x304e5b([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x304e5b([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x304e5b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x304e5b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x4004ce(){const _0x5063ef=[_0x304e5b([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x304e5b([0x74,0x72,0x69,0x61,0x6c])][_0x304e5b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4bf36b[_0x304e5b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x41af6e/0x3e8:0xe10*_0x2fd7b8;return _0x4bf36b[_0x304e5b([0x65,0x78,0x70])]<_0x5063ef;}function _0x34c5ce(){const _0x3e75b4=_0x4bf36b[_0x304e5b([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x3e75b4&&(!!_0x3e75b4[_0x304e5b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x304e5b([0x2a]))||!!_0x3e75b4[_0x304e5b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x304e5b([0x41,0x49])));}function _0x3ec629(){const _0x23219c=_0x4bf36b[_0x304e5b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x23219c||0x0==_0x23219c[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x47ed56}=new URL(window[_0x304e5b([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x23219c[_0x304e5b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x47ed56))return!0x0;const _0x128691=_0x47ed56[_0x304e5b([0x73,0x70,0x6c,0x69,0x74])](_0x304e5b([0x2e]));return _0x23219c[_0x304e5b([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x29a413=>_0x29a413[_0x304e5b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x304e5b([0x2a])))[_0x304e5b([0x6d,0x61,0x70])](_0xdd5d64=>_0xdd5d64[_0x304e5b([0x73,0x70,0x6c,0x69,0x74])](_0x304e5b([0x2e])))[_0x304e5b([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xc4561e=>_0xc4561e[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x128691[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x304e5b([0x6d,0x61,0x70])](_0x45e21b=>Array(_0x128691[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x45e21b[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x304e5b([0x66,0x69,0x6c,0x6c])](_0x45e21b[0x0]===_0x304e5b([0x2a])?_0x304e5b([0x2a]):'')[_0x304e5b([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x45e21b))[_0x304e5b([0x73,0x6f,0x6d,0x65])](_0x3eac45=>_0x128691[_0x304e5b([0x65,0x76,0x65,0x72,0x79])]((_0x1de0b4,_0x367ca4)=>_0x3eac45[_0x367ca4]===_0x1de0b4||_0x3eac45[_0x367ca4]===_0x304e5b([0x2a])));}function _0x163a0c(){return _0x19828d&&_0x16dadb?new window[(_0x304e5b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1e974f,_0x169a64)=>{_0x19828d[_0x304e5b([0x74,0x68,0x65,0x6e])](_0x1e974f,_0x169a64),_0x16dadb[_0x304e5b([0x74,0x68,0x65,0x6e])](_0x5f47b3=>{_0x5f47b3!=_0x304e5b([0x56,0x61,0x6c,0x69,0x64])&&_0x1e974f(_0x5f47b3);},_0x169a64);}):_0x19828d||_0x16dadb||_0x304e5b([0x56,0x61,0x6c,0x69,0x64]);}}function _0x12b6dc(_0x183d3a,_0x234be5){return new window[(_0x304e5b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x320d8f=>{if(_0x207e32())return _0x320d8f(_0x304e5b([0x56,0x61,0x6c,0x69,0x64]));_0x35042c(),_0x51cd80[_0x304e5b([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x304e5b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x23441a=!0x1;const _0x113280=_0x5ef33e();function _0x118313(_0x4d16f3){return!!_0x4d16f3&&(typeof _0x4d16f3===_0x304e5b([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x4d16f3===_0x304e5b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x4d16f3[_0x304e5b([0x74,0x68,0x65,0x6e])]===_0x304e5b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x4d16f3[_0x304e5b([0x63,0x61,0x74,0x63,0x68])]===_0x304e5b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x43bd92(_0xafac46){_0x14ea3e(_0xafac46)[_0x304e5b([0x74,0x68,0x65,0x6e])](_0x54e015=>{if(!_0x54e015||_0x54e015[_0x304e5b([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x304e5b([0x6f,0x6b]))return _0x304e5b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x19384e(_0x4152b9(_0x113280+_0x234be5))!=_0x54e015[_0x304e5b([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x304e5b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x304e5b([0x56,0x61,0x6c,0x69,0x64]);})[_0x304e5b([0x74,0x68,0x65,0x6e])](_0x5bc282=>(_0x3c81aa(),_0x5bc282),()=>{const _0x13952d=_0xde0b4a();return null==_0x13952d?(_0x3c81aa(),_0x304e5b([0x56,0x61,0x6c,0x69,0x64])):_0x304e5b(_0x41af6e-_0x13952d>(0x19f340e1^_0x2d8b9f)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x304e5b([0x74,0x68,0x65,0x6e])](_0x320d8f)[_0x304e5b([0x63,0x61,0x74,0x63,0x68])](()=>{_0x320d8f(_0x304e5b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x5aabcf=0x3dc92a61^_0x2d8b9f;function _0x3c81aa(){const _0x3aacf1=_0x304e5b([0x6c,0x6c,0x63,0x74,0x2d])+_0x19384e(_0x4152b9(_0x183d3a)),_0x31ee41=_0x2946d9(_0x19384e(window[_0x304e5b([0x4d,0x61,0x74,0x68])][_0x304e5b([0x63,0x65,0x69,0x6c])](_0x41af6e/_0x5aabcf)));window[_0x304e5b([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x304e5b([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3aacf1,_0x31ee41);}function _0xde0b4a(){const _0x589307=_0x304e5b([0x6c,0x6c,0x63,0x74,0x2d])+_0x19384e(_0x4152b9(_0x183d3a)),_0x5bc013=window[_0x304e5b([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x304e5b([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x589307);return _0x5bc013?window[_0x304e5b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2946d9(_0x5bc013),0x10)*_0x5aabcf:null;}function _0x14ea3e(_0x4f0b71){return new window[(_0x304e5b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5d116a,_0x3a02cf)=>{_0x4f0b71[_0x304e5b([0x74,0x68,0x65,0x6e])](_0x5d116a,_0x3a02cf),window[_0x304e5b([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x3a02cf,0x3dfe1021^_0x2d8b9f);});}}_0x51cd80[_0x304e5b([0x6f,0x6e])](_0x304e5b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1bcd24,_0x528878)=>{if(_0x528878[0x0]!=_0x183d3a)return _0x320d8f(_0x304e5b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x528878[0x1]={..._0x528878[0x1],[_0x304e5b([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x113280};},{[_0x304e5b([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x304e5b([0x68,0x69,0x67,0x68])}),_0x51cd80[_0x304e5b([0x6f,0x6e])](_0x304e5b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x2fabd5=>{_0x118313(_0x2fabd5[_0x304e5b([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x23441a=!0x0,_0x43bd92(_0x2fabd5[_0x304e5b([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x304e5b([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x304e5b([0x6c,0x6f,0x77])}),_0x2c4dd3[_0x304e5b([0x74,0x68,0x65,0x6e])](()=>{_0x23441a||_0x320d8f(_0x304e5b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x207e32(){return _0x51cd80[_0x304e5b([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x304e5b([0x76,0x69,0x65,0x77])][_0x304e5b([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x304e5b([0x61,0x75,0x74,0x6f]);}function _0x35042c(){_0x51cd80[_0x304e5b([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x304e5b([0x76,0x69,0x65,0x77])][_0x304e5b([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x304e5b([0x61,0x75,0x74,0x6f]);}}function _0x1ba171(_0x32841a){const _0x26d412=[new window[(_0x304e5b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5a83aa=>setTimeout(_0x5a83aa,0x3df6fa2d^_0x2d8b9f)),_0x2c4dd3[_0x304e5b([0x74,0x68,0x65,0x6e])](()=>new window[(_0x304e5b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x347bcd=>{let _0x12b217=0x0;_0x51cd80[_0x304e5b([0x6d,0x6f,0x64,0x65,0x6c])][_0x304e5b([0x6f,0x6e])](_0x304e5b([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3e0f0a,_0x283157)=>{_0x283157[0x0][_0x304e5b([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x12b217++,_0x12b217==(0x3dffc519^_0x2d8b9f)&&(_0x347bcd(),_0x3e0f0a[_0x304e5b([0x6f,0x66,0x66])]());});}))];return window[_0x304e5b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x304e5b([0x72,0x61,0x63,0x65])](_0x26d412)[_0x304e5b([0x74,0x68,0x65,0x6e])](()=>_0x32841a);}async function _0x5750f9(){await _0x2c4dd3,_0x51cd80[_0x304e5b([0x6d,0x6f,0x64,0x65,0x6c])][_0x304e5b([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x5ebbc9,_0x51cd80[_0x304e5b([0x6d,0x6f,0x64,0x65,0x6c])][_0x304e5b([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x5ebbc9,_0x51cd80[_0x304e5b([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x304e5b([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x53fca4(_0x3bfefd){const _0xfff093=_0x169183();_0x51cd80[_0xfff093]=_0x304e5b([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x3bfefd,_0x3bfefd!=_0x304e5b([0x56,0x61,0x6c,0x69,0x64])&&_0x5750f9();}function _0x169183(){const _0x108b6c=window[_0x304e5b([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x304e5b([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x304e5b([0x6e,0x6f,0x77])]())[_0x304e5b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x304e5b([0x2e]),'');let _0x3c43ac=_0x304e5b([0x6e]);for(let _0x4b93e8=0x0;_0x4b93e8<_0x108b6c[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4b93e8+=0x2){let _0x40b3e2=window[_0x304e5b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x108b6c[_0x304e5b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4b93e8,_0x4b93e8+0x2));_0x40b3e2>=_0xcdc22[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x40b3e2-=_0xcdc22[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x3c43ac+=_0xcdc22[_0x40b3e2];}return _0x3c43ac;}function _0x2a50be(){const _0x5de340=_0xf46e4b[_0x304e5b([0x73,0x70,0x6c,0x69,0x74])](_0x304e5b([0x2e]));if(0x3!=_0x5de340[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xb15f4(_0x5de340[0x1]);function _0xb15f4(_0x4bc2d8){const _0x308a21=_0x13b19d(_0x4bc2d8);return _0x308a21&&_0x243b2c()?_0x308a21:null;function _0x243b2c(){const _0x31cd50=_0x308a21[_0x304e5b([0x6a,0x74,0x69])],_0x54d136=window[_0x304e5b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x31cd50[_0x304e5b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x31cd50[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x4c1208={..._0x308a21,[_0x304e5b([0x6a,0x74,0x69])]:_0x31cd50[_0x304e5b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x31cd50[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x4c1208[_0x304e5b([0x76,0x63])],_0x4152b9(_0x4c1208)==_0x54d136;}}}async function _0x19a8d6(){let _0x507275=!0x0;try{const _0x4d09c8=_0xf46e4b[_0x304e5b([0x73,0x70,0x6c,0x69,0x74])](_0x304e5b([0x2e])),[_0xaa08be,_0x5d43c9,_0x47a33f]=_0x4d09c8;return _0x4b7350(_0xaa08be),await _0x4ed4d5(_0xaa08be,_0x5d43c9,_0x47a33f),_0x507275;}catch{return!0x1;}function _0x4b7350(_0x159b29){const _0xb27fc5=_0x13b19d(_0x159b29);_0xb27fc5&&_0xb27fc5[_0x304e5b([0x61,0x6c,0x67])]==_0x304e5b([0x45,0x53,0x32,0x35,0x36])||(_0x507275=!0x1);}async function _0x4ed4d5(_0x5e9c3e,_0x3aea87,_0x4b8e29){const _0x322be3=window[_0x304e5b([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x304e5b([0x66,0x72,0x6f,0x6d])](_0x17ebc9(_0x4b8e29),_0x47e4a4=>_0x47e4a4[_0x304e5b([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x137ec3=new window[(_0x304e5b([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x304e5b([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5e9c3e+_0x304e5b([0x2e])+_0x3aea87),_0x1232bb=window[_0x304e5b([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x304e5b([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1232bb)return;const _0x53ffae=await _0x1232bb[_0x304e5b([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x304e5b([0x6a,0x77,0x6b]),_0x273dd7,{[_0x304e5b([0x6e,0x61,0x6d,0x65])]:_0x304e5b([0x45,0x43,0x44,0x53,0x41]),[_0x304e5b([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x304e5b([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x304e5b([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1232bb[_0x304e5b([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x304e5b([0x6e,0x61,0x6d,0x65])]:_0x304e5b([0x45,0x43,0x44,0x53,0x41]),[_0x304e5b([0x68,0x61,0x73,0x68])]:{[_0x304e5b([0x6e,0x61,0x6d,0x65])]:_0x304e5b([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x53ffae,_0x322be3,_0x137ec3)||(_0x507275=!0x1);}}function _0x13b19d(_0x41b8db){return _0x41b8db[_0x304e5b([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x304e5b([0x65,0x79]))?JSON[_0x304e5b([0x70,0x61,0x72,0x73,0x65])](_0x17ebc9(_0x41b8db)):null;}function _0x17ebc9(_0x6ce853){return window[_0x304e5b([0x61,0x74,0x6f,0x62])](_0x6ce853[_0x304e5b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x304e5b([0x2b]))[_0x304e5b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x304e5b([0x2f])));}function _0x4152b9(_0x4c95c2){let _0x5757a5=0x1505;function _0x3766f7(_0x196885){for(let _0x480b26=0x0;_0x480b26<_0x196885[_0x304e5b([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x480b26++){const _0x28715f=_0x196885[_0x304e5b([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x480b26);_0x5757a5=(_0x5757a5<<0x5)+_0x5757a5+_0x28715f,_0x5757a5&=_0x5757a5;}}function _0x36eeca(_0x9ecda5){Array[_0x304e5b([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x9ecda5)?_0x9ecda5[_0x304e5b([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x36eeca):_0x9ecda5&&typeof _0x9ecda5==_0x304e5b([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x304e5b([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x9ecda5)[_0x304e5b([0x73,0x6f,0x72,0x74])]()[_0x304e5b([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x5b4b1a,_0x3bba45])=>{_0x3766f7(_0x5b4b1a),_0x36eeca(_0x3bba45);}):_0x3766f7(window[_0x304e5b([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x9ecda5));}return _0x36eeca(_0x4c95c2),_0x5757a5>>>0x0;}function _0x19384e(_0x470ebe){return _0x470ebe[_0x304e5b([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x304e5b([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x304e5b([0x30]));}function _0x2946d9(_0x70dc42){return _0x70dc42[_0x304e5b([0x73,0x70,0x6c,0x69,0x74])]('')[_0x304e5b([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x304e5b([0x6a,0x6f,0x69,0x6e])]('');}function _0x5ebbc9(){}function _0x304e5b(_0x52ddce){return _0x52ddce['map'](_0x1e5e21=>String['fromCharCode'](_0x1e5e21))['join']('');}_0x53fca4(await _0x13d6e5());}(this);}['showFakeVisualSelection'](){const _0x4d6ce9=this['editor']['model'];_0x4d6ce9['change'](_0x381867=>{const _0x2ae3cf=_0x4d6ce9['document']['selection']['getRanges']();let _0x411d20=0x0;for(const _0x1483ec of _0x2ae3cf){const _0x23bba2=q+':'+_0x411d20;if(_0x4d6ce9['markers']['has'](_0x23bba2))_0x381867['updateMarker'](_0x23bba2,{'range':_0x1483ec});else{if(_0x1483ec['start']['isAtEnd']){const _0x67c159=_0x1483ec['start']['getLastMatchingPosition'](({item:_0x46209d})=>!_0x4d6ce9['schema']['isContent'](_0x46209d),{'boundaries':_0x1483ec});_0x381867['addMarker'](_0x23bba2,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x381867['createRange'](_0x67c159,_0x1483ec['end'])});}else _0x381867['addMarker'](_0x23bba2,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1483ec});}_0x411d20++;}});}['hideFakeVisualSelection'](){const _0x2fb367=this['editor']['model'],_0x29ae76=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](q));_0x29ae76['length']&&_0x2fb367['change'](_0xfb282d=>{_0x29ae76['forEach'](_0x27f81b=>{_0xfb282d['removeMarker'](_0x27f81b);});});}['insertContent'](_0x42e71b,_0x502bd7){const _0x901e01=this['_getAISelection'](),_0x281dd3=_0x502bd7||_0x901e01['getFirstRange']();this['editor']['model']['canEditAt'](_0x281dd3)&&this['editor']['model']['change'](_0x1e4489=>{this['hideFakeVisualSelection'](),_0x502bd7||this['_resetContentOfSelectedTableCells'](_0x1e4489,_0x901e01),this['_pasteHTMLUsingClipboard']({'insertAt':_0x281dd3,'writer':_0x1e4489,'html':_0x42e71b});});}['insertContentBelow'](_0x2c4e9e){const {model:_0xa2b630}=this['editor'],_0x1c69dd=this['_getAISelection']();_0xa2b630['change'](()=>{const _0x2c623a=this['_prepareTableInsertBelowPosition'](_0x2c4e9e,_0x1c69dd)||this['_getDefaultInsertBelowPosition'](_0x1c69dd);this['insertContent'](_0x2c4e9e,_0x2c623a);});}['_getAISelection'](){const _0x3d16ea=this['editor']['model'],_0x812aea=Array['from'](_0x3d16ea['markers']['getMarkersGroup'](q))['map'](_0x2e2f80=>_0x2e2f80['getRange']());return _0x3d16ea['createSelection'](_0x812aea);}['_pasteHTMLUsingClipboard']({writer:_0xd033f6,html:_0x3a5e4e,insertAt:_0x221d2d}){const {view:_0x2a84f2}=this['editor']['editing'],_0x523c55=this['editor']['plugins']['get'](_0x5586c9),_0x293fdb=new Fn();_0x293fdb['setData']('text/html',_0x3a5e4e);const _0x5dbea4=new ClipboardEvent('paste',{'clipboardData':_0x293fdb}),_0x1fae46=new _0x298a3f(_0x2a84f2,_0x5dbea4,{'dataTransfer':new _0x390f6a(_0x293fdb)});_0xd033f6['setSelection'](_0x221d2d);const _0x58cf5b=(_0x48f070,_0x3ee1d9)=>{_0x3ee1d9['resultRange']&&_0xd033f6['setSelection'](_0x3ee1d9['resultRange']);};_0x523c55['once']('contentInsertion',_0x58cf5b,{'priority':'lowest'}),_0x2a84f2['document']['fire']('paste',_0x1fae46),_0x523c55['off']('contentInsertion',_0x58cf5b);}['_getDefaultInsertBelowPosition'](_0x3945f8){const {model:_0x5c2ae7}=this['editor'],_0x226e15=Array['from'](_0x3945f8['getSelectedBlocks']());return _0x226e15['length']?_0x5c2ae7['createPositionAfter'](_0x226e15['pop']()):_0x3945f8['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x39ba92,_0x434ba6){const {model:_0x84b814,plugins:_0x53bf48}=this['editor'];if(_0x53bf48['has']('TableUtils')){const _0x2b19cb=_0x53bf48['get']('TableUtils')['getSelectedTableCells'](_0x434ba6);if(_0x2b19cb['length']){const _0x59fd96=this['_getTableRowCountFromContent'](_0x39ba92),_0x4ef6e8=this['_createEmptyTableRows'](_0x2b19cb,_0x59fd96);return _0x84b814['createPositionAt'](_0x4ef6e8,0x0);}}return null;}['_getTableRowCountFromContent'](_0x580206){const _0x1a1b09=this['editor']['plugins']['get']('TableUtils'),_0x4c6919=this['editor']['data']['parse'](_0x580206),_0x1fb183=Array['from'](_0x4c6919['getChildren']())['filter'](_0x57efc5=>_0x57efc5['is']('element','table'));let _0x569c5b=0x0;return _0x1fb183['forEach'](_0x302c83=>{_0x569c5b+=_0x1a1b09['getRows'](_0x302c83);}),_0x569c5b;}['_createEmptyTableRows'](_0x1f1a7f,_0x39d082){const _0x3deab5=this['editor']['plugins']['get']('TableUtils'),_0x1254ed=_0x3deab5['getRowIndexes'](_0x1f1a7f),_0x14eb11=_0x3deab5['getColumnIndexes'](_0x1f1a7f),_0x5ec4b0=_0x1254ed['last']+0x1,_0x111b23=_0x14eb11['first'],_0x270e24=_0x1f1a7f[0x0]['findAncestor']('table');for(let _0xce098b=0x0;_0xce098b<_0x39d082;_0xce098b++)_0x3deab5['insertRows'](_0x270e24,{'at':_0x5ec4b0});return _0x270e24['getChild'](_0x5ec4b0)['getChild'](_0x111b23);}['_resetContentOfSelectedTableCells'](_0x3e1f4c,_0x46488c){const {plugins:_0x16f167}=this['editor'],{model:_0x5e4172}=_0x3e1f4c;if(!_0x16f167['has']('TableUtils'))return;_0x16f167['get']('TableUtils')['getSelectedTableCells'](_0x46488c)['length']&&_0x5e4172['deleteContent'](_0x46488c);}}class ni extends _0x3711b7{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x239292('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x1ec9be){super(_0x1ec9be),this['name']='AIRequestError';}}function Yn(_0x1983fa,_0xed8cc0,_0xdc777d){const t=_0x1983fa['t'];switch(_0xed8cc0){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',_0xdc777d);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0xdc777d);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'},_0xdc777d);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 _0xed8cc0;}}class ai extends Nt{['_commandDefinitions'];constructor(_0x50688e,_0x2bd627){super(_0x50688e),this['_commandDefinitions']=_0x2bd627,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x49be4b,_0x48045d,_0x42425b)=>{this['isEnabled']&&(this['enabledCommandsIds']=cs(this['_commandDefinitions'],_0x42425b));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x1e18ce,_0x1a5d0e,_0x3698f7)=>{this['enabledCommandsIds']=_0x3698f7?cs(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x4994bf=this['editor']['model'];this['_hasContext']=function(_0x252349){const _0x1ab4af=_0x252349['document']['selection'];return _0x1ab4af['isCollapsed']?0x0!==[..._0x1ab4af['getSelectedBlocks']()]['length']&&![..._0x1ab4af['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x252349['hasContent'](_0x1ab4af['getFirstRange']());}(_0x4994bf);const _0x1952e2=_0x4994bf['document']['selection'],_0x276547=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x499c94 of _0x1952e2['getRanges']())for(const _0x2642a4 of _0x499c94['getItems']())if(_0x2642a4['is']('element')&&_0x276547['includes'](_0x2642a4['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x2cd0ed='',_0x117ebd='',_0x1be8fb='custom'){this['editor']['plugins']['get'](G)['showUI'](_0x2cd0ed,_0x117ebd,_0x1be8fb);}}function cs(_0x527508,_0x58cf85){const _0x31a52f=new Set();for(const _0x29b200 of _0x527508['values']())(_0x58cf85||!0x1===_0x29b200['requiresContent'])&&_0x31a52f['add'](_0x29b200['id']);return Array['from'](_0x31a52f);}const as=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class oi extends/* #__PURE__ -- @preserve */
24
+ _0x314197(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x5b17d1,_0x135b81,_0x39745b){super(),this['editor']=_0x5b17d1,this['textAdapter']=_0x135b81,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x39745b,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x8fe5d6,_0x320ccc,_0x4553c7)=>{this['view']['value']=this['_sanitizeHTML'](_0x4553c7);}),this['listenTo'](this['view'],'submitPrompt',(_0x61a7e9,_0x531a03)=>{const _0x450a58=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x531a03,_0x450a58,'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:_0x5c99c4,query:_0xabb99e,htmlContent:_0x234609,label:_0x1e25d8,mainActionLabel:_0x4a98d9}){this['view']['prompt']=_0x1e25d8,this['view']['mainAction']=_0x4a98d9,this['initialContext']=_0x234609,_0xabb99e&&(this['view']['isRendered']?this['_handleQuery'](_0xabb99e,_0x234609,_0x5c99c4,_0x1e25d8):this['view']['once']('render',()=>{this['_handleQuery'](_0xabb99e,_0x234609,_0x5c99c4,_0x1e25d8);}));}['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'](_0x520a1e,_0x82b2d2,_0x55e541,_0x1dd5e6){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x82b2d2,this['previousQuery']=_0x520a1e,this['previousLabel']=_0x1dd5e6||_0x520a1e,this['previousActionId']=_0x55e541,new Promise(_0x4bb65b=>{this['textAdapter']['makeRequest']({'query':_0x520a1e,'context':_0x82b2d2,'onData':_0x52bd7e=>{this['currentResponse']=_0x52bd7e,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x55e541})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0xa326d1=>{_0xa326d1 instanceof tr?this['view']['handleError'](_0xa326d1['message']):this['view']['handleError'](),_0x4bb65b();})['finally'](()=>{this['stopProcessing'](),_0x4bb65b();});});}['_parseAndNormalizeContent'](_0x258f86,_0x46dce4=!0x1){const _0x181dae=as['exec'](_0x258f86);_0x258f86=_0x181dae?_0x258f86['substring'](_0x181dae[0x1]['length']):_0x258f86['length']<0x64&&!_0x46dce4?'':this['_stripMarkdownSyntax'](_0x258f86);const _0x11824f=this['_domParser']['parseFromString'](_0x258f86,'text/html');if(_0x181dae){const _0x1178ad=Array['from'](_0x11824f['body']['childNodes']);_0x1178ad['reverse']();for(const _0x4bfd23 of _0x1178ad){if(_0x4bfd23['nodeType']==Node['ELEMENT_NODE'])break;_0x4bfd23['remove']();}}const _0xdcc824=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x11824f['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0xdcc824);const _0x8ec959=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x149e4b=this['editor']['data']['toModel'](_0xdcc824);return _0x8ec959||_0x149e4b['markers']['clear'](),this['editor']['data']['stringify'](_0x149e4b);}['_normalizeResponseHeadings'](_0x444173){const _0x56ad10=new _0x38d8fd(this['editor']['editing']['view']['document']),_0x4bca29=new _0x1bda3b({'name':/^h[1-5]$/}),_0x140980=[];let _0x285f4b=!0x1;for(const _0x10defb of _0x444173)_0x10defb['is']('element')&&_0x4bca29['match'](_0x10defb)&&(_0x140980['push'](_0x10defb),'h1'==_0x10defb['name']&&(_0x285f4b=!0x0));if(_0x285f4b){for(const _0xfd5958 of _0x140980)_0x56ad10['rename']('h'+(parseInt(_0xfd5958['name'][0x1])+0x1),_0xfd5958);}}['_isH1TagSupportEnabled'](){const {data:_0x44a324,editing:_0x52355b}=this['editor'],_0x4cf868=_0x44a324['htmlProcessor']['toView']('<h1></h1>'),_0xc2c4ea=_0x44a324['toView'](_0x44a324['toModel'](_0x4cf868));return!!_0x52355b['view']['domConverter']['viewToDom'](_0xc2c4ea)['querySelector']('h1');}['_sanitizeHTML'](_0x161cc5){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x161cc5),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x3d3509){const _0x241b01=_0x3d3509['trim']();return _0x241b01['startsWith']('```html')?_0x241b01['endsWith']('```')?_0x241b01['substring'](0x7,_0x241b01['length']-0x3):_0x241b01['substring'](0x7):_0x3d3509;}}const ci={'REPLACE':'replace','INSERT':'insert'};class wr extends _0x4deb4c{constructor(_0xc1ae40){super(_0xc1ae40),this['set']('isVisible',!0x1),this['set']('mainAction',ci['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x2eb1d6=>Yn(_0xc1ae40,'AI_'+_0x2eb1d6['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Yn(_0xc1ae40,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Yn(_0xc1ae40,'Try\x20again')),this['stopButton']=this['_createButton'](Yn(_0xc1ae40,'Stop'));const _0x442c65=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x442c65['if']('isVisible','ck-hidden',_0x2ee4c8=>!_0x2ee4c8)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3e8cd4,_0x1bc4dd){const _0x52d4cd=new _0x5cde82(this['locale']);return _0x52d4cd['set']({'label':_0x3e8cd4,'class':_0x1bc4dd||'','isVisible':!0x0,'withText':!0x0}),_0x52d4cd;}}class yr extends _0x10aa9f{['contentFieldView'];['copyButtonView'];constructor(_0x3cc37a,_0x47e7df=''){super(_0x3cc37a),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x14b705=this['bindTemplate'];this['contentFieldView']=new $n(_0x3cc37a,_0x47e7df),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x14b705['if']('isVisible','ck-hidden',_0xa0fb28=>!_0xa0fb28)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x14b705['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 _0x56f935=!0x1;this['on']('change:value',(_0x348db7,_0x3d3941,_0x3b3fe0)=>{const _0x5a05aa=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x3b3fe0),this['isProcessing']&&_0x5a05aa&&!_0x56f935&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x4910a0,_0x241248,_0x1bdc75)=>{_0x56f935=!0x1,_0x1bdc75?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x56f935=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x56f935=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x15ffe1=this['locale'],_0x5d36b9=new _0x5cde82(this['locale']),_0x25f61e='ck-ai-form__copy-button';return _0x5d36b9['set']({'label':Yn(_0x15ffe1,'Copy'),'icon':_0x54fc92,'class':_0x25f61e,'tooltip':!0x0}),_0x5d36b9['bind']('isVisible')['to'](this,'value',_0x3f2e21=>!!_0x3f2e21),_0x5d36b9['bind']('isEnabled')['to'](this,'isProcessing',_0x32da65=>!_0x32da65),_0x5d36b9['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x5d36b9['icon']=_0x47bafa,_0x5d36b9['class']=_0x25f61e+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x5d36b9['icon']=_0x54fc92,_0x5d36b9['class']=_0x25f61e;},0x3e8);}),_0x5d36b9;}['_copyHTMLToClipboard'](_0x3fa536){const {window:_0x4c4651,document:_0x43672a}=_0x218ca6;if(_0x4c4651['ClipboardItem']){const {Blob:_0x151f62,ClipboardItem:_0x40de75}=_0x4c4651,_0xfc09b0=[new _0x40de75({'text/html':new _0x151f62([_0x3fa536['innerHTML']],{'type':'text/html'}),'text/plain':new _0x151f62([_0x3fa536['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0xfc09b0);}else{const _0xdddf3=_0x43672a['createElement']('div');_0xdddf3['style']['position']='absolute',_0xdddf3['style']['left']='-9999px',_0xdddf3['innerHTML']='<span>[</span>'+_0x3fa536['innerHTML']+'<span>]</span>',_0x43672a['body']['appendChild'](_0xdddf3);const _0x18464b=_0x43672a['createRange']();_0x18464b['setStartAfter'](_0xdddf3['firstElementChild']),_0x18464b['setEndBefore'](_0xdddf3['lastElementChild']);const _0x32642b=_0x4c4651['getSelection']();_0x32642b['removeAllRanges'](),_0x32642b['addRange'](_0x18464b),_0x43672a['execCommand']('copy'),_0xdddf3['remove']();}}}class $n extends _0x10aa9f{constructor(_0x5d8a90,_0x192847=''){super(_0x5d8a90),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x192847,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3e9166){this['element']['innerHTML']=_0x3e9166;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x5d6898=new _0x10aa9f(),_0x5816d8=this['locale'],_0x44a375=new _0x2265d2();return _0x44a375['isVisible']=!0x0,_0x5d6898['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x44a375,{'text':Yn(_0x5816d8,'AI\x20is\x20writing...')}]}),_0x5d6898['render'](),_0x5d6898;}}class gr extends _0x10aa9f{constructor(_0x2c4ca1,_0xcc4bd8=''){super(_0x2c4ca1);const _0xba99d9=new _0x3dad93(),_0x22ad8=this['bindTemplate'];this['set']('text',_0xcc4bd8),_0xba99d9['content']=_0x141f49,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0xba99d9,{'text':_0x22ad8['to']('text')}]});}}class Er extends _0x329d79{['submitButtonView'];['showHistoryButtonView'];constructor(_0x469f67,_0x131a8e){super(_0x469f67,_0x131a8e),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',(_0x18ea4e,_0x574829)=>{_0x18ea4e['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x574829());});}['_createSubmitButton'](){const _0xa16afe=new _0x5cde82(this['locale']),_0x40d9dd=this['locale'];return _0xa16afe['set']({'icon':_0x3a517e,'label':Yn(_0x40d9dd,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0xa16afe['on']('execute',()=>{this['submit']();}),_0xa16afe['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4a04a7,_0x5ee184)=>!_0x4a04a7&&_0x5ee184),_0xa16afe;}['_createShowHistoryButton'](){const _0x3f7d04=new _0x5cde82(this['locale']),_0x591554=this['resultsView'],_0x2f5a89=this['locale'];_0x3f7d04['set']({'label':Yn(_0x2f5a89,'History'),'withText':!0x1,'icon':Ht,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x3f7d04['bind']('isOn')['to'](_0x591554,'isVisible'),_0x3f7d04['bind']('isEnabled')['to'](this,'isEnabled'),_0x3f7d04['on']('execute',()=>{_0x591554['isVisible']=!_0x591554['isVisible'],_0x591554['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x275143=()=>{_0x218ca6['window']['requestAnimationFrame'](()=>{if(_0x5a4e2b(this['element'])){const _0x2bfc0f=new _0x507e52(this['queryView']['fieldView']['element']),_0x4bab48=_0x2bfc0f['width'],_0x1589e0='rtl'===_0x2f5a89['uiLanguageDirection']?'left':'right';_0x2bfc0f['excludeScrollbarsAndBorders'](),_0x3f7d04['element']['style'][_0x1589e0]=_0x4bab48-_0x2bfc0f['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x275143),this['on']('render',_0x275143),_0x3f7d04;}['submit'](){const _0x128229=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x128229);}['focus'](_0x17aba0){-0x1===_0x17aba0?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class vr extends _0x4a219d{['historyGroupView'];['clearHistoryButton'];constructor(_0x55df7d){super(_0x55df7d),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x136b89(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Yn(_0x55df7d,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2d1f93=0x0;for(const _0x353e7c of this['items'])_0x2d1f93+=_0x353e7c['items']['length'];return{'resultsCount':_0x2d1f93,'totalItemsCount':_0x2d1f93};}['_createClearHistoryButton'](){const _0x2207d8=this['locale'],_0x50e441=new _0x5cde82(this['locale']);return _0x50e441['set']({'label':'('+Yn(_0x2207d8,'Clear')+')','withText':!0x0}),_0x50e441['on']('execute',()=>this['fire']('clearHistory')),_0x50e441;}}class Ar extends _0x2ced3c{constructor(_0x130f52){super();const _0x110dc0=new _0x342201(),_0x8852f7=new _0x5cde82(this['locale'],_0x110dc0);this['children']['add'](_0x8852f7),_0x8852f7['set']({'label':_0x130f52['prompt'],'withText':!0x0}),_0x8852f7['on']('execute',()=>{this['fire']('execute',{'value':_0xd2685e(_0x130f52['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Pr extends _0x4c3887{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4cb76c,_0x3e6cbb)=>{const _0x3a32c6=fo(_0x3e6cbb['prompt']);for(const _0x14ccbd of this)if(_0x14ccbd!=_0x3e6cbb&&fo(_0x14ccbd['prompt'])===_0x3a32c6){this['remove'](_0x14ccbd);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x2a72a2=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x2a72a2));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x481442=>_0x481442)));}}function fo(_0x5f34f1){return _0x5f34f1['toLowerCase']()['trim']();}class ri extends _0x10aa9f{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x233427,_0x8252e5,_0x4bb8f3=''){super(_0x233427),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',ci['REPLACE']),this['_promptHistory']=new Pr(),this['errorView']=new gr(_0x233427),this['contentArea']=new yr(_0x233427,_0x4bb8f3),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new ts(),this['keystrokes']=new _0x4c12a2(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new $t({'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 _0x1b5338=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x8252e5],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x1b5338['if']('isError','ck-hidden',_0x174f0a=>!_0x174f0a)]},'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'](_0x5a2584=0x1){-0x1===_0x5a2584?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 _0x12aca5=this['locale'],_0x422909=new Er(_0x12aca5,{'queryView':{'label':Yn(_0x12aca5,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x2485cf,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Yn(_0x12aca5,'Empty\x20history'),'secondary':Yn(_0x12aca5,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x422909['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4e240e,_0x254d40)=>_0x4e240e&&!_0x254d40),this['listenTo'](_0x422909,'submit',(_0x217546,_0x2e2994)=>{this['prompt']=_0x2e2994;const _0x1999d5=_0x59aba(_0x2e2994);this['fire']('submitPrompt',_0x1999d5),_0x2e2994['trim']()&&this['_promptHistory']['add']({'prompt':_0x1999d5},0x0);},{'priority':'high'}),_0x422909;}['_createHistoryView'](){const _0x42233f=new vr(this['locale']);return _0x42233f['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ar),_0x42233f['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x42233f;}['_createToolbar'](){const _0x4e3601=new wr(this['locale']);return _0x4e3601['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x40c05f,_0x4043c4,_0x3ef016)=>_0x40c05f&&!_0x4043c4&&!!_0x3ef016),_0x4e3601['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4e3601['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x43c506,_0xfe637c,_0x2e61c9)=>_0x43c506&&!_0xfe637c&&!!_0x2e61c9),_0x4e3601['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4e3601['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x12e01d,_0x52e7d4)=>_0x12e01d&&!_0x52e7d4),_0x4e3601['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4e3601['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4e3601['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4e3601;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x4260a9=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Yn(_0x4260a9,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x1b86ec){const _0x1b304e=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x1b86ec||Yn(_0x1b304e,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const J=globalThis['DataTransfer'];class G extends _0x3711b7{['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[_0x4939a6,F,ni,_0x161ed4];}constructor(_0x2e4f73){super(_0x2e4f73),_0x2e4f73['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2e4f73['config']['define']('ai.assistant.contentAreaCssClass',''),_0x2e4f73['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2e4f73['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x571fb2}=this;this['_aiAdapter']=_0x571fb2['plugins']['get'](ni),this['_dialog']=_0x571fb2['plugins']['get'](_0x161ed4),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x42e63a=new ai(_0x571fb2,Array['from'](this['_commandDefinitions']['values']()));_0x571fb2['commands']['add']('showAIAssistant',_0x42e63a),_0x571fb2['ui']['componentFactory']['add']('aiCommands',_0x407dac=>{const _0x4318a4=_0x1fe5fd(_0x407dac);return _0x4318a4['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4318a4['buttonView']['set']({'label':Yn(_0x407dac,'AI\x20Commands'),'icon':_0x2b987d,'tooltip':!0x0}),_0x4318a4['on']('execute',_0x47cd4d=>this['_onExecute'](_0x47cd4d['source']['id'])),_0x11e5a3(_0x4318a4,_0x571fb2['ui']['view']['body'],function(_0x31f41e){const _0x9b685=z(_0x31f41e['config']['get']('ai.assistant.commands'),_0x31f41e['locale']),_0x3b1a42=hi(_0x31f41e,_0x9b685)['filter'](_0x17a07d=>_0x17a07d['commands']['length']);if(0x1===_0x3b1a42['length'])return hi(_0x31f41e,_0x3b1a42[0x0]['commands'])['map'](_0x22b9da=>({'id':_0x22b9da['id'],'label':_0x22b9da['label']}));return _0x3b1a42['map'](_0x425fe6=>{const {groupId:_0x40525c,groupLabel:_0x21d3e6,commands:_0x129172}=_0x425fe6,_0x57a766=hi(_0x31f41e,_0x129172)['map'](_0xaf07d2=>({'id':_0xaf07d2['id'],'label':_0xaf07d2['label']}));return{'id':_0x40525c,'menu':_0x21d3e6||_0x40525c,'children':_0x57a766};});}(_0x571fb2),{'ariaLabel':Yn(_0x407dac,'AI\x20Commands')}),_0x4318a4['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x42e63a['on']('change:enabledCommandsIds',_0x6561bd),_0x4318a4['menuView']['once']('render',_0x6561bd),_0x4318a4;function _0x6561bd(){_0x4318a4['isEnabled']=_0x42e63a['enabledCommandsIds']['length']>0x0;for(const _0x842a33 of _0x4318a4['menuView']['buttons'])_0x842a33['isEnabled']=_0x42e63a['enabledCommandsIds']['includes'](_0x842a33['id']);}}),_0x571fb2['ui']['componentFactory']['add']('menuBar:aiCommands',_0x62a643=>{const _0x271168=new _0x2d240a(_0x62a643);_0x271168['buttonView']['set']({'label':Yn(_0x62a643,'AI\x20Commands'),'icon':_0x2b987d}),_0x271168['bind']('isEnabled')['to'](_0x42e63a,'enabledCommandsIds',_0x380d40=>_0x380d40['length']>0x0);const _0x38fce7=z(_0x571fb2['config']['get']('ai.assistant.commands'),_0x62a643);return this['_populateMenuBarMenu'](_0x42e63a,_0x271168,_0x38fce7,_0x5e6529=>this['_onExecute'](_0x5e6529)),_0x271168;}),_0x571fb2['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x392584=this['_createAIAssistantUIButton'](_0x5cde82);return _0x392584['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x392584;}),_0x571fb2['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x301884=this['_createAIAssistantUIButton'](_0x3c5e19);return _0x301884['set']({'role':'menuitemcheckbox'}),_0x301884;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2a3838=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x4d0193;for(const _0x3814dc in _0x2a3838){const _0x289e5b=_0x3814dc,_0x1353b9=_0x2a3838[_0x289e5b];if('aiLicenseKeyValid'==_0x1353b9||'aiLicenseKeyInvalid'==_0x1353b9||'aiLicenseKeyExpired'==_0x1353b9||'aiLicenseKeyDomainLimit'==_0x1353b9||'aiLicenseKeyNotAllowed'==_0x1353b9||'aiLicenseKeyEvaluationLimit'==_0x1353b9||'aiLicenseKeyTrialLimit'==_0x1353b9||'aiLicenseKeyUsageLimit'==_0x1353b9){delete _0x2a3838[_0x289e5b],_0x4d0193=_0x1353b9,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x4d0193&&_0x2a3838['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x4d0193&&_0x2a3838['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x4d0193&&_0x2a3838['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x4d0193&&_0x2a3838['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x4d0193&&_0x2a3838['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x4d0193&&_0x2a3838['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x4d0193&&_0x2a3838['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3f695b='',_0x772f3e='',_0x2d1a6b='custom'){const _0x3b25b5=this['editor'],_0x23f61b=_0x3b25b5['editing']['view'],_0x4b9ac3=_0x3b25b5['plugins']['get'](F),_0x431b1a=_0x3b25b5['plugins']['get'](_0x4939a6);_0x4b9ac3['showFakeVisualSelection']();const _0x3bbd6c=new J(),_0x36fd9f=new ClipboardEvent('copy',{'clipboardData':_0x3bbd6c}),_0x43609a=new _0x390f6a(_0x3bbd6c),_0x505e5c=new _0x298a3f(_0x23f61b,_0x36fd9f,{'dataTransfer':_0x43609a});_0x431b1a['_forceMarkersCopy']('comment',()=>{_0x23f61b['document']['fire']('copy',_0x505e5c);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new oi(_0x3b25b5,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x5142d4=_0x43609a['getData']('text/html');const _0x4f4d1=_0x3b25b5['model']['document']['selection'],_0x21d41e=Array['from'](_0x4f4d1['getRanges']());0x1===_0x21d41e['length']&&_0x21d41e[0x0]['isFlat']&&!_0x4f4d1['getSelectedElement']()&&''!==_0x5142d4['replace'](/&nbsp;/g,'')['trim']()&&(_0x5142d4='<p>'+_0x5142d4+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x2d1a6b,'query':_0x3f695b,'htmlContent':_0x5142d4,'label':_0x772f3e,'mainActionLabel':ci[_0x3b25b5['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x547788,'title':Yn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x43cf0d['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4b9ac3['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x71e8d8=new Map(),_0x1431d6=z(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0xef2df3 of _0x1431d6)for(const _0x1cf419 of _0xef2df3['commands'])_0x71e8d8['set'](_0x1cf419['id'],{..._0x1cf419,'groupId':_0xef2df3['groupId'],'groupLabel':_0xef2df3['groupLabel']||_0xef2df3['groupId']});return _0x71e8d8;}['_createAIAssistantUIButton'](_0x5c3ca9){const _0x88abab=this['editor'],_0x264fe7=_0x88abab['commands']['get']('showAIAssistant'),_0x4b4959=new _0x5c3ca9(_0x88abab['locale']);return _0x4b4959['set']({'label':Yn(_0x88abab['locale'],'AI\x20Assistant'),'icon':_0x547788,'isToggleable':!0x0}),_0x4b4959['bind']('isEnabled')['to'](_0x264fe7),_0x4b4959['bind']('isOn')['to'](this['_dialog'],'id',_0x25655c=>'aiAssistant'===_0x25655c),this['listenTo'](_0x4b4959,'execute',()=>{_0x4b4959['isOn']?this['hideUI']():_0x264fe7['execute']();}),_0x4b4959;}['_initView'](){const _0x3a7188=this['editor']['plugins']['get'](F);this['_formView']=new ri(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',()=>{_0x3a7188['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x3a7188['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0xb49db3,ui:{ariaLiveAnnouncer:_0x5586b7}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x535651,_0x59992a,_0x45e58f)=>{const _0x2d718c=this['_aiAssistantController']['currentContext'];_0x45e58f?_0x5586b7['announce'](Yn(_0xb49db3,'AI\x20is\x20writing')):_0x2d718c&&_0x5586b7['announce'](Yn(_0xb49db3,'Generated\x20content:\x20%0',_0x2d718c),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x200766,_0x4755f6,_0x43581b)=>{if(_0x43581b){const _0x50cf4f=this['_formView']['errorView']['text'];_0x5586b7['announce'](Yn(_0xb49db3,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x50cf4f));}});}['_onExecute'](_0x35fb00){const _0x414ebc=this['_commandDefinitions']['get'](_0x35fb00),_0x552a3e=this['editor'],_0x392fa0=_0x552a3e['model']['document']['selection'],_0xcd0cae=_0x552a3e['commands']['get']('showAIAssistant'),_0x37c994=_0x552a3e['plugins']['get'](F),_0x56993f=''+(_0x414ebc['groupId']!==ei?_0x414ebc['groupLabel']+':\x20':'')+_0x414ebc['label'];if(!0x1!==_0x414ebc['requiresContent']&&_0x392fa0['isCollapsed']){const _0x3c6fc3=_0x457991(_0x392fa0['getSelectedBlocks']())||_0x552a3e['model']['schema']['getLimitElement'](_0x392fa0);_0x552a3e['model']['change'](_0x2a2e13=>{_0x2a2e13['setSelection'](_0x3c6fc3,'in');});}_0x37c994['showFakeVisualSelection'](),_0xcd0cae['execute'](_0x414ebc['prompt'],_0x56993f,'command:'+_0x35fb00);}['_populateMenuBarMenu'](_0x33dca3,_0x4de5b2,_0x3a0a22,_0x321af2){const _0x574f40=this['editor'],_0x3c114a=_0x574f40['locale'],_0x2ecba1=new ti(_0x3c114a),_0x497c58=hi(_0x574f40,_0x3a0a22)['filter'](_0x35210f=>_0x35210f['commands']['length']);0x1===_0x497c58['length']?this['_getMenuBarGroupButtons']({'command':_0x33dca3,'commands':_0x497c58[0x0]['commands'],'parentMenuView':_0x4de5b2,'onExecute':_0x321af2})['forEach'](_0x13a3e3=>_0x2ecba1['items']['add'](_0x13a3e3)):_0x497c58['forEach'](({groupId:_0x37097c,groupLabel:_0x447326,commands:_0x109f1e})=>{const _0x3645bf=new _0x29d062(_0x3c114a,_0x4de5b2),_0x51087c=new _0x2d240a(_0x3c114a),_0x29f599=new ti(_0x3c114a),_0x479893=this['_getMenuBarGroupButtons']({'command':_0x33dca3,'commands':_0x109f1e,'parentMenuView':_0x51087c,'onExecute':_0x321af2});_0x51087c['buttonView']['set']({'label':_0x447326||_0x37097c}),_0x51087c['delegate']('execute')['to'](_0x4de5b2),_0x29f599['items']['addMany'](_0x479893),_0x51087c['panelView']['children']['add'](_0x29f599),_0x3645bf['children']['add'](_0x51087c),_0x2ecba1['items']['add'](_0x3645bf);}),_0x4de5b2['panelView']['children']['add'](_0x2ecba1);}['_getMenuBarGroupButtons']({command:_0x16b0e4,commands:_0x3e144b,parentMenuView:_0x360083,onExecute:_0x5f1911}){const _0x48801f=this['editor'],_0x479814=_0x48801f['locale'];return hi(_0x48801f,_0x3e144b)['map'](_0x59aac5=>{const _0x438203=new _0x29d062(_0x479814,_0x360083),_0x2be84b=new _0x3c5e19(_0x479814);return _0x2be84b['set']({'label':_0x59aac5['label']}),_0x2be84b['delegate']('execute')['to'](_0x360083),_0x2be84b['on']('execute',()=>_0x5f1911(_0x59aac5['id'])),_0x2be84b['bind']('isEnabled')['to'](_0x16b0e4,'enabledCommandsIds',_0x470ae1=>_0x470ae1['includes'](_0x59aac5['id'])),_0x438203['children']['add'](_0x2be84b),_0x438203;});}}function li(_0x53cd70,_0x103a9a){return void 0x0!==_0x53cd70['order']&&void 0x0===_0x103a9a['order']?0x1:void 0x0===_0x53cd70['order']&&void 0x0!==_0x103a9a['order']?-0x1:void 0x0!==_0x53cd70['order']&&void 0x0!==_0x103a9a['order']?_0x53cd70['order']-_0x103a9a['order']:0x0;}function hi(_0xfdbd6,_0x88c9d){_0x88c9d['sort'](li);const _0x34bc30={},_0x211889=[];for(const _0x14b00d of _0x88c9d)if(void 0x0!==_0x14b00d['order']){if(_0x14b00d['order']in _0x34bc30)throw new _0x239292('ai-commands-config-order-collision',_0xfdbd6,{'conflictingDefinitions':[_0x14b00d,_0x34bc30[_0x14b00d['order']]]});_0x34bc30[_0x14b00d['order']]=_0x14b00d,_0x211889['splice'](_0x14b00d['order'],0x0,_0x14b00d);}else _0x211889['push'](_0x14b00d);return _0x211889;}class qn extends _0x3711b7{static get['requires'](){return[G,F];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x407c59){super(_0x407c59);const _0x1603df=_0x407c59['config'],_0x1d95b5=_0x407c59['locale'];_0x1603df['define']('ai.assistant.preserveComments',!0x0),_0x1603df['define']('ai.assistant.commands',Qn(_0x1d95b5)),_0x1603df['define']('ai.assistant.extraCommandGroups',[]),_0x1603df['define']('ai.assistant.removeCommands',[]);let _0x3469b4=z(_0x1603df['get']('ai.assistant.commands'),_0x1d95b5);const _0x5c0013=_0x1603df['get']('ai.assistant.extraCommandGroups'),_0xe2c8ea=_0x1603df['get']('ai.assistant.removeCommands');_0x5c0013['forEach'](_0x3079cf=>{const _0x4ee438=_0x3469b4['find'](_0x197905=>_0x197905['groupId']===_0x3079cf['groupId']);_0x4ee438?_0x4ee438['commands']=_0x4ee438['commands']['concat'](_0x3079cf['commands']):_0x3469b4['push'](_0x3079cf);}),_0x3469b4=_0x3469b4['filter'](_0x54a8b3=>!_0xe2c8ea['includes'](_0x54a8b3['groupId'])),_0x3469b4['forEach'](_0x550a68=>{_0x550a68['commands']=_0x550a68['commands']['filter'](_0x7ce021=>!_0xe2c8ea['includes'](_0x7ce021['id']));}),_0x1603df['set']('ai.assistant.commands',_0x3469b4);}}function Qn(_0x25abc3){return[{'groupId':'editOrReview','groupLabel':Yn(_0x25abc3,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Yn(_0x25abc3,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Yn(_0x25abc3,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':Yn(_0x25abc3,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Yn(_0x25abc3,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':Yn(_0x25abc3,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Yn(_0x25abc3,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':Yn(_0x25abc3,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':Yn(_0x25abc3,'Change\x20tone'),'commands':[{'id':'professional','label':Yn(_0x25abc3,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Yn(_0x25abc3,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Yn(_0x25abc3,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Yn(_0x25abc3,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Yn(_0x25abc3,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Yn(_0x25abc3,'Change\x20style'),'commands':[{'id':'business','label':Yn(_0x25abc3,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Yn(_0x25abc3,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Yn(_0x25abc3,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Yn(_0x25abc3,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Yn(_0x25abc3,'Translate'),'commands':[{'id':'translateEnglish','label':Yn(_0x25abc3,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Yn(_0x25abc3,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Yn(_0x25abc3,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Yn(_0x25abc3,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Yn(_0x25abc3,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Yn(_0x25abc3,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Yn(_0x25abc3,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Yn(_0x25abc3,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ue extends _0x3711b7{['abortController'];static get['requires'](){return[ni];}constructor(_0x14a9b5){super(_0x14a9b5),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](ni)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x3b5779){return this['sendRequest'](_0x3b5779)['catch'](_0x19f838=>{if(_0x19f838 instanceof tr)return Promise['reject'](_0x19f838);if('AbortError'==_0x19f838['name'])return Promise['resolve']();throw console['error'](_0x19f838),new _0x239292('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x1cccc0,_0x3f05ad){const _0x12bbcd=this['editor']['locale'],_0x33fba8={'Content-Type':'application/json'};if('object'==typeof _0x1cccc0)Object['assign'](_0x33fba8,_0x1cccc0);else{if(_0x1cccc0)try{const _0x26088f=await _0x1cccc0(_0x3f05ad);Object['assign'](_0x33fba8,_0x26088f);}catch{return Promise['reject'](new tr(Yn(_0x12bbcd,'AI_ERROR_GET_HEADERS')));}}return _0x33fba8;}async['_prepareRequestParameters'](_0x17f47c,_0x21d718){const _0x5e3b89=this['editor']['locale'];if('object'==typeof _0x17f47c)return _0x17f47c;try{return await _0x17f47c(_0x21d718);}catch{return Promise['reject'](new tr(Yn(_0x5e3b89,'AI_ERROR_GET_PARAMETERS')));}}}class Xn extends ue{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x5b0702){super(_0x5b0702),_0x5b0702['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x5b0702['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x5b0702['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x5b0702['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x5b0702['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x5b0702['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x236db5,context:_0x3b1fbc,onData:_0x11b5f8,actionId:_0x5e979a}){const _0x466f92=this['editor']['locale'],_0x2f9ec8=await this['prepareMessages'](_0x236db5,_0x3b1fbc,_0x5e979a),_0x576cc6=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5e979a),_0x3a0d8d=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5e979a),_0x160c6c={'messages':_0x2f9ec8,..._0x3a0d8d},_0xd3dea6={'method':'POST','headers':_0x576cc6,'body':JSON['stringify'](_0x160c6c),'signal':this['abortController']['signal']},_0x23a120=await fetch(this['_apiUrl'],_0xd3dea6);if(_0x23a120['ok'])return _0x3a0d8d['stream']?await this['_readStreamableResponse'](_0x23a120,_0x11b5f8):await this['_readStaticResponse'](_0x23a120,_0x11b5f8),Promise['resolve']();{const _0x1bd05b=await _0x23a120['text']();return _0x1bd05b['includes']('context_length_exceeded')?Promise['reject'](new tr(Yn(_0x466f92,'AI_ERROR_CONTEXT_LENGTH'))):_0x1bd05b['includes']('Moderation')?Promise['reject'](new tr(Yn(_0x466f92,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x1bd05b));}}async['prepareMessages'](_0x4dfc02,_0x1ea695,_0x13fd9d){let _0x47c65a,_0x10b572;return _0x1ea695?(_0x47c65a='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.',_0x10b572='Instruction:\x0a'+_0x4dfc02+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1ea695):(_0x47c65a='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.',_0x10b572=_0x4dfc02),[{'role':'system','content':_0x47c65a},{'role':'user','content':_0x10b572}];}async['_readStreamableResponse'](_0x2a7528,_0x27c6a0){const _0x184c37=_0x2a7528['body']['getReader'](),_0x282fcf=new TextDecoder();let _0xd1fe13='',_0x181842='',_0x193074='',_0x59472=!0x1;for(;!_0x59472;){const {done:_0x1f1e29,value:_0x4f4055}=await _0x184c37['read'](),_0x5c0a55=_0xd1fe13+_0x282fcf['decode'](_0x4f4055);let _0x159384='';_0x59472=_0x1f1e29;try{_0x159384=this['_cleanUpData'](_0x5c0a55),_0xd1fe13='';}catch{_0xd1fe13=_0x5c0a55;continue;}_0x181842+=_0x159384,!_0x59472&&this['_isBufferIncomplete'](_0x181842)||_0x181842&&(_0x193074+=_0x181842,_0x181842='',_0x27c6a0(_0x193074));}return Promise['resolve']();}async['_readStaticResponse'](_0x54da70,_0x35daa3){return _0x35daa3((await _0x54da70['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x467a97){const _0x527b18=_0x467a97['split']('<')['length']!==_0x467a97['split']('>')['length'],_0x3d8d52=_0x467a97['length']<0x1e;return _0x527b18&&_0x3d8d52;}['_cleanUpData'](_0x5439a2){return _0x5439a2['split'](/\n(?![^{]*\})/g)['map'](_0x5301c2=>_0x5301c2['replace']('data:\x20',''))['filter'](_0x4276ca=>_0x4276ca&&_0x4276ca['length']>0x0&&'[DONE]'!==_0x4276ca)['map'](_0x18bd24=>{const {choices:_0x1a8330}=JSON['parse'](_0x18bd24);if(_0x1a8330[0x0]?.['delta']?.['content'])return _0x1a8330[0x0]['delta']['content'];})['filter'](_0x4fb9cf=>_0x4fb9cf)['join']('');}}class zn extends ue{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x17d535){super(_0x17d535),_0x17d535['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x17d535['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']=_0x17d535['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x17d535['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x17d535['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x17d535['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x299cc0,context:_0x4d0bd6,onData:_0x3186da,actionId:_0x2a0b01}){const {model:_0x4bea76,stream:_0x30511d,..._0x1419e5}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2a0b01),_0x481d97={'prompt':await this['preparePrompt'](_0x299cc0,_0x4d0bd6,_0x4bea76,_0x2a0b01),..._0x1419e5};this['_apiUrl']?await this['_processProxyRequest'](_0x481d97,_0x4bea76,_0x30511d,_0x3186da,_0x2a0b01):await this['_processAWSRequest'](_0x481d97,_0x4bea76,_0x30511d,_0x3186da);}async['preparePrompt'](_0x5735ab,_0x2188a1,_0x497133,_0x262942){let _0x408599,_0x2bc5c4;return _0x2188a1?(_0x408599='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.',_0x2bc5c4='Instruction:\x0a'+_0x5735ab+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2188a1):(_0x408599='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.',_0x2bc5c4=_0x5735ab),'meta.llama'==this['getModelFamily'](_0x497133)?'<<SYS>>\x0a'+_0x408599+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2bc5c4+'\x0a[/INST]':'Human:\x0a'+_0x408599+'\x0a'+_0x2bc5c4+'\x0a\x0aAssistant:';}['getModelFamily'](_0x21abac){if(/^anthropic\.claude/['test'](_0x21abac))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x21abac))return'ai21.j2';if(/^cohere\.command/['test'](_0x21abac))return'cohere.command';if(/^meta\.llama/['test'](_0x21abac))return'meta.llama';throw new tr(Yn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x21abac));}async['_processProxyRequest'](_0x1850ed,_0x4e44fe,_0x1be717,_0x21586b,_0xa31c04){const _0x24d063={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xa31c04),'body':JSON['stringify']({..._0x1850ed,'model':_0x4e44fe,'stream':_0x1be717}),'signal':this['abortController']['signal']},_0xe92141=await fetch(this['_apiUrl'],_0x24d063);_0x1be717?await this['_readStreamableResponse'](_0xe92141,_0x4e44fe,_0x21586b):await this['_readStaticResponse'](_0xe92141,_0x4e44fe,_0x21586b);}async['_processAWSRequest'](_0x53d46c,_0x33163b,_0x1fd021,_0x2fa7eb){const _0x29b747=new _0x5a8df5(this['_bedrockClientConfig']),_0x539fa2={'body':JSON['stringify'](_0x53d46c),'contentType':'application/json','accept':'application/json','modelId':_0x33163b};let _0x36b0ca;if(_0x1fd021){const _0x20750f=new _0x440801(_0x539fa2);_0x36b0ca=await _0x29b747['send'](_0x20750f,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x36b0ca,_0x33163b,_0x2fa7eb);}else{const _0x1a698a=new _0x14bf18(_0x539fa2);_0x36b0ca=await _0x29b747['send'](_0x1a698a,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x36b0ca,_0x33163b,_0x2fa7eb);}}async['_readAsyncIterableResponse'](_0xbfa155,_0x557ec5,_0x3344df){const _0x56713c=_0xbfa155['body'],_0x25f899=new TextDecoder('utf-8');let _0x3a085c='';for await(const _0xc6edcf of _0x56713c)if(_0xc6edcf['chunk']){const _0x93ce4e=_0x25f899['decode'](_0xc6edcf['chunk']['bytes']),_0x2bab86=JSON['parse'](_0x93ce4e);_0x3a085c+=this['_getGeneratedText'](_0x2bab86,_0x557ec5),_0x3344df(_0x3a085c);}return Promise['resolve']();}async['_readStreamableResponse'](_0xaa6b8c,_0x5b05cd,_0x405f9d){const _0x2cb15d=_0xaa6b8c['body'],_0x4b59af=new TextDecoder('utf-8'),_0x317d76=_0x2cb15d['getReader']();let _0x23048c='',_0x571fef='',_0x52bc03=!0x1;for(;!_0x52bc03;){const {done:_0x251ea4,value:_0x276026}=await _0x317d76['read']();if(_0x52bc03=_0x251ea4,_0x52bc03)break;const _0x3bdc8d=(_0x23048c+_0x4b59af['decode'](_0x276026))['split']('\x0a')['map'](_0x22ce95=>{try{return _0x23048c='',JSON['parse'](_0x22ce95);}catch{return _0x23048c=_0x22ce95,null;}})['filter'](_0x596ce0=>null!==_0x596ce0);_0x3bdc8d['length']&&(_0x571fef+=_0x3bdc8d['map'](_0x3b314d=>this['_getGeneratedText'](_0x3b314d,_0x5b05cd))['join'](''),_0x405f9d(_0x571fef));}return Promise['resolve']();}async['_readStaticResponse'](_0x3610ae,_0x2bb125,_0x335609){let _0x486ff1;return _0x486ff1=_0x3610ae instanceof Response?await _0x3610ae['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x3610ae['body'])),(_0x335609(this['_getGeneratedText'](_0x486ff1,_0x2bb125)),Promise['resolve']());}['_getGeneratedText'](_0x24b466,_0x235e8f){switch(this['getModelFamily'](_0x235e8f)){case'anthropic.claude':return _0x24b466['completion'];case'ai21.j2':return _0x24b466['completions'][0x0]['data']['text'];case'cohere.command':return _0x24b466['generations'][0x0]['text'];case'meta.llama':return _0x24b466['generation'];}}}class ia extends _0x5cde82{constructor(_0x348cfb,_0xcf30b0={}){super(_0x348cfb),this['isToggleable']=!0x0,this['set']('side',_0xcf30b0['side']||'top');const _0x5523d8=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x2141c6(_0xcf30b0['class']||[]),_0x5523d8['to']('side',_0x387720=>'ck-tab-button_'+_0x387720),_0x5523d8['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x10aa9f{['children'];constructor(_0x726cee,_0x504394={}){super(_0x726cee);const _0x37c54f=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x2141c6(_0x504394['class']||[]),_0x37c54f['to']('class'),_0x37c54f['if']('isVisible','ck-hidden',_0x4834fa=>!_0x4834fa)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x10aa9f{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x3ba541,_0x466782={}){super(_0x3ba541),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x466782['side']||'top'),this['set']('isMaximized',!0x1);const _0x77a813=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x2141c6(_0x466782['class']||[]),_0x77a813['to']('side',_0x54dbf7=>'ck-tabs_'+_0x54dbf7),_0x77a813['to']('class'),_0x77a813['to']('isMaximized',_0x2cee40=>_0x2cee40?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x77a813['to']('side',_0x776aef=>'ck-tabs__buttons-container_'+_0x776aef)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x77a813['to']('side',_0x4c1be2=>'ck-tabs__panels-container_'+_0x4c1be2)]},'children':this['panelViews']},..._0x2141c6(_0x466782['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x58990f){const _0x442708=this['_tabs']['get'](_0x58990f);return _0x442708||null;}['addTab'](_0x5ec2a2){const _0x211b56=this['_setupButton']({'id':_0x5ec2a2['id'],'label':_0x5ec2a2['buttonLabel'],'icon':_0x5ec2a2['buttonIcon'],'order':_0x5ec2a2['order']}),_0x713ebf=new ea(this['locale']);return _0x713ebf['render'](),_0x5ec2a2['content']&&_0x713ebf['children']['add'](_0x5ec2a2['content']),this['panelViews']['add'](_0x713ebf),this['_tabs']['set'](_0x5ec2a2['id'],{'button':_0x211b56,'panel':_0x713ebf,'order':void 0x0!==_0x5ec2a2['order']?_0x5ec2a2['order']:null}),this['fire']('addTab:'+_0x5ec2a2['id'],{'id':_0x5ec2a2['id'],'button':_0x211b56,'panel':_0x713ebf}),null===this['activeTab']?this['activateTab'](_0x5ec2a2['id']):this['_hidePanel'](_0x5ec2a2['id']),{'button':_0x211b56,'panel':_0x713ebf};}['activateTab'](_0x4af66d){if(null!==_0x4af66d&&!this['getTab'](_0x4af66d))throw new _0x239292('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4af66d});this['activeTab']!==_0x4af66d&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x4af66d,_0x4af66d&&this['_showPanel'](_0x4af66d),this['fire']('activateTab:'+_0x4af66d,_0x4af66d));}['showTab'](_0x170d96){if(!this['getTab'](_0x170d96))throw new _0x239292('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x170d96});this['_showPanel'](_0x170d96),this['_showButton'](_0x170d96),this['fire']('show:'+_0x170d96,_0x170d96);}['hideTab'](_0x55f9db){if(!this['getTab'](_0x55f9db))throw new _0x239292('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x55f9db});const _0xea5017=this['activeTab'];this['_hidePanel'](_0x55f9db),this['_hideButton'](_0x55f9db);const _0x3d2dec=this['getTabIds']();_0xea5017===_0x55f9db&&_0x3d2dec['length']>0x1&&this['activateTab'](_0x3d2dec['find'](_0x14f85c=>_0x14f85c!==_0x55f9db)),this['fire']('hide:'+_0x55f9db,_0x55f9db);}['_getPanel'](_0x17a8a2){const _0x1d8782=this['_tabs']['get'](_0x17a8a2);return _0x1d8782?_0x1d8782['panel']:null;}['_showPanel'](_0x5c56c1){null!==this['activeTab']&&this['activeTab']!==_0x5c56c1||this['_getPanel'](_0x5c56c1)['show']();}['_hidePanel'](_0x3840fc){const _0x52e705=this['_getPanel'](_0x3840fc);_0x52e705['isVisible']&&(this['activeTab']===_0x3840fc&&(this['activeTab']=null),_0x52e705['hide']());}['_getButton'](_0x5796bc){const _0x3d2728=this['_tabs']['get'](_0x5796bc);return _0x3d2728?_0x3d2728['button']:null;}['_showButton'](_0x3bccc7){this['_getButton'](_0x3bccc7)['show']();}['_hideButton'](_0x1b5ead){this['_getButton'](_0x1b5ead)['hide']();}['_setupButton'](_0x52f513){const _0x5b0b29=new ia(this['locale'],{'side':this['side']}),_0x40a08c=this['buttonViews'];if(_0x5b0b29['set']({'label':_0x52f513['label'],'icon':_0x52f513['icon'],'tooltip':!0x0,'withText':!0x0}),_0x5b0b29['bind']('isOn')['to'](this,'activeTab',_0x50882e=>_0x50882e===_0x52f513['id']),_0x5b0b29['bind']('side')['to'](this,'side'),_0x52f513['order']){const _0xbabf93=[...this['_tabs']]['reduce']((_0x54b6e9,_0x49975a)=>{const _0x4e7c5c=_0x49975a[0x0],{order:_0x500176}=_0x49975a[0x1];return!_0x500176||_0x500176>_0x52f513['order']?_0x54b6e9:_0x500176>=_0x54b6e9['order']?{'id':_0x4e7c5c,'order':_0x500176}:_0x54b6e9;},{'id':'','order':0x0}),_0x29640d=_0x40a08c['getIndex'](this['_getButton'](_0xbabf93['id']));_0x40a08c['add'](_0x5b0b29,_0x29640d+0x1);}else _0x40a08c['add'](_0x5b0b29);return _0x5b0b29['on']('execute',()=>{this['activateTab'](_0x52f513['id']);}),_0x5b0b29;}}const Ti=['overlay','sidebar','custom'],yi=['left','right'];class bi extends ss{constructor(_0x7430c0,_0x5e32b5={}){super(_0x7430c0,_0x5e32b5),this['set']('type',_0x5e32b5['type']||'sidebar'),this['set']('side',_0x5e32b5['side']||'right'),this['set']('isVisible',_0x5e32b5['visibleByDefault']??!0x0);const _0xceace2=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0xceace2['if']('type','ck-ai-tabs__overlay',_0x9238ef=>'overlay'===_0x9238ef),_0xceace2['if']('type','ck-ai-tabs__sidebar',_0x55f1ca=>'sidebar'===_0x55f1ca),_0xceace2['if']('isVisible','ck-hidden',_0x5e0e73=>!_0x5e0e73)]}}),this['buttonViews']['on']('add',(_0x51f188,_0x4dd5ab)=>{_0x4dd5ab['set']('withText',!0x1);});}}class at extends _0x267838{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1948fe){super(_0x1948fe);const _0x55112d=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x55112d)throw new _0x239292('ai-tabs-configuration-not-found');if(void 0x0!==_0x55112d['showResizeButton']&&(this['showResizeButton']=_0x55112d['showResizeButton']),'sidebar'!==_0x55112d['type']&&'overlay'!==_0x55112d['type']||_0x55112d['side']&&(this['side']=_0x55112d['side']),'sidebar'===_0x55112d['type']){if(this['container']=_0x55112d['element'],this['set']('type','sidebar'),!this['container'])throw new _0x239292('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x55112d['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===_0x55112d['visibleByDefault']||_0x55112d['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 st&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x43f0b2){if(_0x43f0b2&&this['type']!==_0x43f0b2){if(!Ti['includes'](_0x43f0b2))throw new _0x239292('ai-tabs-unsupported-ui-type');this['type']=_0x43f0b2;}}['switchSide'](_0x3ea16f){if(_0x3ea16f&&this['side']!==_0x3ea16f){if(!yi['includes'](_0x3ea16f))throw new _0x239292('ai-tabs-unsupported-ui-side');this['side']=_0x3ea16f;}}['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 _0x267838{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5edd09){super(_0x5edd09),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 _0x8906ee=this['context']['plugins']['get']('CloudServices');if(!_0x8906ee['token'])throw new _0x239292('ai-missing-token',this);this['_token']=_0x8906ee['token'];}['startConversation'](_0xdb198,_0xa9a207){const _0x280e20=this['_sendApiRequest']('/conversations','POST',{'id':_0xdb198,'group':_0xa9a207});return{'getConversation':async()=>(await _0x280e20['request'])['json'](),'abortController':_0x280e20['abortController']};}['queryAssistant']({message:_0x4b88fe,conversationId:_0x4ac0ac,parts:_0x182f17,capabilities:_0x4eaf73,model:_0x50ac2b,quickActionData:_0x5c4b6e}){const _0x59e669={..._0x5c4b6e&&{'quickActionData':_0x5c4b6e}},_0x295bfa={'prompt':_0x4b88fe,'content':_0x182f17,'model':_0x50ac2b,..._0x4eaf73&&{'capabilities':_0x4eaf73},...Object['keys'](_0x59e669)['length']>0x0&&{'attributes':_0x59e669}},_0x5b65d8=this['_sendApiRequest']('/conversations/'+_0x4ac0ac+'/messages','POST',_0x295bfa);return{'getStream':async()=>{const _0x4d2be8=(await _0x5b65d8['request'])['body'];return this['_getStreamReader'](_0x4d2be8);},'abortController':_0x5b65d8['abortController']};}['executeCustomAction']({content:_0x4ec777,message:_0x257654,model:_0x3097a7,outputFormat:_0x1c3b22}){const _0x5f1eb2={'content':[{'type':'text','content':_0x4ec777}],'prompt':_0x257654,'model':_0x3097a7,'outputFormat':_0x1c3b22},_0x3a4972=this['_sendApiRequest']('/actions/custom/calls','POST',_0x5f1eb2);return{'getStream':async()=>{const _0x323bad=(await _0x3a4972['request'])['body'];return this['_getStreamReader'](_0x323bad);},'abortController':_0x3a4972['abortController']};}['executeAction']({actionName:_0x2fbe38,content:_0x16bc79,args:_0x310221}){const _0x25786d={'content':[{'type':'text','content':_0x16bc79}],'args':_0x310221},_0x3d9a18=this['_sendApiRequest']('/actions/system/'+_0x2fbe38+'/calls','POST',_0x25786d);return{'getStream':async()=>{const _0x370799=(await _0x3d9a18['request'])['body'];return this['_getStreamReader'](_0x370799);},'abortController':_0x3d9a18['abortController']};}['uploadFile'](_0x8ab0d,_0x204fd1,_0x19e87c){const _0x5a1cb6=new FormData();_0x5a1cb6['append']('file',_0x204fd1,_0x204fd1['name']),_0x19e87c&&_0x5a1cb6['append']('attributes',JSON['stringify'](_0x19e87c));const _0x192172=this['_sendApiRequest']('/conversations/'+_0x8ab0d+'/files','POST',_0x5a1cb6);return{'getId':async()=>(await _0x192172['request'])['json'](),'abortController':_0x192172['abortController']};}['fetchDocument'](_0x15b3da,_0x3c19ff){const _0x1c78c6=this['_sendApiRequest']('/conversations/'+_0x15b3da+'/documents/'+_0x3c19ff,'GET');return{'getDocument':async()=>(await _0x1c78c6['request'])['json'](),'abortController':_0x1c78c6['abortController']};}['uploadDocument'](_0x43a757,_0x5c8c4f,_0x3ad39d){const _0x36ec0b={'content':_0x5c8c4f};_0x3ad39d&&(_0x36ec0b['attributes']=_0x3ad39d);const _0x4f6300=this['_sendApiRequest']('/conversations/'+_0x43a757+'/documents','POST',_0x36ec0b);return{'getId':async()=>(await _0x4f6300['request'])['json'](),'abortController':_0x4f6300['abortController']};}['fetchConversations'](_0x1e83ff,_0x554099){const _0x130d84=new URLSearchParams();_0x130d84['append']('excludeEmpty','true'),_0x130d84['append']('limit','100'),_0x130d84['append']('group',_0x1e83ff),_0x554099&&_0x130d84['append']('search',_0x554099);const _0x2e2769=this['_sendApiRequest']('/conversations?'+_0x130d84['toString'](),'GET');return{'getConversations':async()=>{const _0xde4d10=await _0x2e2769['request'];return(await _0xde4d10['json']())['items'];},'abortController':_0x2e2769['abortController']};}['deleteConversation'](_0x5bc1ea){const _0x3dbec7=this['_sendApiRequest']('/conversations/'+_0x5bc1ea,'DELETE');return{'execute':async()=>{await _0x3dbec7['request'];},'abortController':_0x3dbec7['abortController']};}['updateConversation'](_0x326987,_0x4ac191){const _0x13cea2=this['_sendApiRequest']('/conversations/'+_0x326987,'PATCH',_0x4ac191);return{'getResult':async()=>(await _0x13cea2['request'],_0x4ac191),'abortController':_0x13cea2['abortController']};}['fetchConversation'](_0x4fbc7c){const _0x412e31=this['_sendApiRequest']('/conversations/'+_0x4fbc7c,'GET');return{'getConversation':async()=>(await _0x412e31['request'])['json'](),'abortController':_0x412e31['abortController']};}['fetchConversationMessages'](_0x48c581){const _0x49165c=this['_sendApiRequest']('/conversations/'+_0x48c581+'/messages','GET');return{'getMessages':async()=>{const _0x4adce1=await _0x49165c['request'];return(await _0x4adce1['json']())['items'];},'abortController':_0x49165c['abortController']};}['uploadUrl'](_0x7c1908,_0x3a849a,_0x1da6bf){const _0x174047=this['_sendApiRequest']('/conversations/'+_0x7c1908+'/web-resources','POST',{'url':_0x3a849a,'attributes':_0x1da6bf});return{'getId':async()=>(await _0x174047['request'])['json'](),'abortController':_0x174047['abortController']};}['getModels'](){const _0x49fab6=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>await(await _0x49fab6['request'])['json'](),'abortController':_0x49fab6['abortController']};}['deleteFile'](_0x30f42c,_0xe23bbe){const _0x154806=this['_sendApiRequest']('/conversations/'+_0x30f42c+'/files/'+_0xe23bbe,'DELETE');return{'execute':async()=>{await _0x154806['request'];},'abortController':_0x154806['abortController']};}['deleteDocument'](_0x17ecc5,_0x16bb9d){const _0xeb4429=this['_sendApiRequest']('/conversations/'+_0x17ecc5+'/documents/'+_0x16bb9d,'DELETE');return{'execute':async()=>{await _0xeb4429['request'];},'abortController':_0xeb4429['abortController']};}['deleteWebResource'](_0xe00bc8,_0x56a243){const _0xdb5d6a=this['_sendApiRequest']('/conversations/'+_0xe00bc8+'/web-resources/'+_0x56a243,'DELETE');return{'execute':async()=>{await _0xdb5d6a['request'];},'abortController':_0xdb5d6a['abortController']};}['callSystemReview']({reviewName:_0x30b921,content:_0x3978b2,args:_0xb01ffc}){const _0x2168c0=this['_sendApiRequest']('/reviews/system/'+_0x30b921+'/calls','POST',{'content':[{'type':'text','content':_0x3978b2}],'args':_0xb01ffc});return{'getStream':async()=>{const _0x162f29=(await _0x2168c0['request'])['body'];return this['_getStreamReader'](_0x162f29);},'abortController':_0x2168c0['abortController']};}['callCustomReview']({content:_0x3ba120,prompt:_0x2a9d8b,model:_0x3b3325}){const _0x31f3df=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x3ba120}],'prompt':_0x2a9d8b,'model':_0x3b3325});return{'getStream':async()=>{const _0x2ae46e=(await _0x31f3df['request'])['body'];return this['_getStreamReader'](_0x2ae46e);},'abortController':_0x31f3df['abortController']};}['upsertAIChatRating'](_0xb5288,_0x30c29c,_0x125ff6){const _0x83b435=this['_sendApiRequest']('/conversations/'+_0xb5288+'/messages/'+_0x30c29c+'/ratings','PUT',{'positiveCount':_0x125ff6['positiveCount'],'totalCount':_0x125ff6['totalCount'],'modificationId':_0x125ff6['modificationId']});return{'execute':async()=>{await _0x83b435['request'];},'abortController':_0x83b435['abortController']};}['upsertAIActionRating'](_0xf89841,_0x2ab542,_0x3812eb){const _0x147390=this['_sendApiRequest']('/actions/system/'+_0xf89841+'/calls/'+_0x2ab542+'/ratings','PUT',{'positiveCount':_0x3812eb['positiveCount'],'totalCount':_0x3812eb['totalCount']});return{'execute':async()=>{await _0x147390['request'];},'abortController':_0x147390['abortController']};}['upsertCustomAIActionRating'](_0x1b5c50,_0x347920){const _0x12d120=this['_sendApiRequest']('/actions/custom/calls/'+_0x1b5c50+'/ratings','PUT',{'positiveCount':_0x347920['positiveCount'],'totalCount':_0x347920['totalCount']});return{'execute':async()=>{await _0x12d120['request'];},'abortController':_0x12d120['abortController']};}['upsertAIReviewRating'](_0xcf6654,_0x11e032,_0x58b795,_0x7226d0){const _0x478a48=this['_sendApiRequest']('/reviews/system/'+_0xcf6654+'/calls/'+_0x11e032+'/ratings','PUT',{'positiveCount':_0x58b795['positiveCount'],'totalCount':_0x58b795['totalCount'],'dataId':_0x7226d0});return{'execute':async()=>{await _0x478a48['request'];},'abortController':_0x478a48['abortController']};}['upsertCustomAIReviewRating'](_0x1f2606,_0x53c7ac,_0x2bcf50){const _0x1e61ec=this['_sendApiRequest']('/reviews/custom/calls/'+_0x1f2606+'/ratings','PUT',{'positiveCount':_0x53c7ac['positiveCount'],'totalCount':_0x53c7ac['totalCount'],'dataId':_0x2bcf50});return{'execute':async()=>{await _0x1e61ec['request'];},'abortController':_0x1e61ec['abortController']};}['_sendApiRequest'](_0x56a71c,_0x33f438,_0xbc13a6){const _0x5efcbb=new AbortController(),_0x27e3c8=_0xbc13a6 instanceof FormData,_0x1bc08c={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0xbc13a6&&!_0x27e3c8&&(_0x1bc08c['Content-Type']='application/json');const _0x5b618={'method':_0x33f438,'headers':_0x1bc08c,'signal':_0x5efcbb['signal']};return _0xbc13a6&&(_0x5b618['body']=_0x27e3c8?_0xbc13a6:JSON['stringify'](_0xbc13a6)),{'request':fetch(''+this['_apiUrl']+_0x56a71c,_0x5b618)['catch'](_0x59300b=>{this['_handleError'](_0x59300b);})['then'](_0x178f0f=>{if(!_0x178f0f['ok'])throw new _0x239292('ai-request-failed',this,{'url':this['_apiUrl'],'path':_0x56a71c,'method':_0x33f438,'body':_0xbc13a6,'status':(_0x178f0f||{})['status'],'statusText':(_0x178f0f||{})['statusText']});return _0x178f0f;}),'abortController':_0x5efcbb};}async*['_getStreamReader'](_0x236752){const _0xb6e413=[],_0x2af7ab=_0x236752['getReader'](),_0x45464a=wt({'onError':_0x3f123d=>{this['_handleError'](_0x3f123d);},'onEvent':_0x447cd1=>{_0x447cd1['data']=JSON['parse'](_0x447cd1['data']),_0xb6e413['push'](_0x447cd1);}});try{let _0x48fb46=!0x1;for(;!_0x48fb46;){const {done:_0x57322a,value:_0x36e9c9}=await _0x2af7ab['read']();_0x57322a&&(_0x48fb46=!0x0),_0x45464a['feed'](this['_decoder']['decode'](_0x36e9c9,{'stream':!0x0})),yield*_0xb6e413,_0xb6e413['length']=0x0;}}catch(_0x13d06c){this['_handleError'](_0x13d06c);}finally{_0x2af7ab['releaseLock'](),_0x45464a['reset']();}}['_handleError'](_0x40ed5e){if(_0x40ed5e instanceof _0x239292)throw _0x40ed5e;if(_0x40ed5e instanceof Error&&'AbortError'===_0x40ed5e['name'])throw new _0x239292('ai-request-aborted',this,{'originalError':_0x40ed5e});throw new _0x239292('ai-request-failed',this,{'originalError':_0x40ed5e});}}function C(_0x12b5b8,_0x1d29f5,_0x44f2b5){const t=_0x12b5b8['t'];switch(_0x1d29f5){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'},_0x44f2b5);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_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.'},_0x44f2b5);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.'},_0x44f2b5);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.'},_0x44f2b5);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_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'},_0x44f2b5);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'},_0x44f2b5);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x44f2b5);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'},_0x44f2b5);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x44f2b5);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'},_0x44f2b5);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x44f2b5);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.'},_0x44f2b5);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.'},_0x44f2b5);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.'},_0x44f2b5);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.'},_0x44f2b5);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'},_0x44f2b5);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_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.'},_0x44f2b5);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_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 _0x1d29f5;}}function Cs(_0x18f84f,_0x4355d1){const _0x35bf27=new _0x5cde82(_0x18f84f),_0x5dbd88=C(_0x18f84f,'AI_TABS_LABEL_MINIMIZE'),_0x41092c=C(_0x18f84f,'AI_TABS_LABEL_MAXIMIZE');return _0x35bf27['set']({'withText':!0x1,'icon':_0x10f52f,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x35bf27['bind']('label')['to'](_0x4355d1,'isMaximized',_0x189a89=>_0x189a89?_0x5dbd88:_0x41092c),_0x35bf27['bind']('icon')['to'](_0x4355d1,'isMaximized',_0xc18798=>_0xc18798?to:_0x10f52f),_0x35bf27['bind']('isOn')['to'](_0x4355d1,'isMaximized'),_0x35bf27['on']('execute',()=>{_0x4355d1['fire']('resizeTabs');}),_0x35bf27;}function Ye(_0xe36a35){return _0x2e2d8f(_0xe36a35);}function ut(_0x3dd33b){return _0x259462(_0x3dd33b);}function ft(_0x206093,_0x44e642,_0x2f31dc){const _0x5f3845=null!==_0x44e642?_0x5b5480=>_0x5b5480['attribs'][_0x206093]===_0x44e642:_0x1bdc29=>Boolean(_0x1bdc29['attribs'][_0x206093]);return gt(_0x35578a=>_0x5bf45b(_0x35578a)&&_0x5f3845(_0x35578a),_0x2f31dc);}function Be(_0x592326,_0x53bad3,_0x174f38){const _0x4ecee0=null!==_0x53bad3?_0x1bd489=>_0x1bd489['attribs'][_0x592326]===_0x53bad3:_0x1bad5e=>Boolean(_0x1bad5e['attribs'][_0x592326]);return _0x5bf864(_0x5b3fbd=>_0x5bf45b(_0x5b3fbd)&&_0x4ecee0(_0x5b3fbd),_0x174f38);}function pt(_0xe04d1,_0x66d0ba){return _0xe04d1&&_0x5bf45b(_0xe04d1)?_0xe04d1['attribs'][_0x66d0ba]:null;}function Qe(_0x425b45,_0xb7559c,_0x39b6db){_0x5bf45b(_0x425b45)&&(null===_0x39b6db?delete _0x425b45['attribs'][_0xb7559c]:_0x425b45['attribs'][_0xb7559c]=_0x39b6db);}function ze(_0x373309,_0x46d3ea,_0x10a2ae){const _0x1c5edf=_0x46d3ea['cloneNode'](!0x0);'beforebegin'===_0x10a2ae?_0x1b3de7(_0x373309,_0x1c5edf):'afterbegin'===_0x10a2ae?_0x10bdac(_0x373309,_0x1c5edf):'beforeend'===_0x10a2ae?_0x838115(_0x373309,_0x1c5edf):'afterend'===_0x10a2ae&&_0x24dd09(_0x373309,_0x1c5edf);}function Ae(_0x2c9ea5){const _0xf831d1=[];let _0x43cf64=_0x2c9ea5;for(;_0x43cf64;)_0x43cf64=_0x375dfb(_0x43cf64),_0x43cf64&&_0xf831d1['push'](_0x43cf64);return _0xf831d1;}function Jn(_0x40a629){return _0x40a629['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Ze(_0x16c4e7){let _0x529d51=0x0;for(;_0x16c4e7['parentNode'];)_0x16c4e7=_0x16c4e7['parentNode'],_0x529d51++;return _0x529d51;}function Is(_0x492ba6){const _0x532ac8=[];let _0x3640b5=_0x492ba6['nextSibling'];for(;_0x3640b5;)_0x532ac8['push'](_0x3640b5),_0x3640b5=_0x3640b5['nextSibling'];_0x532ac8['forEach'](_0x357dc8=>{_0x5de200(_0x357dc8);});}class Oe extends/* #__PURE__ -- @preserve */
25
+ _0x314197(){['_m2html'];constructor(){super(),this['_m2html']=new _0x4652b8();}['convertMarkdownToHTML'](_0x460b85){const _0x3dbaa1=this['_m2html']['parse'](_0x460b85);return this['parseAndNormalizeHTML'](_0x3dbaa1);}['parseAndNormalizeHTML'](_0x18fb2b){return this['_parseHTML'](_0x18fb2b);}['_parseHTML'](_0x2afe22){const _0x27a57a=Ye('<dummy>'+_0x2afe22['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x27a57a['children']=_0x27a57a['children'][0x0]['children'],_0x27a57a;}}class Ne extends/* #__PURE__ -- @preserve */
26
+ _0x314197(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x9fde10){super(),this['_generateUid']=_0x9fde10||_0x5ef33e;}['merge'](_0xb8ed70,_0x36c597,_0x27d30a){const _0x3cf4a9=_0xb8ed70['cloneNode'](!0x0);if(0x0===_0x36c597['childNodes']['length']){const _0x34539=[];return Be('data-id','new-element',_0x3cf4a9)['forEach'](_0x25bb9c=>{const _0x25ad10=this['_generateUid']();Qe(_0x25bb9c,'data-id',_0x25ad10),_0x34539['push'](_0x25ad10);}),this['_removeSpecialComments'](_0x3cf4a9),{'parsedContent':_0x3cf4a9,'newNodeIds':_0x34539,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x27d30a&&_0x27d30a['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x3cf4a9),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Be('data-id',null,_0x36c597)['map'](_0x474196=>pt(_0x474196,'data-id'))['filter'](_0x5b4637=>!!_0x5b4637));let _0x3bddd3=-0x1,_0x106c0d=!0x1;const _0x552c71=_0x3cf4a9['childNodes'],_0x4df1b0=Array['from'](_0x552c71)['filter'](_0x4f654c=>!(0x3===_0x4f654c['nodeType']&&''===ut(_0x4f654c)['trim']())),_0x571296=_0x4df1b0['length'];for(let _0x408f04=0x0;_0x408f04<_0x571296;_0x408f04++){const _0x2e9ccc=_0x4df1b0[_0x408f04],_0xe59fcf=_0x4df1b0[_0x408f04+0x1];if(this['_isNewNode'](_0x2e9ccc)){if(-0x1===_0x3bddd3&&(_0x3bddd3=_0x408f04),this['_markWrappedElements'](_0x2e9ccc),!this['_isNewNode'](_0xe59fcf)){const [_0x4e367f,_0xb63a68]=this['_findReferenceNode'](_0x2e9ccc,_0x106c0d,_0x36c597);if(_0x4e367f){const _0x1867c7=Array['from'](_0x4df1b0)['slice'](_0x3bddd3,_0x408f04+0x1);this['_insertNodes'](_0x4e367f,_0x1867c7,_0xb63a68),_0x3bddd3=-0x1;}}}else{if(this['_isExistingContentComment'](_0x2e9ccc))_0x106c0d=!0x0;else{if(this['_isExistingNode'](_0x2e9ccc)){const _0x531043=pt(_0x2e9ccc,'data-id');if(_0x531043&&this['_existingDataIds']['has'](_0x531043)){const _0x469c0f=ft('data-id',_0x531043,_0x36c597);this['_replaceNode'](_0x469c0f,_0x2e9ccc);}if(this['_touchedNodesState']['removedIds']['includes'](_0x531043)){const _0x1b1f8a=this['_touchedNodesState']['removedIds']['indexOf'](_0x531043);this['_touchedNodesState']['removedIds']['splice'](_0x1b1f8a,0x1);}}else{if(this['_isDelNode'](_0x2e9ccc)){const _0x4718f7=pt(_0x2e9ccc,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x4718f7)||this['_storeDeletedElementIds'](_0x2e9ccc);}}}}}for(const _0x4aad14 of this['_touchedNodesState']['removedIds']){const _0x1593f2=ft('data-id',_0x4aad14,_0x36c597);if(_0x1593f2){if(_0x27d30a&&_0x27d30a['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x4aad14;const _0x4e8426=_0x27d30a['replaceRemovedWith']['cloneNode'](!0x0);Qe(_0x4e8426,'data-id',_0x4aad14),Qe(_0x4e8426,'data-removed','true'),_0x3ad05b(_0x1593f2,_0x4e8426);}else _0x5de200(_0x1593f2);}}if(Be('data-wrapped-id',null,_0x36c597)['forEach'](_0x58421e=>{const _0x379607=ft('data-id',pt(_0x58421e,'data-wrapped-id'),_0x36c597);var _0x4dd2b3,_0x2093ea;_0x379607&&(_0x2093ea=_0x58421e,_0x5de200(_0x4dd2b3=_0x379607),_0x3ad05b(_0x2093ea,_0x4dd2b3));}),Be('data-id','new-element',_0x36c597)['forEach'](_0xb96fee=>{const _0x27947c=this['_getUid'](_0xb96fee);Qe(_0xb96fee,'data-id',_0x27947c),this['_touchedNodesState']['newIds']['push'](_0x27947c);}),this['_removeSpecialComments'](_0x36c597),_0x27d30a&&_0x27d30a['markUnstableElements']&&this['_markUnstableElements'](_0x36c597,_0x27d30a['markUnstableElementsDepth']||0x0),_0x27d30a&&_0x27d30a['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x317c60=ft('data-id',this['_touchedNodesState']['lastTouchedId'],_0x36c597);for(;_0x317c60;)Is(_0x317c60),_0x317c60=_0x317c60['parentNode'];}return{'parsedContent':_0x36c597,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x34a0e3,_0x1b5518,_0x3c9b49){for(const _0x4ba758 of _0x1b5518){const _0xf55ac2=this['_getUid'](_0x4ba758);Qe(_0x4ba758,'data-id',_0xf55ac2),this['_touchedNodesState']['newIds']['push'](_0xf55ac2),this['_touchedNodesState']['lastTouchedId']=_0xf55ac2;}const _0xd903ed='afterbegin'===_0x3c9b49||'afterend'===_0x3c9b49?_0x1b5518['reverse']():_0x1b5518;for(const _0x543547 of _0xd903ed)ze(_0x34a0e3,_0x543547,_0x3c9b49);}['_replaceNode'](_0x41d32a,_0x2ef76b){if(!_0x41d32a)return;if(_0x323aeb=_0x2ef76b,Jn(ut(_0x41d32a))===Jn(ut(_0x323aeb)))return;var _0x323aeb;const _0x4ea32e=this['_getUid'](_0x41d32a);Qe(_0x2ef76b,'data-id',_0x4ea32e),this['_touchedNodesState']['modifiedIds']['push'](_0x4ea32e),this['_touchedNodesState']['lastTouchedId']=_0x4ea32e,_0x3ad05b(_0x41d32a,_0x2ef76b['cloneNode'](!0x0));}['_findReferenceNode'](_0x157ac9,_0x52b760,_0x455739){const _0x406c8a=this['_findPrevElementWithDataId'](_0x157ac9,!0x1);if(_0x406c8a){const _0xa923eb=this['_getNodeDataId'](_0x406c8a),_0x2e8a11=ft('data-id',_0xa923eb,_0x455739);if(_0x2e8a11)return[_0x2e8a11,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0xa923eb);}const _0xbf8d32=this['_findNextElementWithDataId'](_0x157ac9,!0x1);if(_0xbf8d32){const _0x440e83=this['_getNodeDataId'](_0xbf8d32),_0x3231a8=ft('data-id',_0x440e83,_0x455739);if(_0x3231a8)return[_0x3231a8,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x440e83);}return _0x52b760?_0x157ac9['nextSibling']?this['_findFallbackReferenceNode'](_0x157ac9,_0x455739):[_0x455739['childNodes'][_0x455739['childNodes']['length']-0x1],'afterend']:[_0x455739['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x1c1afa,_0x35fc52){const _0x278bf1=[],_0x311e83=this['_findPrevElementWithDataId'](_0x1c1afa,!0x0);if(_0x311e83){const _0x4dc7d9=ft('data-id',this['_getNodeDataId'](_0x311e83),_0x35fc52);_0x4dc7d9&&_0x278bf1['push']([_0x4dc7d9,'afterend']);}const _0x565f12=this['_findNextElementWithDataId'](_0x1c1afa,!0x0);if(_0x565f12){const _0x243289=ft('data-id',this['_getNodeDataId'](_0x565f12),_0x35fc52);_0x243289&&_0x278bf1['push']([_0x243289,'beforebegin']);}if(_0x278bf1['length']>0x1)return Ze(_0x278bf1[0x0][0x0])<=Ze(_0x278bf1[0x1][0x0])?_0x278bf1[0x0]:_0x278bf1[0x1];return 0x1===_0x278bf1['length']?_0x278bf1[0x0]:[_0x35fc52['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x55ab35,_0x522c13){let _0x192579=_0x55ab35['nextSibling'],_0x48bbc1=null,_0x5137e1=!0x1;for(;_0x192579;){if(_0x1f159b(_0x192579)){if(this['_isDelNode'](_0x192579)&&(_0x48bbc1=_0x192579),this['_isExistingContentComment'](_0x192579)&&_0x522c13&&!_0x5137e1){_0x5137e1=!0x0,_0x192579=_0x192579['nextSibling'];continue;}break;}const _0x591360=pt(_0x192579,'data-id');if(_0x591360&&'new-element'!==_0x591360&&this['_existingDataIds']['has'](_0x591360)){_0x48bbc1=_0x192579;break;}_0x192579=_0x192579['nextSibling'];}return _0x48bbc1;}['_findPrevElementWithDataId'](_0x5e5ad8,_0x2743e0){let _0x29574a=_0x5e5ad8['previousSibling'],_0x5d264b=null,_0xfd662e=!0x1;for(;_0x29574a;){if(_0x1f159b(_0x29574a)){if(this['_isDelNode'](_0x29574a)&&(_0x5d264b=_0x29574a),this['_isExistingContentComment'](_0x29574a)&&_0x2743e0&&!_0xfd662e){_0xfd662e=!0x0,_0x29574a=_0x29574a['previousSibling'];continue;}break;}const _0x58dac1=pt(_0x29574a,'data-id');if(_0x58dac1&&'new-element'!==_0x58dac1&&this['_existingDataIds']['has'](_0x58dac1)){_0x5d264b=_0x29574a;break;}_0x29574a=_0x29574a['previousSibling'];}return _0x5d264b;}['_markWrappedElements'](_0x3bcb91){_0x5bf45b(_0x3bcb91)&&Be('data-id',null,_0x3bcb91)['forEach'](_0x86acf5=>{this['_isExistingNode'](_0x86acf5)&&!this['_hasWrappedParent'](_0x86acf5)&&(Qe(_0x86acf5,'data-wrapped-id',pt(_0x86acf5,'data-id')),Qe(_0x86acf5,'data-id',null));});}['_getNodeDataId'](_0x4813d6){if(!_0x4813d6)return null;if(_0x5bf45b(_0x4813d6))return pt(_0x4813d6,'data-id');if(_0x1f159b(_0x4813d6)){const _0x5eeaa9=ut(_0x4813d6)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x5eeaa9&&_0x5eeaa9[0x1])return _0x5eeaa9[0x1];}return null;}['_storeDeletedElementIds'](_0x535826){if(_0x1f159b(_0x535826)){const _0x11abb5=ut(_0x535826)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x11abb5&&_0x11abb5[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x11abb5[0x1]);}}['_getUid'](_0x23a5f3){return this['_isExistingNode'](_0x23a5f3)?pt(_0x23a5f3,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x5bdc51){(function(_0x432d63){return _0x5b38d5(_0x5d96a1=>_0x1f159b(_0x5d96a1),_0x432d63,!0x0,0x1/0x0);}(_0x5bdc51)['filter'](_0x471e6f=>this['_isDelNode'](_0x471e6f)||this['_isExistingContentComment'](_0x471e6f))['forEach'](_0x143642=>{_0x5de200(_0x143642);}));}['_markLastTagElementUnstable'](_0x9f7a18){const _0x52eecd=_0x9f7a18['childNodes'],_0x2238f1=_0x52eecd[_0x52eecd['length']-0x1];_0x2238f1&&_0x5bf45b(_0x2238f1)&&Qe(_0x2238f1,'data-unstable','true');}['_markUnstableElements'](_0x40d86c,_0x24c482){const _0x2f3291=ft('data-unstable','true',_0x40d86c);if(!_0x2f3291)return;const _0xa26cb0=Ae(_0x2f3291)['slice'](0x0,-0x1),_0x4d93ef=_0xa26cb0['length'];let _0x92d80f=_0x2f3291;if(_0x4d93ef>_0x24c482){let _0x2fd020=_0x4d93ef,_0x340062=null;for(;_0x2fd020>_0x24c482&&_0x2fd020>=0x0;)_0x2fd020--,_0x340062=_0xa26cb0[_0x2fd020];_0x340062&&(_0x92d80f=_0x340062,Qe(_0x2f3291,'data-unstable',null),Qe(_0x340062,'data-unstable','true'));}else{if(_0x4d93ef<_0x24c482){let _0x1079ad=_0x4d93ef,_0x1dcd9c=_0x2f3291;for(;_0x1079ad<_0x24c482;){const _0x1718fd=_0x1dcd9c['childNodes']['filter'](_0x3ff5f3=>_0x5bf45b(_0x3ff5f3));if(0x0===_0x1718fd['length'])break;_0x1079ad++,_0x1dcd9c=_0x1718fd[_0x1718fd['length']-0x1];}_0x1dcd9c&&(_0x92d80f=_0x1dcd9c,Qe(_0x2f3291,'data-unstable',null),Qe(_0x1dcd9c,'data-unstable','true'));}}let _0x4d283c=_0x92d80f;for(;_0x4d283c;){for(;_0x4d283c['nextSibling'];)_0x4d283c=_0x4d283c['nextSibling'],_0x5bf45b(_0x4d283c)&&Qe(_0x4d283c,'data-unstable','true');_0x4d283c=_0x4d283c['parentNode'];}}['_isNewNode'](_0x1afd32){return Boolean('new-element'===pt(_0x1afd32,'data-id'));}['_isExistingNode'](_0x20f2ee){return Boolean((pt(_0x20f2ee,'data-id')||'')['length']>0x0&&'new-element'!==pt(_0x20f2ee,'data-id'));}['_isDelNode'](_0x306b04){return!!_0x306b04&&Boolean(_0x1f159b(_0x306b04)&&ut(_0x306b04)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x4cd91a){let _0xd846f6=_0x4cd91a['parentNode'];for(;_0xd846f6;){if(pt(_0xd846f6,'data-wrapped-id'))return!0x0;_0xd846f6=_0xd846f6['parentNode'];}return!0x1;}['_isExistingContentComment'](_0xefb140){return Boolean(_0x1f159b(_0xefb140)&&ut(_0xefb140)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function y({editor:_0x320b03,changeGroups:_0x407359,documentContextContent:_0x4f484d,showDiff:_0x2c4367,trimUnchanged:_0x5a1037=!0x0}){return _0x407359['map'](_0x5e8d90=>{const _0x3c64af=new mt([]),_0x2ff7a3=new mt([]);for(const _0x4f72a0 of _0x5e8d90['changes'])if(_0x2c4367&&'removed'==_0x4f72a0['type']||_0x2ff7a3['children']['push'](_0x4f72a0['node']['cloneNode'](!0x0)),'new'!=_0x4f72a0['type']&&(_0x2c4367||'removed'!=_0x4f72a0['type'])){const _0x251902=gt(_0x4bd01a=>pt(_0x4bd01a,'data-id')==_0x4f72a0['id'],_0x4f484d,!0x0);_0x251902&&_0x3c64af['children']['push'](_0x251902['cloneNode'](!0x0));}const {content:_0x449d85,hasChanges:_0x29b61b}=function(_0x5cd49b,_0x1f3362,_0x1c6e64,_0x32ae50,_0x115316=!0x0){const _0x2ed30d=_0x5cd49b['plugins']['get']('DocumentCompare'),_0x3b2ad1=ut(_0x1f3362),_0x4d920b=ut(_0x1c6e64),_0x576957=_0x5cd49b['data']['parse'](_0x3b2ad1,'$root'),_0x147363=_0x5cd49b['model']['createPositionAt'](_0x576957,0x0),_0x4c3e70=_0x2ed30d['getDiff'](_0x3b2ad1,_0x4d920b,{'anchor':_0x147363,'markDeletions':_0x32ae50}),_0xba231e=_0x4c3e70['getOperations']();if(0x0==_0xba231e['length'])return{'content':_0x1f3362['cloneNode'](!0x0),'hasChanges':!0x1};_0x32ae50?function(_0x32c666,_0x1c6c26,_0x1a5a58){if(0x0==_0x32c666['length'])return;const _0x9ae7a8=_0x1a5a58['plugins']['get']('DocumentCompare'),_0x436de8=_0x1a5a58['plugins']['get']('SuggestionsConversion');_0x1a5a58['model']['change'](_0x381a39=>{const _0x1986b1=new Set();for(let _0x49269b=0x0;_0x49269b<_0x32c666['length'];_0x49269b++){const _0x3db3c4=_0x32c666[_0x49269b];if(_0x3db3c4['baseVersion']=null,_0x3db3c4['isDocumentOperation']=!0x1,_0x9ae7a8['isMarkedRemoveOperation'](_0x3db3c4)){const _0x24faac=_0x2fe0fa(_0x3db3c4['newRange'],_0x1a5a58['model']),_0x1fcc2d='suggestion:deletion:'+_0x5ef33e()+':$aiSuggestion';_0x1c6c26['markers']['set'](_0x1fcc2d,_0x24faac);}else switch(_0x3db3c4['type']){case'rename':{if(_0x3db3c4['oldName']==_0x3db3c4['newName'])break;_0x381a39['batch']['addOperation'](_0x3db3c4),_0x1a5a58['model']['applyOperation'](_0x3db3c4);const _0x2f7765='$elementName',_0xdab92c=_0x3db3c4['position'],_0x1c825d=_0x1a5a58['model']['createRange'](_0xdab92c,_0x1a5a58['model']['createPositionAt'](_0xdab92c['nodeAfter'],'end')),_0x1206a0='suggestion:attribute:'+_0x2f7765+':'+_0x5ef33e()+':$aiSuggestion';_0x1c6c26['markers']['set'](_0x1206a0,_0x1c825d);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x3db3c4['oldValue']==_0x3db3c4['newValue'])break;_0x381a39['batch']['addOperation'](_0x3db3c4),_0x1a5a58['model']['applyOperation'](_0x3db3c4);const _0x1a92cb=_0x3db3c4['key'];if(!_0x436de8['isRegisteredAttribute'](_0x1a92cb))break;const _0x11cff8=_0x2fe0fa(_0x3db3c4['range'],_0x1a5a58['model']),_0x40ca66='suggestion:attribute:'+_0x1a92cb+':'+_0x5ef33e()+':$aiSuggestion';_0x1c6c26['markers']['set'](_0x40ca66,_0x11cff8);break;}case'insert':{_0x381a39['batch']['addOperation'](_0x3db3c4),_0x1a5a58['model']['applyOperation'](_0x3db3c4);if(_0x32c666[_0x49269b+0x1]&&'move'==_0x32c666[_0x49269b+0x1]['type']){ro(_0x1c6c26,_0x3db3c4);break;}const _0x52a2f9=_0x3db3c4['position'],_0x30192b=_0x3db3c4['howMany'],_0x26640d=_0x2fe0fa(_0x1a5a58['model']['createRange'](_0x52a2f9,_0x52a2f9['getShiftedBy'](_0x30192b)),_0x1a5a58['model']),_0xe76400='suggestion:insertion:'+_0x5ef33e()+':$aiSuggestion';_0x1c6c26['markers']['set'](_0xe76400,_0x26640d);break;}case'split':{_0x381a39['batch']['addOperation'](_0x3db3c4),_0x1a5a58['model']['applyOperation'](_0x3db3c4);const _0x5016bd=_0x3db3c4['splitPosition'],_0x561929=_0x3db3c4['moveTargetPosition'],_0x2fcb17=_0x1a5a58['model']['createRange'](_0x5016bd,_0x561929),_0x382d38='suggestion:insertion:'+_0x5ef33e()+':$aiSuggestion';_0x1c6c26['markers']['set'](_0x382d38,_0x2fcb17);break;}case'move':{_0x381a39['batch']['addOperation'](_0x3db3c4),_0x1a5a58['model']['applyOperation'](_0x3db3c4),_0x32c666[_0x49269b-0x1]&&'insert'==_0x32c666[_0x49269b-0x1]['type']&&ro(_0x1c6c26,_0x3db3c4);const _0x4f55f1=_0x3db3c4['getMovedRangeStart'](),_0x2a7104=_0x3db3c4['howMany'];for(let _0x115d1c=0x0;_0x115d1c<_0x2a7104;_0x115d1c++){const _0x15d81f=_0x4f55f1['getShiftedBy'](_0x115d1c)['nodeAfter'];_0x1986b1['add'](_0x15d81f);}break;}case'remove':{const _0x30c484=_0x3db3c4['sourcePosition'],_0x377b9b=_0x3db3c4['howMany'],_0x1a5de8=new _0x207911(_0x30c484,_0x377b9b);_0x381a39['batch']['addOperation'](_0x1a5de8),_0x1a5a58['model']['applyOperation'](_0x1a5de8);break;}}}for(const _0x259cc4 of _0x1986b1){const _0x2218eb=_0x1a5a58['model']['createRangeOn'](_0x259cc4),_0x4dc19c='suggestion:formatBlock:$fakeWrap:'+_0x5ef33e()+':$aiSuggestion';_0x1c6c26['markers']['set'](_0x4dc19c,_0x2fe0fa(_0x2218eb,_0x1a5a58['model']));}});}(_0xba231e,_0x576957,_0x5cd49b):_0x5cd49b['model']['change'](_0x24336b=>{for(const _0x49aa82 of _0xba231e)if('remove'==_0x49aa82['type']){const _0x1e84da=_0x49aa82['sourcePosition'],_0x458b80=_0x49aa82['howMany'],_0x414332=new _0x207911(_0x1e84da,_0x458b80);_0x24336b['batch']['addOperation'](_0x414332),_0x5cd49b['model']['applyOperation'](_0x414332);}else{if('marker'==_0x49aa82['type']){const _0x4dc97e=_0x49aa82['name'],_0x25f77b=_0x49aa82['newRange'];_0x576957['markers']['set'](_0x4dc97e,_0x25f77b);}else _0x49aa82['baseVersion']=null,_0x49aa82['isDocumentOperation']=!0x1,_0x24336b['batch']['addOperation'](_0x49aa82),_0x5cd49b['model']['applyOperation'](_0x49aa82);}});if(_0x115316){const _0x4378a1=lt(_0x5cd49b,_0xba231e,_0x576957);dt(_0x5cd49b['model'],_0x4378a1),function(_0x41a418,_0x471edc){const _0x5a93d9=_0x471edc['getFirstRange']()['start'];let _0x35c068=_0x471edc['getFirstRange']()['end'];const _0xc1f04=_0x5a93d9['root'];(_0x35c068['textNode']||_0x35c068['nodeAfter']&&_0x35c068['nodeAfter']['is']('$text'))&&(_0x2720f2(_0x35c068,'...'),_0x35c068=_0x35c068['getShiftedBy'](0x3)),(_0x5a93d9['textNode']||_0x5a93d9['nodeBefore']&&_0x5a93d9['nodeBefore']['is']('$text'))&&(_0x2720f2(_0x5a93d9,'...'),function(_0x4e918f,_0x1d71b5,_0x3e68da){for(let [_0x1889b8,_0x5dec6e]of _0x4e918f['markers']){const _0x5ca419=_0x5dec6e['_getTransformedByInsertion'](_0x1d71b5,_0x3e68da,!0x1);_0x5dec6e=_0x5ca419[0x0],_0x4e918f['markers']['set'](_0x1889b8,_0x5dec6e);}}(_0xc1f04,_0x5a93d9,0x3),_0x5a93d9['parent']==_0x35c068['parent']&&(_0x35c068=_0x35c068['getShiftedBy'](0x3)));const _0x554254=_0x41a418['createRange'](_0x41a418['createPositionAt'](_0xc1f04,0x0),_0x5a93d9),_0x83f8ea=_0x41a418['createRange'](_0x35c068,_0x41a418['createPositionAt'](_0xc1f04,'end')),_0x2dfa8a=[..._0x554254['getMinimalFlatRanges'](),..._0x83f8ea['getMinimalFlatRanges']()];_0x2dfa8a['reverse']();for(const _0x437529 of _0x2dfa8a)_0x3666da(_0x437529),Zn(_0xc1f04,_0x437529);}(_0x5cd49b['model'],_0x4378a1);}const _0x8a4083=_0x5cd49b['data']['stringify'](_0x576957,{'showSuggestionHighlights':!0x0});return{'content':Ye(_0x8a4083),'hasChanges':!0x0};}(_0x320b03,_0x3c64af,_0x2ff7a3,_0x2c4367,_0x5a1037);return{'type':_0x5e8d90['changes'][0x0]['type'],'index':_0x5e8d90['index'],'content':_0x449d85,'hasChanges':_0x29b61b};});}function ro(_0x4ee4e4,_0x4bdd27){for(const [_0x2d5cd5,_0x369762]of _0x4ee4e4['markers']){const _0x521150=_0x473568['_createFromRanges'](_0x369762['getTransformedByOperation'](_0x4bdd27));_0x4ee4e4['markers']['set'](_0x2d5cd5,_0x521150);}}function lt(_0x2ed3bb,_0x1a9dcc,_0x27f7b2){const _0x5e4099=_0x2ed3bb['plugins']['get']('DocumentCompare');let _0xa5d738=_0x2ed3bb['model']['createPositionAt'](_0x27f7b2,Number['POSITIVE_INFINITY']),_0x426267=_0x2ed3bb['model']['createPositionAt'](_0x27f7b2,0x0);for(const _0x5f2957 of _0x1a9dcc){let _0x21124c,_0x488ef1;if(_0x5e4099['isMarkedRemoveOperation'](_0x5f2957))_0x21124c=_0x5f2957['newRange']['start'],_0x488ef1=_0x5f2957['newRange']['end'];else switch(_0xa5d738=_0xa5d738['getTransformedByOperation'](_0x5f2957),_0x426267=_0x426267['getTransformedByOperation'](_0x5f2957),_0x5f2957['type']){case'rename':_0x21124c=_0x5f2957['position'],_0x488ef1=_0x21124c['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x21124c=_0x5f2957['range']['start'],_0x488ef1=_0x5f2957['range']['end'];break;case'insert':_0x21124c=_0x5f2957['position'],_0x488ef1=_0x21124c['getShiftedBy'](_0x5f2957['howMany']);break;case'split':_0x21124c=_0x5f2957['splitPosition'],_0x488ef1=_0x5f2957['moveTargetPosition'];break;case'merge':{const _0x158f7a=_0x5f2957['targetPosition']['path']['slice'](0x0,-0x1);_0x21124c=_0x2ed3bb['model']['createPositionFromPath'](_0x27f7b2,_0x158f7a),_0x488ef1=_0x21124c['getShiftedBy'](0x1);break;}case'remove':{const _0x3264e3=_0x5f2957['howMany'],_0xb90d77=_0x5f2957['sourcePosition']['_getTransformedByInsertion'](_0x5f2957['targetPosition'],_0x3264e3),_0x26d938=_0x5f2957['getMovedRangeStart']();'remove'==_0x5f2957['type']?(_0x21124c=_0xb90d77,_0x488ef1=_0xb90d77):(_0x21124c=_0x26d938,_0x488ef1=_0x26d938['getShiftedBy'](_0x3264e3));break;}}_0x21124c&&_0x21124c['isBefore'](_0xa5d738)&&(_0xa5d738=_0x21124c['clone'](),_0xa5d738['stickiness']='toNone'),_0x488ef1&&_0x488ef1['isAfter'](_0x426267)&&(_0x426267=_0x488ef1['clone'](),_0x426267['stickiness']='toNone');}return _0x2ed3bb['model']['createSelection'](_0x2ed3bb['model']['createRange'](_0xa5d738,_0x426267));}function dt(_0x52c211,_0x2601c1){so(_0x52c211,_0x2601c1,'forward');const _0x3b2a63=_0x2601c1['getFirstRange']();_0x2601c1['setTo']([]),_0x2601c1['setTo'](_0x3b2a63,{'backward':!0x0}),so(_0x52c211,_0x2601c1,'backward');}function so(_0xce71a6,_0x43787e,_0x2a9c56){let _0x341d3f=0x14;for(;_0x341d3f;){_0xce71a6['modifySelection'](_0x43787e,{'unit':'word','direction':_0x2a9c56}),_0x341d3f--;const _0x5e4e9b=_0x43787e['focus']['forward'==_0x2a9c56?'nodeBefore':'nodeAfter'];if(_0x5e4e9b&&_0x5e4e9b['is']('element')&&_0xce71a6['schema']['isBlock'](_0x5e4e9b)&&_0xce71a6['schema']['isObject'](_0x5e4e9b))break;}}function Zn(_0xfd8c99,_0x290a9d){for(const [_0xd80219,_0x2a6dd7]of _0xfd8c99['markers']){const _0x564e62=_0x2a6dd7['_getTransformedByDeletion'](_0x290a9d['start'],_0x290a9d['end']['offset']-_0x290a9d['start']['offset']);null!=_0x564e62?_0xfd8c99['markers']['set'](_0xd80219,_0x564e62):_0xfd8c99['markers']['delete'](_0xd80219);}}const Ur=['modification-delta','text-delta','web-search','reasoning'],Wr=['conversation-title'];class de extends _0x314197(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new mt([]);['parsedMergedContent']=new mt([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x419563,content:_0x112dd5='',isDone:_0x152ee9=!0x1,interactionId:_0x1247bd,areActionsDisabled:_0x6cb37a,documentContextContent:_0x1e74ac,editor:_0xb39f7f,id:_0x2c1ec1}){super(),this['id']=_0x2c1ec1||_0x5ef33e(),this['interactionId']=_0x1247bd,this['type']=_0x419563,this['areActionsDisabled']=!!_0x6cb37a,this['editor']=_0xb39f7f,this['aiResponseParser']=new Oe(),this['aiResponseApplier']=new Ne(),this['documentContextContent']=Ye(_0x1e74ac||''),this['set']('isDone',_0x152ee9),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x112dd5);}['appendContent'](_0x168dbc){this['set']('content',this['content']+_0x168dbc);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x311b14,_0x90c65b){this['changeGroups'][_0x311b14]['state']=_0x90c65b,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x311b14,'state':_0x90c65b});}['getContentParts']({showDiff:_0x132b40,groupIndex:_0x13d625}){if(!this['editor'])throw new _0x239292('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x30cb76=this['_getCachedContentParts'](_0x132b40,_0x13d625);if(_0x30cb76)return _0x30cb76;let _0x1caf74=[];if(void 0x0===_0x13d625)_0x1caf74=this['changeGroups'];else{const _0x87c595=this['changeGroups']['find'](({index:_0x8facbd})=>_0x8facbd===_0x13d625);if(!_0x87c595)throw new _0x239292('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x13d625});_0x1caf74=[_0x87c595];}const _0x29fedb=y({'editor':this['editor'],'showDiff':_0x132b40,'changeGroups':_0x1caf74,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x132b40,_0x29fedb),_0x29fedb;}['_getCachedContentParts'](_0x1725f5,_0x42da9d){const _0x16aee0=_0x1725f5?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x16aee0]['length'])return null;const _0x514d55=this['cachedSuggestionContentParts'][_0x16aee0];if(void 0x0===_0x42da9d)return _0x3af120(_0x514d55);{const _0x3edf33=_0x514d55['find'](({index:_0x154b93})=>_0x154b93===_0x42da9d);if(_0x3edf33)return[_0x3af120(_0x3edf33)];}return null;}['_setCachedContentParts'](_0x2e192f,_0x4c0cb2){const _0x4a04b2=_0x2e192f?'withDiff':'withoutDiff';_0x4c0cb2['forEach'](_0x498d9c=>{const _0x53755b=this['cachedSuggestionContentParts'][_0x4a04b2],_0x1b5510=_0x53755b['find'](({index:_0x5cc8e7})=>_0x5cc8e7===_0x498d9c['index']);if(_0x1b5510){const _0x301d37=_0x53755b['indexOf'](_0x1b5510);_0x53755b['splice'](_0x301d37,0x1,_0x498d9c);}else _0x53755b['push'](_0x498d9c);});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x5ef47f=this['changeGroups'];this['updateChangeGroups']();const _0x5e13fd=this['_getDifferentChangeGroups'](_0x5ef47f,this['changeGroups']);(_0x5e13fd['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x5e13fd),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0xee2770,_0x40b3db){const _0x2c2eb8=[];for(const _0x3dffe6 of _0x40b3db){const _0x114f66=_0xee2770[_0x3dffe6['index']];_0x114f66?_0x114f66['changes']['length']!==_0x3dffe6['changes']['length']?_0x2c2eb8['push'](_0x3dffe6):_0x114f66['changes']['forEach']((_0x8c8aa3,_0x33e88f)=>{const _0x4c6e67=_0x3dffe6['changes'][_0x33e88f];_0x8c8aa3['id']!==_0x4c6e67['id']&&_0x2c2eb8['push'](_0x3dffe6);}):_0x2c2eb8['push'](_0x3dffe6);}return _0x2c2eb8;}['updateChangeGroups'](){const _0x466131=new _0x3d5305('p',{},[new _0x3d5305('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x40d4fe(C(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x43863e=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x466131,'cutAfterLastChange':!this['isDone']});if(!_0x43863e['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x43863e['parsedContent'];let _0x205dae=[];if(_0x5bf864(_0x25fca2=>{const _0x8db2ff=pt(_0x25fca2,'data-id');if(!_0x8db2ff||!_0x1cb48e(_0x8db2ff))return!0x1;const _0x58e1e7=[_0x25fca2,...Ae(_0x25fca2)]['at'](-0x2);if(_0x25fca2!=_0x58e1e7){const _0x38af70=pt(_0x58e1e7,'data-id');_0x1cb48e(_0x38af70)||(_0x205dae['push']({'node':_0x58e1e7,'id':_0x38af70,'type':'modified'}),_0x43863e['modifiedNodeIds']['push'](_0x38af70));}else _0x43863e['modifiedNodeIds']['includes'](_0x8db2ff)?_0x205dae['push']({'node':_0x25fca2,'type':'modified','id':_0x8db2ff}):_0x43863e['newNodeIds']['includes'](_0x8db2ff)?_0x205dae['push']({'node':_0x25fca2,'type':'new','id':_0x8db2ff,'anchorId':pt(_0x25fca2['previousSibling'],'data-id')}):_0x205dae['push']({'node':_0x25fca2,'type':'removed','id':_0x8db2ff});return!0x0;},this['parsedMergedContent']),_0x205dae=_0x205dae['filter'](({node:_0x2b7b9b})=>[...Ae(_0x2b7b9b),_0x2b7b9b]['every'](_0x491c56=>!pt(_0x491c56,'data-unstable'))),0x0==_0x205dae['length'])return;const _0x38e079=[[_0x205dae[0x0]]];for(let _0x5e6207=0x1;_0x5e6207<_0x205dae['length'];_0x5e6207++){const _0x4f45ec=_0x38e079[_0x38e079['length']-0x1],_0x325d59=_0x4f45ec[_0x4f45ec['length']-0x1];_0x205dae[_0x5e6207]['node']['previousSibling']==_0x325d59['node']&&'modified'!=_0x205dae[_0x5e6207]['type']&&'modified'!=_0x325d59['type']?_0x4f45ec['push'](_0x205dae[_0x5e6207]):_0x38e079['push']([_0x205dae[_0x5e6207]]);}for(const _0x3c1c48 of _0x38e079){const _0x7e541c=_0x3c1c48[0x0],_0x32d83a=_0x3c1c48[_0x3c1c48['length']-0x1],_0x5555e5=_0x304ea1(_0x7e541c['node']['previousSibling']);_0x5555e5&&_0x3c1c48['unshift'](_0x5555e5);const _0x1ba526=_0x304ea1(_0x32d83a['node']['nextSibling']);_0x1ba526&&_0x3c1c48['push'](_0x1ba526);}function _0x1cb48e(_0x317d6f){return _0x43863e['modifiedNodeIds']['includes'](_0x317d6f)||_0x43863e['newNodeIds']['includes'](_0x317d6f)||_0x43863e['removedNodeIds']['includes'](_0x317d6f);}function _0x304ea1(_0x47061a){if(_0x47061a&&pt(_0x47061a,'data-id')&&!pt(_0x47061a,'data-unstable')){const _0x28899a=pt(_0x47061a,'data-id');if(!_0x1cb48e(_0x28899a))return{'node':_0x47061a,'type':'context','id':_0x28899a};}return null;}this['changeGroups']=_0x38e079['map']((_0x97a196,_0x4dace4)=>({'changes':_0x97a196,'state':'pending','index':_0x4dace4}));}}function $i(_0x5850d9){return Object['values'](Ur)['includes'](_0x5850d9);}function Zi(_0x5df154){return Wr['includes'](_0x5df154);}function Ee(_0x53e186){return'conversation-title'===_0x53e186;}function Fe(_0x77ce34){return'source'===_0x77ce34;}const Vt=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','error'];class Jt extends _0x7d5e47(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x6db83e,editor:_0x151813}){super(),this['id']=_0x5ef33e(),this['connector']=_0x6db83e,this['isStopped']=!0x0,this['editor']=_0x151813;}async['start'](){let _0x2e1060;const _0x8fdcb7=[];this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x134138=await this['currentRequest']['getStream']();for await(const _0x1d1fd4 of _0x134138){if(this['isStopped'])return;if('error'===_0x1d1fd4['event'])return void this['fire']('error',{'error':new _0x239292('ai-chat-interaction-error',this)});if('message-metadata'!==_0x1d1fd4['event']){if('action-metadata'!==_0x1d1fd4['event']){if(Ee(_0x1d1fd4['event'])&&this['setConversationTitle'](_0x1d1fd4['data']['conversationTitle'],!0x0),Fe(_0x1d1fd4['event']))_0x8fdcb7['push'](_0x1d1fd4['data']['source']);else{if($i(_0x1d1fd4['event'])){if(_0x1d1fd4['event']!==_0x2e1060){if(_0x2e1060=_0x1d1fd4['event'],'web-search'===_0x1d1fd4['event']){this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));continue;}if('reasoning'===_0x1d1fd4['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':_0x1d1fd4['event'],'interactionId':this['id'],'id':_0x1d1fd4['data']?.['id']}),_0x8fdcb7['length']>0x0&&'modification-delta'===_0x1d1fd4['event']&&(this['currentReply']['sources']=_0x8fdcb7['splice'](0x0));}_0x1d1fd4['data']['textDelta']&&this['currentReply']['appendContent'](_0x1d1fd4['data']['textDelta']);}else Zi(_0x1d1fd4['event'])||_0x361f9e('ai-interaction-invalid-event-type',{'chunk':_0x1d1fd4});}}else this['actionCallId']=_0x1d1fd4['data']['callId'];}else this['messageId']=_0x1d1fd4['data']['messageId'];}}finally{this['isStopped']||(_0x8fdcb7['length']>0x0&&(this['currentReply']['sources']=_0x8fdcb7['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x2baf4c){return this['replies']['find'](_0x1414a7=>_0x1414a7['id']===_0x2baf4c);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x494a2f=>_0x494a2f['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x1eb7da){const _0x2509cb=new de({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x1eb7da});return this['replies']['push'](_0x2509cb),_0x2509cb['delegate'](...Vt)['to'](this),this['fire']('replyCreated',_0x2509cb),_0x2509cb;}['setConversationTitle'](_0x4dc1ad,_0x1f8793=!0x1){this['fire']('setConversationTitle',_0x4dc1ad,_0x1f8793);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Xt=function(_0x27b00b){return _0x27b00b['FILE']='file',_0x27b00b['DOCUMENT']='document',_0x27b00b['URL']='web-resource',_0x27b00b['TEXT']='text',_0x27b00b['SELECTION']='selection',_0x27b00b;}({}),Ie=function(_0x6a343c){return _0x6a343c['TEXT']='text',_0x6a343c['MARKDOWN']='markdown',_0x6a343c['HTML']='html',_0x6a343c;}({});const xi=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Ci extends _0x314197(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x14f24b,config:_0x4598a9,ownerId:_0x21b434}){super(),this['_connector']=_0x14f24b,this['_config']=_0x4598a9,this['_ownerId']=_0x21b434;}['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'](_0x4a9ae3){const _0x405ea1=await this['_createContextItemFromContent'](_0x4a9ae3);return this['_addToConversationContextItem'](_0x405ea1),'current-document'===_0x405ea1['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x405ea1;}async['_createContextItemFromContent'](_0x4114b1){if(_0x4114b1['type']===Xt['DOCUMENT']){const _0x2bfd76=await this['_connector']['fetchDocument'](this['_ownerId'],_0x4114b1['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x4114b1['type'],'content':_0x2bfd76['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x2bfd76['attributes']?.['version'],'sessionId':_0x2bfd76['attributes']?.['sessionId']};}return{'id':_0x4114b1['id'],'uiId':_0x4114b1['id'],'label':_0x4114b1['attributes']?.['label']||_0x4114b1['name']||_0x4114b1['url']||_0x4114b1['id'],'type':_0x4114b1['type'],..._0x4114b1?.['attributes']?.['resourceId']?{'resourceId':_0x4114b1['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x1a1326){const _0x4df497=this['_pendingContextItems']['get'](_0x1a1326);_0x4df497?.['isReadOnly']||this['_removeContextItem'](_0x1a1326);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0xb0bde2 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0xb0bde2['uiId']);const _0x1dd32f=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x1dd32f&&this['_addContextItem']({..._0x1dd32f,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x4164ed){for(const _0x3827d9 of _0x4164ed['values']())this['_addToConversationContextItem'](_0x3827d9);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'](_0x7b45ea){return Array['from'](_0x7b45ea['values']())['map'](_0x5b59c7=>this['_mapContextItemToRequestData'](_0x5b59c7))['filter'](_0x3f9bd3=>null!==_0x3f9bd3);}async['addFilesToContext'](_0x3721da,_0x2cc381,_0x478955=Xt['FILE']){const _0x134e55='files-'+_0x5ef33e();this['_startUploadOperation'](_0x134e55);try{await Promise['all'](_0x3721da['map'](async _0x4fcbb2=>{const _0x499413='file-'+_0x5ef33e(),_0x5cc07a=_0x59aba(_0x4fcbb2['name']);try{this['_addContextItem']({'type':_0x478955,'label':_0x2cc381?.['label']||_0x5cc07a,'uiId':_0x499413,'resourceId':_0x2cc381?.['resourceId']},!0x0);const _0x582bcd=this['_connector']['uploadFile'](this['_ownerId'],_0x4fcbb2,_0x2cc381);this['_ongoingUploads']['set'](_0x499413,_0x582bcd['abortController']);const {id:_0xb387f7}=await _0x582bcd['getId']();this['_ongoingUploads']['delete'](_0x499413),this['_finishContextItemLoading']({'type':_0x478955,'id':_0xb387f7,'label':_0x2cc381?.['label']||_0x5cc07a,'uiId':_0x499413,'resourceId':_0x2cc381?.['resourceId']},!0x1);}catch(_0x4f3929){this['_ongoingUploads']['delete'](_0x499413);if(!_0x4f3929['message']['startsWith']('ai-request-aborted')){const _0x4824f3=new _0x239292('ai-chat-file-upload-failed',null,{'fileName':_0x5cc07a});_0x4824f3['stack']=_0x4f3929['stack'],this['fire']('error',{'error':_0x4824f3,'fileName':_0x5cc07a});}this['_removeContextItem'](_0x499413);}}));}finally{this['_finishUploadOperation'](_0x134e55);}}['addCurrentDocumentToContext'](_0x49f4e7){if(this['isCurrentDocumentInContext']())return;const _0x5c464e={'type':Xt['DOCUMENT'],'uiId':'current-document','label':_0x49f4e7,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x5c464e);}async['updateCurrentDocument'](_0x346deb,_0xf2bc5e,_0x1d8e07,_0x4fe727){const _0x1d180b=this['_pendingContextItems']['get']('current-document');if(_0x1d180b&&_0x346deb){_0x1d180b['selection']=_0x4fe727?_0x4fe727['map'](_0x3038be=>({'start':_0x3038be['start'],'end':_0x3038be['end']})):[];try{if(_0x1d180b['version']===_0xf2bc5e)return;const {id:_0x4573ee}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x346deb,{'version':_0xf2bc5e,'sessionId':_0x1d8e07})['getId']();_0x1d180b['id']=_0x4573ee,_0x1d180b['content']=_0x346deb,_0x1d180b['version']=_0xf2bc5e,_0x1d180b['sessionId']=_0x1d8e07;}catch(_0x43d03c){const _0x38d8d2=new _0x239292('ai-chat-document-upload-failed',null);_0x38d8d2['stack']=_0x43d03c['stack'],this['fire']('error',{'error':_0x38d8d2});}}}['addSelectionToContext'](_0x137c10){this['_addContextItem']({'type':Xt['SELECTION'],'label':_0x137c10,'uiId':'selection','content':_0x137c10});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x1bcfee,_0x4ba8a4){const _0x23a0dc='url-'+_0x5ef33e();this['_startUploadOperation'](_0x23a0dc);const _0x3431bb='url-'+_0x5ef33e();try{this['_addContextItem']({'type':Xt['URL'],'label':_0x4ba8a4?.['label']||_0x1bcfee,'uiId':_0x3431bb,'resourceId':_0x4ba8a4?.['resourceId']},!0x0);const _0x36ee8c=this['_connector']['uploadUrl'](this['_ownerId'],_0x1bcfee,_0x4ba8a4);this['_ongoingUploads']['set'](_0x3431bb,_0x36ee8c['abortController']);const {id:_0x547e99}=await _0x36ee8c['getId']();this['_ongoingUploads']['delete'](_0x3431bb),this['_finishContextItemLoading']({'type':Xt['URL'],'id':_0x547e99,'label':_0x4ba8a4?.['label']||_0x1bcfee,'uiId':_0x3431bb,'resourceId':_0x4ba8a4?.['resourceId']},!0x1);}catch(_0x13d1f0){this['_ongoingUploads']['delete'](_0x3431bb),(_0x13d1f0['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x239292('ai-chat-url-upload-failed',this,{'url':_0x1bcfee,'originalError':_0x13d1f0}),'url':_0x1bcfee}),this['_removeContextItem'](_0x3431bb));}finally{this['_finishUploadOperation'](_0x23a0dc);}}async['loadSourceResources'](_0x55529a,_0x375780,_0x5901eb){const _0x415ae2=this['_addContextOptionsState']['sources']['find'](_0x1bb0c7=>_0x1bb0c7['id']===_0x55529a);if(!_0x415ae2)return this['fire']('error',{'error':new _0x239292('ai-chat-source-not-found',this,{'sourceId':_0x55529a}),'sourceId':_0x55529a}),[];try{const _0x4e3052=(await _0x415ae2['getResources'](_0x375780))['map'](_0x562262=>{const _0x193018=this['_isResourceInContext'](_0x562262['id']);return{..._0x562262,'isInContext':_0x193018};});return _0x415ae2['resources']=_0x4e3052,this['fire']('sourceResourcesLoaded',{'sourceId':_0x55529a,'source':_0x415ae2,'resources':_0x4e3052,'uid':_0x5901eb}),_0x4e3052;}catch(_0x8ceba8){return this['fire']('error',{'error':new _0x239292('ai-chat-source-resources-load-failed',this,{'sourceId':_0x55529a,'originalError':_0x8ceba8}),'sourceId':_0x55529a,'sourceLabel':_0x415ae2['label']}),[];}}async['addResourceToContext'](_0x489311,_0x16c6af){if(this['_isResourceInContext'](_0x16c6af['id']))return;let _0x5509ef=_0x16c6af['data'];if(!_0x5509ef&&_0x489311['getData'])try{_0x5509ef=await _0x489311['getData'](_0x16c6af['id']);}catch(_0x40dc62){return void this['fire']('error',{'error':new _0x239292('ai-chat-resource-load-failed',this,{'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id'],'originalError':_0x40dc62}),'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id']});}if(_0x5509ef)switch(_0x16c6af['type']){case Xt['URL']:if('string'!=typeof _0x5509ef)return void this['fire']('error',{'error':new _0x239292('ai-chat-context-invalid-data',this,{'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id'],'expectedType':'string','actualType':typeof _0x5509ef}),'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id']});await this['addUrlToContext'](_0x5509ef,{'label':_0x16c6af['label'],'resourceId':_0x16c6af['id']});break;case Xt['FILE']:if(!(_0x5509ef instanceof File))return void this['fire']('error',{'error':new _0x239292('ai-chat-context-invalid-data',this,{'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id'],'expectedType':'File','actualType':typeof _0x5509ef}),'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id']});await this['addFilesToContext']([_0x5509ef],{'label':_0x16c6af['label'],'resourceId':_0x16c6af['id']});break;case Xt['TEXT']:if('object'!=typeof _0x5509ef||!('content'in _0x5509ef)||!('type'in _0x5509ef))return void this['fire']('error',{'error':new _0x239292('ai-chat-context-invalid-data',this,{'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x5509ef}),'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id']});_0x5509ef=Ci['_convertTextResourceToFile'](_0x5509ef,_0x16c6af['label']),await this['addFilesToContext']([_0x5509ef],{'label':_0x16c6af['label'],'resourceId':_0x16c6af['id']},Xt['TEXT']);break;default:this['fire']('error',{'error':new _0x239292('ai-chat-context-unsupported-type',this,{'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id'],'resourceType':_0x16c6af['type']}),'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id']});}else this['fire']('error',{'error':new _0x239292('ai-chat-resource-no-data',this,{'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id']}),'resourceId':_0x16c6af['id'],'sourceId':_0x489311['id']});}static['_convertTextResourceToFile'](_0x517119,_0x41a6fd){switch(_0x517119['type']){case Ie['MARKDOWN']:return new File([_0x517119['content']],_0x41a6fd,{'type':'text/markdown'});case Ie['HTML']:return new File([_0x517119['content']],_0x41a6fd,{'type':'text/html'});default:return new File([_0x517119['content']],_0x41a6fd,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x4f8cdb){switch(_0x4f8cdb['type']){case Xt['FILE']:return{'type':Xt['FILE'],'id':_0x4f8cdb['id']};case Xt['URL']:return{'type':Xt['URL'],'id':_0x4f8cdb['id']};case Xt['DOCUMENT']:return{'type':Xt['DOCUMENT'],'id':_0x4f8cdb['id'],..._0x4f8cdb['selection']?.['length']&&{'selection':_0x4f8cdb['selection']}};case Xt['TEXT']:return{'type':Xt['FILE'],'id':_0x4f8cdb['id']};default:return null;}}['_addContextItem'](_0x4948cb,_0x1b5446=!0x1){if(this['_pendingContextItems']['set'](_0x4948cb['uiId'],_0x4948cb),_0x4948cb['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x4948cb,'isLoading':_0x1b5446}),'current-document'===_0x4948cb['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x4948cb['resourceId']){const _0x169216=this['_findSourceIdsByResourceId'](_0x4948cb['resourceId']);_0x169216&&_0x169216['forEach'](_0x31657a=>{this['_updateResourceInContextState'](_0x31657a,_0x4948cb['resourceId'],!0x0);});}}['_removeContextItem'](_0x36f9ba){const _0x4f584e=this['_pendingContextItems']['get'](_0x36f9ba),_0x25b4d4=this['_ongoingUploads']['get'](_0x36f9ba);if(_0x25b4d4&&(_0x25b4d4['abort'](),this['_ongoingUploads']['delete'](_0x36f9ba)),_0x4f584e?.['resourceId']){const _0x49fc8c=this['_findSourceIdsByResourceId'](_0x4f584e['resourceId']);_0x49fc8c&&_0x49fc8c['forEach'](_0x39902e=>{this['_updateResourceInContextState'](_0x39902e,_0x4f584e['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x36f9ba),this['fire']('contextItemRemoved',{'uiId':_0x36f9ba,'type':_0x4f584e?.['type']}),'current-document'===_0x36f9ba&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x17be40,_0x4ed71b){if(this['_pendingContextItems']['has'](_0x17be40['uiId'])&&(this['_pendingContextItems']['set'](_0x17be40['uiId'],_0x17be40),this['fire']('contextItemLoadingEnded',{'contextItem':_0x17be40,'isLoading':_0x4ed71b}),_0x17be40['resourceId'])){const _0x510989=this['_findSourceIdsByResourceId'](_0x17be40['resourceId']);_0x510989&&_0x510989['forEach'](_0x134ef1=>{this['_updateResourceInContextState'](_0x134ef1,_0x17be40['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x28951c){this['_conversationContextItems']['set'](_0x28951c['uiId'],_0x28951c);}['_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'](_0x457431=>({..._0x457431,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x1ba2c3=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x1ba2c3,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x10c15e){for(const _0x2bcbca of this['_pendingContextItems']['values']())if(_0x2bcbca['resourceId']===_0x10c15e)return!0x0;for(const _0x14dd44 of this['_conversationContextItems']['values']())if(_0x14dd44['resourceId']===_0x10c15e)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x28fb4f){const _0x2c2117=[];for(const _0x486af1 of this['_addContextOptionsState']['sources']){_0x486af1['resources']['find'](_0x25cc14=>_0x25cc14['id']===_0x28fb4f)&&_0x2c2117['push'](_0x486af1['id']);}return 0x0===_0x2c2117['length']?null:_0x2c2117;}['_updateResourceInContextState'](_0x209fee,_0x403450,_0x3141b6){const _0x42137d=this['_addContextOptionsState']['sources']['find'](_0x46732f=>_0x46732f['id']===_0x209fee);if(!_0x42137d)return;const _0x21ce2f=_0x42137d['resources']['find'](_0x3d73af=>_0x3d73af['id']===_0x403450);_0x21ce2f&&(_0x21ce2f['isInContext']=_0x3141b6,this['fire']('resourceStateChanged',{'sourceId':_0x209fee,'resourceId':_0x403450,'isInContext':_0x3141b6}));}['_startUploadOperation'](_0x3bd61f){this['_ongoingUploadOperations']['set'](_0x3bd61f,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x10bfc2){this['_ongoingUploadOperations']['delete'](_0x10bfc2),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Mi=['capabilitiesUpdated'];class Di extends _0x7d5e47(){['_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'](_0x442bd7){const _0x2feeff={};return _0x442bd7&&_0x442bd7['isWebSearchEnabled']&&(_0x2feeff['webSearch']={}),_0x442bd7&&_0x442bd7['isReasoningEnabled']&&(_0x2feeff['reasoning']={}),_0x2feeff;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x5b0628){_0x5b0628!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x5b0628,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0xb1861c){_0xb1861c!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0xb1861c,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Si extends Jt{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x2cda0c){super(_0x2cda0c),this['conversationId']=_0x2cda0c['conversationId'],this['contextItems']=_0x2cda0c['contextItems'],this['capabilities']=_0x2cda0c['capabilities'],this['userMessage']=_0x2cda0c['userMessage'],this['model']=_0x2cda0c['model'],this['quickActionData']=_0x2cda0c['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Ci['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Di['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class nt extends _0x7d5e47(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0xac476){super(),this['options']=_0xac476,this['connector']=_0xac476['connector'],this['chatModels']=_0xac476['chatModels'],this['id']=_0xac476['conversationId'];}async['init'](_0x4b69f8){try{this['chatContext']=new Ci({'connector':this['connector'],'config':_0x4b69f8,'ownerId':this['id']}),this['chatContext']['delegate'](...xi)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Di(),this['chatCapabilities']['delegate'](...Mi)['to'](this),this['chatCapabilities']['init']();const _0x903da6=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x903da6});const _0x46c865=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x46c865&&await this['setModel'](_0x46c865);}catch(_0x1a3b18){const _0x290210=new _0x239292('ai-chat-conversation-init-failed',null,{'message':_0x1a3b18['message']});_0x290210['stack']=_0x1a3b18['stack'],this['fire']('error',{'error':_0x290210});}}async['start'](){if(this['isStarted'])throw new _0x239292('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x239292('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x444cb3}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x444cb3,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x58d456){const _0x3ffe4c=new _0x239292('ai-chat-conversation-start-failed',null,{'message':_0x58d456['message']});_0x3ffe4c['stack']=_0x58d456['stack'],this['fire']('error',{'error':_0x3ffe4c});}}async['load'](_0x399909,_0x1b01d9){try{const _0x388b3c=await this['connector']['fetchConversation'](_0x399909)['getConversation'](),_0x51a538=await this['connector']['fetchConversationMessages'](_0x399909)['getMessages'](),_0x2a2a7d=_0x51a538[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x388b3c['id'],'title'in _0x388b3c?this['fire']('setConversationTitle',_0x388b3c['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x32696c=(await this['chatModels']['getAll']())['find'](_0x5d8c2a=>_0x5d8c2a['id']['toLowerCase']()===_0x2a2a7d['toLowerCase']());return this['selectedModel']=_0x32696c,this['fire']('modelSelected',{'selectedModel':_0x32696c,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x51a538,_0x1b01d9,_0x2a2a7d),this['currentInteraction']=void 0x0,this;}catch(_0x48acfd){const _0x33a5db=new _0x239292('ai-chat-conversation-init-from-id-failed',null,{'message':_0x48acfd['message'],'conversationId':_0x399909});throw _0x33a5db['stack']=_0x48acfd['stack'],this['fire']('error',{'error':_0x33a5db}),_0x33a5db;}}async['_processMessagesToInteractions'](_0x2763f4,_0x4e64cd,_0x147a56){let _0x31c14f;for(const _0x4dcdb4 of _0x2763f4)if('user'===_0x4dcdb4['role']){const _0x1db812=await this['_extractContextItems'](_0x4dcdb4),_0x4e17f8={'isReasoningEnabled':Object['hasOwn'](_0x4dcdb4['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x4dcdb4['capabilities'],'webSearch')};_0x31c14f=this['createInteraction']({'userMessage':_0x4dcdb4['prompt'],'contextItems':_0x1db812,'capabilities':_0x4e17f8,'modelId':_0x147a56,'quickActionData':_0x4dcdb4['attributes']?.['quickActionData']}),this['currentInteraction']=_0x31c14f,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x4dcdb4['role']&&_0x31c14f)for(const _0x14b1fd of _0x4dcdb4['content']){const _0x43ee92='text'===_0x14b1fd['type']?'text-delta':'modification-delta',_0x37c490=_0x31c14f['getDocumentContext']()?.['sessionId']!==_0x4e64cd;_0x31c14f['currentReply']=_0x31c14f['createReply']({'type':_0x43ee92,'isDone':!0x0,'interactionId':_0x31c14f['id'],'areActionsDisabled':_0x37c490}),_0x31c14f['currentReply']['appendContent'](_0x14b1fd['content']);}}}async['_extractContextItems'](_0x599c38){const _0x5d9790=new Map();if(!_0x599c38['content'])return _0x5d9790;for(const _0x4a2165 of _0x599c38['content']){const _0x3b71bd=await this['chatContext']['populateFromMessage'](_0x4a2165);_0x3b71bd&&_0x5d9790['set'](_0x3b71bd['id'],_0x3b71bd);}return _0x5d9790;}async['handleUserInteraction']({userMessage:_0xf7916,quickActionData:_0x2d13f2}){if(!this['isStarted'])throw new _0x239292('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x239292('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x15fccd=this['chatContext']['getPendingContextItems'](),_0x40db6c=this['chatCapabilities']['getCapabilitiesConfig'](),_0x407237=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0xf7916,'contextItems':_0x15fccd,'capabilities':_0x40db6c,'modelId':_0x407237,'quickActionData':_0x2d13f2}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x5b9ae2){this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x5b9ae2});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x71ac31,contextItems:_0x1e269f,capabilities:_0x5cd69a,modelId:_0x353a75,quickActionData:_0x162eba}){const _0x15cdea=new Si({'userMessage':_0x71ac31,'contextItems':_0x1e269f,'capabilities':_0x5cd69a,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x353a75,'quickActionData':_0x162eba});return _0x15cdea['delegate'](...Vt)['to'](this),this['interactions']['push'](_0x15cdea),this['fire']('interactionCreated',_0x15cdea),_0x15cdea;}['getInteraction'](_0x1f9d38){return this['interactions']['find'](_0x594b27=>_0x594b27['id']===_0x1f9d38);}['removeInteraction'](_0x436901){const _0x4efa59=this['getInteraction'](_0x436901);_0x4efa59&&(_0x4efa59['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x4efa59),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x31b210){this['chatContext']['addCurrentDocumentToContext'](_0x31b210);}async['updateCurrentDocumentInContext']({content:_0x4d2953,version:_0x1e22f7,sessionId:_0x5f2052,selections:_0x4eaeb4}){await this['chatContext']['updateCurrentDocument'](_0x4d2953,_0x1e22f7,_0x5f2052,_0x4eaeb4);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x2ac2f2){this['chatContext']['addSelectionToContext'](_0x2ac2f2);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x1b880a){this['chatContext']['addFilesToContext'](_0x1b880a);}['addUrlToContext'](_0x31c42b){this['chatContext']['addUrlToContext'](_0x31c42b);}['addResourceToContext'](_0x63cce7,_0x1f8468){this['chatContext']['addResourceToContext'](_0x63cce7,_0x1f8468);}['loadSourceResources'](_0x5a891d,_0x1bc61b,_0xf0f751){return this['chatContext']['loadSourceResources'](_0x5a891d,_0x1bc61b,_0xf0f751);}['removeFromContext'](_0x5383c3){this['chatContext']['removeFromContext'](_0x5383c3);}['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'](_0x91923c){_0x91923c?!0x1===await this['chatModels']['isAvailable'](_0x91923c)&&(_0x361f9e('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x91923c}),_0x91923c=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x361f9e('ai-chat-conversation-set-model-null',{'conversation':this}),_0x91923c=(await this['chatModels']['getAvailableModels']())[0x0]),_0x91923c['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x91923c,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x91923c}));}}function P(_0x3f6750){if(_0x3f6750 instanceof st)return _0x3f6750;if(_0x3f6750?.['editors']&&_0x3f6750['editors']['get'](0x0))return _0x3f6750['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.'),_0x3f6750['editors']['get'](0x0);throw new _0x239292('ai-get-editor-from-context-no-editor');}const rt='ai-selection';class c extends _0x267838{['_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 _0x449f19=P(this['context']),_0x8d7115=_0x449f19['plugins']['has']('RealTimeCollaborationClient')&&_0x449f19['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x8d7115||_0x5ef33e();}return this['_sessionId'];}['getDocumentData'](){const _0x21947e=P(this['context']),_0x29bd48=_0x21947e['model'],_0x26cb2f=_0x21947e['data']['toView'](_0x29bd48['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x570c35=new kt(_0x21947e['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x26cb2f,_0x570c35);let _0x20d9f5=_0x21947e['data']['processor']['toData'](_0x26cb2f);const _0x55e2aa=this['_getMarkersInDocumentOrder'](),_0x143e71=[];for(const _0x50bbd6 of _0x55e2aa){const _0x59177a='<'+_0x50bbd6['name']+':start></'+_0x50bbd6['name']+':start>',_0x11174a=_0x20d9f5['indexOf'](_0x59177a);_0x20d9f5=_0x20d9f5['substring'](0x0,_0x11174a)+_0x20d9f5['substring'](_0x11174a+_0x59177a['length']);const _0x36842d='<'+_0x50bbd6['name']+':end></'+_0x50bbd6['name']+':end>',_0x38853a=_0x20d9f5['indexOf'](_0x36842d);_0x20d9f5=_0x20d9f5['substring'](0x0,_0x38853a)+_0x20d9f5['substring'](_0x38853a+_0x36842d['length']),_0x143e71['push']({'markerName':_0x50bbd6['name'],'start':_0x11174a,'end':_0x38853a,'htmlFragment':_0x20d9f5['substring'](_0x11174a,_0x38853a)});}return{'content':_0x20d9f5,'version':_0x21947e['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x143e71};}async['afterInit'](){this['context']instanceof st?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x4aa04e,_0x5831c3)=>{_0x5831c3['on']('ready',()=>{this['_integrateEditor'](_0x5831c3);});});}['_integrateEditor'](_0x51482e){_0x51482e['conversion']['for']('editingDowncast')['markerToHighlight']({'model':rt,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x51482e['conversion']['for']('dataDowncast')['markerToElement']({'model':rt,'view':(_0x170a58,{writer:_0x3f8fe7,options:_0xd0a347})=>_0xd0a347['convertAiChatSelectionMarker']?_0x3f8fe7['createUIElement'](_0x170a58['markerName']+':'+(_0x170a58['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x2bafa0,_0x5f44fd,_0x55330b=!0x1,_0x29d1c3=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x29d1c3)return!0x1;const _0xa6ae91=P(this['context'])['model'];return _0xa6ae91['change'](_0x68b17b=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x5f44fd,this['_displayedFakeSelectionLocked']=_0x55330b;let _0x143f18=0x0;for(let _0xcbc3df of _0x2bafa0){const _0x10b623=rt+':'+_0x143f18;if(_0xcbc3df['start']['isAtEnd']){const _0x43aea5=_0xcbc3df['start']['getLastMatchingPosition'](({item:_0x4631ed})=>!_0xa6ae91['schema']['isContent'](_0x4631ed),{'boundaries':_0xcbc3df});_0xcbc3df=_0x68b17b['createRange'](_0x43aea5,_0xcbc3df['end']);}_0x68b17b['addMarker'](_0x10b623,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xcbc3df}),_0x143f18++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x44e1eb){if(this['_displayedFakeSelectionId']!=_0x44e1eb)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x5c6f97=P(this['context']),_0x58a675=_0x5c6f97['model']['markers']['getMarkersGroup'](rt);return _0x5c6f97['model']['change'](_0x156fb9=>{for(const _0x31c5e7 of _0x58a675)_0x156fb9['removeMarker'](_0x31c5e7);}),!0x0;}['modelToViewWithIds'](_0x1eec6a){const _0xd84362=P(this['context']),_0x1194f2=_0xd84362['data']['toView'](_0x1eec6a),_0x269072=new kt(_0xd84362['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x1194f2,_0x269072),_0x1194f2;}['_setDataIdsOnChildren'](_0x50b562,_0x4e293b){let _0x317923=!0x1;const _0x53dcab=new Set();for(const _0x449ffc of _0x50b562['getChildren']()){const _0x5dc187=_0x449ffc['is']('emptyElement')||_0x449ffc['is']('containerElement');if(!_0x449ffc['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x449ffc,_0x4e293b)||_0x5dc187)&&(_0x4e293b['setAttribute']('data-id',this['_nextDataId'](_0x53dcab),_0x449ffc),_0x317923=!0x0);}return _0x317923;}['_nextDataId'](_0x6e8235){let _0x2006a0;do{_0x2006a0='';for(let _0x4c01e8=0x0;_0x4c01e8<0x4;_0x4c01e8++)_0x2006a0+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x6e8235['has'](_0x2006a0));return _0x6e8235['add'](_0x2006a0),_0x2006a0;}['getSelectionText'](){const {model:_0x4e2a9e}=P(this['context']),_0x49443f=_0x4e2a9e['document']['selection'],_0x381390=_0x4e2a9e['getSelectedContent'](_0x49443f),_0x2d5cbc=[],_0x44deba=_0x4e2a9e['createRangeIn'](_0x381390)['getWalker']();for(const {item:_0x261bd7}of _0x44deba)_0x261bd7['is']('$textProxy')?_0x2d5cbc['push'](_0x261bd7['data']):_0x261bd7['is']('element')&&_0x2d5cbc['length']>0x0&&'\x20'!==_0x2d5cbc[_0x2d5cbc['length']-0x1]&&_0x2d5cbc['push']('\x20');return'\x22'+_0x2d5cbc['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x54dfaa=P(this['context'])['model'];return Array['from'](_0x54dfaa['markers']['getMarkersGroup'](rt))['sort']((_0x3cedf6,_0x253e05)=>_0x3cedf6['getStart']()['isBefore'](_0x253e05['getStart']())?-0x1:_0x3cedf6['getStart']()['isAfter'](_0x253e05['getStart']())?0x1:0x0);}}const k=['applySuggestion','insertSuggestion','showChangeInText'];class nh extends _0x10aa9f{['actionsButton'];['children'];['applySuggestionModel'];['showChangeInTextModel'];['insertSuggestionModel'];['_partsCount']=0x1;['_dropdownOriginalConfig'];['_dropdownCurrentConfig'];['_firstRender']=!0x0;constructor(_0x5cca61,_0x38aa84){super(_0x5cca61),this['_dropdownOriginalConfig']=_0x38aa84||[...k],this['_dropdownCurrentConfig']=[...this['_dropdownOriginalConfig']];const _0x399354=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['applySuggestionModel']=new _0x238f2a({'label':Hn('applySuggestion',_0x5cca61,this['_partsCount']),'icon':_0x47bafa,'withText':!0x0,'type':'button','actionName':'applySuggestion'}),this['showChangeInTextModel']=new _0x238f2a({'label':Hn('showChangeInText',_0x5cca61,this['_partsCount']),'icon':_0x193385,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x238f2a({'label':Hn('insertSuggestion',_0x5cca61,this['_partsCount']),'icon':_0x87ebb0,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x5cca61),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',_0x399354['if']('isVisible','ck-hidden',_0x2b2528=>!_0x2b2528)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_dropdownCurrentConfig']=this['isTrackChangesOn']?this['_dropdownOriginalConfig']['filter'](_0x2d2e14=>'applySuggestion'!==_0x2d2e14):[...this['_dropdownOriginalConfig']],this['_updateDropdownActions'](_0x5cca61);});}['_updateDropdownActions'](_0x5cad42){this['actionsButton']&&this['children']['has'](this['actionsButton'])&&(this['children']['remove'](this['actionsButton']),this['actionsButton']['destroy']()),this['actionsButton']=this['_createActionsDropdownOrButton'](_0x5cad42),this['actionsButton']&&this['children']['add'](this['actionsButton']);}['_createActionsDropdownOrButton'](_0x32bf7a){if(0x0==this['_dropdownCurrentConfig']['length'])return null;const _0x4dd6f1=0x1===this['_dropdownCurrentConfig']['length']?this['_createActionsButton'](_0x32bf7a):this['_createActionsDropdown'](_0x32bf7a),_0x40ac17=this['_firstRender']?'':'ck-ai-chat__feed__ai-suggestion__actions--no-animation';_0x4dd6f1['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x32bf7a,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x32bf7a,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions\x20'+_0x40ac17});for(const _0x11df53 of this['_dropdownCurrentConfig'])_0x4dd6f1['on'](_0x11df53,()=>{this['fire'](_0x11df53);});return this['_firstRender']=!0x1,_0x4dd6f1;}['_createActionsButton'](_0x106a99){const _0x1c5c0b=new _0x5cde82(_0x106a99);return _0x1c5c0b['set']({'class':'ck-ai-button-primary','withText':!0x0}),_0x1c5c0b['on']('execute',()=>{_0x1c5c0b['fire'](this['_dropdownCurrentConfig'][0x0]);}),_0x1c5c0b;}['_createActionsDropdown'](_0x51b5d3){const _0x521435=new Gn(_0x51b5d3,{'listItemModels':this['_dropdownCurrentConfig']['map'](_0x1d4c95=>{switch(_0x1d4c95){case'applySuggestion':return this['applySuggestionModel'];case'showChangeInText':return this['showChangeInTextModel'];case'insertSuggestion':return this['insertSuggestionModel'];}})});return _0x521435['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x51b5d3,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x51b5d3,this['_partsCount']),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),_0x521435['bind']('isEnabled')['to'](this),_0x521435;}['updateLabels'](_0x33dd40){const _0x3055cb=this['locale'];this['_partsCount']=_0x33dd40||this['_partsCount'],this['actionsButton']['set']({'label':Hn(this['_dropdownCurrentConfig'][0x0],_0x3055cb,this['_partsCount']),'tooltip':Ln(this['_dropdownCurrentConfig'][0x0],_0x3055cb,this['_partsCount'])}),this['applySuggestionModel']['label']=Hn('applySuggestion',_0x3055cb,this['_partsCount']),this['showChangeInTextModel']['label']=Hn('showChangeInText',_0x3055cb,this['_partsCount']),this['insertSuggestionModel']['label']=Hn('insertSuggestion',_0x3055cb,this['_partsCount']);}}class Gn extends _0x1cf9f8{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x376165,_0x569528){super(_0x376165),this['balloonPanelView']=new _0x179f18(this['locale']),this['bodyCollection']=new qt(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x569528['listItemModels']['slice'](0x1)),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',C(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{const _0x180dc8=_0x569528['listItemModels'][0x0]['actionName'];this['fire'](_0x180dc8),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']?yn:Pn]}),this['listView']['focus']());}),_0x2cf367({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x2cc461){const _0x32c009=this['locale'],_0x15d826=new _0x4a219d(_0x32c009);for(const _0x2921ee of _0x2cc461){const _0x98ec9=new _0x2ced3c(_0x32c009),_0xc69ea1=new _0x993614(_0x32c009);_0xc69ea1['bind'](...Object['keys'](_0x2921ee))['to'](_0x2921ee),_0xc69ea1['delegate']('execute')['to'](_0x15d826),_0x98ec9['children']['add'](_0xc69ea1),_0x15d826['items']['add'](_0x98ec9);}return _0x15d826['items']['delegate']('execute')['to'](this),_0x15d826['on']('execute',_0x407da3=>{const _0x22de90=_0x407da3['source'];this['fire'](_0x22de90['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x15d826;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0x4c12a2(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x142a57,_0x3c6aea)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x3c6aea();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function yn(_0x3bb7b5){return{'top':_0x3bb7b5['bottom'],'left':_0x3bb7b5['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function Pn(_0x19d1e3,_0x55b259){return{'top':_0x19d1e3['bottom'],'left':_0x19d1e3['left']-(_0x55b259['width']-_0x19d1e3['width']),'name':'arrowless','config':{'withArrow':!0x1}};}function Hn(_0x257361,_0x32ca65,_0x41a28b){switch(_0x257361){case'applySuggestion':return C(_0x32ca65,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x41a28b);case'showChangeInText':return C(_0x32ca65,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x41a28b);case'insertSuggestion':return C(_0x32ca65,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x41a28b);}}function Ln(_0x750339,_0x95ce45,_0x25651e){switch(_0x750339){case'applySuggestion':return C(_0x95ce45,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x25651e);case'showChangeInText':return C(_0x95ce45,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP',_0x25651e);case'insertSuggestion':return C(_0x95ce45,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP',_0x25651e);}}class ki extends _0x7d5e47(){['_connector'];['_availableModels'];['_defaultModelId'];['_modelList']=[];constructor({connector:_0x38d9c4,availableModels:_0x10f545,defaultModelId:_0xf5b7b1}){super(),this['_connector']=_0x38d9c4,this['_availableModels']=_0x10f545,this['_defaultModelId']=_0xf5b7b1;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x57e3a8=this['_connector']['getModels'](),_0x1ac895=await _0x57e3a8['list']();this['_modelList']=_0x1ac895['items'];}catch(_0x50b12b){throw new _0x239292('ai-models-unable-to-retrieve',null,{'error':_0x50b12b});}return[...this['_modelList']];}async['getAvailableModels'](){const _0x13dbdc=await this['getAll']();return this['_filterModels'](_0x13dbdc,this['_availableModels']);}async['getModel'](_0x3b9d87){const _0x5e8a6b=await this['getAll']();if(!_0x5e8a6b['length'])return null;if(_0x3b9d87){const _0x3601ec=this['_getModelById'](_0x5e8a6b,_0x3b9d87);if(_0x3601ec)return _0x3601ec;_0x361f9e('ai-chat-model-id-unrecognized',{'modelId':_0x3b9d87,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x537a03=await this['getAvailableModels']();if(!_0x537a03['length'])return null;if(this['_defaultModelId']){const _0x1ca901=this['_getModelById'](_0x537a03,this['_defaultModelId']);if(_0x1ca901)return _0x1ca901;_0x361f9e('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x537a03[0x0]['id']});}return _0x537a03[0x0];}async['isAvailable'](_0x88e86c){return(await this['getAvailableModels']())['some'](_0x74bc1c=>_0x74bc1c['name']===_0x88e86c['name']&&_0x74bc1c['provider']===_0x88e86c['provider']);}['_filterModels'](_0x237860,_0x30b1dd){let _0x56f2b6;if(_0x30b1dd){_0x56f2b6=[];const _0x3f902c='string'==typeof _0x30b1dd?[_0x30b1dd['toLocaleLowerCase']()]:_0x30b1dd['map'](_0x39e8ec=>_0x39e8ec['toLocaleLowerCase']());for(const _0x5ddf7d of _0x3f902c)for(const _0x28abb9 of _0x237860)(_0x28abb9['id']['toLocaleLowerCase']()===_0x5ddf7d||_0x28abb9['name']['toLocaleLowerCase']()===_0x5ddf7d||Me(_0x28abb9)&&'auto'===_0x5ddf7d||_0x28abb9['provider']['toLocaleLowerCase']()===_0x5ddf7d||_0x28abb9['id']['toLocaleLowerCase']()['startsWith'](_0x5ddf7d))&&_0x56f2b6['push'](_0x28abb9);}else _0x56f2b6=_0x237860;return _0x56f2b6;}['_getModelById'](_0x19ca9e,_0x1b9e1d){return _0x19ca9e['find'](_0x30b19a=>Me(_0x30b19a)&&'auto'===_0x1b9e1d?_0x30b19a:_0x30b19a['id']===_0x1b9e1d)||null;}static['getLocalized'](_0x15456a,_0x4c3edf){return _0x4c3edf['map'](_0x53791e=>{if(Me(_0x53791e))_0x53791e['name']=C(_0x15456a,'AI_MODEL_NAME_AUTO'),_0x53791e['description']=C(_0x15456a,'AI_MODEL_DESCRIPTION_AUTO');else C(_0x15456a,'AI_MODEL_DESCRIPTION_'+_0x53791e['id']['toUpperCase']())['startsWith']('AI_MODEL_DESCRIPTION_')||(_0x53791e['description']=C(_0x15456a,'AI_MODEL_DESCRIPTION_'+_0x53791e['id']['toUpperCase']()));return _0x53791e;});}}function Me(_0x3c6def){return _0x3c6def['id']['startsWith']('agent');}class ht extends ki{async['getAll'](){return(await super['getAll']())['sort']((_0xfe339b,_0x8ed3f8)=>{const _0x18bd76=Object['values'](_0xfe339b['capabilities'])['filter'](_0x2cd860=>_0x2cd860['enabled'])['length'];return Object['values'](_0x8ed3f8['capabilities'])['filter'](_0x394656=>_0x394656['enabled'])['length']-_0x18bd76;});}}function v({editor:_0x39398f,interaction:_0x55beea,reply:_0x4e6ee9,groups:_0x3af4e0,transform:_0x4a724a,documentCompare:_0x5b67af,documentCompareOptions:_0x375ccf}){const _0x2b182f=_0x55beea['getDocumentContext']();if(!_0x2b182f)return[];const _0x5161aa=_0x2b182f['content'],_0x813d70=_0x2b182f['version'],_0x2b69f0=_0x4e6ee9['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x4307e5}of _0x3af4e0){const _0x331117=_0x4307e5['filter'](_0x229ebc=>'new'!=_0x229ebc['type'])['map'](_0x444230=>ft('data-id',_0x444230['id'],_0x2b69f0)),_0x67087e=_0x4307e5['filter'](_0x52cfb8=>'removed'!=_0x52cfb8['type'])['map'](_0x2862c6=>_0x2862c6['node']['cloneNode'](!0x0));let _0x72b782=null;if(_0x331117['length']){_0x72b782=_0x331117[0x0]['previousSibling'];for(let _0x4174f2=0x0;_0x4174f2<_0x331117['length'];_0x4174f2++)_0x5de200(_0x331117[_0x4174f2]);}if(_0x67087e['length']){_0x72b782||(_0x4307e5[0x0]['anchorId']?_0x72b782=ft('data-id',_0x4307e5[0x0]['anchorId'],_0x2b69f0):(_0x72b782=_0x67087e['shift'](),_0x10bdac(_0x2b69f0,_0x72b782)));for(let _0x16ccf5=0x0;_0x16ccf5<_0x67087e['length'];_0x16ccf5++)_0x24dd09(_0x72b782,_0x67087e[_0x16ccf5]),_0x72b782=_0x67087e[_0x16ccf5];}}const _0x1fa039=ut(_0x2b69f0),_0x72a119=_0x5b67af['getDiff'](_0x5161aa,_0x1fa039,_0x375ccf)['getOperations']();if(_0x4a724a){const _0x342b8f=_0x39398f['model']['document']['history']['getOperations'](_0x813d70),_0x418249={'document':_0x39398f['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x1c1e0c(_0x72a119,_0x342b8f,_0x418249)['operationsA'];}return _0x72a119;}function b(_0x4ffb66,_0x337ea8){if('marker'!=_0x337ea8['type'])return;const _0x5e2aef=_0x4ffb66['model']['markers']['get'](_0x337ea8['name']);_0x5e2aef&&(_0x337ea8['oldRange']=_0x5e2aef['getRange']());}class Vr extends _0x4deb4c{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x32217a,_0x8db6a8={},_0x24bdbe){super(_0x32217a),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x8db6a8};const _0x9ac7d2=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x9ac7d2?'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'](_0x24bdbe),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 _0x5cde82(this['locale']),this['likeButton']['set']({'icon':_0x5c7a21,'label':C(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x43e054=>!_0x43e054),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x5cde82(this['locale']),this['dislikeButton']['set']({'icon':_0x2b5af5,'label':C(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x3b06d6=>!_0x3b06d6),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x5cde82(this['locale']),this['copyButton']['set']({'icon':_0x5165e9,'label':C(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x5cfcfa=>!_0x5cfcfa);const _0x4f5e4e=new _0x3dad93();_0x4f5e4e['set']({'content':_0x222bf2}),_0x4f5e4e['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'](_0x4f5e4e);}['_setupShowChangesButton'](_0x2ba4b5){this['showChangesButton']=new _0x5cde82(this['locale']),this['showChangesButton']['set']({'icon':_0x17eb0a,'label':C(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'isOn':_0x2ba4b5}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x1e2526=>!_0x1e2526),this['showChangesButton']['on']('execute',()=>{const _0xdbbd05=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0xdbbd05,'icon':_0xdbbd05?_0x47c4e2:_0x17eb0a}),this['fire']('toggleShowChanges',_0xdbbd05);});}}class Lr extends _0x10aa9f{['showChangesToggleView'];constructor(_0x416bad,_0x14cc5f){super(_0x416bad),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Yr(_0x416bad),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':C(_0x416bad,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x14cc5f['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x28b81d=>_0x28b81d?_0x5f4a4e:_0x1c85b2),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x4a04d4=new _0x3dad93();_0x4a04d4['content']=_0x2cbef8,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x14cc5f['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x4a04d4,{'tag':'span','children':[C(_0x416bad,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Yr extends _0x5cde82{['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(_0x577276){this['options']={'delay':_0x577276['delay']??0x14,'textNodeStyle':_0x577276['textNodeStyle'],'onStreamUpdate':_0x577276['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x136c9a,targetElement:_0x1e0747,abortSignal:_0x16d745}){this['isStreaming']&&this['stop'](),_0x16d745?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x19eeb8(_0x136c9a,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0x361f9e('ai-html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x569369=0x0;_0x569369<this['currentIndex'];_0x569369++)this['nodesList'][_0x569369]['shouldBeStreamed']=!0x0;let _0x5b23ed=0x0;for(let _0x472962=this['currentIndex'];_0x472962<this['nodesList']['length'];_0x472962++){const _0x399a5d=Date['now'](),_0x235713=this['nodesList'][_0x472962],_0x294715=_0x399a5d-_0x5b23ed;_0x235713['shouldBeStreamed']=!0x0;let _0x847243=_0x235713['parent'];for(;_0x847243;)_0x847243['shouldBeStreamed']=!0x0,_0x847243=_0x847243['parent'];if(_0x294715<this['options']['delay'])try{const {promise:_0xb24781,abortController:_0x8b8d74}=pr(this['options']['delay']-_0x294715);this['timeoutAbortController']=_0x8b8d74,await _0xb24781;}catch(_0x3f6f53){return;}_0x2be199(_0x1e0747,'<'+_0x1e0747['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x1e0747['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x472962,_0x5b23ed=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x22fb3f}){Array['from'](_0x22fb3f['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0xe43cf9=>{_0xe43cf9['replaceWith'](_0xe43cf9['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x4653c4){let _0xc09019='';if(function(_0x2d7684){return _0x2f8491(_0x2d7684);}(_0x4653c4)){for(const _0x2ccd28 of _0x4653c4['children'])_0xc09019+=this['renderNode'](_0x2ccd28);}else{if(dr(_0x4653c4)){if(!_0x4653c4['shouldBeStreamed'])return'';const _0x17dbf9=_0x4653c4,_0x76aa8=Object['entries'](_0x17dbf9['attribs'])['map'](([_0x3f44fb,_0x2d8a67])=>_0x3f44fb+'=\x22'+_0x2d8a67+'\x22')['join']('\x20');_0xc09019+='<'+_0x17dbf9['tagName']+(_0x76aa8?'\x20'+_0x76aa8:'')+'>';for(const _0x5900bf of _0xbebafa(_0x17dbf9))_0xc09019+=this['renderNode'](_0x5900bf);_0xc09019+='</'+_0x17dbf9['tagName']+'>';}else{if(!ar(_0x4653c4))return'';if(!_0x4653c4['shouldBeStreamed'])return'';!function(_0x10b561){if(!_0x10b561['parent']||!dr(_0x10b561['parent']))return!0x1;if(!cr['includes'](_0x10b561['parent']['tagName']))return!0x1;return!_0x439ba7(_0x10b561)['match'](/^\s*[<>]\s*$/);}(_0x4653c4)?_0xc09019+=_0x259462(_0x4653c4):_0xc09019+=_0x259462(new _0x3d5305('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x4653c4]));}}return _0xc09019;}['getParsedDocumentNodeList'](){const _0x3671a4=[];return function(_0x2d56e9,_0x337e24){const _0x815526=_0xdb735c=>{if(_0x337e24(_0xdb735c),_0xdb735c instanceof _0x10a76f)for(let _0x553b3b=0x0;_0x553b3b<_0xdb735c['children']['length'];_0x553b3b++){const _0x3c7080=_0xdb735c['children'][_0x553b3b];_0x815526(_0x3c7080);}};for(let _0x345088=0x0;_0x345088<_0x2d56e9['children']['length'];_0x345088++)_0x815526(_0x2d56e9['children'][_0x345088]);}(this['document'],_0x323085=>{if(ar(_0x323085)){const _0x1f3111=this['splitTextNodeIntoWordNodes'](_0x323085);_0x1f3111['length']&&_0x3671a4['push'](..._0x1f3111);}_0x323085['isWordSplitSource']||_0x323085['isWordSplitResult']||_0x3671a4['push'](_0x323085);}),_0x3671a4;}['splitTextNodeIntoWordNodes'](_0x203f14){if(_0x203f14['isWordSplitSource']||_0x203f14['isWordSplitResult'])return[];const _0x443c70=_0x439ba7(_0x203f14)['match'](/(?:\s*\S+\s*)/g),_0x425689=[];if(_0x443c70&&_0x443c70['length']>0x1){for(const _0x110670 of _0x443c70){const _0x2d7bc8=new _0x40d4fe(_0x110670);_0x2d7bc8['isWordSplitResult']=!0x0,_0x1b3de7(_0x203f14,_0x2d7bc8),_0x425689['push'](_0x2d7bc8);}_0x203f14['isWordSplitSource']=!0x0,_0x5de200(_0x203f14);}return _0x425689;}}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(_0x3aab5d){return _0x1ddb5a(_0x3aab5d);}function dr(_0x398762){return _0x5bf45b(_0x398762);}function pr(_0x90d1e3){const _0x20ad6c=new AbortController();return{'promise':new Promise((_0x251683,_0x573442)=>{const _0x1a1a0b=setTimeout(_0x251683,_0x90d1e3);_0x20ad6c['signal']['addEventListener']('abort',()=>{clearTimeout(_0x1a1a0b),_0x573442();});}),'abortController':_0x20ad6c};}const Te=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class na extends _0x10aa9f{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x2b9b2a,{part:_0x15ceae,uiIndex:_0xae3b2,areActionsDisabled:_0x5da3b6,availableActions:_0x24008d}){super(_0x2b9b2a),this['set']('partDefinition',_0x15ceae),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x5c398b=>'pending'==_0x5c398b&&!_0x5da3b6),this['children']=this['createCollection'](),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Un(_0x2b9b2a,{'part':_0x15ceae,'uiIndex':_0xae3b2,'availableActions':_0x24008d}),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Te)['to'](this);const _0x2db124=this['bindTemplate'];this['contentView']=new _0x10aa9f(),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',_0x2db124['to']('state',_0x358c03=>'ck-ai-suggestion__body__content-part_'+_0x358c03),_0x2db124['to']('isEnabled',_0x42ce62=>_0x42ce62?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x2db124['if']('isVisible','ck-hidden',_0x564fe5=>!_0x564fe5)]},'children':this['children'],'on':{'mouseenter':_0x2db124['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x15ceae['index']});}),'mouseleave':_0x2db124['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x15ceae['index']});})}});}async['updateContent']({part:_0x1ac767,renderingStrategy:_0x343b98,showUnchangedParts:_0x6615fc=!0x1,abortSignal:_0x408540}){this['partDefinition']=_0x1ac767,this['isVisible']=this['partDefinition']['hasChanges']||_0x6615fc,this['isVisible']&&('streaming'===_0x343b98?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x408540}):this['contentView']['element']['innerHTML']=ut(this['partDefinition']['content']));}['toggleHeader'](_0x3b1da5){_0x3b1da5?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Un extends _0x10aa9f{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];['_iconStateOutdated'];constructor(_0x269885,{part:_0x32438c,uiIndex:_0x235f9b,availableActions:_0x2905cb}){super(_0x269885),this['set']('partDefinition',_0x32438c),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x478e1c=new _0x3dad93();_0x478e1c['content']=_0x3b149b,_0x478e1c['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x552738=[];if(_0x2905cb['includes']('showChangeInText')){const _0x3d7416=new _0x5cde82(_0x269885);_0x3d7416['set']({'label':C(_0x269885,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x193385}),_0x3d7416['bind']('isEnabled')['to'](this),_0x3d7416['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x32438c['index']});}),_0x552738['push'](_0x3d7416);}if(_0x2905cb['includes']('insertSuggestion')){const _0x44fce1=new _0x5cde82(_0x269885);_0x44fce1['set']({'label':C(_0x269885,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x87ebb0}),_0x44fce1['bind']('isEnabled')['to'](this),_0x44fce1['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x32438c['index']});}),_0x552738['push'](_0x44fce1);}const _0x13ee6a=new _0x5cde82(_0x269885);_0x13ee6a['set']({'label':C(_0x269885,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x449359}),_0x13ee6a['bind']('isEnabled')['to'](this),_0x13ee6a['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x32438c['index']});}),_0x552738['push'](_0x13ee6a),this['_toolbarView']=new _0x4deb4c(_0x269885),this['_toolbarView']['items']['addMany'](_0x552738),this['_iconStateAccepted']=new _0x3dad93(),this['_iconStateAccepted']['content']=_0x13c00f,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':C(_0x269885,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x3dad93(),this['_iconStateRejected']['content']=_0x5511b4,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':C(_0x269885,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}}),this['_iconStateOutdated']=new _0x3dad93(),this['_iconStateOutdated']['content']=_0x5511b4,this['_iconStateOutdated']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-outdated'],'data-cke-tooltip-text':C(_0x269885,'AI_SUGGESTION_CONTENT_PART_OUTDATED'),'data-cke-tooltip-position':'n'}});const _0x4332c6=new _0x10aa9f(_0x269885);_0x4332c6['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[C(_0x269885,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x235f9b['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x478e1c,_0x4332c6,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',(_0x160fb0,_0x5208d1,_0x2eab37,_0x550801)=>{switch(_0x550801){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(_0x2eab37){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 _0x7d5e47(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x5bcf37){const _0x2dec90=this['createTask'](_0x5bcf37);return this['queue']['push'](_0x2dec90),this['_processQueue'](),_0x2dec90['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(_0x43d7c0=>{this['once']('_queueEmpty',()=>{_0x43d7c0();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x36386b=this['queue']['shift']();try{await _0x36386b['callback'](this['_abortController']['signal']),_0x36386b['resolve']();}catch(_0x4799a5){_0x36386b['reject'](_0x4799a5);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x2b1426){let _0x27bcf0,_0x33dbe0;const _0x1b8b8d=new Promise((_0x62ee2b,_0xd33d25)=>{_0x27bcf0=_0x62ee2b,_0x33dbe0=_0xd33d25;});return{'callback':_0x2b1426,'resolve':_0x27bcf0,'reject':_0x33dbe0,'completePromise':_0x1b8b8d};}}class jr extends _0x10aa9f{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0xbab10b){super();const _0x4bca39=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']=_0xbab10b,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x4bca39['if']('isDone','ck-ai-chat__feed__item_done'),_0x4bca39['if']('isVisible','ck-hidden',_0x3322cf=>!_0x3322cf),'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'](_0x3e1a0d=>{_0x3e1a0d['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x2414e4,_0x4d9a21,_0x4bcbc2){await this['htmlStreamer']['stream']({'document':_0x2414e4,'targetElement':_0x4d9a21,'abortSignal':_0x4bcbc2});}}class _e extends jr{constructor(_0x31ee8b){super(_0x31ee8b),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-error','warning'===_0x31ee8b['level']?'ck-ai-chat-error_warning':'']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x8e1165){this['element']['innerHTML']=_0x8e1165;}}class Dr extends _0x10aa9f{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x24f408,_0xd7a9ff){super(_0x24f408);const {areActionsDisabled:_0x5ca7cf,showUnchangedParts:_0x535b18,availableActions:_0x17e266}=_0xd7a9ff;this['_areActionsDisabled']=_0x5ca7cf,this['_showUnchangedParts']=_0x535b18,this['_availableActions']=_0x17e266,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new _(),this['_emptyPartsWarningView']=new _e({'id':'empty-parts-warning','initialContent':C(_0x24f408,'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:_0x2f893a,renderingStrategy:_0x317721,abortSignal:_0x43dc95}){this['_children']['length']?_0x2f893a['forEach'](_0x24d753=>{const _0x5deb43=this['_cachedContentParts']['findIndex'](_0x4d1e86=>_0x4d1e86['index']==_0x24d753['index']);-0x1===_0x5deb43?this['_cachedContentParts']['push'](_0x24d753):this['_cachedContentParts'][_0x5deb43]=_0x24d753;}):this['_cachedContentParts']=_0x2f893a;for(const _0x3ba1a1 of _0x2f893a['filter'](_0x38cd3f=>_0x38cd3f['hasChanges']))this['_updateContentPartsPromiseQueue']['enqueue'](async _0x378a46=>{let _0x2b02e9=this['getPartView'](_0x3ba1a1['index']);_0x2b02e9||(_0x2b02e9=new na(this['locale'],{'part':_0x3ba1a1,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x2b02e9['delegate'](...Te)['to'](this),this['_children']['add'](_0x2b02e9),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x2b02e9['toggleHeader'](this['_children']['length']>0x1),await _0x2b02e9['updateContent']({'part':_0x3ba1a1,'renderingStrategy':_0x317721,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x378a46});});return _0x43dc95?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x363e87,_0x35c1df){const _0x48b050=this['getPartView'](_0x363e87);_0x48b050&&(_0x48b050['state']=_0x35c1df),this['hasPendingParts']='pending'==_0x35c1df||Array['from'](this['_children'])['some'](_0x1f5956=>'pending'==_0x1f5956['state']);}['getPartView'](_0x153987){return this['_children']['find'](_0x35773c=>_0x35773c['partDefinition']['index']==_0x153987)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x619afd=!this['_cachedContentParts']['find'](({hasChanges:_0x526440})=>_0x526440),_0x14a6de=!!this['_cachedContentParts']['find'](({hasChanges:_0x12705a})=>!_0x12705a);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x14a6de,_0x619afd?this['_emptyPartsWarningView']['setContent'](C(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](C(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x5f4f05=>_0x5f4f05['partDefinition']['hasChanges']);}}class Le extends _0x2265d2{constructor(_0x336590=void 0x0){super();const _0x3b6aa9=_0x336590?'ck-ai-spinner_'+_0x336590:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x3b6aa9]}});}}class e extends _0x10aa9f{['bodyView'];['miniToolbarView'];['children'];['headerView'];['loaderView'];['errorView'];['sourcesView'];constructor(_0x31288c,_0x1ec2d1){super(_0x31288c);const {showDiff:_0x2eae21,areActionsDisabled:_0x409f43,miniToolbarConfig:_0x3acef3,hideHeader:_0x2dd0f5,showLoader:_0x2ec528,showUnchangedParts:_0x53760f,availableActions:_0x3398d6}=_0x1ec2d1;this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x2ec528),this['set']('isErrorVisible',!0x1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x2dd0f5||(this['headerView']=new Lr(_0x31288c,{'showDiff':_0x2eae21}),this['headerView']['on']('toggleShowChanges',(_0x5ecd62,_0x473fcc)=>{this['areChangesVisible']=_0x473fcc['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x473fcc['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new Dr(_0x31288c,{'areActionsDisabled':_0x409f43,'showUnchangedParts':!!_0x53760f,'availableActions':_0x3398d6}),this['bodyView']['delegate'](...Te)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden'),this['bindTemplate']['if']('isErrorVisible','ck-hidden')]}}),this['miniToolbarView']=new Vr(_0x31288c,_0x3acef3,_0x2eae21),this['miniToolbarView']['delegate'](...Te)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x5cb244,_0x3e971a)=>{this['areChangesVisible']=_0x3e971a,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x3e971a});}),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']),_0x2ec528&&(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'](_0x43a208){await this['bodyView']['updateContentParts'](_0x43a208);}['updateSources'](_0x185b9a){this['sourcesView']['children']['addMany'](_0x185b9a['map'](_0x3d8db4=>new Fr(this['locale'],_0x3d8db4))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['showError'](_0xae6894){if(this['errorView']){const _0x3c1933=this['errorView']['element']?.['querySelector']('.ck-ai-suggestion__error-text');_0x3c1933&&(_0x3c1933['textContent']=_0xae6894),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'](_0x37d03a){this['miniToolbarView']['items']['add'](_0x37d03a);}['removeNavigationItem'](_0x2603d6){this['miniToolbarView']['items']['remove'](_0x2603d6);}['_createLoaderView'](){const _0xa08ff=new _0x10aa9f(this['locale']),_0x359aa1=new Le('small');_0x359aa1['isVisible']=!0x0;const _0x1a1ab6=new _0x10aa9f(this['locale']);return _0x1a1ab6['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[C(this['locale'],'AI_CHAT_IS_WRITING')]}),_0xa08ff['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x5e71c2=>!_0x5e71c2)]},'children':[_0x359aa1,_0x1a1ab6]}),_0xa08ff;}['_createErrorView'](){const _0x461f84=new _0x10aa9f(this['locale']),_0x46ece4=new _0x10aa9f(this['locale']);return _0x46ece4['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[C(this['locale'],'AI_CHAT_GENERIC_ERROR')]}),_0x461f84['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0x254118=>!_0x254118)]},'children':[_0x46ece4]}),_0x461f84;}}class Sr extends _0x10aa9f{['children'];constructor(_0x3c97c8){super(_0x3c97c8),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',_0x142e0e=>!_0x142e0e)]},'children':this['children']});const _0x27a8c4=new _0x10aa9f(this['locale']),_0x27b1f7=new _0x3dad93();_0x27b1f7['content']=_0x340ab6,_0x27a8c4['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x27b1f7,{'tag':'span','children':[{'text':C(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x27a8c4);}}class Fr extends _0x5cde82{constructor(_0x3acdfa,_0x448d89){super(_0x3acdfa),this['set']({'label':_0x448d89['title'],'tooltip':_0x448d89['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x13199b=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x13199b['to'](()=>{window['open'](_0x448d89['url'],'_blank');})}}),_0x448d89['favicon']){const _0x389ed4=new _0x10aa9f(_0x3acdfa);_0x389ed4['setTemplate']({'tag':'img','attributes':{'src':_0x448d89['favicon']||_0x340ab6,'alt':_0x448d89['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x389ed4);}else this['set']('icon',_0x340ab6);}}class es extends _0x4deb4c{constructor(_0x46fe46,_0x54fd9e=!0x0,_0xfae7a5=!0x0){super(_0x46fe46),this['set']('isLoading',!0x1),_0x54fd9e&&(this['applyButton']=this['_createButton'](C(_0x46fe46,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x1f5a59=>!_0x1f5a59),this['items']['add'](this['applyButton'])),_0xfae7a5&&(this['suggestButton']=this['_createButton'](C(_0x46fe46,'AI_BALLOON_SUGGEST_BUTTON'),_0x54fd9e?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0xc8d828=>!_0xc8d828),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x30a0e7,_0x7492b5){const _0x55c731=new _0x5cde82(this['locale']);return _0x55c731['set']({'label':_0x30a0e7,'class':_0x7492b5||'','isVisible':!0x0,'withText':!0x0}),_0x55c731;}}class os extends _0x10aa9f{constructor(_0x3fe9e0){super(_0x3fe9e0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':C(_0x3fe9e0,'AI_DISCLAIMER_TEXT')}]}]});}}const O=['applySuggestion','insertSuggestion','showNext','showPrevious'];class R extends _0x10aa9f{['focusTracker'];['keystrokes'];['focusCycler'];['_availableActions'];['_focusables'];['_errorView'];constructor(_0xdde84,_0x2c4d4e,_0x5b4f4b,_0x317ac9){super(_0xdde84),this['_availableActions']=_0x5b4f4b,this['set']('isLoading',!0x1),this['set']('isTrackChangesOn',_0x317ac9),this['set']('isErrorVisible',!0x1),this['set']('errorMessage',''),this['focusTracker']=new ts(),this['keystrokes']=new _0x4c12a2(),this['_focusables']=this['createCollection'](),this['focusCycler']=new $t({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x285700(),this['_addContentView'](_0x2c4d4e['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x2c4d4e['showApplyButton'],_0x2c4d4e['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'](_0x2c4d4e['showApplyButton'],_0x2c4d4e['showSuggestButton']);});}['render'](){super['render']();for(const _0x5ed9c3 of this['_focusables'])this['focusTracker']['add'](_0x5ed9c3['element']);this['keystrokes']['listenTo'](this['element']);}['focus'](_0x1eff23){-0x1===_0x1eff23?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['showError'](_0x47e3f8){this['_errorView']||(this['_errorView']=this['_createErrorView'](),this['_dialogContent']['addMany']([this['_errorView']],0x0)),this['errorMessage']=_0x47e3f8,this['isErrorVisible']=!0x0;}['hideError'](){this['isErrorVisible']=!0x1;}['showRecoverableError'](_0x41cd08){this['showError'](_0x41cd08);}['showBlockingError'](_0x4dd824){this['showError'](_0x4dd824),this['toolbar']&&(this['toolbar']['applyButton']&&(this['toolbar']['applyButton']['isEnabled']=!0x1),this['toolbar']['suggestButton']&&(this['toolbar']['suggestButton']['isEnabled']=!0x1));}['setupRotator'](_0x5df8f2){const _0x4a0e29=this['_createNextButtonView'](),_0x361aab=this['_createPreviousButtonView']();_0x5df8f2['view']['headerView']['children']['add'](_0x4a0e29,0x2),_0x5df8f2['view']['headerView']['children']['add'](_0x361aab,0x0),this['_focusables']['addMany']([_0x4a0e29,_0x361aab]),this['focusTracker']['add'](_0x4a0e29['element']),this['focusTracker']['add'](_0x361aab['element']);}['_addContentView'](_0x434f28){this['_mainView']=_0x434f28,this['_dialogContent']['add'](this['_mainView']);}['updateContent'](_0x3af4f8){const _0x9bba30=this['_dialogContent']['getIndex'](this['_mainView']);this['_dialogContent']['remove'](this['_mainView']),this['_mainView']=_0x3af4f8,this['_dialogContent']['add'](this['_mainView'],_0x9bba30),this['hideError']();}['_addDisclaimerView'](){this['disclaimerView']=new os(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0xe5a2ed=!0x0,_0x5ee75f=!0x0){_0xe5a2ed=_0xe5a2ed&&!this['isTrackChangesOn']&&this['_availableActions']['includes']('applySuggestion'),_0x5ee75f=_0x5ee75f&&this['_availableActions']['includes']('insertSuggestion'),this['toolbar']=new es(this['locale'],_0xe5a2ed,_0x5ee75f),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x197337=new _0x5cde82(this['locale']);return _0x197337['set']({'icon':_0x1524bc,'tooltip':C(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x197337['on']('execute',()=>{this['fire']('showNext');}),_0x197337;}['_createPreviousButtonView'](){const _0x3218c3=new _0x5cde82(this['locale']);return _0x3218c3['set']({'icon':_0x52404d,'tooltip':C(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x3218c3['on']('execute',()=>{this['fire']('showPrevious');}),_0x3218c3;}['_createErrorView'](){const _0x3b185d=new _0x10aa9f(this['locale']),_0x41ab94=new _0x10aa9f(this['locale']);return _0x41ab94['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('errorMessage')}]}),_0x3b185d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ai-balloon-error',this['bindTemplate']['if']('isErrorVisible','ck-hidden',_0xf6eb1a=>!_0xf6eb1a)]},'children':[_0x41ab94]}),_0x3b185d;}}const x=0xa;class w extends _0x267838{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'](_0x5ee860){const _0xe7e861=P(this['context']);if(this['_config']=_0x5ee860,this['isOpen'])return void this['_updateBalloon'](_0x5ee860);const _0x3be58d=this['context']['config']['get']('ai.availableReplyActions')||[...k],_0x13ead7=_0xe7e861?.['commands']['get']('trackChanges'),_0x10ad18=_0x13ead7?.['value'];this['balloonView']=new R(_0xe7e861['locale'],_0x5ee860,_0x3be58d,!!_0x10ad18),this['balloonView']['delegate'](...O)['to'](this),_0x13ead7&&this['balloonView']['bind']('isTrackChangesOn')['to'](_0x13ead7,'value'),this['_showDialog'](_0x5ee860);}['close'](){P(this['context'])['plugins']['get']('Dialog')['hide']();}['_updateBalloon'](_0x13509b){const _0x37597b=P(this['context']),_0x2a0a58=_0x37597b['plugins']['get']('Dialog');this['_pendingRenderCallback']&&(_0x37597b['editing']['view']['off']('render',this['_pendingRenderCallback']),this['_pendingRenderCallback']=null),this['_isUpdatingMarkers']=!0x0,_0x2a0a58['view']?.['headerView']&&(_0x2a0a58['view']['headerView']['label']=_0x13509b['title'],_0x2a0a58['view']['headerView']['iconView']&&_0x13509b['icon']&&(_0x2a0a58['view']['headerView']['iconView']['content']=_0x13509b['icon'])),this['balloonView']['updateContent'](_0x13509b['mainView']),this['_setupVisualSelection'](_0x13509b['ranges'],_0x13509b['index']),this['_pendingRenderCallback']=()=>{this['_isUpdatingMarkers']=!0x1,this['_pendingRenderCallback']=null,_0x2a0a58['view']&&_0x2a0a58['view']['updatePosition']();},_0x37597b['editing']['view']['once']('render',this['_pendingRenderCallback']);}['_setupVisualSelection'](_0x16ee83,_0xd90fb9){this['context']['plugins']['get'](c)['showFakeVisualSelection'](_0x16ee83,'ai-balloon-'+_0xd90fb9,!0x0,!0x0);}['_showDialog'](_0x49abba){const _0x50a869=P(this['context']);this['_setupVisualSelection'](_0x49abba['ranges'],_0x49abba['index']);const _0x2226b1=this['_getSelectionElements']();_0x2226b1&&_0x2226b1[0x0]&&_0x10737b({'target':_0x2226b1[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),_0x50a869['plugins']['get']('Dialog')['show']({'title':_0x49abba['title'],'icon':_0x49abba['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x49abba['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x9aab9c=>{_0x49abba['showRotator']&&this['balloonView']['setupRotator'](_0x9aab9c),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'](_0x408e7a,_0x28447b){if(!_0x28447b)return null;const _0x271952=this['_getSelectionElements']();if(!_0x271952||0x0===_0x271952['length'])return{'left':Math['round'](_0x28447b['left']+_0x28447b['width']/0x2-_0x408e7a['width']/0x2),'top':Math['round'](_0x28447b['top']+_0x28447b['height']/0x2-_0x408e7a['height']/0x2)};const _0x30d8a3=Math['round'](_0x28447b['left']+_0x28447b['width']/0x2-_0x408e7a['width']/0x2),_0x2f715a=new _0x507e52(_0x271952[0x0]),_0xf9a1ff=new _0x507e52(_0x271952[_0x271952['length']-0x1]),_0x2bc049=_0x408e7a['height'],_0x1f8f52=this['_config']['showRotator']?0x8:0x0;return{'left':_0x30d8a3,'top':this['_calculateOptimalTopPosition'](_0x2f715a,_0xf9a1ff,_0x2bc049,_0x1f8f52,_0x28447b)};}['_calculateOptimalTopPosition'](_0x2c29b3,_0x32916b,_0x3effaa,_0x2add18=0x0,_0x54bd96){const _0x115725=_0x3effaa+_0x2add18,_0x452a5c=new _0x507e52(_0x218ca6['window']),_0x160db2=[_0x2c29b3['getVisible'](),_0x32916b['getVisible']()]['filter'](_0x3fa1df=>_0x3fa1df),_0x1b9a8c=_0x507e52['getBoundingRect'](_0x160db2);if(!_0x1b9a8c)return Math['round'](_0x54bd96['top']+_0x54bd96['height']/0x2);const _0x42074a=_0x452a5c['getIntersection'](_0x1b9a8c);if(!_0x42074a)return Math['round'](_0x54bd96['top']+_0x54bd96['height']/0x2);const _0x20ea33=_0x54bd96['getVisible'](),_0x1938f3=_0x20ea33&&_0x1b9a8c['height']>_0x20ea33['height'],_0x255952=_0x42074a['top'],_0x3c5765=_0x42074a['bottom'];if(_0x1938f3){const _0x3f095b=(_0x20ea33||_0x452a5c)['height']/0x2-_0x115725/0x2,_0x9a7f56=_0x255952-x-_0x54bd96['top'],_0x468720=_0x54bd96['bottom']-_0x3c5765-x;return _0x9a7f56>=_0x115725?Math['max'](x,_0x255952-_0x115725-x):_0x468720>=_0x115725?_0x3c5765+x:Math['max'](x,_0x3f095b);}const _0x106e19=_0x255952-_0x115725,_0xc83448=_0x54bd96['bottom']-_0x3c5765-x,_0x3fcab9=_0x255952-x-_0x54bd96['top'];let _0xb69937;if(_0xc83448>=_0x115725)_0xb69937=_0x3c5765+x;else{if(_0x3fcab9>=_0x115725)_0xb69937=_0x106e19-x;else _0xb69937=_0x255952+_0x1b9a8c['height']/0x2-_0x115725/0x2;}return _0xb69937;}['_setupMarkerRemovalListener'](){const _0x4e831c=P(this['context']);this['listenTo'](_0x4e831c['model']['document'],'change',()=>{if(this['_isUpdatingMarkers'])return;for(const {name:_0x656f2b,data:{newRange:_0x1a487c}}of _0x4e831c['model']['document']['differ']['getChangedMarkers']())if(_0x656f2b['startsWith']('ai-selection:')&&(_0x1a487c&&(_0x1a487c['start']['isEqual'](_0x1a487c['end'])||'$graveyard'==_0x1a487c['root']['rootName'])||null==_0x1a487c)){const _0x496a88=C(this['context']['locale'],'AI_ACTIONS_SELECTION_REMOVED_ERROR');this['balloonView']['showBlockingError'](_0x496a88),this['fire']('selectionRemoved');}});}['_cleanupMarkerRemovalListener'](){const _0x4153a2=P(this['context']);this['stopListening'](_0x4153a2['model']['document']);}['_getSelectionElements'](){const _0x168537=P(this['context']);return _0x27098b(_0x168537['editing'],[..._0x168537['model']['markers']['getMarkersGroup']('ai-selection'),..._0x168537['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class tt extends _0x267838{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[s,w,_0x4176c6];}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 ht({'connector':this['_aiConnector'],'availableModels':this['context']['config']['get']('ai.chat.models.displayedModels'),'defaultModelId':this['context']['config']['get']('ai.chat.models.defaultModelId')});const _0x2b845b=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x53348e,_0x3b0f68)=>{this['_handleUIUserMessage']({'userMessage':_0x3b0f68});}),this['listenTo'](_0x2b845b,'resizedTabs',(_0x471f94,_0x289b67)=>{this['_setIsMaximized'](_0x289b67);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x2b845b['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0xdf7c7a,_0xe325ca)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0xe325ca));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x5046a8,_0x445d46)=>{this['activeConversation']?.['addUrlToContext'](_0x445d46);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x457571,_0x5cf6e9)=>{this['activeConversation']?.['addResourceToContext'](_0x5cf6e9['source'],_0x5cf6e9['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0xec8a0e,_0x38cc29)=>{this['_removeFromContext'](_0x38cc29);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x4207ee,_0x520d70)=>{this['activeConversation']?.['loadSourceResources'](_0x520d70['sourceId'],_0x520d70['query'],_0x520d70['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x943f9a,_0x1cbd48)=>{this['activeConversation']?.['setModel'](_0x1cbd48);}),this['listenTo'](this['_aiChatUi'],'like',(_0xf54f6c,{replyId:_0x4f1dad})=>{console['log']('Liked\x20response',_0x4f1dad);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x383e49,{replyId:_0x2cb04d})=>{console['log']('Disliked\x20response',_0x2cb04d);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x452c2a,_0x2ade5a)=>{this['context']['plugins']['get'](w)['close'](),this['_insertSuggestion'](_0x2ade5a);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x533e1c,{replyId:_0x4ad0e2,partIndex:_0x1ce715})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x4ad0e2,_0x1ce715);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x440e75,{replyId:_0x49337d,partIndex:_0x1ce847})=>{const _0x4bd65f=this['_getDocumentRangeForReplyChanges'](_0x49337d,_0x1ce847);_0x4bd65f&&'$graveyard'!=_0x4bd65f['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x4bd65f['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0xcfd308,_0x32d8dc)=>{this['context']['plugins']['get'](w)['close'](),this['_applySuggestion'](_0x32d8dc);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x4066a7,{replyId:_0x1eb5d8,showDiff:_0x7df8e6})=>{const {reply:_0x398ef8}=this['getInteractionAndReplyById'](_0x1eb5d8),_0x336bb2=_0x398ef8['getContentParts']({'showDiff':_0x7df8e6});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x398ef8['id'],'parts':_0x336bb2,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x527d1b,{replyId:_0x3c6ab2,partIndex:_0x328acb})=>{this['_previewedChangeGroup']?.['replyId']==_0x3c6ab2&&this['_previewedChangeGroup']?.['partIndex']==_0x328acb&&this['context']['plugins']['get'](w)['close']();const {reply:_0x175414}=this['getInteractionAndReplyById'](_0x3c6ab2);_0x175414['setChangeGroupState'](_0x328acb,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof st?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x179793,_0x441891)=>{_0x441891['on']('ready',()=>{this['_integrateEditor'](_0x441891);});}),await this['_startConversationSafely']();}['_insertSuggestion'](_0x7eb48e){const _0x2e19df=P(this['context']);if(!_0x2e19df['plugins']['has']('TrackChanges'))throw new _0x239292('ai-no-track-changes',null);const _0x27045c=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x4c822b,interaction:_0x4e8610}=this['getInteractionAndReplyById'](_0x7eb48e['replyId']),_0x1d44b9=this['_getDocumentRangeForReplyChanges'](_0x7eb48e['replyId'],_0x7eb48e['partIndex']),_0x72c1de=void 0x0!==_0x7eb48e['partIndex']?[_0x4c822b['changeGroups'][_0x7eb48e['partIndex']]]:_0x4c822b['changeGroups']['filter'](_0x7648c4=>'pending'==_0x7648c4['state']),_0x18300c=_0x72c1de['map'](_0x2ac13e=>_0x4c822b['changeGroups']['indexOf'](_0x2ac13e));if(!_0x1d44b9||'$graveyard'==_0x1d44b9['range']['root']['rootName'])return void _0x18300c['forEach'](_0x3be6b3=>_0x4c822b['setChangeGroupState'](_0x3be6b3,'outdated'));_0x18300c['forEach'](_0x58d439=>_0x4c822b['setChangeGroupState'](_0x58d439,'accepted'));const _0x30c79a=v({'editor':_0x2e19df,'reply':_0x4c822b,'interaction':_0x4e8610,'groups':_0x72c1de,'transform':!0x0,'documentCompare':_0x27045c,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x29e5ca;_0x1d44b9&&this['_scrollToSuggestionRange'](_0x1d44b9['range']),_0x2e19df['model']['change'](_0x4c3258=>{_0x29e5ca=_0x4c3258['batch'],_0x2e19df['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x30c79a),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x29e5ca,{'interactionId':_0x4e8610['id'],'replyId':_0x4c822b['id'],'indexes':_0x18300c['slice']()}),this['_updateRatings'](_0x4c822b);}['_applySuggestion'](_0x298f9a){const _0x57f981=P(this['context']),_0x4afef5=this['context']['plugins']['get'](_0x4176c6),{reply:_0x113abf,interaction:_0x2a79c8}=this['getInteractionAndReplyById'](_0x298f9a['replyId']),_0xc820c4=this['_getDocumentRangeForReplyChanges'](_0x298f9a['replyId'],_0x298f9a['partIndex']),_0x544146=void 0x0!==_0x298f9a['partIndex']?[_0x113abf['changeGroups'][_0x298f9a['partIndex']]]:_0x113abf['changeGroups']['filter'](_0x379d80=>'pending'==_0x379d80['state']),_0x394b0e=_0x544146['map'](_0x30d615=>_0x113abf['changeGroups']['indexOf'](_0x30d615));if(!_0xc820c4||'$graveyard'==_0xc820c4['range']['root']['rootName'])return void _0x394b0e['forEach'](_0x4e3788=>_0x113abf['setChangeGroupState'](_0x4e3788,'outdated'));_0x394b0e['forEach'](_0x10eb85=>_0x113abf['setChangeGroupState'](_0x10eb85,'accepted'));const _0x4744dd=v({'editor':_0x57f981,'reply':_0x113abf,'interaction':_0x2a79c8,'groups':_0x544146,'transform':!0x0,'documentCompare':_0x4afef5,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x4b6292;_0xc820c4&&this['_scrollToSuggestionRange'](_0xc820c4['range']),_0x57f981['model']['change'](_0x5a2ebb=>{_0x4b6292=_0x5a2ebb['batch'];for(const _0x8f0cb2 of _0x4744dd)_0x8f0cb2['baseVersion']=_0x57f981['model']['document']['version'],b(_0x57f981,_0x8f0cb2),_0x5a2ebb['batch']['addOperation'](_0x8f0cb2),_0x57f981['model']['applyOperation'](_0x8f0cb2);}),this['_batchToChanges']['set'](_0x4b6292,{'interactionId':_0x2a79c8['id'],'replyId':_0x113abf['id'],'indexes':_0x394b0e['slice']()}),this['_updateRatings'](_0x113abf);}['_openBalloonFor'](_0x1944c8,_0x120e12){const _0x128c46=P(this['context']),_0x2fe2ec=this['_getDocumentRangeForReplyChanges'](_0x1944c8,_0x120e12),_0x149075=this['context']['plugins']['get'](w);if(!_0x2fe2ec)return void _0x149075['close']();const {range:_0x583a22,currentIndex:_0x557048}=_0x2fe2ec;if('$graveyard'==_0x583a22['root']['rootName']){const {reply:_0x30bd27}=this['getInteractionAndReplyById'](_0x1944c8);return _0x30bd27['setChangeGroupState'](_0x557048,'outdated'),void _0x149075['close']();}if(this['_previewedChangeGroup']?.['replyId']==_0x1944c8&&this['_previewedChangeGroup']?.['partIndex']==_0x557048)return;this['stopListening'](_0x149075),this['_previewedChangeGroup']={'replyId':_0x1944c8,'partIndex':_0x557048};let _0x24d1a5=_0x128c46['config']['get']('ai.availableReplyActions')||[...k];_0x128c46['plugins']['has']('TrackChanges')||(_0x24d1a5=_0x24d1a5['filter'](_0x4fc299=>'insertSuggestion'!=_0x4fc299));const _0x1398c1=new e(_0x128c46['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0,'availableActions':_0x24d1a5});this['stopListening'](_0x1398c1);const {reply:_0x4869e9}=this['getInteractionAndReplyById'](_0x1944c8),_0x481b43=_0x4869e9['getContentParts']({'showDiff':this['_balloonShowDiff']})['filter'](_0x3f970d=>_0x3f970d['hasChanges']),_0x29377e=_0x481b43['findIndex'](_0x1abdf8=>_0x1abdf8['index']==_0x557048);if(-0x1==_0x29377e)return;const _0x1d910a=_0x481b43[_0x29377e],_0x1f585e=_0x481b43['at']((_0x29377e-0x1)%_0x481b43['length'])?.['index'],_0x587b9b=_0x481b43['at']((_0x29377e+0x1)%_0x481b43['length'])?.['index'];_0x1398c1['updateContent']({'parts':[_0x1d910a],'renderingStrategy':'static'});const _0x569ec4=_0x557048!==_0x1f585e;this['_scrollToSuggestionRange'](_0x583a22,!0x0),_0x149075['open']({'index':_0x557048,'title':C(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x29377e+0x1)['toString']()),'icon':Ct,'mainView':_0x1398c1,'showRotator':_0x569ec4,'showApplyButton':!0x0,'showSuggestButton':_0x128c46['plugins']['has']('TrackChanges'),'ranges':[_0x583a22]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x1944c8,_0x557048),this['listenTo'](_0x1398c1,'toggleSuggestionDisplayMode',(_0x18a603,{showDiff:_0x49ac91})=>{this['_balloonShowDiff']=_0x49ac91;const {reply:_0x1ae521}=this['getInteractionAndReplyById'](_0x1944c8),_0x441949=_0x1ae521['getContentParts']({'showDiff':_0x49ac91,'groupIndex':_0x557048});_0x1398c1['updateContent']({'parts':_0x441949,'renderingStrategy':'static'});}),this['listenTo'](_0x149075,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x1944c8,'partIndex':_0x557048}),_0x569ec4?this['_openBalloonFor'](_0x1944c8,_0x587b9b):_0x149075['close']();}),this['listenTo'](_0x149075,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x1944c8,'partIndex':_0x557048}),_0x569ec4?this['_openBalloonFor'](_0x1944c8,_0x587b9b):_0x149075['close']();}),_0x569ec4&&(this['listenTo'](_0x149075,'showNext',()=>{this['_openBalloonFor'](_0x1944c8,_0x587b9b);}),this['listenTo'](_0x149075,'showPrevious',()=>{this['_openBalloonFor'](_0x1944c8,_0x1f585e);})),this['listenTo'](_0x149075,'dialogClosed',()=>{this['stopListening'](_0x149075),this['stopListening'](_0x1398c1),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x338c37,_0x3cb1e8){const _0x3a1679=P(this['context']),{reply:_0x53697c,interaction:_0x1f2d57}=this['getInteractionAndReplyById'](_0x338c37),_0x3af9e9=_0x53697c['changeGroups']['filter'](_0x342750=>'pending'==_0x342750['state']),_0xecba2f=_0x3af9e9['map'](_0xc1063c=>_0x53697c['changeGroups']['indexOf'](_0xc1063c));void 0x0===_0x3cb1e8&&(_0x3cb1e8=_0xecba2f[0x0]);const _0x434b2c=_0xecba2f['indexOf'](_0x3cb1e8);if(-0x1==_0x434b2c)return null;const _0x58f83a=_0x3af9e9[_0x434b2c],_0x37b01f=new mt([]),_0x11ead2=new mt([]);for(const _0xf9cae3 of _0x58f83a['changes'])if('removed'!=_0xf9cae3['type']&&_0x11ead2['children']['push'](_0xf9cae3['node']['cloneNode'](!0x0)),'new'!=_0xf9cae3['type']){const _0xccb89d=gt(_0x31de12=>pt(_0x31de12,'data-id')==_0xf9cae3['id'],_0x53697c['documentContextContent'],!0x0);_0x37b01f['children']['push'](_0xccb89d['cloneNode'](!0x0));}if(0x0==_0x37b01f['children']['length']){if(_0x58f83a['changes'][0x0]['anchorId']){const _0x3de10d=ft('data-id',_0x58f83a['changes'][0x0]['anchorId'],_0x53697c['documentContextContent']);_0x37b01f['children']['unshift'](_0x3de10d['cloneNode'](!0x0)),_0x11ead2['children']['unshift'](_0x3de10d['cloneNode'](!0x0)),_0x3de10d['nextSibling']&&(_0x37b01f['children']['push'](_0x3de10d['nextSibling']['cloneNode'](!0x0)),_0x11ead2['children']['push'](_0x3de10d['nextSibling']['cloneNode'](!0x0)));}else{const _0x54881a=_0x53697c['documentContextContent']['children'][0x0];if(!_0x54881a)return null;_0x37b01f['children']['push'](_0x54881a['cloneNode'](!0x0)),_0x11ead2['children']['push'](_0x54881a['cloneNode'](!0x0));}}const _0x48e2bf=_0x1f2d57['getDocumentContext'](),_0x1a5556=_0x3a1679['data']['parse'](_0x48e2bf['content']),_0x268009=ut(_0x37b01f),_0x4c3691=_0x3a1679['data']['parse'](_0x268009),_0x2e55e0=_0x3a1679['data']['parse'](_0x268009),_0x5eff2e=_0x3a1679['model']['createPositionAt'](_0x4c3691,0x0),_0x547914=ut(_0x11ead2),_0xff4086={'anchor':_0x5eff2e,'markDeletions':!0x1},_0x47caa8=_0x3a1679['plugins']['get'](_0x4176c6)['getDiff'](_0x268009,_0x547914,_0xff4086)['getOperations']();if(!_0x47caa8['length'])return null;_0x3a1679['model']['change'](_0x4c6edc=>{for(const _0x499a07 of _0x47caa8)if('remove'==_0x499a07['type']){const _0x24d7a2=_0x499a07['sourcePosition'],_0x264a40=_0x499a07['howMany'],_0x58435b=new _0x207911(_0x24d7a2,_0x264a40);_0x4c6edc['batch']['addOperation'](_0x58435b),_0x3a1679['model']['applyOperation'](_0x58435b);}else'marker'!==_0x499a07['type']&&(_0x499a07['baseVersion']=null,_0x499a07['isDocumentOperation']=!0x1,_0x4c6edc['batch']['addOperation'](_0x499a07),_0x3a1679['model']['applyOperation'](_0x499a07));});const _0x308ec7=lt(_0x3a1679,_0x47caa8,_0x4c3691);dt(_0x3a1679['model'],_0x308ec7);const _0x40c973=_0x308ec7['getFirstRange']()['start']['path']['slice'](),_0x33c26c=_0x308ec7['getFirstRange']()['end']['path']['slice'](),_0x35135b=[];let _0x4ccead=_0x4c3691,_0x346d8c=_0x2e55e0;for(let _0x327608=0x0;_0x327608<_0x33c26c['length'];_0x327608++){const _0x33ae68=_0x4ccead['maxOffset']-_0x33c26c[_0x327608];_0x35135b[_0x327608]=_0x346d8c['maxOffset']-_0x33ae68,_0x4ccead=_0x4ccead['getChildAtOffset'](_0x33c26c[_0x327608]),_0x346d8c=_0x346d8c['getChildAtOffset'](_0x35135b[_0x327608]);}const _0x5673d7=_0x3a1679['model']['createRange'](_0x3a1679['model']['createPositionFromPath'](_0x2e55e0,_0x40c973),_0x3a1679['model']['createPositionFromPath'](_0x2e55e0,_0x35135b)),_0x17f617=_0x2e55e0['getChild'](0x0)['getAttribute'](ct),_0x464e43=Array['from'](_0x1a5556['getChildren']())['find'](_0x35ec54=>_0x35ec54['getAttribute'](ct)==_0x17f617)['getPath'](),_0x526ada=_0x5673d7['start']['path']['slice'](),_0x461208=_0x5673d7['end']['path']['slice']();_0x526ada[0x0]=_0x464e43[0x0]+_0x526ada[0x0],_0x461208[0x0]=_0x464e43[0x0]+_0x461208[0x0];let _0x299b75=_0x3a1679['model']['createRange'](_0x3a1679['model']['createPositionFromPath'](_0x3a1679['model']['document']['getRoot'](),_0x526ada),_0x3a1679['model']['createPositionFromPath'](_0x3a1679['model']['document']['getRoot'](),_0x461208));const _0x44e674=_0x3a1679['model']['document']['history']['getOperations'](_0x48e2bf['version']);for(const _0x5cd8ce of _0x44e674)_0x299b75=_0x473568['_createFromRanges'](_0x299b75['getTransformedByOperation'](_0x5cd8ce));return{'range':_0x299b75,'currentIndex':_0x3cb1e8};}['_integrateEditor'](_0x2b2ce2){if(!_0x2b2ce2['plugins']['has']('Undo'))return;const _0x154977=_0x2b2ce2['commands']['get']('undo'),_0x55a980=_0x2b2ce2['commands']['get']('redo');this['listenTo'](_0x154977,'revert',(_0x28c74b,_0x38d6da,_0x3d2748)=>{const _0x22c4c6=this['_batchToChanges']['get'](_0x38d6da);if(!_0x22c4c6)return;const _0x5f54db=this['activeConversation']['getInteraction'](_0x22c4c6['interactionId'])['getReply'](_0x22c4c6['replyId']);_0x22c4c6['indexes']['forEach'](_0x4ac283=>_0x5f54db['setChangeGroupState'](_0x4ac283,'pending')),this['_batchToChanges']['delete'](_0x38d6da),this['_batchToChanges']['set'](_0x3d2748,_0x22c4c6);}),this['listenTo'](_0x55a980,'revert',(_0xc6d193,_0x39dcd7,_0x243edf)=>{const _0x2e944e=this['_batchToChanges']['get'](_0x39dcd7);if(!_0x2e944e)return;const _0x38535f=this['activeConversation']['getInteraction'](_0x2e944e['interactionId'])['getReply'](_0x2e944e['replyId']);_0x2e944e['indexes']['forEach'](_0x2ea2a2=>_0x38535f['setChangeGroupState'](_0x2ea2a2,'accepted')),this['_batchToChanges']['delete'](_0x39dcd7),this['_batchToChanges']['set'](_0x243edf,_0x2e944e);});}async['loadConversation'](_0x5779df){this['context']['plugins']['get'](w)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{const _0x44ac26=this['context']['plugins']['get'](at);this['updateConversationTitle']('\x20'),_0x44ac26['view']['activateTab']('chat'),await this['_startConversationSafely'](_0x5779df);const {sessionId:_0xeb608e}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x5779df,_0xeb608e),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x2b9f83){console['error']('Failed\x20to\x20load\x20conversation',_0x2b9f83);}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x3b126f){this['activeConversation']['id']===_0x3b126f&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x76d22=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x76d22),this['activeConversation']?.['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x3be0f0,quickActionData:_0x207055}){await this['_handleUIUserMessage']({'userMessage':_0x3be0f0,'quickActionData':_0x207055});}['getGroupId'](){const _0x3c3c94=this['context']['config']['get']('collaboration.channelId');if(!_0x3c3c94)throw new _0x239292('ai-chat-missing-channel-id',this);return _0x3c3c94;}async['_startConversationSafely'](_0x215e57){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x215e57);}catch(_0x31e688){ot('ai-chat-conversation-start-failed',_0x31e688),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x17c5d5){const _0x1d2257=this['context']['plugins']['get'](w);let _0x20a388;_0x1d2257['isOpen']&&_0x1d2257['close'](),_0x17c5d5||!this['activeConversation']?_0x20a388=this['context']['config']['get']('ai.chat.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x20a388=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x5e893a=this['getGroupId'](),_0x2f0aef=_0x17c5d5||_0x5ef33e();this['activeConversation']=new nt({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x20a388,'conversationId':_0x2f0aef,'group':_0x5e893a,'getEditor':()=>P(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x208cb7,_0x3697b7)=>{this['_aiChatUi']['createConversation'](_0x3697b7),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x17c5d5||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](C(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x5aed33,_0x18ad3e)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x18ad3e['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x2a7804,_0x576285)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x576285);}),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',(_0x250a35,_0x20380c)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x20380c,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x282b7a,_0x3bb55f)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3bb55f,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x53655e,_0x6cd2db)=>{this['_aiChatUi']['removeFeedInteraction'](_0x6cd2db['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x28a0dd,_0x15b0ae,_0x36b078)=>{this['updateConversationTitle'](_0x15b0ae,_0x36b078);}),this['activeConversation']['on']('replyCreated',(_0x1d9900,_0x206ca1)=>{'text-delta'===_0x206ca1['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x206ca1):this['_aiChatUi']['addFeedItemAISuggestion'](_0x206ca1);}),this['activeConversation']['on']('replyContentUpdated',async(_0x4bd571,_0x370ba3)=>{await this['_updateReplyContent']({'reply':_0x370ba3});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0xc888fd,{reply:_0x1353e5,index:_0x4a296f,state:_0x531024})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x1353e5['id'],'index':_0x4a296f,'state':_0x531024});}),this['activeConversation']['on']('contextItemAdded',(_0x377d26,_0x5d8255)=>{if(this['_aiChatUi']['addContextItem'](_0x5d8255['contextItem'],_0x5d8255['isLoading']),'selection'===_0x5d8255['contextItem']['type']){const _0x95d430=[...P(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x95d430,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x1dfa9b,_0x41e602)=>{this['_aiChatUi']['removeContextItem'](_0x41e602['uiId']),'current-document'==_0x41e602['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x41e602['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0xb66b32,_0x3cc28b)=>{this['_aiChatUi']['setContextItemLoading'](_0x3cc28b['contextItem']['uiId'],_0x3cc28b['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x24498c,_0x39d5b7)=>{this['_aiChatUi']['setConversationContext'](_0x39d5b7['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x10546f,_0x398a43)=>{this['_aiChatUi']['setAddContextOptions'](_0x398a43['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x3d8b94,_0xbeb50)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0xbeb50['sourceId'],_0xbeb50['source'],_0xbeb50['resources'],_0xbeb50['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x160ec3,_0x41867c)=>{this['_aiChatUi']['updateResourceState'](_0x41867c['sourceId'],_0x41867c['resourceId'],_0x41867c['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x1158fa,_0xe813df)=>{this['_aiChatUi']['updateCapabilities'](_0xe813df);}),this['activeConversation']['on']('modelSelected',(_0x1cb3f0,_0x267a2c)=>{this['_aiChatUi']['setSelectedModel'](_0x267a2c['selectedModel'],_0x267a2c['isDisabled']);}),this['activeConversation']['on']('error',(_0x64d680,{error:_0x154f76,interactionId:_0x433eb2,fileName:_0x1ffeee,url:_0x30c6de,sourceId:_0x52645c,sourceLabel:_0x5b625b})=>{const _0x46319c=_0x433eb2?_0x433eb2+':'+_0x5ef33e():_0x5ef33e();_0x154f76['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':C(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x46319c}):_0x154f76['message']['startsWith']('ai-chat-conversation-init-failed')||_0x154f76['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x46319c}),this['_logError'](_0x154f76)):_0x154f76['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x1ffeee),'id':_0x46319c}):_0x154f76['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x30c6de),'id':_0x46319c}):_0x154f76['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x46319c}):_0x154f76['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x46319c}):_0x154f76['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x52645c&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x52645c),this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x5b625b||'source'),'id':_0x46319c}),this['_logError'](_0x154f76)):_0x154f76['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x46319c}),this['_logError'](_0x154f76)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':C(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x46319c}),this['_logError'](_0x154f76));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x17c5d5||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x352eba,quickActionData:_0x3c88fa}){if(!this['activeConversation'])throw new _0x239292('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':_0x352eba,'quickActionData':_0x3c88fa}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x21748b=P(this['context'])['model'],_0x7c2128=Array['from'](_0x21748b['markers']['getMarkersGroup'](rt));_0x21748b['change'](_0x3f4b68=>{_0x7c2128['forEach'](_0x3ffe60=>_0x3f4b68['removeMarker'](_0x3ffe60));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x1414e9){this['_aiChatUi']['setIsMaximized'](_0x1414e9);}['_logError'](_0x4a34eb){ot(_0x4a34eb['message']);}['_removeFromContext'](_0x46c830){this['activeConversation']?.['removeFromContext'](_0x46c830);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x101674){const [_0x3c555e,_0x564d02]=_0x101674['split'](':'),_0x1a4b26=this['activeConversation']['getInteraction'](_0x3c555e),_0x2f4ce1=_0x1a4b26['getReply'](_0x564d02);return{'interaction':_0x1a4b26,'reply':_0x2f4ce1};}['_scrollToSuggestionRange'](_0x255ae1,_0x353889=!0x1){const _0x4856a2=P(this['context']),_0x293bcb={'target':_0x4856a2['editing']['view']['domConverter']['viewRangeToDom'](_0x4856a2['editing']['mapper']['toViewRange'](_0x255ae1)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x353889};_0x353889&&(_0x293bcb['alignToTop']=!0x0),_0x10737b(_0x293bcb);}['updateConversationTitle'](_0x1923c7,_0xb51c2c=!0x1){this['_aiChatUi']['setConversationTitle'](_0x1923c7||C(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0xb51c2c);}async['_updateReplyContent']({reply:_0x1bdb3c,renderingStrategy:_0x341f57}){const {id:_0x52883c,isDone:_0x3f5564,type:_0x426466,parsedContent:_0x58d54b}=_0x1bdb3c;if('modification-delta'===_0x426466){const _0x423ed7=_0x1bdb3c['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x52883c,'parts':_0x423ed7,'renderingStrategy':_0x341f57,'isDone':_0x3f5564});}else'text-delta'===_0x426466&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x52883c,'parsedContent':_0x58d54b,'renderingStrategy':_0x341f57,'isDone':_0x3f5564});_0x3f5564&&_0x1bdb3c['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x52883c,_0x1bdb3c['sources']);}async['_stopLastInteraction'](){const _0x31000b=this['activeConversation']?.['lastInteraction'];_0x31000b&&(_0x31000b['stop'](),this['_aiChatUi']['stopInteraction'](_0x31000b));}async['_flushLastInteractionUI'](){const _0x25bb48=this['activeConversation']?.['lastInteraction'];if(_0x25bb48){for await(const _0x1be404 of _0x25bb48['replies'])await this['_updateReplyContent']({'reply':_0x1be404,'renderingStrategy':'static'});}}['_updateRatings'](_0x14afb6){const _0x39977e={'positiveCount':_0x14afb6['changeGroups']['filter'](_0x310ae8=>'accepted'===_0x310ae8['state'])['length'],'totalCount':_0x14afb6['changeGroups']['length'],'modificationId':_0x14afb6['id']},_0x351e93=this['activeConversation']['getInteraction'](_0x14afb6['interactionId'])['messageId'];this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x351e93,_0x39977e);}}const St=[...Te,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ge extends jr{['containerView'];['actionsView'];constructor(_0x4d289f,_0x2e731e){super(_0x2e731e),this['set']('isTrackChangesOn',!0x1),this['containerView']=new e(_0x4d289f,{'showDiff':_0x2e731e['showDiff'],'areActionsDisabled':_0x2e731e['areActionsDisabled'],'availableActions':_0x2e731e['availableActions']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x4d010b,_0x4ab915)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x4ab915['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',(_0x4fc209,{index:_0x269c6e})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x269c6e});}),this['containerView']['on']('insertSuggestion',(_0xf4abf,{index:_0x4b08f7})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4b08f7});}),this['containerView']['on']('rejectSuggestion',(_0x57fee2,{index:_0x2753b8})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2753b8});}),this['containerView']['on']('mouseOverSuggestion',(_0x5ed48e,{index:_0x2d652a})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2d652a});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x889015,{index:_0x10ad71})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x10ad71});}),this['actionsView']=new nh(_0x4d289f,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']});}),_0x2e731e['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'](_0x170f69){await this['containerView']['updateContent'](_0x170f69),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x543533,_0x3aa400){this['containerView']['bodyView']['updatePartState'](_0x543533,_0x3aa400);}['updateSources'](_0x276b34){this['containerView']['updateSources'](_0x276b34);}['getPartView'](_0x253723){return this['containerView']['bodyView']['getPartView'](_0x253723);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class ke extends jr{['replyContainer'];constructor(_0x12a456,_0x4d920a){super(_0x4d920a),this['locale']=_0x12a456,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x10aa9f(),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':Ye(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x419644,renderingStrategy:_0x3e0ebe,abortSignal:_0x3c168b}){'streaming'===_0x3e0ebe?await this['streamIntoElement'](_0x419644,this['replyContainer']['element'],_0x3c168b):this['replyContainer']['element']['innerHTML']=_0x259462(_0x419644);}['updateSources'](_0x448bd2){const _0x22ed05=new Sr(this['locale']);_0x22ed05['children']['addMany'](_0x448bd2['map'](_0x349a7d=>new Fr(this['locale'],_0x349a7d))),_0x22ed05['isVisible']=!0x0,this['children']['add'](_0x22ed05);}}const xn={'file':_0x18f1cd,'document':_0x3af6f7,'web-resource':_0xe254f0,'text':_0x18f1cd,'selection':_0x5ce07c},$r='ck-ai-chat-context-chip',Qr='ck-ai-chat-context-chip_wide',Zr='ck-ai-chat-context-chip_document',ra='ck-ai-chat-context-chip__label',oa='ck-ai-chat-context-chip__type-icon',ca='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class bo extends _0x5cde82{constructor(_0x7e3554,_0x291454,_0x258c32,_0x514d00,_0xcf61ff=!0x1){super(_0x7e3554),this['_isAnimationOnEnterEnabled']=_0x514d00,this['_initializeProperties'](_0x291454,_0x258c32,_0xcf61ff),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'](_0x487cc2,_0x1ee4b0,_0x2f1f31){this['set']('label',_0x487cc2['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x487cc2['type']),this['set']('id',_0x487cc2['uiId']),this['set']('readonly',_0x1ee4b0),this['set']('isLoading',_0x2f1f31);}['_setupTemplate'](){const _0x1ea638=this['_createIconView'](),_0x17f91e=this['_createRemoveButton'](),_0x5c5adb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x5c5adb),'children':this['_createTemplateChildren'](_0x1ea638,_0x17f91e,_0x5c5adb)});}['_createTemplateAttributes'](_0x11edc0){return{'class':[$r,_0x11edc0['if']('itemType',Zr,_0x483e35=>'document'==_0x483e35),_0x11edc0['if']('itemType',Qr,_0x28018f=>'selection'==_0x28018f)],'data-cke-tooltip-text':_0x11edc0['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':ca};}['_createTemplateChildren'](_0xd1f8fc,_0x4a2549,_0x14b8af){const _0x4db913=this['_createLabelElement'](_0x14b8af),_0x3aaa35=this['_createLoaderIcon']();return this['readonly']?[_0xd1f8fc,_0x4db913]:[_0xd1f8fc,_0x3aaa35,_0x4db913,_0x4a2549];}['_createLabelElement'](_0x4b9aa2){return{'tag':'span','attributes':{'class':ra},'children':[{'text':_0x4b9aa2['to']('label')}]};}['_createRemoveButton'](){const _0x573f64=new _0x5cde82(this['locale']);return _0x573f64['set']({'label':C(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x3c4bba}),this['_setupRemoveButtonEvent'](_0x573f64),_0x573f64;}['_setupRemoveButtonEvent'](_0x48fa21){_0x48fa21['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x5ecd0d=this['bindTemplate'],_0x15dc45=new _0x3dad93();return _0x15dc45['content']=xn[this['itemType']],_0x15dc45['extendTemplate']({'attributes':{'class':[oa,_0x5ecd0d['if']('isLoading','ck-hidden',_0x26aed0=>_0x26aed0)]}}),_0x15dc45;}['_handleAnimationEndOnce'](_0x25bd1c,_0x3a3112){if(!_0x25bd1c)return;const _0x4d7f53=()=>{_0x3a3112(),_0x25bd1c['removeEventListener']('animationend',_0x4d7f53),_0x25bd1c['removeEventListener']('webkitAnimationEnd',_0x4d7f53);};_0x25bd1c['addEventListener']('animationend',_0x4d7f53),_0x25bd1c['addEventListener']('webkitAnimationEnd',_0x4d7f53);}['_createLoaderIcon'](){const _0x1dba60=new Le('small');return _0x1dba60['bind']('isVisible')['to'](this,'isLoading',_0x3ed344=>_0x3ed344),_0x1dba60;}}function In(_0x23468d){if(!_0x23468d)return _0x23468d;if(_0x23468d['length']<=0x78)return _0x23468d;const _0x13154b=_0x23468d['slice'](0x0,0x78),_0x1d7bb4=_0x13154b['lastIndexOf']('\x20');return(_0x1d7bb4>0x0?_0x13154b['slice'](0x0,_0x1d7bb4):_0x13154b)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Ao{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x25a0bc,_0xb27260,_0x129897,_0x183531,_0x1217e2){this['_locale']=_0x25a0bc,this['_visibleChips']=_0xb27260,this['_config']={...hn,..._0x129897,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x129897['cssClasses']}},this['_overflowChips']=new _0x4c3887(),this['_bodyCollection']=_0x183531,this['_parentView']=_0x1217e2||null;}['setContainerElement'](_0xa8564f){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0xa8564f,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 _0x23e867=[...this['_visibleChips'],...this['_overflowChips']],_0x297800=this['_createCalculationContainer'](),_0x172bf0=this['_calculateOverflowInContainer'](_0x297800,_0x23e867),_0x12b5f7=_0x297800['_ancestorsToRestore'];_0x12b5f7&&this['_restoreAncestorVisibility'](_0x12b5f7),_0x297800['remove'](),this['_applyOverflowResults'](_0x23e867,_0x172bf0);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x2cf367({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x14e6c3=new _0x5cde82(this['_locale']);_0x14e6c3['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x22ed77=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x22ed77['push'](this['_config']['cssClasses']['controlsButton']),_0x14e6c3['extendTemplate']({'attributes':{'class':_0x22ed77}}),_0x14e6c3;}['_createShowMoreBalloonPanelView'](){const _0x48ec20=new _0x179f18(this['_locale']);return _0x48ec20['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x48ec20),_0x48ec20;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x9a456b=>{_0x9a456b['disableAnimationOnEnter']();});const _0x33f3ee=new _0x10aa9f(this['_locale']);_0x33f3ee['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x33f3ee);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x182316=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x182316?'':'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'](_0x47c280){const _0x1bf1ca=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x485540=this['_containerElement']?.['classList'];if(_0x485540){const _0x5b44db=_0x485540[0x0]||'',_0x14e597=_0x47c280['querySelector']('.'+_0x5b44db),_0x2e5a61=_0x47c280['querySelector'](_0x1bf1ca);return _0x14e597||_0x2e5a61||_0x47c280;}return _0x47c280['querySelector'](_0x1bf1ca)||_0x47c280;}['_calculateContainerWidth'](){const _0x225a64=this['_parentView']?.['element']||this['_containerElement'];if(!_0x225a64)return an;const _0x22bf3d=window['getComputedStyle'](_0x225a64)['width'];if('auto'===_0x22bf3d||'0px'===_0x22bf3d||!_0x22bf3d){const _0x2d3e4a=_0x225a64['parentElement'];if(_0x2d3e4a){const _0x56db6e=window['getComputedStyle'](_0x2d3e4a);return'auto'!==_0x56db6e['width']?_0x56db6e['width']:an;}return an;}return _0x22bf3d;}['_applyCalculationStyles'](_0x266694,_0x5251fe){this['_config']['cssClasses']['calculationContainer']&&_0x266694['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x266694['style']['width']=_0x5251fe,_0x266694['style']['position']='absolute',_0x266694['style']['top']='-9999px',_0x266694['style']['left']='-9999px',_0x266694['style']['opacity']='0',_0x266694['style']['pointerEvents']='none',_0x266694['style']['zIndex']='-1',_0x266694['style']['visibility']='visible\x20!important',_0x266694['style']['display']='block\x20!important',_0x266694['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x2111da){_0x2111da['forEach'](({element:_0x533247,originalDisplay:_0x147bbe,originalVisibility:_0xda9b5f})=>{_0x533247['style']['display']=_0x147bbe,_0x533247['style']['visibility']=_0xda9b5f;});}['_makeAncestorsVisible'](_0xb01a62){const _0x40ebf2=[];let _0x189244=_0xb01a62;for(;_0x189244&&_0x189244!==document['body'];){const _0x4d45aa=window['getComputedStyle'](_0x189244);'none'!==_0x4d45aa['display']&&'hidden'!==_0x4d45aa['visibility']||(_0x40ebf2['push']({'element':_0x189244,'originalDisplay':_0x189244['style']['display'],'originalVisibility':_0x189244['style']['visibility']}),_0x189244['style']['display']='block',_0x189244['style']['visibility']='visible'),_0x189244=_0x189244['parentElement'];}return _0x40ebf2;}['_createContainerElements'](){let _0x54ada7,_0x1eebda;return this['_parentView']?.['element']?(_0x54ada7=this['_parentView']['element']['cloneNode'](!0x0),_0x1eebda=this['_findTargetContainer'](_0x54ada7)):(_0x54ada7=document['createElement']('div'),_0x1eebda=_0x54ada7),{'calculationContainer':_0x54ada7,'targetContainer':_0x1eebda};}['_createCalculationContainer'](){const {calculationContainer:_0x5727b7,targetContainer:_0x5328cc}=this['_createContainerElements'](),_0x3c1b7a=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x5727b7,_0x3c1b7a);const _0x3dfb51=this['_parentView']?.['element']||this['_containerElement'],_0x5a03b8=_0x3dfb51?.['parentElement'];_0x5a03b8?_0x5a03b8['appendChild'](_0x5727b7):document['body']['appendChild'](_0x5727b7),_0x5727b7['_targetContainer']=_0x5328cc;const _0x326b37=this['_makeAncestorsVisible'](_0x5a03b8||null);return _0x5727b7['offsetWidth'],_0x5727b7['_ancestorsToRestore']=_0x326b37,_0x5727b7;}['_calculateOverflowInContainer'](_0x3ef474,_0x43a141){const _0x428d9b=_0x3ef474['_targetContainer']||_0x3ef474,_0x47c2e1=[],{rowCount:_0x18d443}=this['_renderChipsAndCountRows'](_0x428d9b,_0x43a141);if(_0x18d443<=this['_config']['maxVisibleRows'])return _0x47c2e1;const _0x1ed0b4=_0x43a141['slice']();for(;_0x1ed0b4['length']>0x0;){if(this['_testButtonFit'](_0x3ef474,_0x428d9b,_0x1ed0b4)){const _0xc6b791=_0x43a141['filter'](_0x2b832f=>!_0x1ed0b4['includes'](_0x2b832f));_0x47c2e1['push'](..._0xc6b791);break;}if(!_0x1ed0b4['pop']())break;}return _0x47c2e1;}['_renderChipsAndCountRows'](_0x3c9123,_0x51bcde){_0x3c9123['innerHTML']='',_0x51bcde['forEach'](_0x4a7a58=>{if(_0x4a7a58['element']){const _0xf5ea19=_0x4a7a58['element']['cloneNode'](!0x0);_0x3c9123['appendChild'](_0xf5ea19);}}),_0x3c9123['offsetWidth'];const _0x3c4926=_0x3c9123['children'],_0x980b72=[];return Array['from'](_0x3c4926)['forEach'](_0x3e501f=>{const _0x22c5fd=_0x3e501f['getBoundingClientRect']()['top'];_0x980b72['some'](_0x5d4eea=>Math['abs'](_0x5d4eea-_0x22c5fd)<this['_config']['rowDetectionTolerance'])||_0x980b72['push'](_0x22c5fd);}),{'rowCount':_0x980b72['length']};}['_createMockButton'](){const _0x4b9942=document['createElement']('button');return _0x4b9942['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x4b9942['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x4b9942['textContent']='+\x201',_0x4b9942;}['_testButtonFit'](_0x15e8d0,_0x2c7496,_0x115263){this['_renderChipsAndCountRows'](_0x2c7496,_0x115263);const _0x5a0673=this['_createMockButton']();_0x15e8d0['appendChild'](_0x5a0673),_0x15e8d0['offsetWidth'];const _0x3408ed=[..._0x2c7496['children'],_0x5a0673],_0x3ac40a=[];_0x3408ed['forEach'](_0x36a69f=>{const _0xde211c=_0x36a69f['getBoundingClientRect']()['top'];_0x3ac40a['some'](_0x8f0aa=>Math['abs'](_0x8f0aa-_0xde211c)<this['_config']['rowDetectionTolerance'])||_0x3ac40a['push'](_0xde211c);});const _0x4b7d94=_0x3ac40a['length'];return _0x5a0673['remove'](),_0x4b7d94<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x5cffee,_0x134015){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x5cffee['forEach'](_0x585821=>{_0x134015['includes'](_0x585821)?this['_overflowChips']['add'](_0x585821):this['_visibleChips']['add'](_0x585821);});}['_updateOverflowUI'](_0x4f559a){if(_0x4f559a>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x4f559a>0x0&&this['_showMoreButtonView']){const _0x1278f7=''+this['_config']['showMoreLabelPrefix']+(_0x4f559a<0x63?_0x4f559a:'99');this['_showMoreButtonView']['label']=_0x1278f7;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x1464b9,_0x109e8c){this['_distributeChips'](_0x1464b9,_0x109e8c),this['_updateOverflowUI'](_0x109e8c['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x73cdf=>{_0x73cdf[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 _0x292e73=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x292e73['width']||0x0===_0x292e73['height'])return!0x1;const _0x360d77=window['innerHeight']||document['documentElement']['clientHeight'],_0x130843=window['innerWidth']||document['documentElement']['clientWidth'],_0x1c28ac=0xc8;return _0x292e73['bottom']>=-0xc8&&_0x292e73['top']<=_0x360d77+_0x1c28ac&&_0x292e73['right']>=-0xc8&&_0x292e73['left']<=_0x130843+_0x1c28ac;}}const la='ck-ai-chat__feed__context-chips',da='ck-ai-chat-context-chips-wrapper',ua='ck-ai-chat-context-chips-wrapper-balloon',_a='ck-ai-chat-controls-button',Ia='ck-ai-chat-controls_context_show-more-button',Aa='ck-ai-chat-context-controls__show-more-balloon-panel';class ah extends _0x10aa9f{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x3d4996,_0x42edc5,_0x80f57e){super(_0x3d4996),this['_bodyCollection']=_0x80f57e,this['_createContextChips'](_0x42edc5);const _0xae5e6b={'cssClasses':{'showMoreButton':Ia,'showMoreBalloon':Aa,'overflowContainer':ua,'controlsButton':_a}};this['_overflowManager']=new Ao(_0x3d4996,this['_contextChips'],_0xae5e6b,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[la,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':da},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x2856ca=this['element']['querySelector']('.'+da);_0x2856ca&&(this['_overflowManager']['setContainerElement'](_0x2856ca),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x1636f5){for(const _0x57775a of _0x1636f5){const _0x477846=new bo(this['locale'],_0x57775a,!0x0,!0x1);this['_contextChips']['add'](_0x477846);}}}class ve extends jr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x547dd0,_0x2c2636,_0x51fc56){super(_0x2c2636),this['_locale']=_0x547dd0,this['_bodyCollection']=_0x51fc56,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 ah(this['_locale'],this['options']['contextItems']['filter'](_0x2f0c98=>!_0x2f0c98['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x10aa9f(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class Et extends jr{['capabilities'];constructor(_0x3dc44e,_0x179c2d){super(_0x179c2d);const {isWebSearchEnabled:_0x240c28,isReasoningEnabled:_0x4d899d}=_0x179c2d['capabilities'],_0x207071=[];let _0x1ddb4b='';_0x240c28&&_0x4d899d?(_0x1ddb4b=C(_0x3dc44e,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x207071['push'](aa(_0x340ab6)),_0x207071['push'](aa(_0x18edd5))):_0x240c28?(_0x1ddb4b=C(_0x3dc44e,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x207071['push'](aa(_0x340ab6))):_0x4d899d&&(_0x1ddb4b=C(_0x3dc44e,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x207071['push'](aa(_0x18edd5))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x1ddb4b?'':'ck-hidden']}});const _0x5125e7=new _0x10aa9f();_0x5125e7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x207071,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x1ddb4b]}]}),this['children']['add'](_0x5125e7),this['capabilities']=_0x179c2d['capabilities'];}}function aa(_0x1d3131){const _0x3e126b=new _0x3dad93();return _0x3e126b['content']=_0x1d3131,_0x3e126b;}const ws=['wheel','touchstart','pointerdown','keydown'],fs=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class be{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x2ad1e3){this['element']=_0x2ad1e3,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x425b22 of ws){const _0x508991='keydown'!==_0x425b22;this['element']['addEventListener'](_0x425b22,this['_onUserEvent']['bind'](this),{'passive':_0x508991,'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'](_0xa54ce8){if(this['isRunning']){if('keydown'===_0xa54ce8['type']){const _0x58814a=_0xa54ce8['key'];if(!fs['includes'](_0x58814a))return;}_0xa54ce8 instanceof WheelEvent?_0xa54ce8['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x5df61b,scrollHeight:_0x44304e,clientHeight:_0x3151a5}=this['element'];return _0x44304e-_0x5df61b-_0x3151a5<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class je extends _0x10aa9f{constructor(_0x29d225,_0x12317f){super(_0x29d225),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x12317f)});}['_createSkeletonItems'](_0x3bf187){const _0x20aa05=['ck','ck-ai-skeleton__item'];return _0x3bf187['map'](_0x176349=>{let _0x825283='';switch(_0x176349['attributes']['align']){case'right':_0x825283='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x825283='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x825283='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x176349['tag'],'attributes':{'class':[..._0x20aa05,_0x176349['attributes']['class']?_0x176349['attributes']['class']:''],'style':'width:\x20'+_0x176349['attributes']['width']+';\x20height:\x20'+_0x176349['attributes']['height']+';'+_0x825283}};});}}const Ce={'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(_0x36824f,_0x479dfa,_0x36633d,_0x1b469e){return new Array(_0x36824f)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x479dfa,'height':_0x36633d,'align':_0x1b469e}}));}class ji extends _0x10aa9f{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x56a5b9,_0x55b7ea){super(_0x56a5b9),this['_bodyCollection']=_0x55b7ea,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...St)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new be(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x471646,_0x966549){let _0x2f07a8;'ai-reply'===_0x471646?_0x2f07a8=new ke(this['locale'],_0x966549):'ai-suggestion-reply'===_0x471646?(_0x2f07a8=new ge(this['locale'],_0x966549),_0x2f07a8['bind']('isTrackChangesOn')['to'](this,'isTrackChangesOn')):_0x2f07a8='user-message'===_0x471646?new ve(this['locale'],_0x966549,this['_bodyCollection']):'interaction-header'===_0x471646?new Et(this['locale'],_0x966549):new _e(_0x966549),this['children']['add'](_0x2f07a8);}async['updateReplyItem']({id:_0x4d4320,parsedContent:_0x37bb73,renderingStrategy:_0x5d98ce,abortSignal:_0x46b511}){const _0x52e2f6=this['getItemById'](_0x4d4320);if(!(_0x52e2f6 instanceof ke))throw new _0x239292('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x52e2f6,'id':_0x4d4320,'parsedContent':_0x37bb73});await _0x52e2f6['updateContent']({'parsedContent':_0x37bb73,'renderingStrategy':_0x5d98ce,'abortSignal':_0x46b511});}async['updateWebSources'](_0x5cfa83,_0x408ed6){const _0x58bd11=this['getItemById'](_0x5cfa83);if(_0x58bd11 instanceof ge)_0x58bd11['updateSources'](_0x408ed6);else{if(!(_0x58bd11 instanceof ke))throw new _0x239292('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x58bd11,'id':_0x5cfa83,'sources':_0x408ed6});_0x58bd11['updateSources'](_0x408ed6);}}async['updateSuggestionItem']({id:_0x5c37f0,parts:_0x3ba99c,renderingStrategy:_0x4d4c74,abortSignal:_0xb3e1c2}){const _0x3b8ee5=this['getItemById'](_0x5c37f0);if(!(_0x3b8ee5 instanceof ge))throw new _0x239292('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x3b8ee5,'id':_0x5c37f0,'parts':_0x3ba99c});await _0x3b8ee5['updateContent']({'parts':_0x3ba99c,'renderingStrategy':_0x4d4c74,'abortSignal':_0xb3e1c2});}['updateSuggestionPartState']({id:_0x99e44c,index:_0x51b99e,state:_0x5182d3}){const _0x23120d=this['getItemById'](_0x99e44c);if(!(_0x23120d instanceof ge))throw new _0x239292('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x99e44c});_0x23120d['updatePartState'](_0x51b99e,_0x5182d3);}['markItemAsDone'](_0x5a799e){this['getItemById'](_0x5a799e)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x2401e0=>_0x2401e0['options']['id']);}['removeItem'](_0x21cd6c){this['children']['remove'](this['getItemById'](_0x21cd6c));}['scrollToSuggestion'](_0x4484bb,_0x1db680){const _0x538bc0=this['getItemById'](_0x4484bb);if(!(_0x538bc0 instanceof ge))return void _0x361f9e('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x4484bb,'partIndex':_0x1db680});const _0x5bf8e2=_0x538bc0['getPartView'](_0x1db680);_0x5bf8e2?_0x10737b({'target':_0x5bf8e2['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x361f9e('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x4484bb,'partIndex':_0x1db680});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x2fc60b=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x2fc60b,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x5dd01a=new je(this['locale'],Ce['aiFeed']);return _0x5dd01a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x407afc=>!_0x407afc)]}}),_0x5dd01a;}['_createFeedItems'](){const _0x524494=new _0x10aa9f(this['locale']);return _0x524494['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x524494;}['_createFeedLoader'](){const _0x452e79=new _0x10aa9f(this['locale']);return _0x452e79['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x39e0f7=>!_0x39e0f7)]},'children':this['_createLoaderChildren']()}),_0x452e79;}['_createLoaderChildren'](){const _0x11b9d0=new Le();return _0x11b9d0['isVisible']=!0x0,[_0x11b9d0,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x23da30){const _0x112f08=this['children']['find'](_0x4e55ff=>_0x4e55ff['options']['id']['includes'](_0x23da30));if(!_0x112f08)throw new _0x239292('ai-chat-feed-view-item-not-found',this,{'id':_0x23da30});return _0x112f08;}['setLoadingMessage'](_0x5e1a63){this['set']('loadingMessage',_0x5e1a63);}['toggleLoadingSkeleton'](_0x34dc49){this['set']('isLoadingSkeletonVisible',_0x34dc49);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Ir extends _0x4a219d{['filter'](){let _0x5365f3=0x0;for(const _0x138aa5 of this['items'])_0x5365f3+=_0x138aa5['items']['length'];return{'resultsCount':_0x5365f3,'totalItemsCount':_0x5365f3};}}class ds extends _0x329d79{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x3bb5e5,_0x5ca3a5){super(_0x3bb5e5,{'queryView':{'label':'','creator':_0x2485cf,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Ir(_0x3bb5e5),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x5ca3a5,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ds['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ds['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',(_0x268c68,_0x55fda2)=>!_0x268c68&&!_0x55fda2),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x49582a,_0x1d9021)=>{this['isUploadInProgress']||this['isEmpty']||_0x49582a['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1d9021());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x1c935b=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x1c935b)return this['queryView']['errorText']=C(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x10098d=_0x59aba(_0x1c935b);this['fire']('sendUserMessage',_0x10098d),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x37ce1f){this['queryView']['fieldView']['set']('placeholder',_0x37ce1f);}['_createSubmitButton'](){const _0x56c01d=new _0x5cde82(this['locale']);return _0x56c01d['set']({'icon':_0x3a517e,'label':C(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x56c01d['on']('execute',()=>{this['submit']();}),_0x56c01d;}['setIsUploadInProgress'](_0x2717c4){this['isUploadInProgress']=_0x2717c4;}['_setUpAddContextButtonPositioning'](){const _0x4efdd3=this['locale'],_0x12d565=()=>{_0x218ca6['window']['requestAnimationFrame'](()=>{if(_0x5a4e2b(this['element'])){const _0x1ceb7c=new _0x507e52(this['queryView']['fieldView']['element']),_0x7fc077=new _0x507e52(this['_addContextButtonView']['element']),_0x3902fa=_0x1ceb7c['width'],_0x199d97='rtl'===_0x4efdd3['uiLanguageDirection']?'right':'left';_0x1ceb7c['excludeScrollbarsAndBorders']();const _0x5558f3=_0x3902fa-_0x1ceb7c['width']+0x1;this['_addContextButtonView']['element']['style'][_0x199d97]='calc('+(_0x3902fa-_0x7fc077['width']-_0x5558f3)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x12d565),this['on']('render',()=>{_0x12d565(),this['_queryViewResizeObserver']=new _0x459443(this['queryView']['fieldView']['element'],()=>{_0x12d565();});});}}const ga='ck-ai-chat__prompt-capabilities',Ea='ck-ai-chat-controls-button',ma='ck-ai-chat-controls-button--commands',pa='ck-ai-chat-controls__model-selection',Ta='ck-ai-chat-controls__model-selection__item-name',Ca='ck-ai-chat-controls__model-selection__item-description',wa='ck-ai-chat-controls__model-selection__item-capabilities',fa='n';class ps extends _0x10aa9f{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0xd1f31d){super(_0xd1f31d),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',_0x547297=>_0x547297),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x88c53a=>_0x88c53a?this['_modelSelectionDropdown']['buttonView']['label']:C(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x452a2a=>_0x452a2a),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x548473=>_0x548473),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x4c1d14=>!_0x4c1d14),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x27bf13=>C(this['locale'],_0x27bf13?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x5b9901=>_0x5b9901),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x5f4463=>!_0x5f4463),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x1bf8be=>C(this['locale'],_0x1bf8be?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ga]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x4c3887(),_0x43d564(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0xbe856e,_0x4ea096){if(this['set']('modelSelectorVisible',!(_0x4ea096&&_0xbe856e['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0xbe856e?.['length']){const _0x161eee=ki['getLocalized'](this['locale'],_0xbe856e);for(const _0x2c6ab3 of _0x161eee){const _0x47c4e1=new _0x238f2a({'label':_0x2c6ab3['name'],'withText':!0x0,'role':'menuitemradio','id':_0x2c6ab3['id'],'model':_0x2c6ab3});_0x47c4e1['bind']('isOn')['to'](this,'activeModelId',_0x4d44fb=>_0x4d44fb===_0x2c6ab3['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x47c4e1,'labelView':new Sa(this['locale'],_0x2c6ab3)});}}}['setWebSearch'](_0x43c96e){this['set']('webSearchActive',_0x43c96e);}['setReasoning'](_0x5f3b63){this['set']('reasoningActive',_0x5f3b63);}['setModel'](_0x176eab){if(!_0x176eab)return;this['activeModelId']=_0x176eab['id'],this['activeModelName']=_0x176eab['name']||_0x176eab['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x176eab['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x176eab['name']);const _0x48ebe9=_0x176eab['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x48ebe9),this['_webSearchButton']['set']('isVisible',_0x48ebe9);const _0xe38fd9=_0x176eab['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0xe38fd9),this['_reasoningButton']['set']('isVisible',_0xe38fd9);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x46bce6){this['set']('modelSelectorEnabled',!0x1),_0x46bce6&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x240a9d=new _0x5cde82();return _0x240a9d['set']({'label':C(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x340ab6,'class':Ea,'isToggleable':!0x0,'tooltipPosition':fa}),_0x240a9d['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x240a9d;}['_createReasoningButton'](){const _0x208eee=new _0x5cde82();return _0x208eee['set']({'label':C(this['locale'],'AI_CHAT_REASONING'),'icon':_0x18edd5,'class':Ea,'isToggleable':!0x0,'tooltipPosition':fa}),_0x208eee['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x208eee;}['_createCommandsButton'](){const _0x92b076=new _0x5cde82();return _0x92b076['set']({'label':C(this['locale'],'AI_CHAT_COMMANDS'),'icon':Ct,'withText':!0x0,'class':Ea,'isToggleable':!0x0,'tooltip':C(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':fa}),_0x92b076['extendTemplate']({'attributes':{'class':[ma]}}),_0x92b076['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x92b076;}['_createModelSelectionDropdown'](){const _0x268432=_0x1fe5fd(this['locale']);return _0x268432['set']({'panelPosition':'ne','class':[pa]}),_0x268432['buttonView']['set']({'label':C(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':fa}),this['listenTo'](_0x268432,'execute',_0x1c552e=>{this['fire']('selectModel',_0x1c552e['source']['model']);}),_0x268432;}['_createModelNameView'](){const _0x1ce179=new Ko(this['locale']);return _0x1ce179['bind']('text')['to'](this,'activeModelName',_0x5da54b=>_0x5da54b??''),_0x1ce179['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x2515c4,_0x4f7f51)=>!_0x2515c4&&!_0x4f7f51?.['toLowerCase']()['startsWith']('agent')),_0x1ce179;}}let Sa=class extends _0x342201{constructor(_0x123c4b,_0x4a3196){super();const _0x12ebe6=this['bindTemplate'],_0x5c8158=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x12ebe6['to']('style'),'id':_0x12ebe6['to']('id')},'children':[{'tag':'div','attributes':{'class':[Ta]},'children':[{'text':_0x12ebe6['to']('text')}]},{'tag':'div','attributes':{'class':[Ca]},'children':[{'tag':'span','children':[{'text':_0x4a3196['description']}]}]},{'tag':'div','attributes':{'class':[wa]},'children':_0x5c8158}]}),_0x5c8158['addMany'](this['_getCapabilityParts'](_0x123c4b,_0x340ab6,'AI_CHAT_SEARCH_WEB',_0x4a3196['capabilities']['webSearch']?.['enabled']??!0x1)),_0x5c8158['addMany'](this['_getCapabilityParts'](_0x123c4b,_0x18edd5,'AI_CHAT_REASONING',_0x4a3196['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x334710,_0x2c043d,_0x736a34,_0x28d4a7){const _0x17c3ce=new _0x3dad93();_0x17c3ce['content']=_0x2c043d;const _0x47e69c=new _0x10aa9f(_0x334710);_0x47e69c['setTemplate']({'tag':'span','children':[{'text':C(_0x334710,_0x736a34)+':\x20'}]});const _0x14fb8a=new _0x10aa9f(_0x334710);return _0x14fb8a['setTemplate']({'tag':'span','children':[{'text':C(_0x334710,_0x28d4a7?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x17c3ce,_0x47e69c,_0x14fb8a];}};class Ko extends _0x10aa9f{constructor(_0x454da6){super(_0x454da6),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x108203=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x108203['if']('isVisible','ck-hidden',_0x2ea821=>!_0x2ea821)]},'children':[{'text':_0x108203['to']('text')}]});}}const Oa='ck-ai-chat-context-controls__url-form',Ra='ck-ai-chat-context-controls__url-input-section';class To extends _0x10aa9f{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0xa89ab9){super(_0xa89ab9),this['focusTracker']=new ts(),this['keystrokes']=new _0x4c12a2(),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 $t({'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'](_0x4f1f31=>{this['focusTracker']['add'](_0x4f1f31['element']),this['keystrokes']['listenTo'](_0x4f1f31['element']);}),_0x256be1({'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'](_0x176859){this['urlInputField']['errorText']=_0x176859,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x3118f8=new _0x5cde82(this['locale']);return _0x3118f8['set']({'icon':_0x52404d,'tooltip':C(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x3118f8;}['_createUrlInputField'](){const _0x41ec5b=new _0x2acda0(this['locale'],_0x3090df);return _0x41ec5b['set']({'label':C(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x41ec5b['fieldView']['set']({'placeholder':C(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x41ec5b;}['_createConfirmButton'](){const _0x40b787=new _0x5cde82(this['locale']);return _0x40b787['set']({'icon':_0x222bf2,'tooltip':C(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x40b787;}['_setupTemplate'](){const _0x102665=new _0x4f9b0c(this['locale'],{'label':C(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x102665['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Oa,'tabindex':'-1'},'children':[_0x102665,{'tag':'div','attributes':{'class':Ra},'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',_0x3c488b=>{_0x3c488b['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x20c749,_0x3a5f24)=>{this['clear'](),this['fire']('cancel'),_0x3a5f24();});}['_handleSubmit'](){const _0x2a8bb9=this['getValue']()['trim']();_0x2a8bb9?this['_isValidUrl'](_0x2a8bb9)?(this['clearError'](),this['fire']('submitUrl',_0x2a8bb9)):this['setError'](C(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](C(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x114f47=this['getValue']()['trim'](),_0x400946=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x114f47['length']>0x0&&!_0x400946;}['_isValidUrl'](_0x3d1b7b){try{return!!new URL(_0x3d1b7b);}catch{return!0x1;}}}const ba='ck-ai-chat-resources__item',Na='ck-ai-chat-resources__item--in-context',ka='ck-ai-chat-resources__item-title',ya='ck-ai-chat-resources__item__icon';class tc extends _0x2ced3c{['resource'];['_titleView'];['_iconView'];constructor(_0x41e114,_0xc7a3e8){super(_0x41e114),this['resource']=_0xc7a3e8,this['set']('isInContext',!!_0xc7a3e8['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0xb4aa2c){if(_0xb4aa2c['isInContext'])return _0x222bf2;switch(_0xb4aa2c['type']){case Xt['DOCUMENT']:return _0x3af6f7;case Xt['URL']:return _0xe254f0;case Xt['FILE']:case Xt['TEXT']:return _0x18f1cd;default:return _0x2ca83b;}}['highlightText'](_0x4ae50d){if(!_0x4ae50d||''===_0x4ae50d['trim']())return void this['_titleView']['highlightText'](null);const _0x2ea2a0=new RegExp(_0x186f47(_0x4ae50d),'gi');this['_titleView']['highlightText'](_0x2ea2a0);}['updateResourceState'](_0x3c5630){this['resource']['isInContext']=_0x3c5630,this['isInContext']=_0x3c5630,this['_updateIcon']();}['_createTitleView'](){const _0xa259=new _0x4eed03();return _0xa259['text']=this['resource']['label'],_0xa259['extendTemplate']({'tag':'span','attributes':{'class':[ka]}}),_0xa259;}['_createIconView'](){const _0x1e7159=new _0x3dad93();return _0x1e7159['content']=this['getResourceIcon'](this['resource']),_0x1e7159;}['_setupTemplate'](){const _0x4783f4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[ba,_0x4783f4['if']('isVisible','ck-hidden',_0x2d1422=>!_0x2d1422),_0x4783f4['if']('isInContext',Na)]},'children':[{'tag':'div','attributes':{'class':[ya]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x4783f4['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const va='ck-ai-chat-resources__list';class qr extends _0x4a219d{['_source'];constructor(_0x4aab6a,_0x4af0a1){super(_0x4aab6a),this['_source']=_0x4af0a1,this['extendTemplate']({'attributes':{'class':[va]}});}['setResources'](_0x5832c5,_0xc54543){this['items']['clear']();let _0x45a30e=_0x5832c5;if(this['_source']['useDefaultFiltering']&&_0xc54543&&''!==_0xc54543['trim']()){const _0x45a44d=new RegExp(_0xc54543['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x45a30e=_0x5832c5['filter'](_0x33ee84=>_0x45a44d['test'](_0x33ee84['label']));}for(const _0x5d027f of _0x45a30e){const _0xfa2fb4=new tc(this['locale'],_0x5d027f);_0xfa2fb4['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x5d027f);}),this['items']['add'](_0xfa2fb4);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0xc54543);}['highlightText'](_0x33d722){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x527c20=>{_0x527c20['highlightText'](_0x33d722);});}['updateResourceState'](_0x21ff27,_0x237634){for(const _0x7af849 of this['items']){const _0x11a17e=_0x7af849;_0x11a17e['resource']['id']===_0x21ff27&&_0x11a17e['updateResourceState'](_0x237634);}}['_handleResourceSelection'](_0x3944bf,_0x3029a9){this['fire']('addResourceToContext',{'source':_0x3944bf,'resource':_0x3029a9});}}class Tr extends _0x2acda0{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x3fa5ed){const t=_0x3fa5ed['t'],_0x17ad0b={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x3090df,'label':C(_0x3fa5ed,'AI_CHAT_SEARCH_RESOURCES')};super(_0x3fa5ed,_0x17ad0b['creator']),this['label']=_0x17ad0b['label'],this['_viewConfig']=_0x17ad0b,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x3fa5ed,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x517ec4){this['fire']('search',_0x517ec4);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x3dad93(),this['iconView']['content']=_0x15be19,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x323297,t){this['resetButtonView']=new _0x5cde82(_0x323297),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x27c5a9,'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',_0x10365e=>!_0x10365e),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 _0x10aa9f{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x5c49ce,_0x333a48){super(_0x5c49ce),this['_source']=_0x333a48['source'],this['_searchInputVisibleFrom']=_0x333a48['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 _0x285700([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Tr(this['locale']);}['_createSearchSection'](){const _0x4f622e=new _0x10aa9f(this['locale']);return _0x4f622e['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x555474,_0x29b017)=>{this['loadResources'](_0x29b017),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x29b017);}),_0x4f622e;}['_createResourcesListView'](){const _0x337a97=new qr(this['locale'],this['_source']);return _0x337a97['delegate']('addResourceToContext')['to'](this),_0x337a97['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x337a97;}['_createSkeletonView'](){const _0x2b0964=new je(this['locale'],Ce['aiChatResources']);return _0x2b0964['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x5c7a84=>!_0x5c7a84)]}}),_0x2b0964;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x295ee8){const _0x9ccd5e=_0x5ef33e();this['_latestLoadResourcesUid']=_0x9ccd5e,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x295ee8,'uid':_0x9ccd5e}),this['isLoading']=!0x0;}['setResources'](_0x5ea150,_0x36d83b){if(_0x36d83b&&_0x36d83b!==this['_latestLoadResourcesUid'])return;const _0x2a9853=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x5ea150,_0x2a9853),_0x5ea150['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x2ab3ab,_0x411299){this['_resourcesListView']['updateResourceState'](_0x2ab3ab,_0x411299);}}const xa='ck-ai-chat-context-controls__source-balloon-panel',La='ck-button-icon\x20ck-button-back',Da='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class ko{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x2b2ef6,_0x5a8895,_0x184d3a){this['_locale']=_0x2b2ef6,this['_bodyCollection']=_0x5a8895,this['_config']=_0x184d3a;}['showSourceResourcesBalloon'](_0x2c0ce4){let _0x56d159=this['_sourceResourceBalloons']['get'](_0x2c0ce4['id']);_0x56d159||(_0x56d159=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x2c0ce4['id'],_0x56d159),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x56d159)),this['_addSourceResourceContent'](_0x56d159,_0x2c0ce4),_0x56d159['show']();const _0xc059b1=this['_config']['getTargetElement']();_0xc059b1&&_0x56d159['pin']({'target':_0xc059b1,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x1364fa,_0x3c8f1a,_0xcb89dd){const _0x538cf9=this['_sourceResourceBalloons']['get'](_0x1364fa);if(!_0x538cf9)return;const _0x5cb733=this['_getResourcesViewFromBalloon'](_0x538cf9);_0x5cb733&&(_0x5cb733['setResources'](_0x3c8f1a,_0xcb89dd),_0x5cb733['once']('change:isLoading',()=>{_0x538cf9['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x51494a){const _0x2d9583=this['_sourceResourceBalloons']['get'](_0x51494a);_0x2d9583&&requestAnimationFrame(()=>{_0x2d9583['hide'](),this['_sourceResourceBalloons']['delete'](_0x51494a),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x2fa2c2 of this['_sourceResourceBalloons']['values']())if(_0x2fa2c2['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x1d7fbc,_0x59df37,_0x11e3b1){const _0x275c9a=this['_sourceResourceBalloons']['get'](_0x1d7fbc);if(!_0x275c9a||!_0x275c9a['isVisible'])return;const _0x4a28aa=this['_config']['getTargetElement']();if(!_0x4a28aa)return;_0x275c9a['pin']({'target':_0x4a28aa,'limiter':this['_config']['getLimiterElement']()});const _0xff5d98=this['_getResourcesViewFromBalloon'](_0x275c9a);_0xff5d98&&_0xff5d98['updateResourceState'](_0x59df37,_0x11e3b1);}['destroy'](){for(const _0x5cead8 of this['_sourceResourceBalloons']['values']())_0x5cead8['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x583f52=new _0x179f18(this['_locale']);return _0x583f52['extendTemplate']({'attributes':{'class':xa}}),this['_bodyCollection']['add'](_0x583f52),_0x583f52;}['_addSourceResourceContent'](_0x126f3b,_0x52bdf8){_0x126f3b['content']['clear']();const _0x59aa8b=this['_createBalloonHeader'](_0x126f3b,_0x52bdf8);_0x126f3b['content']['add'](_0x59aa8b);const _0x5066ee=this['_createBalloonResourcesView'](_0x52bdf8);_0x126f3b['content']['add'](_0x5066ee);}['_createBalloonHeader'](_0x5a63e4,_0xdc7d1c){const _0x6e62e1=this['_createBackButton'](_0x5a63e4),_0x3a122a=new _0x4f9b0c(this['_locale'],{'label':_0xdc7d1c['label'],'class':Da});return _0x3a122a['children']['add'](_0x6e62e1,0x0),_0x3a122a;}['_createBackButton'](_0x1c4e62){const _0x3a31b4=new _0x5cde82(this['_locale']);return _0x3a31b4['set']({'icon':_0x52404d,'tooltip':C(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':La}),_0x3a31b4['on']('execute',()=>{_0x1c4e62['hide'](),this['_config']['onBackToContext']();}),_0x3a31b4;}['_createBalloonResourcesView'](_0x2f6a1e){const _0x18a5ab=new Or(this['_locale'],{'source':_0x2f6a1e,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x18a5ab['on']('loadSourceResources',(_0x536994,_0x56645f)=>{this['_config']['onLoadSourceResources'](_0x56645f);}),_0x18a5ab['on']('addResourceToContext',(_0x3e8438,_0x3c345f)=>{this['_config']['onResourceSelected'](_0x3c345f['source'],_0x3c345f['resource']),this['closeSourceResourceBalloon'](_0x2f6a1e['id']);}),_0x18a5ab;}['_getResourcesViewFromBalloon'](_0x4afcaf){const _0x41a094=_0x4afcaf['content']['get'](0x1);return _0x41a094 instanceof Or?_0x41a094:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x311a1f){_0x2cf367({'emitter':_0x311a1f,'contextElements':[_0x311a1f['element']],'callback':()=>{_0x311a1f['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x311a1f['isVisible']});}}const ms=['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=[_0x179f18['defaultPositions']['northArrowSouthWest'],_0x179f18['defaultPositions']['northArrowSouth'],_0x179f18['defaultPositions']['northArrowSouthEast'],_0x179f18['defaultPositions']['southArrowNorthWest'],_0x179f18['defaultPositions']['southArrowNorth'],_0x179f18['defaultPositions']['southArrowNorthEast']];class us extends _0x10aa9f{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x1d592c,_0x50c61e){super(_0x1d592c),this['bodyCollection']=_0x50c61e['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x1d592c),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x1d592c),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x1d592c),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x1d592c,_0x50c61e);const _0x423ad3={'cssClasses':{'showMoreButton':Oo,'showMoreBalloon':Mo,'overflowContainer':No,'controlsButton':Lo}};this['_overflowManager']=new Ao(_0x1d592c,this['_currentContextsChips'],_0x423ad3,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'](_0x1751d6,_0x696961){const _0x46c59a=this['_createContextButton'](_0x1751d6,'current',!0x0,_0x696961);this['_addContextToCollection'](_0x46c59a,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x52de82){this['_removeContextFromCollection'](_0x52de82,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x52de82,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x51e07f,_0x55c8ab){let _0x2051cf=this['_currentContextsChips']['find'](_0x39f899=>_0x39f899['id']===_0x51e07f);_0x2051cf||(_0x2051cf=this['_overflowManager']['overflowChips']['find'](_0x5f4b6e=>_0x5f4b6e['id']===_0x51e07f)),_0x2051cf&&(_0x2051cf['isLoading']=_0x55c8ab);}['setConversationContext'](_0x3a041e){this['_conversationContextsChips']['clear']();for(const _0x3b89ab of _0x3a041e){const _0x5e6f9a=this['_createContextButton'](_0x3b89ab,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x5e6f9a,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x4193e8,_0x5479c7,_0x3cbdde){this['_resourcesBalloonView']['updateResourceState'](_0x4193e8,_0x5479c7,_0x3cbdde);}['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'](_0x32b11c){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x32b11c),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x13984c,_0x154a68,_0x1c92f0,_0x4f5d01){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x13984c,_0x1c92f0,_0x4f5d01);}['closeSourceResourceBalloon'](_0x233043){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x233043),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0xa0aa99){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0xa0aa99),this['_setAddContextButtonEnabled'](_0xa0aa99);}['_setAddContextButtonEnabled'](_0x37a6f7){const _0x530a02=!_0x37a6f7['document']['isHidden']&&_0x37a6f7['document']['enabled'],_0x171acf=_0x37a6f7['urls']['enabled'],_0x4a2089=_0x37a6f7['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x530a02||_0x171acf||_0x4a2089;}['_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'](_0x2ec9cd){const _0x1c05c8=new _0x5cde82(_0x2ec9cd);return _0x1c05c8['set']({'label':C(_0x2ec9cd,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Lo+'\x20'+Io,'icon':_0x5e57c2,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x1c05c8;}['_createAddContextBalloonPanelView'](_0x57f434){return this['_createBaseBalloonPanel'](_0x57f434,Vo);}['_createUrlBalloonPanelView'](_0x32281f){const _0x24c4f3=this['_createBaseBalloonPanel'](_0x32281f,Po);return this['_addUrlContent'](_0x24c4f3,_0x32281f),_0x24c4f3;}['_createResourcesBalloonView'](_0x39c1fe,_0x397a4d){const _0x37e0de={'searchInputVisibleFrom':_0x397a4d['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo});},'onResourceSelected':(_0x4f1617,_0x24895e)=>{this['fire']('addResourceToContext',{'source':_0x4f1617,'resource':_0x24895e});},'onLoadSourceResources':_0xad9a1f=>{this['fire']('loadSourceResources',_0xad9a1f);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new ko(_0x39c1fe,_0x397a4d['bodyCollection'],_0x37e0de);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Ho)||document['body'];}['_createBaseBalloonPanel'](_0x6d3607,_0x120f02){const _0x148d69=new _0x179f18(_0x6d3607);return _0x148d69['extendTemplate']({'attributes':{'class':_0x120f02}}),this['bodyCollection']['add'](_0x148d69),_0x148d69;}['_setBalloonPanelContent'](_0x118fe3,_0x5e7511,_0x343d2e){if(_0x118fe3['content']['clear'](),!_0x343d2e['document']['isHidden']&&_0x343d2e['document']['enabled']){const _0x53666f=this['_createBalloonButton'](_0x5e7511,{'label':C(_0x5e7511,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x3af6f7});_0x53666f['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x118fe3['content']['add'](_0x53666f);}if(_0x343d2e['urls']['enabled']){const _0x128697=this['_createBalloonButton'](_0x5e7511,{'label':C(_0x5e7511,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0xe254f0});_0x128697['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo}),this['_urlInputView']['focus']();}),_0x118fe3['content']['add'](_0x128697);}if(_0x343d2e['files']['enabled']){const _0x2872ce=new _0x522a32(_0x5e7511);_0x2872ce['set']({'label':C(_0x5e7511,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x2625c2,'withText':!0x0,'tooltip':!0x0,'class':Ro,'allowMultipleFiles':!0x0}),_0x2872ce['on']('done',(_0x6a60ca,_0x40d918)=>{this['fire']('addFileToContext',_0x40d918),this['hideAddContextBalloonPanel']();}),_0x2872ce['tooltip']=!0x0,_0x118fe3['content']['add'](_0x2872ce);}for(const _0x1244f1 of _0x343d2e['sources']){const _0x54c816=this['_createBalloonButton'](_0x5e7511,{'label':_0x1244f1['label'],'icon':_0x1244f1['icon']||_0x2ca83b,'type':'source'});_0x118fe3['content']['add'](_0x54c816),_0x54c816['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x1244f1);});}}['_addUrlContent'](_0x157d09,_0xf9a5b2){this['_urlInputView']=new To(_0xf9a5b2),this['_urlInputView']['on']('submitUrl',(_0x595f49,_0x1e3fa3)=>{this['_handleUrlSubmit'](_0x1e3fa3);}),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});}),_0x157d09['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x12cacc,_0x366819){const _0x49a569='source'===_0x366819['type']?new Pa(_0x12cacc):new _0x5cde82(_0x12cacc);return _0x49a569['set']({'label':_0x366819['label'],'icon':_0x366819['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Ro}),_0x49a569;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x2cf367({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x31ac7e){const _0x77eaa1=this['_addContextBalloonConfig'];_0x77eaa1['buttonView']['isOn']=_0x31ac7e,_0x31ac7e?_0x77eaa1['balloonView']['show']():_0x77eaa1['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x21d443,buttonView:_0x38ab5a,hideMethod:_0x514a91}=this['_addContextBalloonConfig'];_0x2cf367({'emitter':_0x21d443,'contextElements':[_0x21d443['element'],_0x38ab5a['element']],'callback':()=>{_0x514a91();},'activator':()=>_0x38ab5a['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x124de9,_0x21e3cb,_0x4cf2b7=!0x1,_0x1932d2=!0x1){const _0x8b9f94='conversation'===_0x21e3cb||!0x0===_0x124de9['isReadOnly'],_0x2fbc2a=new bo(this['locale'],_0x124de9,_0x8b9f94,_0x4cf2b7,_0x1932d2);return _0x8b9f94||_0x2fbc2a['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x2fbc2a['id']);}),_0x2fbc2a;}['_addContextToCollection'](_0x5cb669,_0xe509f6){_0xe509f6['add'](_0x5cb669,0x0);}['_removeContextFromCollection'](_0x39b195,_0x20276b){const _0x4aeb9a=_0x20276b['find'](_0x277654=>_0x277654['id']===_0x39b195);_0x4aeb9a&&_0x20276b['remove'](_0x4aeb9a);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jo}));}['_handleUrlSubmit'](_0x72d09a){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x72d09a);}}class Pa extends _0x5cde82{['arrowView'];constructor(_0x1d2572){super(_0x1d2572),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 _0xa6549e=new _0x3dad93();return _0xa6549e['content']=_0xb14688,_0xa6549e['extendTemplate']({'attributes':{'class':Uo+'__arrow'}}),_0xa6549e;}}class bs extends _0x10aa9f{['_cancelButtonView'];['_loaderView'];constructor(_0x236efb){super(_0x236efb),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 _0x17b4f9=new _0x5cde82(this['locale']);return _0x17b4f9['set']({'label':C(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x2b48d9}),_0x17b4f9['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x17b4f9;}['_createLoaderView'](){const _0x37949a=new _0x10aa9f(this['locale']);return _0x37949a['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':C(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x37949a;}}class Bi extends _0x10aa9f{['_displayedModels']=[];['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x413720,_0x7c73e5){super(_0x413720),this['_contextPanelView']=this['_createContextPanelView'](_0x413720,{'bodyCollection':_0x7c73e5['bodyCollection'],'searchInputVisibleFrom':_0x7c73e5['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x413720),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x413720),this['_loaderView']=this['_createLoaderView'](_0x413720),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x413720),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'](...ms)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0xaa14ad=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0xaa14ad['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0xaa14ad['if']('isLoading','ck-hidden',_0x289a55=>_0x289a55||!this['isModelAvailable']),_0xaa14ad['if']('isModelAvailable','ck-hidden',_0x1b86d1=>!_0x1b86d1||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0xaa14ad['if']('isLoading','ck-hidden',_0x85a1c2=>!_0x85a1c2)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0xaa14ad['if']('isModelAvailable','ck-hidden',_0x53e11c=>_0x53e11c)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x2cf367({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x571850,_0x3f223b){return new us(_0x571850,_0x3f223b);}['_createPromptInputView'](_0x363465){return new ds(_0x363465,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x50eb16){return new ps(_0x50eb16);}['_createLoaderView'](_0xed0f03){return new bs(_0xed0f03);}['_createModelUnavailableMessageView'](_0x12bf22){const _0x3eff60=new gs(_0x12bf22);return _0x3eff60['delegate']('startConversation')['to'](this),_0x3eff60;}['_handlePromptInputFocus'](_0x498efa,_0x17fd14,_0x5c0be7){_0x5c0be7?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x17962a,_0x1650b7){this['_contextPanelView']['addContextItem'](_0x17962a,_0x1650b7);}['removeContextItem'](_0x407748){this['_contextPanelView']['removeContextItem'](_0x407748);}['setContextItemLoading'](_0x48bcc7,_0x44777f){this['_contextPanelView']['setContextItemLoading'](_0x48bcc7,_0x44777f);}['setIsUploadInProgress'](_0x2c61a1){this['_promptInputView']['setIsUploadInProgress'](_0x2c61a1);}['setConversationContext'](_0x9e9019){this['_contextPanelView']['setConversationContext'](_0x9e9019);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x396e4b,_0x2469c5,_0x39e48d){this['_contextPanelView']['updateResourceState'](_0x396e4b,_0x2469c5,_0x39e48d);}['setWebSearch'](_0x5e342a){this['_promptCapabilitiesView']['setWebSearch'](_0x5e342a);}['setReasoning'](_0x7c0912){this['_promptCapabilitiesView']['setReasoning'](_0x7c0912);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x51ebf6){this['_contextPanelView']['setAddContextOptions'](_0x51ebf6);}['setInputPlaceholder'](_0x572063){this['_promptInputView']['setPlaceholderText'](_0x572063);}['setModelList'](_0x1058ea,_0x5dd433){this['_displayedModels']=_0x1058ea,this['_promptCapabilitiesView']['setModelList'](_0x1058ea,_0x5dd433);}['setModel'](_0x3fd2c0){(_0x3fd2c0?this['_displayedModels']['find'](_0xab633f=>_0xab633f['id']===_0x3fd2c0['id']):null)?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x3fd2c0)):_0x3fd2c0?.['id']['startsWith']('agent')?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](this['_displayedModels'][0x0])):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x644f25){this['_promptCapabilitiesView']['disableModelSelector'](_0x644f25);}['populateSourceResourceBalloon'](_0x27bf44,_0x515718,_0x1ef30a,_0x46940f){this['_contextPanelView']['populateSourceResourceBalloon'](_0x27bf44,_0x515718,_0x1ef30a,_0x46940f);}['closeSourceResourceBalloon'](_0xe47218){this['_contextPanelView']['closeSourceResourceBalloon'](_0xe47218);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class gs extends _0x10aa9f{constructor(_0x4cbea8){super(_0x4cbea8);const _0x397d73=new _0x5cde82(_0x4cbea8);_0x397d73['set']({'label':C(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x397d73['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':C(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x397d73]}]});}}class Fi extends _0x4f9b0c{['conversationStartButton'];['resizeButton'];constructor(_0x21de37,_0x2ae6fb){super(_0x21de37,{'label':C(_0x21de37,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_t}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x21de37),this['children']['add'](this['conversationStartButton']),_0x2ae6fb&&(this['resizeButton']=Cs(_0x21de37,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x3abe6c){const _0x3eedc6=new _0x5cde82(_0x3abe6c);return _0x3eedc6['set']({'label':C(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x17d64d,'class':'ck-ai-chat__start-conversation'}),_0x3eedc6['on']('execute',()=>{this['fire']('startConversation');}),_0x3eedc6;}}class Vi extends _0x10aa9f{constructor(_0x26f64a){super(_0x26f64a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':C(_0x26f64a,'AI_DISCLAIMER_TEXT')}]}]});}}class At extends _0x10aa9f{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x18fe26,_0x1c5f05){super(_0x18fe26),this['_bodyCollection']=new qt(_0x18fe26),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Fi(_0x18fe26,_0x1c5f05['showResizeButton']),this['chatHeader']['delegate'](...St)['to'](this),this['chatFeed']=new ji(_0x18fe26,this['_bodyCollection']),this['chatFeed']['delegate'](...St)['to'](this),this['chatControls']=new Bi(_0x18fe26,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x1c5f05['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...St)['to'](this),this['chatDisclaimer']=new Vi(_0x18fe26),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x18fe26['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x184fc3,_0x12104e,_0x5a8a0b,_0x1b0b59){this['chatControls']['populateSourceResourceBalloon'](_0x184fc3,_0x12104e,_0x5a8a0b,_0x1b0b59);}['closeSourceResourceBalloon'](_0x277e3e){this['chatControls']['closeSourceResourceBalloon'](_0x277e3e);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class et extends _0x267838{static get['requires'](){return[at];}['_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(_0x29faad){super(_0x29faad);const _0x28d1bb=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new _(),this['_view']=new At(this['context']['locale'],{'showResizeButton':_0x28d1bb['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...St)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x584a52,{showDiff:_0x1644d7})=>{this['showDiff']=_0x1644d7;}),_0x28d1bb['view']['addTab']({'id':'chat','buttonLabel':C(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_t,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x5a2d10=>_0x5a2d10),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x1a1c03=>_0x1a1c03),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x13b584){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x13b584['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':C(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x384241,staticMessage:_0x409009}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x384241,'initialContent':'<p>'+_0x409009+'</p>'});}['addFeedItemUserMessage'](_0x414aec){const _0xdc333f=_0x414aec['quickActionData']?.['displayedPrompt']||_0x414aec['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x414aec['contextItems']['values']()),'initialContent':'<p>'+_0xdc333f+'</p>','id':_0x414aec['id']});}['addFeedItemError']({errorMessage:_0x6512dd,id:_0x3f3fc3}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x6512dd+'</p>','id':_0x3f3fc3});}['addFeedItemAIReply'](_0x3a9b73){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x3a9b73['interactionId']+':'+_0x3a9b73['id']}),this['setLoadingMessage'](null);});}async['addFeedItemAISuggestion'](_0x4d665d){const _0x14b523=P(this['context']);let _0x18b12e=_0x14b523['config']['get']('ai.availableReplyActions')||[...k];if(_0x14b523['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x4f696e=_0x14b523['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x4f696e,'value');}}else _0x18b12e=_0x18b12e['filter'](_0x4dbe83=>'insertSuggestion'!=_0x4dbe83);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x4d665d['interactionId']+':'+_0x4d665d['id'],'areActionsDisabled':_0x4d665d['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x18b12e}),this['setLoadingMessage'](null);});}['addFeedInteractionHeader'](_0x4c896d,_0x3e239d){const _0x2e9960=this['_view']['chatFeed']['children']['last'];if(_0x2e9960 instanceof Et)return this['_view']['chatFeed']['children']['remove'](_0x2e9960),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x4c896d['id'],'capabilities':{'isWebSearchEnabled':_0x2e9960['capabilities']['isWebSearchEnabled']||_0x3e239d['isWebSearchEnabled'],'isReasoningEnabled':_0x2e9960['capabilities']['isReasoningEnabled']||_0x3e239d['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x4c896d['id'],'capabilities':_0x3e239d});}['updateFeedInteractionHeader'](_0x1e0f38){const _0x1c0e82=this['_view']['chatFeed']['children']['find'](_0x49416f=>_0x49416f['options']['id']==_0x1e0f38['id']&&_0x49416f instanceof Et);_0x1c0e82&&_0x1c0e82['set']('isVisible',_0x1e0f38['isVisible']);}async['updateFeedItemAIReplyContent'](_0x555802){const _0x426f00=_0x555802['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0xba4d4c=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x555802,'abortSignal':_0xba4d4c,'renderingStrategy':_0x426f00}),_0x555802['isDone']&&this['markFeedItemAsDone'](_0x555802['id']);});}['updateFeedItemAIReplySources'](_0x36206,_0xcb8f42){this['_view']['chatFeed']['updateWebSources'](_0x36206,_0xcb8f42);}async['updateFeedItemAIReplySuggestionContent'](_0x14408e){const _0x38f337=_0x14408e['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x625c09=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x14408e,'abortSignal':_0x625c09,'renderingStrategy':_0x38f337}),_0x14408e['isDone']&&this['markFeedItemAsDone'](_0x14408e['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x3943f2){this['_view']['chatFeed']['updateSuggestionPartState'](_0x3943f2);}['markFeedItemAsDone'](_0x38a480){this['_view']['chatFeed']['markItemAsDone'](_0x38a480);}['removeFeedInteraction'](_0x354121){this['_view']['chatFeed']['getItemIds']()['filter'](_0x1c148d=>_0x1c148d['startsWith'](_0x354121))['forEach'](_0x5ec9b9=>this['_view']['chatFeed']['removeItem'](_0x5ec9b9));}['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'](_0x4b561a){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x44fd0e=>_0x44fd0e['startsWith'](_0x4b561a['id']))['forEach'](_0x3687b3=>this['markFeedItemAsDone'](_0x3687b3)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x759fbd,_0x11c9da){this['_view']['chatControls']['addContextItem'](_0x759fbd,_0x11c9da);}['removeContextItem'](_0x2435e8){this['_view']['chatControls']['removeContextItem'](_0x2435e8);}['setContextItemLoading'](_0x58f5b7,_0x5c0198){this['_view']['chatControls']['setContextItemLoading'](_0x58f5b7,_0x5c0198);}['setIsUploadInProgress'](_0x3f519b){this['_view']['chatControls']['setIsUploadInProgress'](_0x3f519b);}['setConversationContext'](_0x451fc4){this['_view']['chatControls']['setConversationContext'](_0x451fc4);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x3f1f8f,_0x46472a,_0x5b6221){this['_view']['chatControls']['updateResourceState'](_0x3f1f8f,_0x46472a,_0x5b6221);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x2b9119){this['_view']['chatControls']['setAddContextOptions'](_0x2b9119);}['updateCapabilities'](_0x429f6f){this['_view']['chatControls']['setWebSearch'](_0x429f6f['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x429f6f['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x429f6f));}['setSelectedModel'](_0x431960,_0x5b0480){this['_view']['chatControls']['setModel'](_0x431960),_0x5b0480&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x1aa19b){this['feedItemRenderingStrategy']=_0x1aa19b;}['toggleLoadingSkeleton'](_0x362a9c){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x362a9c);}['resetConversationTitle'](){this['setConversationTitle'](C(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x16a13b,_0x34757b=!0x1){if(_0x34757b&&!It()&&_0x16a13b['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x16a13b);this['_view']['chatHeader']['label']=_0x16a13b;}['setLoadingMessage'](_0x5029c6){const _0x1150bb=this['_getLoadingMessage'](_0x5029c6);this['_view']['chatFeed']['setLoadingMessage'](_0x1150bb);}['_animateConversationTitle'](_0x54fe39){let _0x21bea8=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x54fe39[_0x21bea8],_0x21bea8++,_0x21bea8===_0x54fe39['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x466a69){this['_view']['chatHeader']['isMaximized']=_0x466a69;}['_getLoadingMessage'](_0x4d2527){return _0x4d2527?_0x4d2527['isWebSearchEnabled']&&_0x4d2527['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x4d2527['isWebSearchEnabled']?C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x4d2527['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):C(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR'):'';}['_getInputPlaceholder'](_0x19618c){return _0x19618c?_0x19618c['isWebSearchEnabled']&&_0x19618c['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x19618c['isWebSearchEnabled']?C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x19618c['isReasoningEnabled']?C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):C(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x2f6930,_0x1ddf6d,_0x4bb8a0,_0x43f7d4){this['_view']['populateSourceResourceBalloon'](_0x2f6930,_0x1ddf6d,_0x4bb8a0,_0x43f7d4);}['closeSourceResourceBalloon'](_0x15710a){this['_view']['closeSourceResourceBalloon'](_0x15710a);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x32e491,_0x286dda){this['_view']['chatFeed']['scrollToSuggestion'](_0x32e491,_0x286dda);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Ji extends _0x4a219d{['sections'];constructor(_0x103203,_0x493f02){super(_0x103203),this['sections']=_0x493f02,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x315e5b){let _0x1393be=0x0,_0x37f2ec=0x0;for(const _0x156d45 of this['sections']){const {resultsCount:_0x14b7fe,totalItemsCount:_0x4cdc61}=_0x156d45['filter'](_0x315e5b);_0x1393be+=_0x14b7fe,_0x37f2ec+=_0x4cdc61;}return{'resultsCount':_0x1393be,'totalItemsCount':_0x37f2ec};}}class Ki extends _0x2ced3c{['title'];['itemsViews'];['_itemsListView'];constructor(_0xb68378,{title:_0x494cc6,items:_0x4a5a33}){super(_0xb68378);const _0x5eaed0=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x494cc6,this['itemsViews']=_0x4a5a33;const _0x26e53a=new _0x10aa9f(_0xb68378);_0x26e53a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x4a219d(_0xb68378),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x5eaed0['if']('isVisible','ck-hidden',_0x13831b=>!_0x13831b)]},'children':[_0x26e53a,this['_itemsListView']]});}['filter'](_0x502739){const _0x1d5a79=this['itemsViews']['length'];let _0x54b05b=0x0;for(const _0x304b9b of this['itemsViews']){if(_0x502739){const _0x53a0c5=_0x304b9b['isMatching'](_0x502739);_0x304b9b['isVisible']=!!_0x53a0c5,_0x304b9b['highlightText'](_0x502739);}else _0x304b9b['isVisible']=!0x0,_0x304b9b['highlightText'](null);_0x304b9b['isVisible']&&_0x54b05b++;}return this['isVisible']=_0x54b05b>0x0,{'resultsCount':_0x54b05b,'totalItemsCount':_0x1d5a79};}['getItem'](_0x143e81){return this['itemsViews']['find'](_0x147055=>_0x147055['id']===_0x143e81);}['removeItem'](_0x48066c){const _0x150718=this['itemsViews']['indexOf'](_0x48066c);-0x1!==_0x150718&&(this['itemsViews']['splice'](_0x150718,0x1),this['_itemsListView']['items']['remove'](_0x48066c));}}class Qi extends/* #__PURE__ -- @preserve */
27
+ _0x3a5d8a(_0x2ced3c){['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(_0x3429f5,_0x302460){super(_0x3429f5);const _0x23d0be=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x302460['pinned']),this['set']('loadingState',null),this['id']=_0x302460['id'];const {title:_0x173ac8,createdAt:_0x4a0245,active:_0x495837=!0x1}=_0x302460;this['_titleView']=new _0x4eed03(),this['_titleView']['text']=_0x173ac8,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x49052e=this['_createCheckView'](),_0x568fd2=this['_createPinButtonView'](_0x3429f5),_0x735486=this['_createMenuDropdownView'](),_0x42a2e8=this['_createEditInputView'](_0x3429f5,_0x173ac8),_0x277f68=this['_createAcceptEditButtonView'](_0x3429f5,_0x42a2e8),_0xea046f=this['_createCancelEditButtonView'](_0x3429f5,_0x42a2e8);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x568fd2),this['actions']['add'](_0x735486),this['on']('change:isEdit',(_0x53da63,_0x1c8bf3,_0x376e9a)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x376e9a?(this['actions']['add'](_0x277f68),this['actions']['add'](_0xea046f),this['mainContent']['add'](_0x42a2e8),_0x42a2e8['element']['focus']()):(this['actions']['add'](_0x568fd2),this['actions']['add'](_0x735486),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x495837?'ck-ai-chat-history__item--active':'',_0x23d0be['if']('isVisible','ck-hidden',_0x2afd2d=>!_0x2afd2d),_0x23d0be['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',_0x23d0be['if']('loadingState','ck-hidden',_0x3345fe=>!!_0x3345fe)]},'children':_0x495837?[_0x49052e]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x23d0be['if']('loadingState','ck-hidden',_0x438d15=>!_0x438d15)]},'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',_0x23d0be['if']('loadingState','ck-hidden',_0x37bd76=>!!_0x37bd76)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x23d0be['if']('loadingState','ck-hidden',_0x356760=>!_0x356760)]},'children':[{'text':_0x23d0be['to']('loadingState',_0x5a6065=>_0x5a6065?C(this['locale'],Qi['LOADING_LABELS'][_0x5a6065]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x4a0245]}]},{'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'](_0x284064){this['_titleView']['text']=_0x59aba(_0x284064);}['updateLoadingState'](_0x2f41ac,_0x39a43a){this['set']('loadingState',_0x39a43a?_0x2f41ac:null);}['_createCheckView'](){const _0x51b697=new _0x3dad93();return _0x51b697['set']({'content':_0x47bafa}),_0x51b697;}['_createPinButtonView'](_0x527229){const _0x35ad01=new _0x5cde82(_0x527229);return _0x35ad01['set']({'label':C(_0x527229,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x47880f,'withText':!0x1,'tooltip':!0x0}),_0x35ad01['bind']('isOn')['to'](this,'pinned'),_0x35ad01['on']('execute',()=>{const _0x27db92=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x27db92});}),_0x35ad01;}['_createMenuDropdownView'](){const _0x150877=_0x1fe5fd(this['locale'],_0x2515fe),_0x3da708=_0x150877['panelView']['children'];_0x150877['buttonView']['set']({'label':C(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x3c01b9}),_0x150877['panelPosition']='sw';const _0x27a312=new _0x5cde82(this['locale']);_0x27a312['label']=C(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x27a312['withText']=!0x0,_0x27a312['on']('execute',()=>{this['isEdit']=!0x0;});const _0x383805=new _0x5cde82(this['locale']);_0x383805['label']=C(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x383805['withText']=!0x0,_0x383805['on']('execute',()=>{this['showConfirm'](C(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x1f7455=new _0x4a219d(this['locale']),_0x233cfb=new _0x2ced3c(this['locale']);_0x233cfb['children']['add'](_0x27a312);const _0x1b97a9=new _0x2ced3c(this['locale']);return _0x1b97a9['children']['add'](_0x383805),_0x1f7455['items']['addMany']([_0x233cfb,_0x1b97a9]),_0x3da708['add'](_0x1f7455),_0x150877;}['_createEditInputView'](_0x28c34a,_0x2ea06a){const _0x501ac8=new _0x35834b(_0x28c34a),_0x4952d3=_0x501ac8['bindTemplate'];return _0x501ac8['value']=_0x2ea06a,_0x501ac8['extendTemplate']({'on':{'keydown':_0x4952d3['to'](_0x206b05=>{'Enter'==_0x206b05['key']&&this['_commitEditInputValue'](_0x501ac8);})}}),_0x501ac8;}['_createAcceptEditButtonView'](_0x5a7df9,_0x5a0733){const _0x1247b8=new _0x5cde82(_0x5a7df9);return _0x1247b8['set']({'icon':_0x47bafa,'withText':!0x1,'tooltip':C(_0x5a7df9,'AI_CHAT_HISTORY_ACCEPT')}),_0x1247b8['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x1247b8['on']('execute',()=>{this['_commitEditInputValue'](_0x5a0733);}),_0x1247b8;}['_commitEditInputValue'](_0x3e250e){const _0x2780dd=_0x3e250e['element']['value']||'';this['_titleView']['text']=_0x2780dd,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x2780dd});}['_createCancelEditButtonView'](_0x2776ce,_0x2a91b1){const _0x16e4ee=new _0x5cde82(_0x2776ce);return _0x16e4ee['set']({'icon':_0x27c5a9,'withText':!0x1,'tooltip':C(_0x2776ce,'AI_CHAT_HISTORY_CANCEL')}),_0x16e4ee['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x16e4ee['on']('execute',()=>{this['isEdit']=!0x1,_0x2a91b1['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x16e4ee;}['_createSpinnerView'](){const _0x2f2a8a=new Le('tiny');return _0x2f2a8a['isVisible']=!0x0,_0x2f2a8a;}['isMatching'](_0x492ec2){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x492ec2)?{'title':!0x0}:null;}['highlightText'](_0x4f88c1){this['_titleView']['highlightText'](_0x4f88c1);}}class vt extends _0x10aa9f{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x593f88,_0x11a483){super(_0x593f88),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0x318d49=new _0x4f9b0c(_0x593f88,{'label':C(_0x593f88,'AI_CHAT_HISTORY_HEADING'),'icon':Ht,'class':'ck-ai-header\x20ck-ai-header_history'});_0x11a483&&(this['resizeButton']=Cs(_0x593f88,this),_0x318d49['children']['add'](this['resizeButton'])),this['sectionsView']=new Ji(_0x593f88,[]),this['sectionsView']['delegate'](...Xi)['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':[_0x318d49,{'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 _0x19c724=new _0x722ee7(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':C(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x5c8fdf=>C(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x5c8fdf),'secondary':C(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0x19c724['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0x19c724['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x113e78=>!_0x113e78)]}}),_0x19c724;}['_createSkeletonView'](){const _0x1a2a5f=new je(this['locale'],Ce['aiHistory']);return _0x1a2a5f['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0xeaef85=>!_0xeaef85)]}}),_0x1a2a5f;}['_createErrorView'](){const _0x52280d=new _0x10aa9f(this['locale']),_0x219e07=new _0x5cde82(this['locale']);return _0x219e07['set']({'withText':!0x1,'icon':_0x27c5a9,'class':'ck-ai-chat-error__dismiss-button'}),_0x219e07['bind']('isVisible')['to'](this,'hasItems',_0x4a6704=>!!_0x4a6704),_0x219e07['on']('execute',()=>{this['errorMessage']='';}),_0x52280d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x51654f=>!_0x51654f)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x219e07]}),_0x52280d;}['_createEmptyStateView'](){const _0x2521e8=new _0x5cde82(this['locale']);_0x2521e8['set']({'label':C(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x17d64d,'class':'ck-ai-chat__start-conversation'}),_0x2521e8['on']('execute',()=>{this['fire']('openChat');});const _0x57da9f=new _0x10aa9f(this['locale']);return _0x57da9f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x5b2dd1=>!_0x5b2dd1)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[C(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x2521e8]}),_0x57da9f;}['_createListItemViews'](_0x35ec43,_0x2fa1bd){const _0x38b3c6=[];for(const _0x587686 of _0x35ec43){const _0x32ad91=new Qi(_0x2fa1bd,_0x587686);_0x32ad91['delegate'](...Xi)['to'](this),_0x38b3c6['push'](_0x32ad91);}return _0x38b3c6;}['updateHistoryItemsWithCategories'](_0x5d918e){const _0x36b623=this['locale']||'en',_0x3a010d=[];for(const _0x5a7c6c of _0x5d918e){const _0x2cdf2a=this['_createListItemViews'](_0x5a7c6c['items'],_0x36b623);_0x3a010d['push'](new Ki(_0x36b623,{'title':_0x5a7c6c['title'],'items':_0x2cdf2a}));}this['sectionsView']['sections']=_0x3a010d,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x3a010d),this['hasItems']=_0x5d918e['some'](_0x337dfb=>_0x337dfb['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x4e9990){for(const _0x3015c9 of this['sectionsView']['sections']){const _0x465533=_0x3015c9['getItem'](_0x4e9990);if(_0x465533){if(_0x3015c9['removeItem'](_0x465533),0x0===_0x3015c9['itemsViews']['length']){const _0x9230a4=this['sectionsView']['sections']['indexOf'](_0x3015c9);-0x1!==_0x9230a4&&(this['sectionsView']['sections']['splice'](_0x9230a4,0x1),this['sectionsView']['items']['remove'](_0x3015c9));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0xf5a56,_0x53c10d){for(const _0x20b34b of this['sectionsView']['sections']){const _0x5bbcdf=_0x20b34b['getItem'](_0xf5a56);if(_0x5bbcdf){_0x5bbcdf['updateTitle'](_0x53c10d);break;}}}['updateItemLoadingState'](_0x215b99,_0x405510,_0x3a4b66){for(const _0x1be440 of this['sectionsView']['sections']){const _0xe788fc=_0x1be440['getItem'](_0x215b99);if(_0xe788fc){_0xe788fc['updateLoadingState'](_0x405510,_0x3a4b66);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x229375=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x229375);}}}const Xi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class jt extends _0x267838{static get['requires'](){return[at];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x58cdb2){super(_0x58cdb2);const _0x3302ae=this['context']['plugins']['get']('AITabs');this['_historyView']=new vt(this['context']['locale'],_0x3302ae['showResizeButton']),this['_historyView']['delegate'](...Xi)['to'](this),_0x3302ae['view']['addTab']({'id':'history','buttonLabel':C(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x55c4c1){this['_historyView']['removeHistoryItem'](_0x55c4c1);}['updateItems'](_0x1f185c){this['_historyView']['updateHistoryItemsWithCategories'](_0x1f185c);}['updateItemTitle'](_0x1aa6ee,_0x1b103b){this['_historyView']['updateItemTitle'](_0x1aa6ee,_0x1b103b);}['updateItemLoadingState'](_0x5b0905,_0x6447f9,_0x4cc7d2){this['_historyView']['updateItemLoadingState'](_0x5b0905,_0x6447f9,_0x4cc7d2);}['setLoadingSkeleton'](_0x338610){this['_historyView']['isLoading']=_0x338610;}['showError'](_0x2fb6cb){this['_historyView']['errorMessage']=_0x2fb6cb;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x11cc7f){this['_historyView']['isMaximized']=_0x11cc7f;}}class De extends _0x314197(){['id'];['createdAt'];constructor({id:_0x5da507,title:_0x3058f0,createdAt:_0x68d3aa,updatedAt:_0xc1f012,pinned:_0x2e95db}){super(),this['id']=_0x5da507,this['createdAt']=new Date(_0x68d3aa),this['set']('title',_0x3058f0),this['set']('updatedAt',_0xc1f012?new Date(_0xc1f012):null),this['set']('pinned',_0x2e95db||!0x1);}['updateTitle'](_0x1fd844){this['set']('title',_0x59aba(_0x1fd844)),this['updatedAt']=new Date();}['updatePinned'](_0x47d355){this['set']('pinned',_0x47d355),this['updatedAt']=new Date();}}class Tt extends _0x7d5e47(){['items']=[];['connector'];['group'];constructor({connector:_0x33a212,group:_0x47f936}){super(),this['connector']=_0x33a212,this['group']=_0x47f936;}async['init'](){try{const _0x28c38b=this['connector']['fetchConversations'](this['group']),_0x41b42f=await _0x28c38b['getConversations']();this['loadItems'](_0x41b42f);}catch(_0x29428a){this['fire']('error',{'error':_0x29428a,'operation':'init'});}}['addItem'](_0x40a8c6){this['items']['push'](_0x40a8c6);}async['removeItem'](_0x3d6937){const _0x19b1d8=this['items']['findIndex'](_0x263d84=>_0x263d84['id']===_0x3d6937);if(-0x1===_0x19b1d8)return!0x1;try{return await this['connector']['deleteConversation'](_0x3d6937)['execute'](),this['items']['splice'](_0x19b1d8,0x1),this['fire']('itemRemoved',{'itemId':_0x3d6937}),!0x0;}catch(_0x20f150){return this['fire']('error',{'error':_0x20f150,'operation':'removeItem','itemId':_0x3d6937}),!0x1;}}['getItem'](_0x552c14){return this['items']['find'](_0x381008=>_0x381008['id']===_0x552c14);}async['updateItemTitle'](_0x4261b3,_0xc54a31){const _0x54b227=this['getItem'](_0x4261b3);if(!_0x54b227)return!0x1;try{return await this['connector']['updateConversation'](_0x4261b3,{'title':_0xc54a31})['getResult'](),_0x54b227['updateTitle'](_0xc54a31),this['fire']('itemUpdated',{'itemId':_0x4261b3,'updates':{'title':_0xc54a31}}),!0x0;}catch(_0x438418){return this['fire']('error',{'error':_0x438418,'operation':'updateItemTitle','itemId':_0x4261b3}),!0x1;}}async['updateItemPinned'](_0x2c18ea,_0x4c7dc7){const _0x1046f4=this['getItem'](_0x2c18ea);if(!_0x1046f4)return!0x1;try{return await this['connector']['updateConversation'](_0x2c18ea,{'pinned':_0x4c7dc7})['getResult'](),_0x1046f4['updatePinned'](_0x4c7dc7),this['fire']('itemUpdated',{'itemId':_0x2c18ea,'updates':{'pinned':_0x4c7dc7}}),!0x0;}catch(_0x255054){return this['fire']('error',{'error':_0x255054,'operation':'updateItemPinned','itemId':_0x2c18ea}),!0x1;}}['loadItems'](_0x4375e1){try{this['items']=[],_0x4375e1['map'](_0x25530f=>{this['addItem'](new De(_0x25530f));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x562237){this['fire']('error',{'error':_0x562237,'operation':'loadItems'});}}['getItems'](_0x489e38={}){const _0x249ed7=void 0x0!==_0x489e38['pinned']&&_0x489e38['pinned'],_0x368aa9=_0x489e38['from']?new Date(_0x489e38['from']['getFullYear'](),_0x489e38['from']['getMonth'](),_0x489e38['from']['getDate']()):null,_0x49f719=_0x489e38['to']?new Date(_0x489e38['to']['getFullYear'](),_0x489e38['to']['getMonth'](),_0x489e38['to']['getDate']()):null;return this['items']['filter'](_0x5398ec=>{if(_0x5398ec['pinned']!==_0x249ed7)return!0x1;if(_0x49f719){const _0x5dda9d=new Date(_0x5398ec['createdAt']['getFullYear'](),_0x5398ec['createdAt']['getMonth'](),_0x5398ec['createdAt']['getDate']());return _0x368aa9?_0x368aa9['getTime']()===_0x49f719['getTime']()?_0x5dda9d['getTime']()===_0x368aa9['getTime']():_0x5dda9d<_0x49f719&&_0x5dda9d>=_0x368aa9:_0x5dda9d<_0x49f719;}return!0x0;});}}class yt extends _0x267838{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[s,tt,jt,at];}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'](jt),this['_aiChatController']=this['context']['plugins']['get'](tt);const _0x49fa27=this['context']['plugins']['get'](at),_0x202bd1=this['_aiChatController']['getGroupId']();this['history']=new Tt({'connector':this['_aiConnector'],'group':_0x202bd1}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x1b7398,_0x519237)=>{this['_setItemLoading'](_0x519237['id'],'remove'),this['_handleRemove'](_0x519237['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x5a482c,_0x391918)=>{this['_setItemLoading'](_0x391918['id'],'rename'),this['_handleEditTitle'](_0x391918['id'],_0x391918['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x1e027f,_0xd80516)=>{void 0x0!==_0xd80516['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0xd80516['itemId'],_0xd80516['updates']['title']),void 0x0!==_0xd80516['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0xd80516['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x557136,_0x206d28)=>{this['_aiChatController']['handleRemovedConversation'](_0x206d28['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x206d28['itemId']),this['_clearItemLoading'](_0x206d28['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x22e014,_0x14e46f)=>{this['_handleHistoryErrorUI'](_0x14e46f['error'],_0x14e46f['operation'],_0x14e46f['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x2bc68b,_0x1d2a87)=>{this['_handleSelectConversation'](_0x1d2a87['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x8d4f02,_0x50c38d)=>{const _0x432741=_0x50c38d['pinned']?'pin':'unpin';this['_setItemLoading'](_0x50c38d['id'],_0x432741),this['_handleTogglePin'](_0x50c38d['id'],_0x50c38d['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x49fa27['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x49fa27['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x49fa27,'resizedTabs',(_0x12e94b,_0x191af9)=>{this['_setIsMaximized'](_0x191af9);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x49fa27['resize']();});}async['_handleEditTitle'](_0x4e7ae0,_0x651de5){await this['history']['updateItemTitle'](_0x4e7ae0,_0x651de5);}async['_handleTogglePin'](_0x160df2,_0x5ca377){await this['history']['updateItemPinned'](_0x160df2,_0x5ca377);}async['_handleRemove'](_0x41d774){await this['history']['removeItem'](_0x41d774);}async['_handleSelectConversation'](_0x4eb612){await this['_aiChatController']['loadConversation'](_0x4eb612);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x29d7e5=this['_aiChatController']['activeConversation']?.['id'],_0x44b517=this['_getCategorizedItems']()['map'](_0x2245ef=>({'title':_0x2245ef['title'],'items':_0x2245ef['items']['map'](_0x2f4620=>({'id':_0x2f4620['id'],'title':_0x2f4620['title']||C(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x2f4620['createdAt'])['toLocaleDateString'](),'active':_0x2f4620['id']===_0x29d7e5,'pinned':_0x2f4620['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x44b517);}['_setItemLoading'](_0x39b0f5,_0x569b56){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x39b0f5,_0x569b56,!0x0);}['_clearItemLoading'](_0x214747){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x214747,null,!0x1);}['_handleHistoryErrorUI'](_0x1c5985,_0x112138,_0x5113d4){const _0xe44ca5=this['_generateErrorMessage'](_0x112138,_0x5113d4);this['_aiChatHistoryUi']['showError'](_0xe44ca5),_0x5113d4&&this['_clearItemLoading'](_0x5113d4),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x2125a6,_0x1786f1){const _0x5eeabc=_0x1786f1?this['history']['getItem'](_0x1786f1):null,_0x32d83f=_0x5eeabc?.['title']||C(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x2125a6){case'updateItemTitle':return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x32d83f);case'updateItemPinned':{const _0x34a18f=C(this['context']['locale'],_0x5eeabc?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x34a18f,_0x32d83f]);}case'removeItem':return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x32d83f);case'init':case'loadItems':return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return C(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x2301b8=new Date(),_0x2e54f5=new Date(_0x2301b8['getFullYear'](),_0x2301b8['getMonth'](),_0x2301b8['getDate']()),_0x31bc3e=new Date(_0x2e54f5);_0x31bc3e['setDate'](_0x31bc3e['getDate']()-0x1);const _0x45e875=new Date(_0x2e54f5);_0x45e875['setDate'](_0x45e875['getDate']()-0xe);const _0x2912ff=this['history']['getItems']({'pinned':!0x0}),_0xd01b1c=this['history']['getItems']({'from':_0x2e54f5,'to':_0x2e54f5}),_0x477377=this['history']['getItems']({'from':_0x31bc3e,'to':_0x31bc3e}),_0x55e6d0=this['history']['getItems']({'from':_0x45e875,'to':_0x31bc3e}),_0x3a2dec=this['history']['getItems']({'to':_0x45e875}),_0x428390=[];return _0x2912ff['length']>0x0&&_0x428390['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x2912ff}),_0xd01b1c['length']>0x0&&_0x428390['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0xd01b1c}),_0x477377['length']>0x0&&_0x428390['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x477377}),_0x55e6d0['length']>0x0&&_0x428390['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x55e6d0}),_0x3a2dec['length']>0x0&&_0x428390['push']({'title':C(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x3a2dec}),_0x428390;}['_setIsMaximized'](_0x15cfc2){this['_aiChatHistoryUi']['setIsMaximized'](_0x15cfc2);}}class it extends _0x267838{static get['requires'](){return[yt,jt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ha extends _0x267838{static get['requires'](){return[tt,c,et,it];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x411cdd){super(_0x411cdd),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'](tt)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](tt)['startConversation']();}async['sendMessage']({message:_0x288adc,quickActionData:_0x18cf63}){await this['context']['plugins']['get'](tt)['sendMessage']({'message':_0x288adc,'quickActionData':_0x18cf63});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](tt)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](tt)['focusPromptInput']();}}class co extends Nt{constructor(_0x4a099f){super(_0x4a099f);const _0x5cd217=_0x4a099f['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x5cd217,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x57daf6=this['editor']['plugins']['get']('AITabs')['view'];_0x57daf6['isVisible']=!_0x57daf6['isVisible'];}}class bt extends _0x3711b7{static get['requires'](){return[at];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1546de=this['editor'];_0x1546de['commands']['add']('toggleAi',new co(_0x1546de)),_0x1546de['ui']['componentFactory']['add']('toggleAi',()=>{const _0x864cb8=this['_createAIUIButton'](_0x5cde82);return _0x864cb8['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x864cb8;}),_0x1546de['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x317c79=this['_createAIUIButton'](_0x3c5e19);return _0x317c79['set']({'role':'menuitemcheckbox'}),_0x317c79;});}['_createAIUIButton'](_0x53f76a){const _0x231b7c=this['editor'],_0x197e39=_0x231b7c['commands']['get']('toggleAi'),_0x18cdb4=new _0x53f76a(_0x231b7c['locale']);return _0x18cdb4['set']({'label':C(_0x231b7c['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x3e2624,'isToggleable':!0x0}),_0x18cdb4['bind']('isEnabled')['to'](_0x197e39),_0x18cdb4['bind']('isOn')['to'](_0x197e39,'value',_0x5017b5=>!!_0x5017b5),this['listenTo'](_0x18cdb4,'execute',()=>{_0x197e39['execute']();}),_0x18cdb4;}}class Ma extends _0x3711b7{static get['requires'](){return[bt,Pt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Gt(_0x1ffa63,_0x853999,_0x10a54a=!0x1,_0x814475=!0x0,_0x1366a0=!0x0){return()=>{const _0x51c9a6=_0x1ffa63['locale'],_0x5abe18=new _0x5cde82(_0x51c9a6),_0x2fbe4c=_0x5abe18['bindTemplate'];_0x1366a0&&_0x5abe18['extendTemplate']({'on':{'mouseenter':_0x2fbe4c['to'](()=>{_0x5abe18['focus']();})}});const _0x3905b1=_0x853999['icon']??_0x853999['parent']?.['icon'];return _0x5abe18['set']({'label':_0x853999['displayedPrompt'],'withText':_0x10a54a,'role':'menuitem','icon':_0x814475?_0x3905b1??_0x2faead:void 0x0,'tooltip':!_0x10a54a,'class':'ck-ai-quick-actions-button'}),_0x5abe18['on']('execute',()=>{_0x1ffa63['editing']['view']['focus'](),_0x1ffa63['commands']['execute']('aiQuickAction',_0x853999);}),_0x5abe18;};}const Ls='menu',Ns='menuitem';class ao extends _0x10aa9f{['_bodyCollection'];['optionsListView'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();constructor(_0x493a0c,_0x208ab5,_0x35d6b4,_0x583a3f){const _0x58c9d9=_0x493a0c['locale'];super(_0x58c9d9),this['_bodyCollection']=_0x583a3f;const _0x1d340b=this['_createListItems'](_0x493a0c,_0x208ab5,_0x35d6b4);this['optionsListView']=new _0x4a219d(_0x58c9d9),this['optionsListView']['role']=Ls,this['optionsListView']['items']['addMany'](_0x1d340b),this['focusTracker']=new ts(),this['keystrokes']=new _0x4c12a2(),this['_focusables']=_0x1d340b,this['focusCycler']=new $t({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x58c9d9['uiLanguageDirection']},'children':[this['optionsListView']]});}['_createListItems'](_0x452379,_0x5a1c0a,_0x96f0d3){const _0x5a5652=new _0x285700();return _0x5a1c0a['forEach'](_0x57f74a=>{'actions'in _0x57f74a?_0x5a5652['add'](this['_createActionGroupButton'](_0x452379,_0x57f74a,_0x96f0d3)):_0x5a5652['add'](this['_createActionButton'](_0x452379,_0x57f74a));}),_0x5a5652;}['_createActionButton'](_0x1ba6cf,_0x10222b){const _0x2ca564=new _0x2ced3c(this['locale']),_0x52a5be=Gt(_0x1ba6cf,_0x10222b,!0x0,void 0x0!==_0x10222b['icon'])();return _0x2ca564['children']['add'](_0x52a5be),_0x2ca564;}['_createActionGroupButton'](_0x33df64,_0x783201,_0x207dfe){const _0x46c7a9=new _0x2ced3c(this['locale']),_0x4a2501=new _0x15c9c1(this['locale']),_0x49b2bc=_0x4a2501['bindTemplate'],_0x5ed5d5='rtl'===_0x207dfe['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft',_0x545a5b=this['_createGroupActionsList'](_0x33df64,_0x783201['actions'],_0x207dfe);_0x4a2501['set']({'label':_0x783201['label'],'withText':!0x0,'role':Ns,'icon':_0x783201['icon']??_0x2faead}),_0x4a2501['extendTemplate']({'on':{'mouseenter':_0x49b2bc['to'](()=>{_0x4a2501['focus']();})}});const _0x45654c=new _0x179f18(this['locale']);return _0x45654c['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x49b2bc['to'](_0x68c369=>{_0x68c369['key']==_0x5ed5d5&&(_0x4a2501['focus'](),this['_hideNestedPanel'](_0x45654c));})}}),_0x4a2501['bind']('isOn')['to'](_0x45654c,'isVisible'),this['_bodyCollection']['add'](_0x45654c),_0x45654c['content']['add'](_0x545a5b),this['_setupGroupMenuBehavior'](_0x4a2501,_0x45654c),_0x46c7a9['children']['add'](_0x4a2501),_0x46c7a9;}['_createGroupActionsList'](_0x4b727,_0x596330,_0x1f4a3e){const _0x5c9dd3=new _0x4a219d(this['locale']);return _0x5c9dd3['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x596330['forEach'](_0x40c5f5=>{const _0xf4cf3a=new _0x2ced3c(this['locale']),_0x5d3b1d=Gt(_0x4b727,_0x40c5f5,!0x0,!0x1)();_0xf4cf3a['children']['add'](_0x5d3b1d),_0x1f4a3e['focusTracker']['add'](_0x5d3b1d),_0x5c9dd3['items']['add'](_0xf4cf3a);}),_0x5c9dd3;}['_setupGroupMenuBehavior'](_0x4239ef,_0x1e7e69){const _0xe46e7d=_0x4239ef['bindTemplate'],_0x2900a4='rtl'===_0x4239ef['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';_0x4239ef['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0xe46e7d['to'](()=>{this['_showNestedPanel'](_0x1e7e69,_0x4239ef);}),'mouseleave':_0xe46e7d['to'](_0x1f3e89=>{const _0x103e6d=_0x1f3e89['relatedTarget'];this['_isMovingToNestedMenu'](_0x103e6d,_0x1e7e69)||this['_hideNestedPanel'](_0x1e7e69);}),'keydown':_0xe46e7d['to'](_0x589e9b=>{_0x589e9b['key']==_0x2900a4&&(this['_showNestedPanel'](_0x1e7e69,_0x4239ef),_0x1e7e69['content']['get'](0x0)['focus']());})}}),_0x1e7e69['on']('render',()=>{_0x1e7e69['element']?.['addEventListener']('mouseleave',_0x1c9c63=>{const _0x501abd=_0x1c9c63['relatedTarget'];_0x4239ef['element']?.['contains'](_0x501abd)||this['_isMovingToNestedMenu'](_0x501abd,_0x1e7e69)||this['_hideNestedPanel'](_0x1e7e69);});});}['_showNestedPanel'](_0x2dad74,_0x37b5a3){this['_openNestedPanels']['forEach'](_0x48ab30=>{_0x48ab30!==_0x2dad74&&_0x48ab30['isVisible']&&_0x48ab30['hide']();}),_0x2dad74['show'](),_0x2dad74['pin']({'positions':[_0x426b9b['eastSouth']],'target':_0x37b5a3['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x2dad74);}['_hideNestedPanel'](_0x1285ac){_0x1285ac['hide'](),this['_openNestedPanels']['delete'](_0x1285ac);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x483302=>_0x483302['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x4a0936,_0x3a5c27){if(!_0x4a0936)return!0x1;if(_0x3a5c27['element']?.['contains'](_0x4a0936))return!0x0;const _0x150389=_0x4a0936;return _0x150389['closest']&&(null!==_0x150389['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x150389['closest']('.ck-ai-quick-actions-group-list')||null!==_0x150389['closest']('.ck-ai-quick-actions-group-button'));}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['optionsListView']['focus']();}}function Yt(_0x28971e,_0x10bc34,_0x501047,_0x3bd3ba){return()=>{const _0x96a37b=_0x28971e['locale'],_0x25e199=_0x1fe5fd(_0x96a37b);_0x25e199['buttonView']['set']({'icon':_0x501047['icon']??_0x2faead,'label':_0x501047['label'],'tooltip':!0x0}),_0x25e199['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x1f6615=new ao(_0x28971e,_0x10bc34,_0x25e199,_0x3bd3ba);return _0x25e199['panelView']['children']['add'](_0x1f6615),_0x25e199;};}const Ft='<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>',Wt='<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>',Bt='<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 Ot=function(_0x556daa){return _0x556daa['CHAT']='CHAT',_0x556daa['ACTION']='ACTION',_0x556daa['REVIEW']='REVIEW',_0x556daa;}({}),Ua=function(_0x32794f){return _0x32794f['CHAT']='AIChat',_0x32794f['ACTION']='AIActions',_0x32794f['REVIEW']='AIReviewMode',_0x32794f;}({});class ui extends _0x3711b7{static get['requires'](){return[zt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_prepareQuickActionsDefinition'](this['_getDefaultAndCustomActions']()),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x12c762){return function(_0x420d1b){const _0x54b7f1=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x420d1b['uiLanguage']),_0x2e8141=_0x54b7f1||'English',_0x54eb7c=[{'id':'ask-ai','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Ut},{'id':'chat-commands','label':C(_0x420d1b,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Ut,'actions':[{'id':'explain','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Ft['replace']('%0',_0x2e8141),'type':'CHAT'},{'id':'summarize','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Wt['replace']('%0',_0x2e8141),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Bt['replace']('%0',_0x2e8141),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Mt},{'id':'continue','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Kt},{'id':'fix-grammar','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Rt},{'id':'adjust-length','label':C(_0x420d1b,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Qt,'actions':[{'id':'make-shorter','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':C(_0x420d1b,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':xt,'actions':[{'id':'make-tone-casual','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Dt,'actions':[{'id':'translate-to-english','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':C(_0x420d1b,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':C(_0x420d1b,'AI_QUICK_ACTIONS_OTHER'),'icon':Lt,'actions':[]}];return _0x54eb7c;}(_0x12c762);}['_getDefaultAndCustomActions'](){const _0x5de835=ui['getDefaultQuickActions'](this['editor']['locale']),_0x3c9487=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x283fb1=>({..._0x283fb1,'icon':void 0x0}));return _0x5de835['find'](_0x436327=>'other'===_0x436327['id'])['actions']['push'](..._0x3c9487),_0x5de835;}['_initializeQuickActionsComponentsAndCommands'](){const _0x31f7d2=new qt(this['editor']['locale']);_0x31f7d2['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x31f7d2),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x31f7d2);}['_initializeQuickActionsDropdown'](_0x368a79){this['editor']['ui']['componentFactory']['add']('aiQuickActions',Yt(this['editor'],this['_quickActionsDefinition'],{'icon':_0x2faead,'label':C(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},_0x368a79));}['_prepareQuickActionsDefinition'](_0x78735d){this['_quickActionsDefinition']=_0x78735d['map'](_0x17cc48=>{if('actions'in _0x17cc48){const _0x13b7fb=_0x17cc48;return{..._0x13b7fb,'actions':_0x13b7fb['actions']['map'](_0x46a985=>{const {actions:_0x25a18c,..._0x1087d3}=_0x13b7fb;return{..._0x46a985,'parent':_0x1087d3};})['filter'](_0xe7091c=>this['_shouldIncludeAction'](_0xe7091c))};}return _0x17cc48;})['filter'](_0x2f025a=>'actions'in _0x2f025a?_0x2f025a['actions']['length']>0x0:this['_shouldIncludeAction'](_0x2f025a));}['_shouldIncludeAction'](_0x3ba6d0){const _0x12a511=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ua[_0x3ba6d0['type']])&&!_0x12a511['includes'](_0x3ba6d0['id']);}['_initializeQuickActionsComponents'](_0xca2993){this['_quickActionsDefinition']['forEach'](_0x2d9ef5=>{if('actions'in _0x2d9ef5){const _0x4f39ee=Yt(this['editor'],_0x2d9ef5['actions'],_0x2d9ef5,_0xca2993);this['editor']['ui']['componentFactory']['add'](_0x2d9ef5['id'],_0x4f39ee),_0x2d9ef5['actions']['forEach'](_0x263d48=>{const _0x51525d=Gt(this['editor'],_0x263d48);this['editor']['ui']['componentFactory']['add'](_0x263d48['id'],_0x51525d);});}else{const _0x14c09f=Gt(this['editor'],_0x2d9ef5,!0x1,!0x0,!0x1);this['editor']['ui']['componentFactory']['add'](_0x2d9ef5['id'],_0x14c09f);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x3de64a=>{const _0x3c9980=new _0x2d240a(_0x3de64a),_0x4ca50c=C(_0x3de64a,'AI_QUICK_ACTIONS_HEADING');_0x3c9980['buttonView']['set']({'label':_0x4ca50c,'icon':_0x2faead});const _0xf4da5f=new ti(_0x3de64a);_0xf4da5f['set']({'ariaLabel':_0x4ca50c,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x250623=>{if('actions'in _0x250623){const _0x3e3180=_0x250623,_0x171649=new _0x29d062(_0x3de64a,_0x3c9980),_0x24bcca=new _0x2d240a(_0x3de64a),_0x3de0ad=new ti(_0x3de64a);_0x24bcca['buttonView']['set']({'label':_0x3e3180['label'],'icon':_0x3e3180['icon']}),_0x3e3180['actions']['forEach'](_0x59ac8d=>{const _0x57ffcb=new _0x29d062(_0x3de64a,_0x24bcca),_0x2e3ebf=new _0x3c5e19(_0x3de64a);_0x2e3ebf['set']({'label':_0x59ac8d['displayedPrompt'],'icon':_0x59ac8d['icon'],'role':'menuitem'}),_0x2e3ebf['on']('execute',()=>{this['_executeQuickAction'](_0x59ac8d);}),_0x2e3ebf['delegate']('execute')['to'](_0x24bcca),_0x57ffcb['children']['add'](_0x2e3ebf),_0x3de0ad['items']['add'](_0x57ffcb);}),_0x24bcca['panelView']['children']['add'](_0x3de0ad),_0x171649['children']['add'](_0x24bcca),_0xf4da5f['items']['add'](_0x171649);}else{const _0xe75328=_0x250623,_0x303eb9=new _0x29d062(_0x3de64a,_0x3c9980),_0x57b3d1=new _0x3c5e19(_0x3de64a);_0x57b3d1['set']({'label':_0xe75328['displayedPrompt'],'icon':_0xe75328['icon'],'role':'menuitem'}),_0x57b3d1['on']('execute',()=>{this['_executeQuickAction'](_0xe75328);}),_0x57b3d1['delegate']('execute')['to'](_0x3c9980),_0x303eb9['children']['add'](_0x57b3d1),_0xf4da5f['items']['add'](_0x303eb9);}});const _0x3229fb=Object['values'](Ua)['some'](_0x2df471=>this['editor']['plugins']['has'](_0x2df471));return _0x3c9980['set']({'isEnabled':_0x3229fb}),_0x3c9980['panelView']['children']['add'](_0xf4da5f),_0x3c9980;});}['_executeQuickAction'](_0x2d4809){const _0x6afb95=this['editor'];_0x6afb95['editing']['view']['focus'](),_0x6afb95['commands']['execute']('aiQuickAction',_0x2d4809);const _0x5c29ac=_0x6afb95['ui']['view']['menuBarView'];_0x5c29ac&&_0x5c29ac['close']&&_0x5c29ac['close']();}}class Ai extends Nt{['execute'](_0x5eeb00){switch(this['_expandSelectionIfCollapsed'](),_0x5eeb00['type']){case Ot['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x5ebaa1=C(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x239292('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5ebaa1});}this['_handleAIChatAction'](_0x5eeb00);break;case Ot['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x303020=C(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x239292('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x303020});}this['_handleAIActionsAction'](_0x5eeb00);break;case Ot['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x1d1e89=C(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x239292('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x1d1e89});}this['_handleAIReviewAction'](_0x5eeb00);}}async['_handleAIChatAction'](_0x2d7eb3){const _0x4da035=this['editor']['plugins']['get']('AIChat'),_0x378b2b=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x2d7eb3['id'])_0x378b2b['removeSelectionFromChatContext'](),await _0x4da035['addSelectionToChatContext'](),_0x4da035['focusPromptInput']();else await _0x4da035['startConversation'](),_0x378b2b['removeSelectionFromChatContext'](),await _0x4da035['addSelectionToChatContext'](),_0x4da035['focusPromptInput'](),await _0x4da035['sendMessage']({'message':_0x2d7eb3['prompt']||_0x2d7eb3['displayedPrompt'],'quickActionData':{'id':_0x2d7eb3['id'],'displayedPrompt':_0x2d7eb3['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x4b4cc9=this['editor'],_0x172520=_0x4b4cc9['model']['document']['selection'];if(!_0x172520['isCollapsed'])return;const _0x40da76=_0x457991(_0x172520['getSelectedBlocks']())||_0x4b4cc9['model']['schema']['getLimitElement'](_0x172520);_0x4b4cc9['model']['change'](_0x404319=>{_0x404319['setSelection'](_0x40da76,'in');});}['_handleAIActionsActionLabel'](_0x37975c){return _0x37975c['parent']?.['label']&&'other'!==_0x37975c['parent']?.['id']?_0x37975c['parent']['label']+':\x20'+_0x37975c['displayedPrompt']:_0x37975c['displayedPrompt'];}async['_handleAIActionsAction'](_0x5ead29){const _0x5b5ca1=this['editor']['plugins']['get']('AIActions'),_0x573629=_0x5ead29['prompt']?{'userMessage':_0x5ead29['prompt'],'model':_0x5ead29['model']}:{'actionName':_0x5ead29['actionName']||_0x5ead29['id'],'args':_0x5ead29['args']},_0x235dd8=this['_handleAIActionsActionLabel'](_0x5ead29);await _0x5b5ca1['executeAction'](_0x573629,_0x235dd8,_0x5ead29['icon']);}async['_handleAIReviewAction'](_0x56e9e8){console['log']('handleAIReviewAction',_0x56e9e8);}}class gi extends _0x3711b7{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x8c2439=this['editor'],_0x5bd7d8=new Ai(this['editor']);if(_0x8c2439['commands']['add']('aiQuickAction',_0x5bd7d8),_0x8c2439['plugins']['has']('AIChat')){const _0x513a59=this['editor']['plugins']['get']('AIChat');_0x8c2439['model']['document']['selection']['on']('change:range',(_0x4dcf99,_0x51e335)=>{_0x51e335['directChange']&&_0x513a59['removeSelectionFromChatContext']();});}}}class Zt extends de{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x11134c=this['documentContextContent']['children']['map'](_0x74246=>({'node':_0x74246,'id':pt(_0x74246,'data-id')})),_0x2c65f2=this['parsedMergedContent']['children']['map'](_0x34c5bf=>({'node':_0x34c5bf,'id':pt(_0x34c5bf,'data-id')||_0x5ef33e()})),_0x59cfbb=_0x271aee(_0x11134c,_0x2c65f2,{'comparator':(_0x583297,_0x56baae)=>_0x583297['id']==_0x56baae['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x59cfbb['length']&&_0x59cfbb[_0x59cfbb['length']-0x1]['removed'];)_0x59cfbb['pop']();}const _0x5dbb76=_0x59cfbb['map'](_0x30ad29=>{const _0x42066b=_0x30ad29['added']?'new':_0x30ad29['removed']?'removed':'modified';return{'node':_0x30ad29['value'][0x0]['node'],'type':_0x42066b,'id':_0x30ad29['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x5dbb76,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x3e6437,_0xc4f3b7){return _0xc4f3b7;}}class l extends Jt{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x532045){super(_0x532045),this['content']=_0x532045['content'],this['version']=_0x532045['version'],this['actionName']=_0x532045['actionName'],this['args']=_0x532045['args'],this['userMessage']=_0x532045['userMessage'],this['model']=_0x532045['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':Xt['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x338a21){const _0x5d1464=new Zt({'editor':this['editor'],'documentContextContent':this['content'],..._0x338a21});return this['replies']['push'](_0x5d1464),_0x5d1464['delegate'](...Vt)['to'](this),this['fire']('replyCreated',_0x5d1464),_0x5d1464;}}class pi extends _0x3711b7{static get['requires'](){return[s,_0x161ed4,c,w,_0x4176c6];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x285700();['_navigationPreviousButton'];['_navigationCounter'];['_isNavigationCounterInView']=!0x1;['_navigationNextButton'];['_isNavigationPreviousButtonInView']=!0x1;['_isNavigationNextButtonInView']=!0x1;['_promiseQueue'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}constructor(_0x3f3bb4){super(_0x3f3bb4),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new _(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x30464b,_0x14c3ad,_0x397f44){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x17d44c,anchorData:_0x5472ca}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x30464b,_0x17d44c,_0x5472ca,_0x14c3ad,_0x397f44);}}const {modelFragment:_0x58dd8b,anchorData:_0x3223f8}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x30464b,_0x58dd8b,_0x3223f8,_0x14c3ad,_0x397f44);}['_getExecuteDataRegular'](){const _0x2a8b6b=this['editor']['model']['document']['selection'];if(_0x2a8b6b['isCollapsed']){const _0x5031c3=_0x457991(_0x2a8b6b['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x2a8b6b);this['editor']['model']['change'](_0x284722=>{_0x284722['setSelection'](_0x5031c3,'in');});}const _0x17e50c=_0x2a8b6b['getFirstRange'](),_0xb55ee5=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x2a8b6b),_0x17e50c['start'],_0x17e50c['end']),_0x3de57c=_0x2a8b6b['getFirstRange']()['start'],_0x722635=new Map();let _0x1046bc=_0xb55ee5;for(let _0x219a95=0x0;_0x219a95<_0x3de57c['path']['length'];_0x219a95++)_0x722635['set'](_0x1046bc,_0x3de57c['path'][_0x219a95]),_0x1046bc=_0x1046bc['getChild'](0x0);return{'modelFragment':_0xb55ee5,'anchorData':_0x722635};}['_getExecuteDataInTable'](){const _0x3fc645=this['editor']['model']['document']['selection'],_0x3d4dad=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x58221c=_0x3fc645['getFirstRange']()['start']['parent']['parent'],_0x58d527=this['_wrapWithCommonAncestors'](_0x3d4dad,this['editor']['model']['createPositionBefore'](_0x58221c),this['editor']['model']['createPositionAfter'](_0x58221c)),_0x1b92e7=_0x3fc645['getFirstRange']()['start'],_0x25c8b5=new Map();let _0xe69388=_0x58d527;for(let _0x2e13db=0x0;_0x2e13db<_0x1b92e7['path']['length'];_0x2e13db++)if(_0x25c8b5['set'](_0xe69388,_0x1b92e7['path'][_0x2e13db]),_0x2e13db<_0x1b92e7['path']['length']-0x1)_0xe69388=_0xe69388['getChild'](0x0);else{let _0x1297d5=_0xe69388['nextSibling'];for(;_0x1297d5;)_0x25c8b5['set'](_0x1297d5,_0x1b92e7['path'][_0x2e13db]),_0x1297d5=_0x1297d5['nextSibling'];}return{'modelFragment':_0x58d527,'anchorData':_0x25c8b5};}['_executeAction'](_0x32f902,_0x16e218,_0x174bcc,_0x6fae68,_0x4c9320){const _0x591178=this['editor']['plugins']['get'](c),_0x59de43=this['editor']['plugins']['get'](w),_0xf33152=this['editor']['model']['document']['selection'],_0x3961dd=_0x591178['modelToViewWithIds'](_0x16e218),_0x4eca31=this['editor']['data']['processor']['toData'](_0x3961dd),_0x268d9a=this['editor']['model']['document']['version'],_0x24f03f=[..._0xf33152['getRanges']()];let _0x260401=this['editor']['config']['get']('ai.availableReplyActions')||[...k];this['editor']['plugins']['has']('TrackChanges')||(_0x260401=_0x260401['filter'](_0x313afd=>'insertSuggestion'!=_0x313afd));const _0x12b359=new e(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0,'availableActions':_0x260401});return _0x59de43['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x6fae68,'icon':_0x4c9320||_0x2faead,'mainView':_0x12b359,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':this['editor']['plugins']['has']('TrackChanges'),'ranges':_0x24f03f}),this['_setLoadingState'](_0x12b359,_0x59de43),this['listenTo'](_0x59de43,'applySuggestion',()=>{this['_applyChanges'](_0x16e218,_0x174bcc,!0x1);}),this['listenTo'](_0x59de43,'insertSuggestion',()=>{this['_applyChanges'](_0x16e218,_0x174bcc,!0x0);}),this['listenTo'](_0x59de43,'selectionRemoved',()=>{this['_stopInteraction'](),this['_disableCustomViews']();}),this['listenTo'](_0x59de43,'dialogClosed',()=>{if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0xbeacf4=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0xefa5d8=_0xbeacf4['changeGroups'][0x0];_0xefa5d8&&'pending'===_0xefa5d8['state']&&_0xbeacf4['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x59de43);}),this['_createInteraction'](_0x4eca31,_0x268d9a,_0x12b359,_0x59de43,_0x32f902);}['_wrapWithCommonAncestors'](_0x4bfb12,_0xf7a229,_0x1aa301){const _0x45da50=this['editor']['model']['createRange'](_0xf7a229,_0x1aa301)['getCommonAncestor'](),_0x1f28f8=_0x45da50['is']('documentFragment')?[]:_0x45da50['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x1f28f8['length']){const _0x493d8a=_0x1f28f8['map'](_0x1ad998=>_0x1ad998['_clone'](!0x1));for(let _0x45a6c9=0x1;_0x45a6c9<_0x493d8a['length'];_0x45a6c9++)_0x493d8a[_0x45a6c9-0x1]['_appendChild'](_0x493d8a[_0x45a6c9]);return _0x493d8a[_0x493d8a['length']-0x1]['_appendChild'](_0x4bfb12),new _0x42c406(_0x493d8a[0x0]);}return _0x4bfb12;}async['_createInteraction'](_0x15f46f,_0x117263,_0x378ef7,_0x5448f9,_0x503c66){const _0x4ff012=this['editor'];this['_interactionParams']={'action':_0x503c66,'content':_0x15f46f,'version':_0x117263,'mainView':_0x378ef7,'aiBalloon':_0x5448f9};const _0x20558e=new l({'connector':this['_aiConnector'],'editor':_0x4ff012,'content':_0x15f46f,'version':_0x117263,..._0x503c66});this['_interactions']['push'](_0x20558e),_0x378ef7['hideError']();const _0x4cfd85=(_0x19cb22,_0x4ff408,_0x1d6617=!0x1,_0x213ab2='streaming')=>this['_promiseQueue']['enqueue'](async _0x1b3cd2=>{try{const _0x3efba9=y({'editor':_0x4ff012,'changeGroups':_0x19cb22['changeGroups'],'documentContextContent':_0x19cb22['documentContextContent'],'showDiff':_0x1d6617,'trimUnchanged':!0x1});await _0x4ff408['updateContent']({'parts':_0x3efba9,'renderingStrategy':_0x213ab2,'abortSignal':_0x1b3cd2});}catch(_0xf777d8){if(this['_isAbortError'](_0xf777d8))return;throw _0xf777d8;}});this['_interaction']['on']('replyCreated',(_0x7959f1,_0x206195)=>{_0x378ef7['hideLoader'](),_0x4cfd85(_0x206195,_0x378ef7)['catch'](_0x4cb6fc=>{this['_isAbortError'](_0x4cb6fc)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x4cb6fc),this['_setErrorState'](_0x20558e,_0x378ef7));});}),this['_interaction']['on']('replyContentUpdated',(_0x201e01,_0x567bff)=>{_0x4cfd85(_0x567bff,_0x378ef7)['catch'](_0x4fe549=>{this['_isAbortError'](_0x4fe549)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x4fe549),this['_setErrorState'](_0x20558e,_0x378ef7));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x378ef7,_0x5448f9),this['_updateNavigationUI']();}catch(_0x38a3fc){this['_isAbortError'](_0x38a3fc)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x38a3fc),this['_setErrorState'](_0x20558e,_0x378ef7));}}),this['listenTo'](_0x378ef7,'toggleSuggestionDisplayMode',(_0x22d23c,{showDiff:_0x20a6f4})=>{this['_balloonShowDiff']=_0x20a6f4;const _0x1428a3=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x1428a3&&_0x4cfd85(_0x1428a3,_0x378ef7,_0x20a6f4,'static')['catch'](_0x349903=>{this['_isAbortError'](_0x349903)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x349903),this['_setErrorState'](_0x20558e,_0x378ef7));});}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x1a612f,{reply:_0x5841d0})=>{const _0x1563c6={'positiveCount':_0x5841d0['changeGroups']['filter'](_0x51a575=>'accepted'===_0x51a575['state'])['length'],'totalCount':_0x5841d0['changeGroups']['length']},_0x74a1dd=this['_interaction']['actionCallId'],_0x44629f=this['_interaction']['actionName'];_0x44629f?this['_aiConnector']['upsertAIActionRating'](_0x44629f,_0x74a1dd,_0x1563c6):this['_aiConnector']['upsertCustomAIActionRating'](_0x74a1dd,_0x1563c6);}),this['_setLoadingState'](_0x378ef7,_0x5448f9);try{const _0xc1172f=await this['_interaction']['start']();return this['_updateNavigationUI'](),_0xc1172f;}catch(_0x93bad7){if(this['_isAbortError'](_0x93bad7))return;_0x378ef7['hideLoader'](),this['_setErrorState'](_0x20558e,_0x378ef7);}}['_applyChanges'](_0x76303b,_0x27bb62,_0x414eaf){const _0x4f231=this['editor'];if(_0x414eaf&&!_0x4f231['plugins']['has']('TrackChanges'))throw new _0x239292('ai-no-track-changes',null);const _0x2fb54e=this['editor']['plugins']['get'](_0x4176c6),_0x18f531=this['_interaction'],_0x10acbe=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x3353ab=_0x10acbe['changeGroups'];_0x10acbe['setChangeGroupState'](0x0,'accepted');let _0x3d4812=v({'editor':_0x4f231,'reply':_0x10acbe,'interaction':_0x18f531,'groups':_0x3353ab,'transform':!0x1,'documentCompare':_0x2fb54e,'documentCompareOptions':{'anchor':_0x4f231['model']['createPositionAt'](_0x76303b,0x0),'markDeletions':_0x414eaf}});_0x3d4812=this['_filterOperationsOutsideRange'](_0x3d4812,_0x27bb62);for(const _0x27c767 of _0x3d4812)this['_anchorOperation'](_0x27bb62,_0x27c767,_0x4f231['model']['document']['getRoot']());const _0x4baff0=_0x18f531['getDocumentContext']()['version'],_0x1cd0ec=_0x4f231['model']['document']['history']['getOperations'](_0x4baff0),_0x713f44={'document':_0x4f231['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x4286ae=_0x1c1e0c(_0x3d4812,_0x1cd0ec,_0x713f44)['operationsA'];_0x4f231['model']['change'](_0xb0db82=>{if(_0xb0db82['setSelection'](_0x4f231['model']['document']['selection']['focus']),_0x414eaf)_0x4f231['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4286ae);else{for(const _0x1c18c1 of _0x4286ae)_0x1c18c1['baseVersion']=_0x4f231['model']['document']['version'],b(_0x4f231,_0x1c18c1),_0xb0db82['batch']['addOperation'](_0x1c18c1),_0x4f231['model']['applyOperation'](_0x1c18c1);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x5a28e9,_0x359ac8){return _0x5a28e9['filter'](_0x34e434=>{if('rename'==_0x34e434['type']){const _0x1dcd26=_0x34e434['position']['nodeAfter'];return!_0x359ac8['has'](_0x1dcd26);}if(_0x34e434['type']['indexOf']('Attribute')>-0x1){const _0xdc0da3=_0x34e434['range']['start']['nodeAfter'];return!_0x359ac8['has'](_0xdc0da3);}return!0x0;});}['_anchorOperation'](_0x5def78,_0x516390,_0x233f50){const _0x35b27f=_0x516390['clone']();for(const _0x325ebb in _0x516390){const _0x5e00ab=_0x516390[_0x325ebb];_0x5e00ab instanceof _0x473568?_0x516390[_0x325ebb]=new _0x473568(_0x195538(_0x5e00ab['start']),_0x195538(_0x5e00ab['end'])):_0x5e00ab instanceof _0x2a6f0c&&(_0x516390[_0x325ebb]=_0x195538(_0x5e00ab));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x35b27f['type'])){if(_0x35b27f['isDocumentOperation']=!0x1,_0x35b27f['baseVersion']=null,'remove'==_0x35b27f['type']){const _0x126b30=_0x35b27f['sourcePosition'],_0x159edb=_0x35b27f['howMany'];new _0x207911(_0x126b30,_0x159edb)['_execute']();}else _0x35b27f['_execute']();}function _0x195538(_0x903258){if('$graveyard'==_0x903258['root']['rootName'])return _0x903258;const _0xd2becb=[];let _0x3b7b02=_0x903258['root'];for(let _0x213011=0x0;_0x213011<_0x903258['path']['length'];_0x213011++){const _0x373d0b=_0x5def78['get'](_0x3b7b02)||0x0;_0xd2becb[_0x213011]=_0x903258['path'][_0x213011]+_0x373d0b,_0x3b7b02=_0x3b7b02['getChildAtOffset'](_0x903258['path'][_0x213011]);}return new _0x2a6f0c(_0x233f50,_0xd2becb,_0x903258['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x10579e,content:_0x4a3401,version:_0xd07cde,mainView:_0xfe32e6,aiBalloon:_0x21526b}=this['_interactionParams'];_0xfe32e6['areChangesVisible']=!0x1,_0xfe32e6['hideError'](),this['_clearErrorState'](_0xfe32e6,_0x21526b);const _0x520a28=_0xfe32e6;_0x520a28['miniToolbarView']&&_0x520a28['miniToolbarView']['showChangesButton']&&_0x520a28['miniToolbarView']['showChangesButton']['set']({'isOn':!0x1,'icon':_0x17eb0a}),this['_clearSuggestionContent'](_0xfe32e6),_0xfe32e6['showLoader'](),this['_updateNavigationUI'](),this['_createInteraction'](_0x4a3401,_0xd07cde,_0xfe32e6,_0x21526b,_0x10579e)['catch'](_0x1a3183=>{this['_isAbortError'](_0x1a3183)||console['error']('Error\x20refreshing\x20interaction:',_0x1a3183);});}['_clearSuggestionContent'](_0x40dc00){const _0x3eaff4=_0x40dc00['bodyView']['_children'];for(;_0x3eaff4['length']>0x0;)_0x3eaff4['remove'](_0x3eaff4['first']);_0x40dc00['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0xf4d960){return!!_0xf4d960['message']&&_0xf4d960['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;}['_setupCustomViews'](){const _0x429ae5=new _0x5cde82(this['editor']['locale']),_0xfb7a3f=new _0x5cde82(this['editor']['locale']),_0x117e6c=new _0x10aa9f(this['editor']['locale']),_0x4ecd67=new _0x5cde82(this['editor']['locale']);_0x429ae5['set']({'icon':_0x384b34,'label':C(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0xfb7a3f['set']({'icon':_0x52404d,'tooltip':C(this['editor']['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x117e6c['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':['1/1']}),_0x4ecd67['set']({'icon':_0x1524bc,'tooltip':C(this['editor']['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x429ae5['bind']('isEnabled')['to'](this,'isBusy',_0x5ee856=>!_0x5ee856),_0x429ae5['on']('execute',()=>{this['_refreshInteraction']();}),_0xfb7a3f['bind']('isEnabled')['to'](this,'isBusy',_0x2d00e6=>!_0x2d00e6),_0xfb7a3f['on']('execute',()=>{this['_navigateToPrevious']();}),_0x4ecd67['bind']('isEnabled')['to'](this,'isBusy',_0x45b11a=>!_0x45b11a),_0x4ecd67['on']('execute',()=>{this['_navigateToNext']();}),this['_navigationPreviousButton']=_0xfb7a3f,this['_navigationCounter']=_0x117e6c,this['_navigationNextButton']=_0x4ecd67,this['_customViews']['add'](_0x429ae5);}['_navigateToPrevious'](){const _0x5de301=this['_interactions']['length'];this['_currentInteractionIndex']<_0x5de301-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x5e8fff){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x5e8fff;const {mainView:_0xf0d087}=this['_interactionParams'],_0x2af998=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x2af998)return;if(_0x2af998['hasError'])return this['_setErrorState'](_0x2af998,_0xf0d087),void this['_updateNavigationUI']();if(!_0x2af998['replies']['length'])return;_0xf0d087['hideError'](),this['_interactionParams']&&this['_clearErrorState'](_0xf0d087,this['_interactionParams']['aiBalloon']);const _0x1f504b=_0x2af998['replies'][_0x2af998['replies']['length']-0x1];if(_0x1f504b){const _0x9e7599=this['editor'];this['_clearSuggestionContent'](_0xf0d087);try{const _0x204781=y({'editor':_0x9e7599,'changeGroups':_0x1f504b['changeGroups'],'documentContextContent':_0x1f504b['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});this['_clearSuggestionContent'](_0xf0d087),await new Promise(_0x293ca7=>setTimeout(_0x293ca7,0x32)),await _0xf0d087['updateContent']({'parts':_0x204781,'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x2c2676){this['_isAbortError'](_0x2c2676)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x2c2676);}}this['_updateNavigationUI']();}['_updateNavigationUI'](){if(!this['_navigationPreviousButton']||!this['_navigationCounter']||!this['_navigationNextButton'])return;const _0x470fbb=this['_interactions']['length'],_0x1ce1fb=_0x470fbb>0x1,_0x30fc88=this['_interactionParams']?.['mainView'];if(_0x1ce1fb){this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView']||(this['_customViews']['add'](this['_navigationPreviousButton']),_0x30fc88?.['addNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x0,this['_customViews']['add'](this['_navigationCounter']),_0x30fc88?.['addNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x0,this['_customViews']['add'](this['_navigationNextButton']),_0x30fc88?.['addNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x0);const _0x34d2a0=_0x470fbb-this['_currentInteractionIndex'];this['_navigationCounter']['element']&&(this['_navigationCounter']['element']['textContent']=_0x34d2a0+'/'+_0x470fbb),this['_navigationPreviousButton']['isEnabled']=this['_currentInteractionIndex']<_0x470fbb-0x1,this['_navigationNextButton']['isEnabled']=this['_currentInteractionIndex']>0x0;}else(this['_isNavigationPreviousButtonInView']||this['_isNavigationCounterInView']||this['_isNavigationNextButtonInView'])&&(this['_customViews']['remove'](this['_navigationPreviousButton']),_0x30fc88?.['removeNavigationItem'](this['_navigationPreviousButton']),this['_isNavigationPreviousButtonInView']=!0x1,this['_customViews']['remove'](this['_navigationCounter']),_0x30fc88?.['removeNavigationItem'](this['_navigationCounter']),this['_isNavigationCounterInView']=!0x1,this['_customViews']['remove'](this['_navigationNextButton']),_0x30fc88?.['removeNavigationItem'](this['_navigationNextButton']),this['_isNavigationNextButtonInView']=!0x1);}['_setLoadingState'](_0x1bdf4a,_0x2d0094){_0x1bdf4a['setLoading'](),_0x2d0094['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_setErrorState'](_0xc0d332,_0xffb7c5){const _0x41a506=C(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');_0xffb7c5['showError'](_0x41a506),_0xc0d332['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],_0xffb7c5['setErrorState'](),this['_interactionParams']?.['aiBalloon']['balloonView']['toolbar']&&(this['_interactionParams']['aiBalloon']['balloonView']['toolbar']['isLoading']=!0x0);}['_clearErrorState'](_0xbb8e42,_0x1bfd70){_0xbb8e42['clearErrorState'](),_0x1bfd70['balloonView']['toolbar']&&(_0x1bfd70['balloonView']['toolbar']['isLoading']=!0x1);}async['_clearLoadingState'](_0x2e0c21,_0xf9712d){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x2e0c21['clearLoading'](),_0xf9712d['balloonView']['clearLoading']();}['_disableCustomViews'](){this['_customViews']['forEach'](_0xd42d38=>{'isEnabled'in _0xd42d38&&(_0xd42d38['isEnabled']=!0x1);});}}class Va extends _0x3711b7{static get['requires'](){return[ui,gi,pi];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4eabf2){super(_0x4eabf2),_0x4eabf2['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[]});}}class $s{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x3b1cf0,title:_0x44646d,description:_0x279d3d,isParameterized:_0x2eb709,useArgs:_0xf553d5,options:_0x5bd57c}){this['id']=_0x3b1cf0,this['title']=_0x44646d,this['description']=_0x279d3d,this['isParameterized']=_0x2eb709,this['useArgs']=_0xf553d5,this['options']=_0x5bd57c;}}class kr extends $s{['_models']=[];get['models'](){return this['_models'];}set['models'](_0xb190cc){this['_models']=_0xb190cc;}}class wi extends _0x314197(){['_checks'];constructor(_0x1c23f1){super(),this['_checks']=this['_mapCheckDefinitions'](_0x1c23f1);}get['checks'](){return this['_checks'];}['getCheckById'](_0x4b8d76){return this['checks']['find'](_0x1b7904=>_0x1b7904['id']===_0x4b8d76);}['_mapCheckDefinitions'](_0x479968){return _0x479968['map'](_0x4a973a=>'custom'===_0x4a973a['id']?new kr(_0x4a973a):new $s(_0x4a973a));}}class th extends _0x7d5e47(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x3586b0,contentNew:_0x50df98,contentInitial:_0x165442,documentVersion:_0x15e345}){super(),this['id']=_0x3586b0,this['contentNew']=_0x50df98,this['contentInitial']=_0x165442,this['documentVersion']=_0x15e345;}}class eh extends _0x314197(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x24ae69,_0xd5a1c3,_0x24c73d){super(),this['id']=_0x24ae69,this['parent']=_0x24c73d,this['_data']=_0xd5a1c3,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 _0x314197(){['id']=_0x5ef33e();['callId'];['_results']=new Map();['_changes']=[];['_documentData'];['_sourceCheck'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x57fe36,_0x143bd4,_0x33dd21,_0x589152,_0x8a8817){super(),this['_documentData']=_0x57fe36,this['_sourceCheck']=_0x143bd4,this['_aiConnector']=_0x33dd21,this['_reviewParams']=_0x589152,this['_reviewArgs']=_0x8a8817,this['on']('change:status',(_0x10247e,_0x159675,_0x1ddf84)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x1ddf84,'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'](_0xe2526b=>'pending'===_0xe2526b['status']);}get['currentError'](){return this['_currentError'];}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x4c7f30=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x267d31 of _0x4c7f30)'unmodified'!==_0x267d31['data']['operation']&&('error'!==_0x267d31['data']['operation']?'review-metadata'!==_0x267d31['event']?this['_addReviewCheckResult'](_0x267d31['data']['dataId'],_0x267d31['data']['textDelta']):this['callId']=_0x267d31['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']?this['status']='unmodified':this['status']='ready');}catch(_0x1e7cfd){this['_currentError']=_0x1e7cfd,_0x1e7cfd instanceof Error&&_0x1e7cfd['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'](_0x2aa6a7,_0x5f1a22){const _0x274a97=this['_results']['get'](_0x2aa6a7);if(!_0x274a97)return;const _0x50f2e9=[];_0x5f1a22['forEach']((_0x211ceb,_0x3213c3)=>{const _0x1bb92b=new eh(_0x274a97['id']+'-'+_0x3213c3,_0x211ceb,_0x274a97);_0x1bb92b['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x1bb92b,'status':_0x1bb92b['status']});}),_0x1bb92b['on']('change:isActivated',()=>{_0x1bb92b['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x1bb92b}):this['fire']('reviewCheckResultDeactivated',{'change':_0x1bb92b});}),this['_changes']['push'](_0x1bb92b),_0x50f2e9['push'](_0x1bb92b);}),this['fire']('reviewCheckResultReady',{'changes':_0x50f2e9,'result':_0x274a97,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x28ab0d){const _0x4c08f4=this['_changes']['find'](_0x1e95c3=>_0x1e95c3['id']===_0x28ab0d);return!(!_0x4c08f4||'pending'!==_0x4c08f4['status']);}['getActiveChanges'](){return this['_changes']['filter'](_0x4b9c1c=>'pending'===_0x4b9c1c['status']);}['markAllChangesAsAccepted'](){for(const _0x226ecc of this['_changes'])'pending'===_0x226ecc['status']&&(_0x226ecc['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x3ae756){const _0x24381d=this['_changes']['find'](_0x507548=>_0x507548['id']===_0x3ae756);_0x24381d&&'pending'===_0x24381d['status']&&(_0x24381d['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x1409eb){const _0x1684b9=this['_changes']['find'](_0x13eacd=>_0x13eacd['id']===_0x1409eb);_0x1684b9&&'pending'===_0x1684b9['status']&&(_0x1684b9['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x2488eb){const _0x1fecc0=this['_changes']['find'](_0x425c2f=>_0x425c2f['id']===_0x2488eb);_0x1fecc0&&'pending'===_0x1fecc0['status']&&(_0x1fecc0['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x111743){const _0x2321cf=this['_changes']['find'](_0x52687e=>_0x52687e['id']===_0x111743);_0x2321cf&&'outdated'===_0x2321cf['status']&&(_0x2321cf['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x16e789){this['_changes']['filter'](_0x119e08=>_0x119e08['isActivated']&&_0x119e08['id']!==_0x16e789)['forEach'](_0x2e9b5f=>{_0x2e9b5f['isActivated']=!0x1;});const _0x2b466a=this['_changes']['find'](_0x323e39=>_0x323e39['id']===_0x16e789);_0x2b466a&&'pending'===_0x2b466a['status']&&(_0x2b466a['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0xe858e7=>_0xe858e7['isActivated'])['forEach'](_0x68b750=>{_0x68b750['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x38e325){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x5b9cb4;if(_0x38e325){const _0x13bde4=this['_changes']['find'](_0x3ecd3d=>_0x3ecd3d['id']===_0x38e325);if(_0x13bde4&&_0x13bde4['isRated'])return;_0x13bde4&&(_0x5b9cb4=_0x13bde4['parent']['id'],_0x13bde4['isRated']=!0x0);}const _0x4da724={'positiveCount':this['_changes']['filter'](_0x58ceb6=>'accepted'===_0x58ceb6['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x4da724,this['callId'],_0x5b9cb4);}['_addReviewCheckResult'](_0x2bda5a,_0x2e6e56){const _0x12edbc=this['_documentData']['elements']['get'](_0x2bda5a);if(!_0x12edbc)return;const _0x5bac4e=_0x12edbc['getContent']();if(_0x5bac4e===_0x2e6e56)return;const _0x26d771=new th({'id':_0x2bda5a,'contentInitial':_0x5bac4e,'contentNew':_0x2e6e56,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x26d771['id'],_0x26d771),this['fire']('reviewCheckResultAdded',{'result':_0x26d771,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x2e0e1d=>'pending'===_0x2e0e1d['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x1eaf40=>'pending'===_0x1eaf40['status'])['length']&&(this['status']='finished'));}}class vi extends Rr{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x45f818=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x28a7a4=0x0;_0x28a7a4<this['_reviewParams']['length'];_0x28a7a4++){if(!this['_reviewParams'][_0x28a7a4]||!this['_sourceCheck']['options'][_0x28a7a4])continue;const _0x507569=this['_sourceCheck']['options'][_0x28a7a4],_0x3359d9=_0x507569['data']?.['find'](_0x2b29d3=>_0x2b29d3['id']===this['_reviewParams'][_0x28a7a4]);_0x3359d9&&_0x45f818['push'](_0x3359d9['label']);}return _0x45f818['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x287b4a,_0x4a6bed,_0x10284b){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x4a6bed,_0x287b4a,_0x10284b);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class fi extends Rr{['_prompt'];['_model'];constructor(_0x342320,_0x45b08a,_0x2b9d10,_0x504c98,_0x3edbf1){super(_0x2b9d10,_0x504c98,_0x3edbf1),this['_prompt']=_0x342320,this['_model']=_0x45b08a;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x38d992,_0xbe6295,_0x49947f){return this['_aiConnector']['upsertCustomAIReviewRating'](_0xbe6295,_0x38d992,_0x49947f);}}const Ri=[{'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 ee extends _0x267838{['_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 _0xfb890b=this['context']['config']['get']('ai.reviewMode.translations');if(_0xfb890b){for(const _0x490a61 of Ri)'translate'===_0x490a61['id']&&(_0x490a61['options'][0x0]['data']=_0xfb890b);}const _0x2adbbf=this['_translateReviewChecks'](Ri);this['_aiReviewCheckList']=new wi(_0x2adbbf);const _0x24b182=this['_aiReviewCheckList']['checks']['find'](_0x548579=>'custom'===_0x548579['id']);if(_0x24b182){const _0x3ea23f=await new ki({'connector':this['_aiConnector']})['getAll']();_0x24b182['models']=_0x3ea23f['map'](_0x599f01=>({..._0x599f01,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0x599f01['id']['toUpperCase'](),_0x599f01['description'])}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x3e09a3,_0x31feaf)=>{const _0x2f1616=this['_aiReviewCheckList']['getCheckById'](_0x31feaf['id']);if(_0x2f1616){this['_onDiffChange'](this['_isDiffOn']),_0x31feaf['isCustom']?this['_currentReviewCheckRun']=new fi(_0x31feaf['args']['prompt'],_0x31feaf['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x2f1616,this['_aiConnector']):this['_currentReviewCheckRun']=new vi(this['_aiReviewModeEditing']['getDocumentData'](),_0x2f1616,this['_aiConnector'],_0x31feaf['params'],_0x31feaf['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x384e22,_0x1a37d0)=>{'data'===_0x1a37d0['status']||'loading'===_0x1a37d0['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x1a37d0)):'finished'===_0x1a37d0['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x1a37d0['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'unmodified'===_0x1a37d0['status']?this['_aiReviewModeUi']['showNoChangesView']():'error-general'===_0x1a37d0['status']?(this['_aiReviewModeUi']['showGeneralErrorView'](),this['_logError'](new _0x239292('ai-review-mode-check-run-general-error',this,this['_currentReviewCheckRun']?.['currentError']))):'error-chunk'===_0x1a37d0['status']?(this['_aiReviewModeUi']['showChunkErrorView'](),this['_logError'](new _0x239292('ai-review-mode-check-run-chunk-error',this,this['_currentReviewCheckRun']?.['currentError']))):'aborted'===_0x1a37d0['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0)),'ready'!==_0x1a37d0['status']&&'error-chunk'!==_0x1a37d0['status']&&'error-general'!==_0x1a37d0['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x6afd42,_0xa58feb)=>{if(!this['_currentReviewCheckRun'])throw new _0x239292('ai-review-mode-no-current-check-run',this);const _0x4d4c3=this['_aiReviewModeEditing']['diffContent'](_0xa58feb['result']['contentInitial'],_0xa58feb['result']['contentNew']);_0xa58feb['source']['addResultChanges'](_0xa58feb['result']['id'],_0x4d4c3);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x318e78,_0x5274d9)=>{for(const _0x50fafb of _0x5274d9['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x50fafb);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x5274d9['changes'],_0x5274d9['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x163994,_0xbcad8e)=>{this['_aiReviewModeUi']['updateChangeState'](_0xbcad8e['change']['id'],_0xbcad8e['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x2e0001,_0x26d714)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x26d714['change']['id']);const _0x2acc34=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x26d714['change']['id']);if(_0x2acc34){if('content'===this['_changeActivationSource']){const _0x50ebe4=this['_aiReviewModeUi']['getChangeElement'](_0x26d714['change']['id']);_0x50ebe4&&_0x9d44c8(_0x50ebe4['closest']('.ck-ai-review-mode__check-run-result')||_0x50ebe4);}else{if('panel'===this['_changeActivationSource']){const _0x28fab4={'target':_0x2acc34['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};_0x10737b(_0x28fab4);}}this['_aiReviewModeUi']['showChangeBalloon'](_0x26d714['change'],_0x2acc34['domElement']);}}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults'](),this['_aiReviewModeUi']['hideChangeBalloon']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x2c190a){_0x2c190a instanceof Error&&_0x2c190a['message']['includes']('ai-request-aborted')||(_0x2c190a instanceof _0x239292?this['_logError'](_0x2c190a):this['_logError'](new _0x239292('ai-review-mode-check-run-failed',this,{'error':_0x2c190a})));}}else this['_logError'](new _0x239292('ai-review-mode-source-check-not-found',this,{'checkId':_0x31feaf['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 _0x566f37=this['_currentReviewCheckRun']['getActiveChanges']();_0x566f37['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x566f37['map'](_0x499dd4=>_0x499dd4['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted'](),this['_currentReviewCheckRun']['sendRating']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x4326b4,_0x4d694e)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4d694e['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x4d694e['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x4d694e['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4d694e['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x25f283,_0x54d377)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x54d377['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x54d377['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x54d377['id']),this['_aiReviewModeUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x54d377['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x3be61b,_0x2313d2)=>{this['_isDiffOn']=_0x2313d2['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&await this['_currentReviewCheckRun']['restart']();}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x2bd544,_0x5c2269)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x5c2269['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x276ed5,_0x201bee)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x201bee['changeId']));}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRemoved',(_0x39f7a2,_0x54fa6c)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x54fa6c['changeId']);}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerRestored',(_0x264583,_0x453bae)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x453bae['changeId']);});}['_onReviewModeRunLeave'](_0x49cd4e=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x49cd4e&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x2179ab=this['_aiReviewModeEditing']['getEditor']();_0x2179ab&&_0x2179ab['editing']['view']['change'](_0x597ae0=>{const _0x25875=_0x2179ab['editing']['view']['document']['getRoot']();_0x597ae0['removeClass']('ck-ai-review-mode-diff',_0x25875),_0x597ae0['removeClass']('ck-ai-review-mode-highlights',_0x25875);});}['_onDiffChange'](_0xe67161){const _0x26c33b=this['_aiReviewModeEditing']['getEditor']();_0xe67161?this['_aiReviewModeUi']['hideDiffInBalloon']():this['_aiReviewModeUi']['showDiffInBalloon'](),_0x26c33b&&_0x26c33b['editing']['view']['change'](_0x724a0a=>{const _0x5043de=_0x26c33b['editing']['view']['document']['getRoot']();_0x724a0a['removeClass']('ck-ai-review-mode-diff',_0x5043de),_0x724a0a['removeClass']('ck-ai-review-mode-highlights',_0x5043de),_0x724a0a['addClass'](_0xe67161?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights',_0x5043de);});}['_translateReviewChecks'](_0x4521e0){return _0x4521e0['map'](_0x461faf=>{const _0x4699e6='AI_REVIEW_CHECK_'+_0x461faf['id']['toUpperCase']()['replaceAll']('-','_'),_0x4de1f1={..._0x461faf,'title':this['_getTranslationWithDefault'](_0x4699e6+'_TITLE',_0x461faf['title']),'description':this['_getTranslationWithDefault'](_0x4699e6+'_DESCRIPTION',_0x461faf['description'])};return _0x461faf['options']&&(_0x4de1f1['options']=_0x461faf['options']['map'](_0xe55779=>({..._0xe55779,'label':this['_getTranslationWithDefault'](_0x4699e6+'_OPTIONS_LABEL',_0xe55779['label']||''),'data':_0xe55779['data']?_0xe55779['data']['map'](_0x291ea0=>({..._0x291ea0,'label':this['_getTranslationWithDefault'](_0x4699e6+'_OPTIONS_DATA_'+_0x291ea0['id']['toUpperCase'](),_0x291ea0['label'])})):void 0x0}))),_0x4de1f1;});}['_getTranslationWithDefault'](_0x10361c,_0x513af0){const _0x37fbdf=C(this['context']['locale'],_0x10361c);return _0x37fbdf===_0x10361c?_0x513af0:_0x37fbdf;}['_logError'](_0x3f1cd1){ot(_0x3f1cd1['message']),this['_aiReviewModeUi']['showGeneralErrorView']();}}class Mr extends _0x10aa9f{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x3f0fc8,_0x2ea0af){super(_0x3f0fc8),this['_defaultValue']=_0x2ea0af['default']||(_0x2ea0af['data']['length']>0x0?_0x2ea0af['data'][0x0]['id']:''),this['_defaultLabel']=_0x2ea0af['data']['find'](_0x21d39b=>_0x21d39b['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x1fe5fd(this['locale']);const _0xf0e6cd=this['_prepareListOptions'](_0x2ea0af['data']);_0x43d564(this['_dropdownView'],_0xf0e6cd,{'role':'menu','ariaLabel':_0x2ea0af['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x402d60=>{_0x402d60['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x436731=>{this['formValue']=_0x436731['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x436731['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'](_0x3ef0b9=[]){const _0x422e16=new _0x4c3887();this['resetToDefault']();for(const _0x3ae0ee of _0x3ef0b9){const _0x719d62=new _0x238f2a({'label':_0x3ae0ee['label'],'withText':!0x0,'role':'menuitemradio','id':_0x3ae0ee['id'],'model':_0x3ae0ee});_0x719d62['bind']('isOn')['to'](this,'formValue',_0x1a64a9=>_0x1a64a9===_0x719d62['id']);const _0x3f4bbc={'type':'button','model':_0x719d62};_0x422e16['add'](_0x3f4bbc);}return _0x422e16;}}class Ks extends _0x2ced3c{['_formItem']=null;constructor(_0x566c03,_0x5296ac,_0x1a536b){super(_0x566c03),this['argsKey']=_0x5296ac?.['argsKey'];if('dropdown'===_0x5296ac['formType'])this['_formItem']=new Mr(this['locale'],_0x5296ac);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x1dad38=new _0x4f6c96(this['locale'],{'children':[this['_formItem']],'class':[_0x1a536b?'ck-form__row_with-submit':'']});_0x1a536b&&_0x1dad38['children']['add'](_0x1a536b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x1dad38]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Ps extends _0x317754{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x4ac6c3){super(_0x4ac6c3),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x4c12a2(),this['minRows']=Ps['MIN_ROWS'],this['maxRows']=Ps['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 Qs extends _0x10aa9f{['focusTracker']=new ts();['keystrokes']=new _0x4c12a2();['focusCycler'];['_focusables']=new _0x285700();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0xfc5e5a,_0x13aabc){super(_0xfc5e5a),this['_check']=_0x13aabc,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x13aabc['models']&&_0x13aabc['models']['length']>0x0?_0x13aabc['models'][0x0]['id']:'',this['_defaultLabel']=_0x13aabc['models']&&_0x13aabc['models']['length']>0x0?_0x13aabc['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x2acda0(this['locale'],()=>new Ps(_0xfc5e5a)),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 _0x4c3887(),this['_setModelList'](),_0x43d564(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 _0x4f6c96(this['locale'],{'children':[this['promptInputView']]}),new _0x4f6c96(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x3fc6de,_0x31f055)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x31f055()):_0x31f055();}),this['focusCycler']=new $t({'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'](_0x6c08b8=>{this['_focusables']['add'](_0x6c08b8),this['focusTracker']['add'](_0x6c08b8['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 _0x33cee5 of this['_getFormValidators']()){const _0x410d93=_0x33cee5();if(_0x410d93)return this['promptInputView']['errorText']=_0x410d93,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return C(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0xcd3a88=new _0x5cde82(this['locale']),t=this['locale']['t'];return _0xcd3a88['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0xcd3a88['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0xcd3a88;}['_createCancelButtonView'](){const _0x5bef64=new _0x5cde82(this['locale']),t=this['locale']['t'];return _0x5bef64['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x5bef64['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x50f85f=>{_0x50f85f['stopPropagation']();})}}),_0x5bef64['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x5bef64;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x5ea483=this['_check']['models'];if(this['resetToDefault'](),_0x5ea483?.['length']){const _0x4fc7e0=ki['getLocalized'](this['locale'],_0x5ea483);for(const _0x3f9806 of _0x4fc7e0){const _0xc7a6e0=new _0x238f2a({'label':_0x3f9806['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3f9806['id'],'model':_0x3f9806});_0xc7a6e0['bind']('isOn')['to'](this,'modelId',_0x48b850=>_0x48b850===_0x3f9806['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xc7a6e0,'labelView':new Fs(this['locale'],_0x3f9806)});}}}['_createModelSelectionDropdown'](){const _0x2a9036=_0x1fe5fd(this['locale']);return _0x2a9036['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x2a9036['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x2a9036,'execute',_0x216f1e=>{this['modelId']=_0x216f1e['source']['model']['id'],_0x2a9036['buttonView']['label']=_0x216f1e['source']['label'];}),_0x2a9036;}['_createActionsFooterView'](){const _0x43396e=new _0x10aa9f(this['locale']);return _0x43396e['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']]}]}),_0x43396e;}}class Fs extends _0x342201{constructor(_0x52cf92,_0x46e31e){super();const _0x1d244f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1d244f['to']('style'),'id':_0x1d244f['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x1d244f['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x46e31e['description']||'']}]}]});}}class zs extends _0x2ced3c{['_formItemsCollection']=new _0x285700();['_customCheckView']=null;constructor(_0x4faa3b,_0x3244c0,_0x30654d){super(_0x4faa3b),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x3244c0['isParameterized']);const _0x1b23b1=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',_0x9055c5=>_0x9055c5),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x4378d7=>_0x4378d7)],'style':{'--ck-ai-review-check-list-item-index':_0x30654d}},'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':_0x3244c0['title']}]},_0x1b23b1]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x3244c0['description']}]}]}]},..._0x3244c0['isParameterized']?[this['_createParameterizedView'](_0x3244c0)]:[],...'custom'===_0x3244c0['id']?[this['_createCustomView'](_0x3244c0)]:[]]}),this['on']('click',()=>{_0x3244c0['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x3244c0['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x2cf367({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x4278e4=>{_0x4278e4['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x329747=new _0x3dad93();return _0x329747['content']=_0x5a11af,_0x329747['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x329747;}['_createParameterizedView'](_0x463925){const _0xb8f39f=new _0x10aa9f(),_0x1de65e=this['_createFormView'](_0x463925);return _0xb8f39f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x1b6437=>!_0x1b6437)]},'children':[_0x1de65e]}),_0xb8f39f;}['_createFormView'](_0x3cacb8){const _0x22ab10=new _0x10aa9f(),_0x5e885c=Array['isArray'](_0x3cacb8['options'])?_0x3cacb8['options']:[],_0x58ae7e=new _0x5cde82(this['locale']),t=this['locale']['t'];_0x58ae7e['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x58ae7e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5d9b39=>{_0x5d9b39['stopPropagation']();})}}),_0x58ae7e['on']('execute',()=>{const _0x5d4b79=[],_0x13283b={};this['_formItemsCollection']['forEach'](_0x270082=>{_0x5d4b79['push'](_0x270082['value']),_0x3cacb8['useArgs']&&_0x3cacb8['options']&&(_0x13283b[_0x270082['argsKey']]=_0x270082['value']);}),this['fire']('runReviewCheck',{'id':_0x3cacb8['id'],'params':_0x5d4b79['length']?_0x5d4b79:void 0x0,'args':Object['keys'](_0x13283b)['length']?_0x13283b:void 0x0});});const _0x27c604=_0x5e885c['length'];return _0x5e885c['forEach']((_0x142705,_0x4ad199)=>{const _0x5ca587=_0x4ad199===_0x27c604-0x1;this['_formItemsCollection']['add'](new Ks(this['locale'],_0x142705,_0x5ca587?_0x58ae7e:null));}),_0x22ab10['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x22ab10;}['_createCustomView'](_0x3317a8){return this['_customCheckView']=new Qs(this['locale'],_0x3317a8),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',_0x52566b=>!_0x52566b)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x22e0a9,_0x5aad3a,_0xaa8439)=>{_0xaa8439||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class Us extends _0x2ced3c{['_checkViews'];constructor(_0x22395d){super(_0x22395d),this['_checkViews']=new _0x285700();const _0x446066=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x446066['if']('isVisible','ck-hidden',_0x383a07=>!_0x383a07)]},'children':this['_checkViews']});}['setChecks'](_0x5f31a4){this['_checkViews']['clear']();for(const [_0xcba06,_0x1a87bc]of _0x5f31a4['entries']()){const _0x26b856=new zs(this['locale'],_0x1a87bc,_0xcba06);_0x26b856['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x26b856);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x4d9f95 of this['_checkViews'])_0x4d9f95 instanceof zs&&_0x4d9f95['resetToDefault']();}}class Bs extends _0x10aa9f{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['statusButtonView'];constructor(_0xaccc97,_0x176c93){super(_0xaccc97),this['id']=_0x176c93,this['set']('status','pending'),this['set']('changeId',_0x176c93),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':_0x176c93,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x4095c0=new _0x10aa9f(this['locale']);return _0x4095c0['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',_0x360ed3=>!_0x360ed3)]}}),_0x4095c0;}['_createAcceptButtonView'](){const _0x49dfdd=new _0x5cde82(this['locale']);return _0x49dfdd['set']({'label':C(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x49dfdd['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x33bae6=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x33bae6['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x4ded83=>'pending'!==_0x4ded83)]}}),_0x49dfdd;}['_createDismissButtonView'](){const _0x401afb=new _0x5cde82(this['locale']);return _0x401afb['set']({'label':C(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x401afb['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x125b46=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x125b46['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-result-dismiss-button',this['bindTemplate']['if']('status','ck-hidden',_0x2a89d6=>'pending'!==_0x2a89d6)]}}),_0x401afb;}['_createInfoButtonView'](){const _0x2e0b0d=new _0x5cde82(this['locale']);return _0x2e0b0d['set']({'label':C(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x4ae3dc,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x2e0b0d['bind']('isOn')['to'](this,'isInfoToggleOn',_0x4b7e64=>_0x4b7e64),_0x2e0b0d['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x2e0b0d;}['_createStatusButtonView'](){const _0x4f5965=new _0x5cde82(this['locale']);return _0x4f5965['set']({'withText':!0x0,'isEnabled':!0x1}),_0x4f5965['bind']('label')['to'](this,'status',_0x2b2873=>C(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_'+_0x2b2873['toUpperCase']())),_0x4f5965['bind']('icon')['to'](this,'status',_0x2fea9b=>'ACCEPTED'===_0x2fea9b['toUpperCase']()?_0x47bafa:'REJECTED'===_0x2fea9b['toUpperCase']()?_0x27c5a9:_0x44d7c8),_0x4f5965['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x313a17=>'pending'===_0x313a17)],'disabled':'disabled'}}),_0x4f5965;}}class Gs extends _0x5cde82{constructor(_0x247996){super(_0x247996),this['set']({'label':C(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ys extends _0x2ced3c{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];constructor(_0x17e9a7){super(_0x17e9a7),this['_resultViews']=new _0x285700(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new Vi(_0x17e9a7),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 _0x249f0d=this['_createCombinedSkeletonLoader'](),_0x1cb2a8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x1cb2a8['if']('isVisible','ck-hidden',_0x12d6f4=>!_0x12d6f4)]},'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',_0x2c0ff6=>_0x2c0ff6)]},'children':this['_resultViews']},_0x249f0d]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x59c823){const _0x1807c1=new Bs(this['locale'],_0x59c823['id']);_0x1807c1['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x1807c1),_0x1807c1['resultResponseView']['element']['innerHTML']=_0x59c823['contentDiffed'];}['hideResult'](_0x30168a,_0x37a5ca){if('pending'===_0x37a5ca)return;const _0x3e3edb=this['_resultViews']['find'](_0x507e86=>_0x507e86['id']===_0x30168a);_0x3e3edb&&(_0x3e3edb['status']=_0x37a5ca,_0x3e3edb['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_grayout'));}['showResult'](_0x31aadb,_0x5bc515){if('pending'!==_0x5bc515)return;const _0x9bc2cc=this['_resultViews']['find'](_0x31bd65=>_0x31bd65['id']===_0x31aadb);_0x9bc2cc&&(_0x9bc2cc['status']=_0x5bc515,_0x9bc2cc['element']?.['classList']['remove']('ck-ai-review-mode__check-run-result_grayout'));}['setTitle'](_0x25e483,_0x1c6641){this['headerTitle']=_0x25e483,this['headerSubtitle']=_0x1c6641||'';}['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 je(this['locale'],Ce['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x58f5c2=new _0x10aa9f(this['locale']),_0x4fbbb3=[];for(let _0x45a66a=0x0;_0x45a66a<0x10;_0x45a66a++){const _0x38894d=this['_createSkeletonLoader']();_0x38894d['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x4fbbb3['push'](_0x38894d);}return _0x58f5c2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x4e549d=>!_0x4e549d)]},'children':_0x4fbbb3}),_0x58f5c2;}['_createErrorView'](){const _0x234953=new _0x10aa9f(this['locale']),_0x25bdc7=new _0x5cde82(this['locale']),t=this['locale']['t'];return _0x234953['delegate']('retryReview')['to'](this),_0x25bdc7['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x25bdc7['on']('execute',()=>{this['fire']('retryReview');}),_0x234953['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x34f5eb=>!_0x34f5eb),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x2ec8ba=>'chunk'===_0x2ec8ba)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-chat-error','ck-ai-chat-error_full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-chat-error_warning',_0x51fbaa=>'chunk'===_0x51fbaa)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x12665e=>'general'!==_0x12665e)]},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x3ee397=>'chunk'!==_0x3ee397)]},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x25bdc7]}),_0x234953;}['_createCancelButtonView'](){const _0x113fdc=new _0x5cde82(this['locale']);return _0x113fdc['set']({'label':C(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x2b48d9}),_0x113fdc['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2dbcc1=>_0x2dbcc1),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x398120=>_0x398120)]}}),_0x113fdc['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x113fdc;}['_createToggleDiffButtonView'](){const _0x4415e6=new _0x5cde82(this['locale']);_0x4415e6['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x4415e6['bind']('isEnabled')['to'](this,'isError',_0x46a6d8=>!_0x46a6d8),_0x4415e6['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5bd1a2=>!_0x5bd1a2),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x335296=>_0x335296)]}});const _0x41be2d=C(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x2d3347=C(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x4415e6['bind']('isOn')['to'](this,'isToggleDiffOn',_0x36ac2f=>_0x36ac2f),_0x4415e6['bind']('icon')['to'](this,'isToggleDiffOn',_0x308541=>_0x308541?_0x554163:_0x320f3e),_0x4415e6['bind']('label')['to'](this,'isToggleDiffOn',_0x1c7f97=>_0x1c7f97?_0x41be2d:_0x2d3347),_0x4415e6['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x4415e6;}['_createAcceptAllButtonView'](){const _0x477bb3=new _0x5cde82(this['locale']);return _0x477bb3['set']({'label':C(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x477bb3['bind']('isEnabled')['to'](this,'isError',_0x31720b=>!_0x31720b),_0x477bb3['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x56bf81=>!_0x56bf81),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x46136a=>_0x46136a)]}}),_0x477bb3['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x477bb3;}['_createExitReviewButtonView'](){const _0x579dc2=new _0x5cde82(this['locale']);return _0x579dc2['set']({'label':C(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x579dc2['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x567f1a=>!_0x567f1a),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3d9a1d=>_0x3d9a1d)]}}),_0x579dc2['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x579dc2;}['_createResultHeaderView'](){const _0x584f86=new _0x10aa9f(this['locale']),_0x21c13d=this['_createTitleView']();return _0x584f86['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai-review-mode__review-completed-header',_0x32a30f=>_0x32a30f)]},'children':[_0x21c13d,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x584f86;}['_createTitleView'](){const _0x4d9b3c=new _0x10aa9f(this['locale']),_0x15bdf1=new Le();return _0x15bdf1['bind']('isVisible')['to'](this,'isResultReady',_0xa7983f=>!_0xa7983f),_0x4d9b3c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-wrapper']},'children':[_0x15bdf1,{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2bc77e=>_0x2bc77e)]},'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',_0x4a7666=>!_0x4a7666)]},'children':[{'text':C(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x4d9b3c;}['_createFinishReviewButtonView'](){const _0x1b50e5=new Gs(this['locale']);return _0x1b50e5['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2bace4=>!_0x2bace4)]}}),_0x1b50e5['delegate']('finishReview')['to'](this),_0x1b50e5;}}class Zs extends _0x2ced3c{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x1716c1){super(_0x1716c1),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x2c0a22=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x2c0a22['if']('isVisible','ck-hidden',_0x28284b=>!_0x28284b)]},'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':C(_0x1716c1,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x27a152=new Gs(this['locale']);return _0x27a152['delegate']('finishReview')['to'](this),_0x27a152;}['_createResultHeaderView'](){const _0x500e70=new _0x10aa9f(this['locale']);return _0x500e70['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':C(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x500e70;}}class le extends _0x10aa9f{['reviewModeHeader'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x546cd2){super(_0x546cd2),this['reviewModeHeader']=new _0x4f9b0c(_0x546cd2,{'label':C(_0x546cd2,'AI_REVIEW_MODE'),'icon':_0x30da4f,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['reviewCheckListView']=new Us(_0x546cd2),this['reviewCheckListView']['delegate'](...Xs)['to'](this),this['reviewCheckResultsView']=new Ys(_0x546cd2),this['reviewCheckResultsView']['delegate'](...Xs)['to'](this),this['reviewCompletedView']=new Zs(_0x546cd2),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['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'](_0x5bbf85){this['reviewCheckResultsView']['addResult'](_0x5bbf85),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;}['showGeneralErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class we extends _0x179f18{['resultItemView'];constructor(_0x40a2f2,_0x2c6c9c){super(_0x40a2f2),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['content']['add'](this['_createContentView']()),_0x2c6c9c['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0xc122a1){this['resultItemView']['changeId']=_0xc122a1['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0xc122a1['contentDiffed'];}['showBalloon'](_0x4fba1b,_0x55ba59){this['updateContent'](_0x4fba1b),this['show'](),this['pin']({'target':()=>this['_getBestRectPosition'](_0x55ba59)});}['hideBalloon'](){this['hide'](),this['unpin']();}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange');}['_setupClickOutsideHandler'](){_0x2cf367({'emitter':this,'activator':()=>this['isVisible'],'contextElements':[this['element']],'callback':()=>{this['hideBalloon'](),this['deactivateChange']();}});}['_createContentView'](){const _0x1eb42b=new _0x10aa9f();return this['resultItemView']=new Bs(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x1eb42b['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion']},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0x1eb42b;}['_getBestRectPosition'](_0x177252){const _0x5443ac=Array['from'](_0x177252['getClientRects']());return _0x5443ac['find'](_0x48f29e=>_0x48f29e['width']>0x0)||_0x5443ac[0x0];}}const Xs=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ie extends _0x267838{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[at];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4576ef){super(_0x4576ef),this['_bodyCollection']=new qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new le(this['context']['locale']),this['_reviewModeView']['delegate'](...Xs)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new we(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x1c5077=this['context']['plugins']['get']('AITabs');_0x1c5077['view']['on']('activateTab',(_0x582dce,_0x1642f4)=>{'reviewMode'===_0x1642f4?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x1c5077['view']['addTab']({'id':'reviewMode','buttonLabel':C(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x30da4f,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x165dac){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x165dac),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x391fca){_0x391fca&&('error-general'!==_0x391fca['status']?'error-chunk'!==_0x391fca['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralErrorView']());}['showCheckRunResult'](_0x5bc51c){this['_reviewModeView']['addCheckRunResult'](_0x5bc51c);}['showGeneralErrorView'](){this['_reviewModeView']['showGeneralErrorView']();}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x4212a1,_0x766415){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x4212a1,_0x766415);}['setActiveStateInResults'](_0x12385d){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x3cc574=>{_0x3cc574['id']===_0x12385d&&_0x3cc574['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x5eb74a=>_0x5eb74a['setItemAsInactive']());}['updateChangeState'](_0x4cde64,_0x251183){'accepted'===_0x251183||'rejected'===_0x251183||'outdated'===_0x251183?this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x4cde64,_0x251183):this['_reviewModeView']['reviewCheckResultsView']['showResult'](_0x4cde64,_0x251183);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x33d6d1,_0x435e6c){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x33d6d1,_0x435e6c);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['hideDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_reviewModeBalloonSuggestionItemView']['showDiffInBalloon']();}['getChangeElement'](_0x6ca1d1){const _0x5ac516=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x466c06=>_0x466c06['id']===_0x6ca1d1);return _0x5ac516?_0x5ac516['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const me='reviewmode-';class re extends _0x267838{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x4176c6,c];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x1531d8){super(_0x1531d8),this['_domEmitter']=new(_0x14a852())(),this['_eventEmitter']=new(_0x7d5e47())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x4055bb=P(this['context']);_0x4055bb['conversion']['for']('editingDowncast')['markerToElement']({'model':me+'insert','view':(_0x5bf453,{writer:_0x2c1c03})=>{const _0x23e8d1=this['_markers']['get'](_0x5bf453['markerName']),_0x551aa5={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x5bf453['markerName']};return _0x2c1c03['createUIElement']('span',_0x551aa5,function(_0x363739){const _0x2f89e8=this['toDomElement'](_0x363739);return _0x2f89e8['innerHTML']=_0x23e8d1?.['text']||'',_0x2f89e8;});}}),_0x4055bb['conversion']['for']('editingDowncast')['markerToHighlight']({'model':me+'remove-only','view':_0x2fbb68=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x2fbb68['markerName']}})}),_0x4055bb['conversion']['for']('editingDowncast')['markerToHighlight']({'model':me+'remove-context','view':_0x14c961=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x14c961['markerName']}})}),_0x4055bb['conversion']['for']('editingDowncast')['markerToHighlight']({'model':me+'remove-text','view':_0x57326f=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x57326f['markerName']}})}),_0x4055bb['conversion']['for']('dataDowncast')['markerToElement']({'model':me+'suggestion-context','view':(_0x5a4c83,{writer:_0x3e2723})=>_0x3e2723['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x5a4c83['isOpening']?'start':'end')})}),_0x4055bb['conversion']['for']('downcast')['attributeToAttribute']({'model':ct,'view':_0x3ebb99}),this['_domEmitter']['listenTo'](document,'click',(_0x2bc888,_0x218555)=>{const _0x28e9f7=_0x218555['target'],_0x79ae24=this['_findMarkerElement'](_0x28e9f7);if(!_0x79ae24)return;const _0x3361ec=_0x79ae24['getAttribute']('data-marker-id'),_0x5822bf=_0x3361ec['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x3361ec,'changeId':_0x5822bf});}),_0x4055bb['model']['document']['registerPostFixer'](_0x219013=>this['_validateMarkers'](_0x4055bb,_0x219013)),_0x4055bb['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x4055bb));}['getDocumentData'](){const _0x4b6587=this['context']['plugins']['get']('AIEditing'),_0x1aa225=P(this['context']),_0x45f918=_0x1aa225['model'],_0xe01094=new _0x42c406();for(const _0xc54501 of _0x45f918['document']['getRoot']()['getChildren']()){const _0x228012=_0xc54501['_clone'](!0x0);_0xe01094['_appendChild'](_0x228012);}for(const _0x1b2939 of _0x45f918['markers'])_0xe01094['markers']['set'](_0x1b2939['name'],this['_changeRangeOwnerDocument'](_0x1b2939['getRange']()['clone'](),_0xe01094));const _0x32d21a=new _0x1c22cf({'ignoreElementEnd':!0x0,'startPosition':_0x45f918['createPositionAt'](_0xe01094,0x0)}),_0x177409=new Set(),_0x131633=new Map();for(const {item:_0x59851d}of _0x32d21a){if(!_0x59851d['is']('$textProxy'))continue;const _0x31794c=_0x59851d['parent'];if((!_0x31794c||!_0x31794c['is']('element','caption'))&&(_0x31794c&&_0x31794c['is']('element'))){let _0x334ca9=_0x31794c['getAttribute'](ct);_0x334ca9||(_0x334ca9=_0x4b6587['_nextDataId'](_0x177409),_0x31794c['_setAttribute'](ct,_0x334ca9)),_0x177409['add'](_0x334ca9);let _0x53efdd=_0x31794c;for(;_0x53efdd['parent']&&!_0x53efdd['parent']['is']('documentFragment');)_0x53efdd=_0x53efdd['parent'],_0x53efdd['hasAttribute'](ct)&&_0x53efdd['_removeAttribute'](ct);_0x131633['set'](_0x334ca9,{'path':_0x31794c['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x53efdd['_clone'](!0x0),_0x334ca9,_0x1aa225['data'])}),_0x32d21a['jumpTo'](_0x45f918['createPositionAfter'](_0x31794c));}}return{'content':_0x1aa225['data']['processor']['toData'](_0x1aa225['data']['toView'](_0xe01094)),'version':_0x1aa225['model']['document']['version'],'elements':_0x131633};}['diffContent'](_0x8a67ce,_0x1a5c30){const _0x23c50f=[],_0x4de82e=P(this['context']),_0x22944f=_0x4de82e['data']['parse'](_0x8a67ce,'$documentFragment'),_0x276307=_0x4de82e['model']['createPositionAt'](_0x22944f,0x0),_0x136f62=_0x4de82e['data']['parse'](_0x1a5c30,'$documentFragment');if(!this['_hasSameTopLevelElement'](_0x22944f,_0x136f62))return _0x23c50f;const _0x2d13c3=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x8a67ce,_0x1a5c30,{'anchor':_0x276307,'markDeletions':!0x0})['getOperations']()['filter'](_0xa714c1=>'insert'===_0xa714c1['type']||'marker'===_0xa714c1['type']&&_0xa714c1['name']['startsWith']('$markedRemove')),_0x3df4b1=this['_groupAdjacentOperations'](_0x2d13c3);let _0x40ef71=0x0;return _0x4de82e['model']['change'](_0x575eeb=>{for(let _0x7bcd19=0x0;_0x7bcd19<_0x3df4b1['length'];_0x7bcd19++){const _0x218905=_0x3df4b1[_0x7bcd19],_0x36cc9c=_0x575eeb['createDocumentFragment']();for(const _0x2e3996 of _0x22944f['getChildren']())_0x575eeb['append'](_0x2e3996['_clone'](!0x0),_0x36cc9c);for(const _0x3841e2 of _0x218905['operationsIsolated'])if('insert'===_0x3841e2['type']){const _0x5940d4=_0x3841e2;_0x5940d4['baseVersion']=null,_0x5940d4['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x5940d4,_0x36cc9c),_0x575eeb['batch']['addOperation'](_0x3841e2),_0x4de82e['model']['applyOperation'](_0x3841e2);const _0x123464='suggestion:insertion:id:authorId:'+_0x40ef71++,_0x5935fa=_0x4de82e['model']['createRange'](_0x5940d4['position'],_0x5940d4['position']['getShiftedBy'](_0x5940d4['howMany']));_0x36cc9c['markers']['set'](_0x123464,_0x5935fa);}else{if('marker'===_0x3841e2['type']&&_0x3841e2['name']['startsWith']('$markedRemove')){const _0x4da128=_0x3841e2,_0x179f93='suggestion:deletion:id:authorId:'+_0x40ef71++;this['_changeOperationOwnerDocument'](_0x4da128,_0x36cc9c),_0x36cc9c['markers']['set'](_0x179f93,_0x4da128['newRange']);}}const _0xf52a5d=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x218905['operationsIsolated'][0x0]),_0x36cc9c),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x218905['operationsIsolated'][_0x218905['operationsIsolated']['length']-0x1]),_0x36cc9c));_0x36cc9c['markers']['set'](me+'suggestion-context',new _0x473568(_0xf52a5d['start'],_0xf52a5d['end'])),_0x23c50f['push']({..._0x218905,'context':this['_createGetContextFn'](_0x36cc9c,_0x4de82e['data'],{'ellipsisBefore':_0xf52a5d['hasContentBefore'],'ellipsisAfter':_0xf52a5d['hasContentAfter']}),'content':this['_createGetContentFn'](_0x36cc9c,_0x4de82e['data'])});}}),_0x23c50f;}['markChangePositionInEditorContent'](_0x45aa2c,_0x4335a2){if(!_0x45aa2c['length'])return;const _0xebd9a3=_0x45aa2c[0x0]['parent']['id'],_0x3194a7=_0x4335a2['elements']['get'](_0xebd9a3);if(!_0x3194a7)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0xebd9a3);const _0x1c5dc5=_0x3194a7['path'],_0x2877f4=P(this['context']),_0x3e9827=_0x2877f4['model']['document']['history']['getOperations'](_0x4335a2['version']),_0x1f9693=[];for(const _0x4a3efc of _0x45aa2c){const _0x2eed58=_0x4a3efc['operationsIsolated']['map'](_0x1eb61d=>this['_translateOperationToEditorContent'](_0x1eb61d,_0x1c5dc5,_0x2877f4['model']['document']['getRoots']()[0x0]));if(!_0x2eed58||!_0x2eed58['length'])continue;const _0x3e3a7d=_0x2eed58['every'](_0x12c742=>'marker'===_0x12c742['type']&&_0x12c742['name']['startsWith']('$markedRemove')),_0x1fef9c={'document':_0x2877f4['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x2cfd83=_0x1c1e0c(_0x2eed58,_0x3e9827,_0x1fef9c)['operationsA'];for(const _0x2aedd3 of _0x2cfd83)if('insert'===_0x2aedd3['type']){const _0x2e7acc=_0x2aedd3,_0x438f4e=_0x2e7acc['nodes'];let _0x2a5fa3='';for(const _0x9e3cc of _0x438f4e)_0x9e3cc&&_0x9e3cc['is']('model:$text')&&(_0x2a5fa3+=_0x9e3cc['data']);_0x1f9693['push']({'start':_0x2e7acc['position'],'end':_0x2e7acc['position'],'type':'insert','groupId':_0x4a3efc['id'],'text':_0x2a5fa3});}else{if('marker'===_0x2aedd3['type']&&_0x2aedd3['name']['startsWith']('$markedRemove')){const _0x1109d9=_0x2aedd3;let _0x1c7ba8='remove-text';if(_0x3e3a7d){const _0x4d6f55=this['_findAdjacentContextDistance'](_0x1109d9['newRange']['start'],'backward',_0x2877f4['model']['schema']),_0x2e6f37=this['_findAdjacentContextDistance'](_0x1109d9['newRange']['end'],'forward',_0x2877f4['model']['schema']);if(_0x4d6f55||_0x2e6f37){const _0x525246=_0x1109d9['newRange']['start']['getShiftedBy'](-_0x4d6f55),_0x3c5663=_0x1109d9['newRange']['end']['getShiftedBy'](_0x2e6f37);_0x1f9693['push']({'start':_0x525246,'end':_0x3c5663,'groupId':_0x4a3efc['id'],'type':'remove-context'});}else _0x1c7ba8='remove-only';}_0x1f9693['push']({'start':_0x1109d9['newRange']['start'],'end':_0x1109d9['newRange']['end'],'groupId':_0x4a3efc['id'],'type':_0x1c7ba8});}}}this['_insertMarkers'](_0x1f9693);}['clearAllMarkers'](){const _0x4ead27=P(this['context']);_0x4ead27['model']['change'](_0x571e5d=>{for(const _0x9d2e61 of this['_markers']['keys']())_0x4ead27['model']['markers']['get'](_0x9d2e61)&&_0x571e5d['removeMarker'](_0x9d2e61);}),this['_markers']['clear']();}['switchToReadOnly'](){P(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){P(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x284817){const _0x2187f2=P(this['context']),_0x318008=_0x2187f2['model'],_0x448399=_0x284817['map'](_0x12570b=>this['_getMarkersDataForGroup'](_0x12570b))['flat']();_0x318008['change'](_0x3e4a54=>{for(const _0x3e0c17 of _0x448399){const _0x1d1e38=_0x2187f2['model']['markers']['get'](_0x3e0c17['id']);_0x1d1e38&&('insert'===_0x3e0c17['type']?_0x318008['insertContent'](_0x3e4a54['createText'](_0x3e0c17['text']||''),_0x1d1e38['getRange']()['start']):'remove-text'!==_0x3e0c17['type']&&'remove-only'!==_0x3e0c17['type']||_0x318008['deleteContent'](_0x318008['createSelection'](_0x1d1e38['getRange']())),_0x3e4a54['removeMarker'](_0x3e0c17['id']),this['_markers']['delete'](_0x3e0c17['id']));}});}['rejectChange'](_0x4ce9cc){const _0x1a7e20=P(this['context']),_0x4bb17f=this['_getMarkersDataForGroup'](_0x4ce9cc);_0x1a7e20['model']['change'](_0x454abb=>{for(const _0x5c05a1 of _0x4bb17f)_0x454abb['removeMarker'](_0x5c05a1['id']),this['_markers']['delete'](_0x5c05a1['id']);});}['getEditor'](){return P(this['context']);}['getMarkerElementForChange'](_0x1c88b2){const _0x59966d=Array['from'](this['_markers']['values']())['filter'](_0x1e7ef6=>_0x1e7ef6['groupId']===_0x1c88b2);if(!_0x59966d['length'])return null;const _0x59ed22=0x1===_0x59966d['length']?_0x59966d[0x0]:this['_sortMarkers'](_0x59966d)[0x0],_0x4fc392=P(this['context']),_0x60391f=_0x4fc392['model']['markers']['get'](_0x59ed22['id']);if(!_0x60391f)return null;const _0x1b8b04=_0x60391f['getRange'](),_0x5ebb27=_0x4fc392['editing']['view']['getDomRoot']();if(!_0x5ebb27||!_0x1b8b04)return null;const _0x3b9204=_0x5ebb27['querySelector']('[data-marker-id=\x22'+_0x59ed22['id']+'\x22]');return _0x3b9204?{'modelRange':_0x1b8b04,'domElement':_0x3b9204}:null;}['_validateMarkers'](_0x5c41f7,_0x38af17){const _0x407c39=Array['from'](this['_markers']['keys']()),_0x2ea6cc=new Map();for(const _0x5f5d2a of _0x407c39){const _0x408055=_0x5c41f7['model']['markers']['get'](_0x5f5d2a);if(!_0x408055)continue;const _0x2ee122=_0x408055['getStart']()['path'][0x0];_0x2ea6cc['has'](_0x2ee122)||_0x2ea6cc['set'](_0x2ee122,[]),_0x2ea6cc['get'](_0x2ee122)['push'](_0x408055);}const _0x3f9d7d=new Set();for(const _0x56f4d5 of _0x5c41f7['model']['document']['differ']['getChanges']()){let _0x506f7d=-0x1,_0x42ee75=null;if('insert'===_0x56f4d5['type'])_0x42ee75=new _0x473568(_0x56f4d5['position'],_0x56f4d5['position']['getShiftedBy'](_0x56f4d5['length'])),_0x506f7d=_0x56f4d5['position']['path'][0x0];else{if('remove'!==_0x56f4d5['type'])continue;_0x42ee75=new _0x473568(_0x56f4d5['position']),_0x506f7d=_0x56f4d5['position']['path'][0x0];}const _0x235732=_0x2ea6cc['get'](_0x506f7d)||[];if(_0x235732['length']){for(const _0x8a2b47 of _0x235732)if(_0x42ee75['root']['rootName']===_0x8a2b47['getRange']()['root']['rootName']&&('insert'!==_0x56f4d5['type']||!_0x42ee75['containsRange'](_0x8a2b47['getRange']()))&&(_0x42ee75['isIntersecting'](_0x8a2b47['getRange']())||_0x42ee75['start']['isTouching'](_0x8a2b47['getRange']()['end'])||_0x42ee75['end']['isTouching'](_0x8a2b47['getRange']()['start']))){const _0xbc9a51=this['_parseMarkerName'](_0x8a2b47['name']);Array['from'](this['_markers']['values']())['filter'](_0x28b6f0=>_0x28b6f0['groupId']===_0xbc9a51['groupId'])['forEach'](_0x12ee62=>_0x3f9d7d['add'](_0x12ee62['id']));}}}if(_0x3f9d7d['size']){for(const _0x49ac02 of _0x3f9d7d)_0x38af17['removeMarker'](_0x49ac02);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0xf6885c){for(const {name:_0xa4a899,data:_0x586bb9}of _0xf6885c['model']['document']['differ']['getChangedMarkers']()){if(!_0xa4a899['startsWith'](me))continue;const _0x24933e=_0x586bb9['oldRange'],_0x45d4de=_0x586bb9['newRange'],_0x3ca92d=_0x24933e&&'$graveyard'===_0x24933e['root']['rootName'],_0x1ae570=_0x45d4de&&'$graveyard'===_0x45d4de['root']['rootName'];if(_0x3ca92d&&_0x1ae570)continue;const _0x856687=this['_parseMarkerName'](_0xa4a899);this['_markers']['get'](_0xa4a899)&&(_0x1ae570||!_0x45d4de?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0xa4a899,'changeId':_0x856687['groupId']}):_0x3ca92d&&_0x45d4de&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0xa4a899,'changeId':_0x856687['groupId']}));}}['_parseMarkerName'](_0x13e527){const _0x30152d=_0x13e527['split'](':'),_0x5abcaf=(_0x30152d[0x1]||'')['split']('_');return{'prefix':_0x30152d[0x0],'groupId':_0x5abcaf[0x0],'suffix':_0x5abcaf[0x1]};}['_translateOperationToEditorContent'](_0x3bebe4,_0xb286b2,_0x8b4a66){if('insert'===_0x3bebe4['type']){const _0xa884b=_0x3bebe4;return new te(this['_changePosition'](_0xb286b2['concat'](_0xa884b['position']['offset']),_0x8b4a66),_0xa884b['nodes'],_0xa884b['baseVersion']);}if('marker'===_0x3bebe4['type']&&_0x3bebe4['name']['startsWith']('$markedRemove')){const _0x4462e0=_0x3bebe4;return new _0x55facf(_0x4462e0['name'],_0x4462e0['oldRange'],this['_changeRange'](_0x4462e0['newRange'],_0xb286b2['concat'](_0x4462e0['newRange']['start']['offset']),_0xb286b2['concat'](_0x4462e0['newRange']['end']['offset']),_0x8b4a66),_0x4462e0['_markers'],_0x4462e0['affectsData'],_0x4462e0['baseVersion']);}return _0x3bebe4;}['_groupAdjacentOperations'](_0x1e86a0){if(!_0x1e86a0['length'])return[];const _0x389b55=[];let _0x50687c=0x0,_0x53faa4=0x0,_0x4be342=[];for(let _0xebeddc=0x0;_0xebeddc<=_0x1e86a0['length'];_0xebeddc++){const _0x256d3f=_0x1e86a0[_0xebeddc],_0x3b0eea=_0x1e86a0[_0xebeddc-0x1];!_0x256d3f||_0x3b0eea&&!this['_getOperationEnd'](_0x3b0eea)['isTouching'](this['_getOperationStart'](_0x256d3f))?(_0x389b55['push']({'operations':_0x4be342,'operationsIsolated':_0x4be342['map'](_0xe4e6c5=>this['_shiftOperation'](_0xe4e6c5['clone'](),-_0x53faa4)),'groupOffset':_0x50687c}),_0x4be342=_0x256d3f?[_0x256d3f]:[],_0x53faa4+=_0x50687c,_0x50687c=0x0):_0x4be342['push'](_0x256d3f),_0x256d3f&&'insert'===_0x256d3f['type']&&(_0x50687c+=_0x256d3f['howMany']);}return _0x389b55;}['_findAdjacentContextDistance'](_0x4b3f9a,_0x1098a1,_0x1118ec,_0x1939f6=0x1){const _0x2671c3=new _0x1c22cf({'startPosition':_0x4b3f9a,'direction':_0x1098a1});let _0x5694c7=0x0;for(let _0x7e012d=0x0;_0x7e012d<_0x1939f6;_0x7e012d++){let _0x5ad3e8=0x0,_0x3be759=!0x1,_0x253d09='forward'===_0x1098a1?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x18e751}of _0x2671c3)if(_0x18e751['is']('$textProxy')){const _0x29eb8b=_0x253d09['exec'](_0x18e751['data']);if(_0x29eb8b&&_0x29eb8b['length']){if(_0x5ad3e8+='forward'===_0x1098a1?_0x29eb8b['index']+_0x29eb8b[0x0]['length']:_0x18e751['data']['length']-_0x29eb8b['index'],_0x29eb8b[0x0]['length']!==_0x18e751['data']['length'])break;_0x3be759=!0x0,_0x253d09='forward'===_0x1098a1?/^\w+/:/\w+$/;}else{if(_0x3be759)break;_0x5ad3e8+=_0x18e751['offsetSize'];}}else{if(_0x18e751['is']('element')){_0x1118ec['isInline'](_0x18e751)&&!_0x3be759&&(_0x5ad3e8+=0x1);break;}}_0x5694c7+=_0x5ad3e8,_0x2671c3['jumpTo'](_0x4b3f9a['getShiftedBy']('forward'===_0x1098a1?_0x5694c7:-_0x5694c7));}return _0x5694c7;}['_getChangeContext'](_0x58942b,_0x2453c5){const _0xf6df78=P(this['context'])['model']['schema'],_0x5e1131=this['_findAdjacentContextDistance'](_0x58942b,'backward',_0xf6df78,0x6),_0x577492=this['_findAdjacentContextDistance'](_0x2453c5,'forward',_0xf6df78,0x6),_0x2914b6=_0x58942b['getShiftedBy'](-_0x5e1131),_0x4d7b30=_0x2453c5['getShiftedBy'](_0x577492);return{'start':_0x2914b6,'end':_0x4d7b30,'hasContentBefore':!_0x2914b6['isAtStart'],'hasContentAfter':!_0x4d7b30['isAtEnd']};}['_insertMarkers'](_0x24d496){const _0x15dd04=this['context']['plugins']['get']('AIEditing'),_0x5b3128=new Set();P(this['context'])['model']['change'](_0x2ae3d9=>{for(const _0x218e09 of _0x24d496){const _0x410bb3=''+me+_0x218e09['type']+':'+_0x218e09['groupId']+'_'+_0x15dd04['_nextDataId'](_0x5b3128);this['_markers']['set'](_0x410bb3,{'id':_0x410bb3,'groupId':_0x218e09['groupId'],'type':_0x218e09['type'],'text':_0x218e09['text']}),_0x2ae3d9['addMarker'](_0x410bb3,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2ae3d9['createRange'](_0x218e09['start'],_0x218e09['end'])});}});}['_createGetContextFn'](_0x4932a8,_0xf6e84f,_0x56d44e){let _0x2c259d='';return()=>{if(!_0x2c259d){const _0x3b6155=_0xf6e84f['toView'](_0x4932a8,{'showSuggestionHighlights':!0x0}),_0x142fb8=_0x3b6155['getChild'](0x0);if(!_0x142fb8)return'';let _0x42580c=!0x1;const _0x3b0261=[];for(const _0x5b4940 of _0x142fb8['getChildren']())_0x5b4940['is']('element','span')&&_0x5b4940['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x42580c=!0x1),_0x42580c&&_0x3b0261['push'](_0x5b4940),_0x5b4940['is']('element','span')&&_0x5b4940['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x42580c=!0x0);_0x142fb8['_removeChildren'](0x0,_0x142fb8['childCount']),_0x56d44e?.['ellipsisBefore']&&_0x142fb8['_appendChild']('…'),_0x142fb8['_appendChild'](_0x3b0261),_0x56d44e?.['ellipsisAfter']&&_0x142fb8['_appendChild']('…');const _0x46e71a=_0xf6e84f['htmlProcessor']['domConverter']['viewToDom'](_0x3b6155),_0x408b85=_0xf6e84f['htmlProcessor']['htmlWriter']['getHtml'](_0x46e71a);_0x2c259d=_0x408b85;}return _0x2c259d;};}['_createGetContentFn'](_0xd020b1,_0x28e427){let _0x5672b9='';return()=>(_0x5672b9||(_0x5672b9=_0x28e427['stringify'](_0xd020b1,{'showSuggestionHighlights':!0x0})),_0x5672b9);}['_createGetContentUsingDataIdFn'](_0x226c50,_0x27cf32,_0x5883cc){let _0xfbeb25='';return()=>{if(!_0xfbeb25){const _0x2b695b=_0x5883cc['toView'](new _0x42c406(_0x226c50)),_0x100868=_0x5883cc['htmlProcessor']['domConverter']['viewToDom'](_0x2b695b)['querySelector']('[data-id=\x22'+_0x27cf32+'\x22]');_0xfbeb25=_0x100868?.['outerHTML']||'';}return _0xfbeb25;};}['_findMarkerElement'](_0x385a3d,_0x38ce95=0x5){let _0x199c35=_0x385a3d,_0x5cfb25=null;for(let _0x3f0f98=0x0;_0x3f0f98<_0x38ce95&&_0x199c35;_0x3f0f98++){if(!_0x199c35['className']){_0x199c35=_0x199c35['parentElement'];continue;}if(!(''+_0x199c35['className'])['includes']('ck-ai_review-mode-marker_')){_0x199c35=_0x199c35['parentElement'];continue;}if(!_0x199c35['getAttribute']('data-marker-id'))break;_0x5cfb25=_0x199c35;break;}return _0x5cfb25;}['_getMarkersDataForGroup'](_0x6190e0){return Array['from'](this['_markers']['values']())['filter'](_0x5afcc6=>_0x5afcc6['groupId']===_0x6190e0);}['_getOperationStart'](_0x17937d){return'insert'===_0x17937d['type']?_0x17937d['position']:_0x17937d['newRange']['start'];}['_getOperationEnd'](_0xcec552,_0x145ac0=!0x1){return'insert'===_0xcec552['type']?_0x145ac0?_0xcec552['position']:_0xcec552['position']['getShiftedBy'](_0xcec552['howMany']):_0xcec552['newRange']['end'];}['_shiftOperation'](_0x552e5d,_0x313f3b){return'insert'===_0x552e5d['type']?_0x552e5d['position']=_0x552e5d['position']['getShiftedBy'](_0x313f3b):'marker'===_0x552e5d['type']&&_0x552e5d['newRange']&&(_0x552e5d['newRange']=new _0x473568(_0x552e5d['newRange']['start']['getShiftedBy'](_0x313f3b),_0x552e5d['newRange']['end']['getShiftedBy'](_0x313f3b))),_0x552e5d;}['_changeOperationOwnerDocument'](_0x28a3a1,_0x3c0763){'insert'===_0x28a3a1['type']?_0x28a3a1['position']=this['_changePositionOwnerDocument'](_0x28a3a1['position'],_0x3c0763):'marker'===_0x28a3a1['type']&&_0x28a3a1['newRange']&&(_0x28a3a1['newRange']=this['_changeRangeOwnerDocument'](_0x28a3a1['newRange'],_0x3c0763));}['_changePositionOwnerDocument'](_0x47079c,_0x58d79b){return new _0x2a6f0c(_0x58d79b,_0x47079c['path']);}['_changeRangeOwnerDocument'](_0x3d301a,_0x4e7f9b){return new _0x473568(this['_changePositionOwnerDocument'](_0x3d301a['start'],_0x4e7f9b),this['_changePositionOwnerDocument'](_0x3d301a['end'],_0x4e7f9b));}['_changePosition'](_0x1a04f3,_0x3c040a){return new _0x2a6f0c(_0x3c040a,[..._0x1a04f3]);}['_changeRange'](_0x7975fc,_0x1da462,_0x281dd7,_0x167ca2){return new _0x473568(this['_changePosition'](_0x1da462,_0x167ca2),this['_changePosition'](_0x281dd7,_0x167ca2));}['_sortMarkers'](_0x43c8d8){const _0x73137e=_0x57d823=>{switch(_0x57d823){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x43c8d8['sort']((_0xf23448,_0xb708bc)=>_0x73137e(_0xf23448['type'])-_0x73137e(_0xb708bc['type']));}['_hasSameTopLevelElement'](_0x4a0c67,_0x394b07){const _0x350f31=_0x4a0c67['getChild'](0x0),_0x10d4ad=_0x394b07['getChild'](0x0);return!(!_0x350f31||!_0x10d4ad)&&((!_0x350f31['is']('element')||!_0x10d4ad['is']('element')||_0x350f31['name']===_0x10d4ad['name'])&&!(_0x350f31['is']('element')&&!_0x10d4ad['is']('element')||!_0x350f31['is']('element')&&_0x10d4ad['is']('element')));}}class Ga extends _0x267838{static get['requires'](){return[ee,ie,re];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{pi as AIActions,ni as AIAdapter,qn as AIAssistant,G as AIAssistantUI,w as AIBalloon,Ha as AIChat,tt as AIChatController,it as AIChatHistory,yt as AIChatHistoryController,jt as AIChatHistoryUI,et as AIChatUI,s as AIConnector,c as AIEditing,Ma as AIEditorIntegration,Ot as AIQuickActionType,Va as AIQuickActions,ui as AIQuickActionsUI,tr as AIRequestError,$s as AIReviewCheck,th as AIReviewCheckResult,Rr as AIReviewCheckRun,Ga as AIReviewMode,ee as AIReviewModeController,re as AIReviewModeEditing,ie as AIReviewModeUI,at as AITabs,ue as AITextAdapter,bt as AIToggleButtonUI,zn as AWSTextAdapter,Xn as OpenAITextAdapter,ai as ShowAIAssistantCommand,co as ToggleAICommand,Cs as createResizeButton,Qn as getDefaultAICommands};